Repository navigation
test(mask-risc): count only the measuring thread's allocations in no_alloc - #1333
Conversation
…alloc six_plane_recognition_allocates_nothing failed once with 790 bytes and then passed 9/9 reruns. The counting global allocator was process-wide, and libtest's own threads (result reporting, output capture) sit outside the SERIAL lock, so they could allocate inside a measured window. The allocator now counts only allocations made while a const-initialised, Drop-free thread-local MEASURING flag is set; `measure(f)` sets it around the window. The zero-allocation assertions and the can-it-fire probe are unchanged in strength (the probe now runs inside `measure`). New test allocations_on_other_threads_are_not_counted: a foreign thread allocates 4096 bytes strictly inside the window (barrier rendezvous) and the window must read 0. It fails with the filter disabled. Verified: 50/50 parallel and 50/50 --test-threads=1 runs green. Claude-Session: https://claude.ai/code/session_01EwBQ2F8SxVoVB9qwhtg3zo
|
Warning Review limit reachedYour organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Next included review available in 56 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Your 55 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (1)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 59c7c17a-8548-4541-a95b-eeeb1acaefe4) |
…te index Wording only, after rebasing onto main (#1331, #1333): - entries/README.md regenerated from the rebased tree (218 rows). - Fold-contract OPEN splits the old "destination resolution" item into A. destination binding / coordinate resolution (frontend / binder; lowers to the existing Local / Via fold; not a missing ndarray primitive) and B. functional route composition beyond depth 2 (substrate / R2IL; chain vs precomposed lane unmeasured). - TD-KEYED-SINK-MERGE-IDENTITY-1 states exactly what merge_group_sink checks (supported keyed i64 terminal, equal length) and adds binding identity, contribution-population identity, and the working law that an ordinal has meaning only inside its destination-space / codebook identity. - merge_group_sink precondition 5 names the binding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DCEP2fZdHYdMCtcEVcTpS2
Problem
six_plane_recognition_allocates_nothingincrates/lance-graph-mask-risc/tests/no_alloc.rsfailed once with "six-plane recognition allocated 790 bytes over 100 runs", then passed 9 of 9 reruns. This was seen on the branch for #1332, which does not touch the recognition path.Cause: the counting
#[global_allocator]counted every allocation in the process. libtest's own threads (result reporting, output capture) don't take theSERIALlock, so they could allocate inside a measured window, for example when the sibling test finished and its result was printed.Fix
MEASURING: Cell<bool>is set on the current thread. It is const-initialised and has no destructor, so reading it from insideallocneither allocates nor recurses. It usestry_withso thread teardown is safe.measure(f) -> usizesets the flag around the window. Both zero-allocation assertions still use== 0. The existing can-it-fire probe is kept, and now runs insidemeasure.allocations_on_other_threads_are_not_counted: another thread allocates 4096 bytes strictly inside the window (two barrier rendezvous). The window must read 0, and the other thread returns itsVeclength to prove the allocation happened.Verification
true, the new test fails with "a foreign thread's 4096 bytes were counted". The file was restored afterwards.cargo test -p lance-graph-mask-risc --test no_alloc(withCARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0 CARGO_INCREMENTAL=0): 50/50 passed with default threads and 50/50 passed with--test-threads=1.cargo clippy -p lance-graph-mask-risc --test no_alloc -- -D warnings: clean.rustfmt --check: clean.https://claude.ai/code/session_01EwBQ2F8SxVoVB9qwhtg3zo
Generated by Claude Code