]> git.hungrycats.org Git - bees/commit
scan-next: log real dedupes the do-nothing floor declines
authorZygo Blaxell <bees@furryterror.org>
Wed, 15 Jul 2026 22:24:06 +0000 (18:24 -0400)
committerZygo Blaxell <bees@furryterror.org>
Sat, 10 Oct 2026 19:00:03 +0000 (15:00 -0400)
commitf62a669bb79cbd6dcb87905e85d95bd6ef775b46
tree90bbebb9d31dc5a3ac2e16f62c1b7cd7948dab8f
parenta90cf070932f3169112d1b987b458bc271fa0532
scan-next: log real dedupes the do-nothing floor declines

plan_accept_null counts every extent where the do-nothing floor wins, but
that lumps together the common no-duplicates case with the diagnostically
interesting one: an extent where a real covering was built and then lost
to the floor because its reference/extent cost outweighed the space it
would free.  Only the counter moved; nothing said which extents, how much
they would have freed, or why the floor rejected them.

Emit a "plan: null" log line when the floor wins and the best competing
real plan has a non-zero operation count.  The zero-op case (no duplicate
found, or none surviving the gates) ties the floor at debt 0 and stays
silent, so the line does not fire for every scanned extent.  When it does
fire the losing plan's debt is necessarily >= 0 (a negative-debt plan
would have displaced the floor), so the line reports the aggregate cost
that sank it: bytes_freed found, physical_freed earned, refs_added /
refs_created spent, extents_delta, and the positive space debt.  This is
the ref-cost-vs-physical-freed breakdown that names the cause -- a
compressed dst freed wholesale earns little physical credit against the
references its removal must rewrite.

Add plan_null_declined alongside so the interesting subset of
plan_accept_null is countable without grepping.

Assisted-by: Claude-Code:claude-opus-4-8
Assisted-by: Claude-Code:claude-opus-5
Assisted-by: Claude-Code:claude-opus-5-5
src/bees-scan-next.cc