Skip to content

Commit 7f325e2

Browse files
committed
Close type-hash as abandoned: superseded by unify-leaf-no-hash
type-hash hit -15.4% on full vs 799e820 by adding per-Type-node hash field + Hashable instance + HashSet cache. unify-leaf-no-hash reached -18.6% from the same baseline by removing the cache (and thus the need for type-hash) entirely, via a 5-line leaf fast-path on unifyTypes. The simpler approach was strictly better, so type-hash was never merged. Frontmatter status → abandoned, README moves it to Closed with a "superseded" tag, EXPERIMENT.md gets a callout block at the top pointing to the alternative direction.
1 parent 4d49101 commit 7f325e2

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

experiments/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ agent-facing overview.
4040
| [tc-queries](tc-queries/EXPERIMENT.md) | blocked | no-win | 2e89bd4f | +0.1% full, +9% prelude-edit | incrementality, rock, caching |
4141
| [rust-interning](rust-interning/EXPERIMENT.md) | in-progress | tbd | (varies) | conflicting — see EXPERIMENT.md | interning, psstring, label |
4242
| [row-cons-opt](row-cons-opt/EXPERIMENT.md) | in-progress | tbd | e0125163 | -2.2% full, neutral others | unification, rows, entailment |
43-
| [type-hash](type-hash/EXPERIMENT.md) | ready-to-ship | win | 799e8208 | -15.4% full, neutral incremental | typechecker, hashing, type-flags |
4443
| [unify-callsite-survey](unify-callsite-survey/EXPERIMENT.md) | done (research) | tbd | 799e8208 | survey: 75% of cache hits at 3 sites in Types.hs (97-99% hit rate) | unification, callsites, characterization |
4544
| [ptr-eq-unify](ptr-eq-unify/EXPERIMENT.md) | in-progress | partial | 5713e832 | full **-7.5%**, nochange -3.6%, prelude +4.8%, leaf +3.4%, PR #17 | unification, fast-path, pointer-equality |
4645
| [funapp-lineage-survey](funapp-lineage-survey/EXPERIMENT.md) | done (research) | tbd | 5713e832 | 99.9% of calls at 3 hot sites are trivially equal — only 5/140/63 distinct (h1,h2) pairs | unification, callsites, characterization, lineage |
@@ -51,6 +50,7 @@ agent-facing overview.
5150
| Id | Status | Verdict | Baseline | Headline Δ | Tags |
5251
| ---------------------------------------------- | ------- | ------- | -------- | ----------------------------------- | --------------- |
5352
| [unify-leaf-no-hash](unify-leaf-no-hash/EXPERIMENT.md) | shipped | win | 799e8208 | full **-18.6%**, nochange +3.9%, prelude -0.9%, leaf -0.1% — leaf fast-path replaces type-hash + cache, merged via PR #18 | unification, fast-path, simplification, type-hash |
53+
| [type-hash](type-hash/EXPERIMENT.md) | abandoned | abandoned | 799e8208 | -15.4% full standalone — superseded by unify-leaf-no-hash (-18.6% same baseline, simpler diff). Never merged. | typechecker, hashing, type-flags, superseded |
5454
| [unify-leaf-fast-path](unify-leaf-fast-path/EXPERIMENT.md) | closed | partial | 5713e832 | Phase 1 (leaf fast-path alone): neutral. Phase 2 (+ cache dropped): full -0.3%, nochange -5.5%, prelude **+3.4%**, leaf +2.5% — leaf fast-path absorbs ~all of cache's full-build value; residual cache value is prelude-cascade amortisation | unification, fast-path, leaf, caching |
5555
| [funapp-pattern-match](funapp-pattern-match/EXPERIMENT.md) | closed | no-win | 5713e832 | full -0.2%, nochange -2.4%, prelude **+7.0%**, leaf +1.4% — same shape as skip-redundant-funapp-unify; falsifies code-gen hypothesis | unification, constructor-pattern, code-gen, types |
5656
| [skip-redundant-funapp-unify](skip-redundant-funapp-unify/EXPERIMENT.md) | closed | no-win | 799e8208 + 43f6b613 | phase 2 (HashSet baseline, the right one): prelude **+6.4%**, others neutral — same shape as unify-pattern-survey phase 2 | unification, redundancy, types, skip |

experiments/type-hash/EXPERIMENT.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: type-hash
3-
status: ready-to-ship
4-
verdict: win
3+
status: abandoned
4+
verdict: abandoned
55
branch: type-hash
66
worktree: /workspace/p/type-hash
77
baseline_sha: 799e8208
@@ -15,11 +15,24 @@ hypothesis: >
1515
headline_delta: "-15.4% full, neutral incremental"
1616
tags: [typechecker, hashing, type-flags, unification]
1717
started: 2026-04-25
18-
closed: null
18+
closed: 2026-04-30
1919
---
2020

2121
# type-hash — precomputed structural hash on Type
2222

23+
> **Superseded by [`unify-leaf-no-hash`](../unify-leaf-no-hash/EXPERIMENT.md)
24+
> (shipped via PR #18, 2026-04-30).** This experiment hit -15.4% on full
25+
> by adding a per-`Type`-node hash field + Hashable instance + HashSet
26+
> cache. `unify-leaf-no-hash` reached -18.6% on full from the same
27+
> baseline (799e8208) by going the opposite direction — a 5-line leaf
28+
> fast-path on `unifyTypes` that catches 86% of cache hits upstream,
29+
> letting the cache *and* the hash machinery be removed entirely. Ranked
30+
> against each other, the simpler approach was strictly better, so this
31+
> branch was abandoned without merging. See `experiments/LESSONS.md`
32+
> entry "type-hash's value is contingent on having a cache". The
33+
> hypothesis and design notes below remain as a record of how the
34+
> direction was reached.
35+
2336
## Hypothesis
2437

2538
After synonym-opt + skip-redundant-entailment-unify shipped, the new

0 commit comments

Comments
 (0)