You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
frontier's gen-hash cache never evicts: every t27c rebuild adds ~1860 entries for good -- keep the newest 3 binaries' groups #8928
Part of #8737 (hot reload). This is a defect in my own H1 (#8741).
Problem
Why it grows: the gen-hash cache key holds the t27c binary's bytes, so every rebuild of t27c writes a fresh entry for each of ~1860 specs. Nothing ever deletes the old ones.
Measured on this Mac, 2026-10-11 after a day of rebuilds: ~/.cache/t27/genhash holds 14,795 entries, 58 MB. At ~15 rebuilds a day that is about 100 MB a day, without bound, on a machine that has hit 0 bytes free before.
Change
Group entries by binary:~/.cache/t27/genhash/<binary digest>/<key>. The key's value is unchanged.
Evict at the start of each frontier walk: keep the current binary's group plus the newest GEN_CACHE_KEEP_BINARIES - 1 others by mtime, and delete the rest, along with the flat entries of the old layout.
The rule, gen_cache_keep(is_current, rank_among_others), in specs/verified/gen_hash_cache.t27:
the current binary is never evicted;
switching between two or three binaries (master, a branch) stays warm.
Acceptance criteria
gen_hash_cache.t27 has a test that names gen_cache_keep.
After one walk, at most GEN_CACHE_KEEP_BINARIES groups remain and no flat entries. A warm walk afterwards is as fast as before, and frontier --list is identical.
Hand-written foreign lines do not grow.
Boundary
specs/verified/gen_hash_cache.t27
User Scenarios
Given a developer rebuilds t27c multiple times, When frontier runs its gen-hash cache walk, Then only the current binary's cache group plus the newest GEN_CACHE_KEEP_BINARIES - 1 other binary groups remain, and all older groups are evicted.
Given a developer switches between two or three t27c binaries (e.g., master and a branch), When frontier runs, Then the cache groups for those active binaries are retained and subsequent walks are warm (as fast as before eviction).
Given the cache previously used the flat layout (entries directly under ~/.cache/t27/genhash/), When frontier runs after the change, Then those flat entries are deleted during the first walk and no new flat entries are created.
Requirements
FR-001: The cache directory structure MUST be changed from flat ~/.cache/t27/genhash/<key> to grouped ~/.cache/t27/genhash/<binary digest>/<key>.
FR-002: At the start of each frontier walk, the cache MUST evict all binary digest groups except the current binary's group and the newest GEN_CACHE_KEEP_BINARIES - 1 other groups by mtime.
FR-003: The current binary's cache group MUST never be evicted regardless of GEN_CACHE_KEEP_BINARIES value.
FR-004: The function gen_cache_keep(is_current, rank_among_others) MUST be implemented in specs/verified/gen_hash_cache.t27 to encode the eviction rule.
FR-005: specs/verified/gen_hash_cache.t27 MUST contain a test that names and exercises gen_cache_keep.
FR-006: After one walk with the new logic, at most GEN_CACHE_KEEP_BINARIES binary digest groups MUST remain and no flat entries MUST exist.
FR-007: A warm walk after eviction MUST be as fast as before, and frontier --list output MUST be identical.
FR-008: Hand-written foreign lines in the cache MUST not grow unbounded.
Activity
the bitstream reuse cache keeps the 32 most recently used entries and…
tri hot: every hot-reload speed-up as one word -- watch, frontier, pr…
frontier's gen-hash cache keeps the newest 3 binaries' entries and ev…