fix: make the optional-plain-compare leak case print its peak, not its checksum - #808
Merged
Conversation
…s checksum The gate contract is that a case prints peak_kb() and nothing else; the case from #807 printed its hit counter instead, so the "growth" the gate compared was 800k*3 - 200k*3 = 1,800,000 — the difference of two checksums, not two peaks — and main went red on a case that does not leak. ## what was tested - the gate's own measure sequence against the rebuilt case: PITH_LEAK_ROUNDS=200000 -> 2616 kb, 800000 -> 2656 kb, growth 40 kb against the 2048 kb limit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The leak gate's contract (documented in tests/leaks/leakprobe.pith) is that a case prints
peak_kb()and nothing else — the harness runs it at two round counts and compares the two numbers. The case added in #807 printed its hit counter instead, so the gate compared checksums: 800k rounds × 3 hits minus 200k × 3 = exactly the "grew 1800000kb" that turned main red. The compare shapes themselves do not leak.This aligns the case's main with the other cases: accumulate a checksum so the loop cannot be optimized away, guard it behind an impossible branch, print
probe.peak_kb().what was tested
PITH_LEAK_ROUNDS=200000→ 2616 kb peak,800000→ 2656 kb peak, growth 40 kb against the 2048 kb limit