Fix fast_path_counters test: measure dealloc delta from before snapshot - #66
Merged
Merged
Conversation
Phase 11.9 moved fast_path_deallocs counter updates from the per-dealloc hot path to a pre-credit at small_refill (alloc time). The test's snapshot window `after_alloc -> after_dealloc` therefore captured zero rise even though the counter had already been credited the matching ~1024 deallocs during the alloc phase. Switch the dealloc-side measurement to `after_dealloc - before`, matching the same fix the Rust frontend_stats test received in Phase 11.9. C++ test logic was missed at the time. Verified locally: - ctest -E "long|stress": 104/104 pass - cargo test --features stats-basic / stats-full / profiling: green - cargo test --workspace: green
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.
Summary
fast_path_deallocscounter increments off the per-dealloc fast path and into a pre-credit atsmall_refill(alloc time). The C++fast_path_counterstest still measuredafter_alloc → after_dealloc, capturing zero rise.after_dealloc - before(cumulative window), matching the same fix already applied tosnmalloc-rs/tests/frontend_stats.rsin 11.9.Test plan
Full local sweep (CI is out of minutes):
ctest -E "long|stress"→ 104/104 passcargo test --release(no features) → greencargo test --features stats-basic→ greencargo test --features stats-full→ greencargo test --features profiling→ greencargo test --workspace→ green (incl. snmalloc-tools)