GPU tests: one page-table test lock for every test that binds a list #2886
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2888"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-25T23:07:10Z.
memory::tests::bitmap_pool_reuses_and_zeroes_across_resetsasserts that a list whose page tables were released gets its own 256 KiB dirty-page bitmap back when it is bound again. The pool those bitmaps come from (BITMAP_POOL) is shared by the whole process, hands them back last-in-first-out and is capped at 64, so the assertion only holds while no other test takes or returns a bitmap in between.memory's tests already heldgpu_test_lockfor exactly that reason, but two other tests take a page table from the same pool without it:descriptor::tests::a_released_view_heap_drops_its_page_table(throughmemory::bind);draw::tests::compute_view_marks_rebind_after_depth_twin_conversion(throughState::bind, which binds a heap's page table).In a parallel suite run they do just that between the reset and the next bind, and the assertion fails:
Fix
gpu_test_lockbecomes a module-level#[cfg(test)] pub(crate)helper (it was private tomemory::tests), documented with the pool's properties, and every test that binds a list holds it for its run. No production code changes: at runtime the pool is only reached from the submitting thread.Verified
Windows 11, RX 7900 XTX,
223d010-equivalent tree, debug:victory-gputest binary,--test-threads=256cargo test -p victory-gpu(default threads)cargo test --workspace --exclude victory-corevictory.example.tomlis absent from this checkout, which is the only reasonvictory-coreis excluded; the change touches no config code.Notes for review
FIND-20(parallel-suite flakiness invictory-gpu) but not the same test: this one is inmemory, notwatch, and 30 runs of thewatch::tests alone showed no failure here.FIND-20should stay open.Claimed in #1633: https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7177154035
AI-assisted (drafted with an AI coding agent); the reproduction and the test runs above are my own.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T23:34:12Z.
Review: COMMENTED
Right scope extension: the bitmap pool is process-wide and LIFO, so any test binding a list (directly or through draw::State::bind) can interleave with another's acquire/return — same flake class as #2861. Promoting the lock to pub(crate) and holding it for the whole run is the correct fix. LGTM.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T23:18:40Z.
Reviewed and verified
9c70f452on Windows 11 (RTX 5090 + WARP) againstmain(842b0cb):memory::bind/State::bindtest call sites acrossvictory-gpu: all 4 directmemory::bindtests andcompute_view_marks_rebind_after_depth_twin_conversionnow sharememory::gpu_test_lock()at the outermost test scope with no nested re-entry (andplaced_uav_dispatch_writes_its_textureusesstage.memory == None, so it does not touch page tables orBITMAP_POOL).--features diagnostics, full crate parallel run) 242 passed; 0 failed; 1 ignored with zero deadlocks; RTX 5090226/227(only the pre-existing842b0cbNVIDIA 1M-heaplists_share_a_table_and_copies_keep_their_viewsbaseline issue);cargo clippy --locked -p victory-gpu --all-targets -- -D warnings0 warnings;cargo xtask policy(190 files ok).Looks clean and ready to merge.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T04:29:09Z.
Automated triage for the maintainers.
Merge candidate. Fixes a flaky test:
bitmap_pool_reuses_and_zeroes_across_resetsrelies on the process-wideBITMAP_POOL, but two other tests took page tables from it without the lock.gpu_test_lockmoves to module level invictory-gpu/src/memory.rs, anda_released_view_heap_drops_its_page_tableandcompute_view_marks_rebind_after_depth_twin_conversionnow hold it. No production changes.CI: passing.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T09:52:03Z.
Review: APPROVED
Verified on RTX 5090 against
origin/main(63bcca4):cargo test -p victory-gpu --lib memory:: -- --test-threads=1 --skip lists_share_a_table_and_copies_keep_their_views: 7/7 passed.cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20/20 passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly unifies the page-table test lock across all GPU tests that bind a command list.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T11:04:59Z.
Review: APPROVED
Verified
9c70f452locally on Windows 11 (RTX 5090 and WARP, withVICTORY_D3D12_DEBUG=1):cargo xtask policyandcargo clippy -p victory-gpu --tests -- -D warnings(default and--all-features): clean.memory::(7/7, excluding the pre-existinglists_share_a_table_and_copies_keep_their_viewsbaseline),descriptor::tests::a_released_view_heap_drops_its_page_table, anddraw::tests::compute_view_marks_rebind_after_depth_twin_conversion: all passed.bitmap_pool_reuses_and_zeroes_across_resets,a_released_view_heap_drops_its_page_table,compute_view_marks_rebind_after_depth_twin_conversion, anda_submission_that_missed_leaves_the_copies_at_once: 10/10 passed on RTX 5090 and 10/10 passed on WARP +VICTORY_D3D12_DEBUG=1.Audited all
memory::bindandState::bindtest paths acrossvictory-gpu— every test that can touchBITMAP_POOLnow serializes onmemory::gpu_test_lock()with no nested acquisition. Looks good to merge.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.