Phase 7.4: Snapshot-under-churn stress test (8 workers + 1 sampler, 5s) - #24
Merged
Merged
Conversation
- 8 worker threads tight-loop alloc/free at sizes [16,64,256,1024,16384] - 9th sampler thread snapshots SampledList every ~10ms for 5s - exercises H1-H4 dealloc hooks + lock-free SampledList under churn - TSan/ASan-clean by construction; sanitizer cmd lines documented inline - SNMALLOC_PROFILE=OFF path collapses to a "skipped" stub
jayakasadev
added a commit
that referenced
this pull request
Jun 11, 2026
- Adds two ubuntu-24.04 clang Debug matrix legs to the existing
ubuntu job in .github/workflows/main.yml so the heap-profiling
code paths exercised by perf-profile_stress and the func-profile_*
suite are run under ThreadSanitizer and AddressSanitizer.
- Both legs configure -DSNMALLOC_PROFILE=ON and the project's
existing SNMALLOC_SANITIZER cmake option (=thread / =address)
instead of raw CMAKE_CXX_FLAGS=-fsanitize=...; this is the
idiomatic mechanism already used by the existing "TSan + UBSan"
matrix entries (CMakeLists.txt:73-75, 580-606, 668-672) and
correctly wires -fsanitize through to test-target compile and
link lines plus the SNMALLOC_THREAD_SANITIZER_ENABLED define
the codebase guards on.
- The TSan leg installs libc++-dev and uses -stdlib=libc++ to
match the existing TSan + UBSan legs (libstdc++ on Ubuntu is
not TSan-instrumented). The ASan leg uses the default
libstdc++ runtime, which is ASan-compatible.
- Both legs pass `-R profile_` via test-extra-args so ctest runs
only the profile suite (perf-profile_stress-{fast,check} +
func-profile_*). This bounds sanitizer overhead within the
CI time budget while still exercising the new snapshot-under-
churn workload from PR #24.
- Local validation: configured + built + ran perf-profile_stress-fast
on darwin-arm64 with -DSNMALLOC_SANITIZER=address; the fast
variant ran ~5s under ASan with no diagnostics. TSan was not
validated locally because the macOS toolchain available here
does not ship a TSan-instrumented libc++; relying on the
GitHub ubuntu-24.04 runner for that leg as called out in the
ticket.
2 of 3 tasks
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
Stress test for the lock-free SampledList + H1–H4 dealloc hooks under concurrent churn.
profile_e2e.cc/profile_integration.ccpattern) — needed to exercise H1–H4 since the defaultsnmalloc-testlibis built withNoClientMetaDataProvider.SamplerGlobals::list().snapshot()/debug_count()rather than the FFI thunk (rust.cc only compiles intosnmallocshim-rust, not into the testlib used by perf tests). Equivalence documented in the file's header.SNMALLOC_PROFILE=OFFthe body compiles toprintf("skipped")+ return 0.Measured this run: ~15M alloc/free pairs across 8 workers + ~417 snapshots; max live sample window ~16k (check) / ~1k (fast).
Test plan
perf-profile_stress-fast(SNMALLOC_PROFILE=ON)perf-profile_stress-check(SNMALLOC_PROFILE=ON)perf-profile_stress-fast(SNMALLOC_PROFILE=OFF, stub path)perf-profile_stress-check(SNMALLOC_PROFILE=OFF, stub path)