]> git.hungrycats.org Git - bees/commit
scan-next: erase hash cells pointing at a ceiling extent
authorZygo Blaxell <bees@furryterror.org>
Sat, 19 Sep 2026 17:11:30 +0000 (13:11 -0400)
committerZygo Blaxell <bees@furryterror.org>
Sun, 11 Oct 2026 00:48:00 +0000 (20:48 -0400)
commitd4d05254b3663dbd70fc291c91c58ab74a04ca4d
treea2255b8fe4c02856e336c8a234ad82c0d69b2a55
parent386544439727ba90970b37f16ffa43738479d921
scan-next: erase hash cells pointing at a ceiling extent

An extent at or above rewrite.refs-max cannot take another reference, so
it can never serve as a dedupe src again.  Its block hashes stay in the
hash table regardless, and every later scan that shares one of them pays
a lookup and an extent resolve to rediscover that the extent is
unusable.  Nothing ever clears this:  the crawler advances past the
extent and will not return, because nothing about the extent changes.

Erase the cell instead.  The candidate search already erases cells that
resolve into a gap between extents, and normalizes cells that point into
the middle of an extent; a ceiling extent belongs in the first category
rather than the second, since normalizing its address only preserves a
pointer to something that has permanently withdrawn from dedupe.

This erases only the hashes that actually surface in a lookup, which is
the complete set of hashes that cost anything -- a hash nobody looks up
is free to leave in place.  It also needs no reference list, which
matters here because a ceiling extent has none to offer.

Telling a ceiling extent apart from a freed one needs the same
disambiguation the start-extent path needed, so the candidate gate now
asks refs_at_ceiling() as well, and counts the two separately.

Document the candidate event group, which was missing entirely.

Assisted-by: Claude-Code:claude-opus-5
Assisted-by: Claude-Code:claude-opus-5-5
docs/event-counters.md
src/bees-scan-next.cc