Repository navigation
Tests: recording-memory tests leave no fake allocator backing behind - #3472
tiagonleal wants to merge 1 commit into
Conversation
a_recordings_memory_is_held_for_the_pc_allocator_it_is_on reset its stack-address list on the fake allocator `other` (a Box address + 2), which made alloc_pool record the list as a user of a backing keyed by `other`. Cleanup removed the LISTS entry but never forget_list'ed the list, so forget(other) found the backing busy and only marked it retire_when_free. After the Box was freed, any later test on the same worker whose list reused that stack slot called on_release -> forget_list, the backing became free, and sweep_release_owners dropped ID3D12CommandAllocator::from_raw(other): windows-core checks the vtable pointer alignment and the non-unwinding panic aborted the whole lib test binary (0xc0000409), seen in wait64_flags_do_not_mask_the_recorded_counter. Both reset tests in list_x now clean up with on_release(key) before forgetting the fake allocators, like their neighbours, and the recording-memory test asserts that alloc_pool keeps nothing keyed by its fake ids. The bind test that leaves a recording on the fake `busy` allocator drops that backing without releasing it, as the alloc_pool tests do with their synthetic backings.
7230332 to
be8bce2
Compare
|
merge-check
|
|
merge-check AI-written and posted by Foniass without a human check of each point. |
|
#3183 and #3190 are also for #3180 but fix other flaky tests (a serialised pipeline test in AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Part of #3180. A recording-memory test leaves a fake allocator backing in
alloc_pool, and a later test on the same worker thread can abort the whole lib test binary.a_recordings_memory_is_held_for_the_pc_allocator_it_is_onresets a list on the fake allocatorother(a Box address + 2), soalloc_poolrecords the list as a user of a backing keyed byother. The test's cleanup removed theLISTSentry but never calledforget_list, soforget(other)found the backing busy and only marked itretire_when_free. After the Box was freed, a later test on the same worker thread whose list reused that stack address went throughon_release, thenforget_list. The backing became free andsweep_release_ownersdroppedID3D12CommandAllocator::from_raw(other)on a fake id. Thewindows-corealignment check on the vtable pointer fails there, and the panic is non-unwinding, so the whole lib test binary aborts (0xc0000409).Seen in CI run 46300047915 on #3190, a PR that only touches
alloc_pooltests: abort inhle::d3d12x::list_x::tests::wait64_flags_do_not_mask_the_recorded_counter, "misaligned pointer dereference: address must be a multiple of 0x8 but is 0x1d1adc819a2". The sighting is listed in #3180.What is in it
list_x.rs: the two reset tests clean up withon_release(key)before forgetting the fake allocators, like their neighbours; the recording-memory test asserts thatalloc_poolkeeps nothing keyed by its fake idsalloc_pool.rs: new#[cfg(test)]helperstracks_for_test(doesSTATEstill key anything by a fake id) anddrop_synthetic_for_test(drop a fake backing and its users' recordings without releasing it)bind.rs: the test that leaves a recording on the fakebusyallocator drops that backing withdrop_synthetic_for_test#[cfg(test)], no runtime behaviour changesTested
cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4on headbe8bce2d: 2841 passed, 0 failed, 51 ignored (24SKIPPEDlines: 22no wave64, 2no heap windows; the same 24 in both logs).mainf97120dcon the same machine: 2841 passed, 0 failed, 51 ignored.7230332c(same diff, before the rebase), with the old cleanup line put back in that one test (LISTS.lock().unwrap().as_mut().unwrap().remove(&key);in place ofon_release(key);),cargo test -p xcl --lib hle::d3d12x::list_x::tests::a_recordings_memory_is_held_for_the_pc_allocator_it_is_on -- --exact --test-threads=1fails on the new assertion withleft: [true, false, false, true]: the list and the fake allocatorotherare still keyed inalloc_pool. With the fix the same command passes.Regression run
scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e(a retail title), release builds of both commits,mainf97120dcand this PR's headbe8bce2d, one run each. A second run ofmainafter the PR runs gave 1680 frames.main(f97120dc):This PR (
be8bce2d):Not tested
alloc_pool(device_x,pso_async, the VRAM tests) were not audited.AI use