GPU tests: the work run while a view is prepared is per thread #2946
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2946
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2946/head"
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?
@desplmfao on GitHub · 2026-11-26 01:14 UTC · original
desplmfao:fix/preparing-hook-per-thread→main· +23 −7 · 1 files · 1 commits · closed without mergingviews_bound_while_another_slot_gets_its_texture_do_not_waitfails at random in CI withboth made. In the last 25 failed runs it did on three unrelated PRs: #2310 (run),gpu/loose-window-reuse(run) andgpu/parallel-refresh(run).Cause: that test and
a_slot_rewritten_while_its_view_is_prepared_views_the_new_recordset a global hook (WHILE_PREPARING) that runs while a view's texture is prepared, and any test that prepares a view takes it. With tests in parallel, one test can take or replace the other's hook. The work then never runs where it was meant to, and the second slot is never made.Change: the hook is thread-local. It's set and taken on the test's own thread; the threads the work spawns don't see it. Test code only.
How it was found: the failing CI run on #2310 (which doesn't touch
descriptor/), then a search of the recent failed runs for the test name. Locally (Wine, vkd3d-proton 3.2.0, RTX 5080) it didn't reproduce in 25 parallel runs ofdescriptor::host, before or after; the race needs CI's timing. Clippy is clean.🤖 Generated with Claude Code
@fuzeofficlal on GitHub · 2026-11-26 01:31 UTC · original
Code review and parallel stress verification at head
f337e710f98donmain(63bcca43c6a0):crates/victory-gpu/src/descriptor/host.rs:1917-1941):WHILE_PREPARINGfrom a globalMutex<Option<Work>>tothread_local! RefCell<Option<Work>>behind privateon_prepare/prepare_pendinghelpers (verified no other references exist acrossvictory-gpu/src). Spawned worker threads inside prepare callbacks observeNonein their own TLS and cannot steal callbacks from concurrent tests.VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy --locked -p victory-gpu --tests -- -D warnings: 0 warningsdescriptor::host::testsin parallel across 6 consecutive runs: all 14 non-1M-heap-cap tests (including all 3WHILE_PREPARINGconcurrency tests) passed 6/6 runs cleanly (only the pre-existing NVIDIA 1M view-heap baselinedynamic_slots_are_held_until_releasedfailed consistently).LGTM.
@fyernald on GitHub · 2026-11-26 02:22 UTC · original
This is the same change as #2585, opened 2026-11-25 16:16 UTC and triaged as a merge candidate at
19016aa:WHILE_PREPARINGbecomes thread-local, test code only.That PR has parallel-run numbers for both tests: 22/200 → 0/200 runs failing on an RTX 3080, and 7/150 → 0/150 on WARP from @oni-swr. Linking the two so only one needs to land.
@desplmfao on GitHub · 2026-11-26 03:23 UTC · original
@fyernald thanks, you're right. #2585 is the same change, it came first, and it has the parallel-run numbers. I searched for the test's name rather than for
WHILE_PREPARINGand missed it. Closing this in favour of #2585.Pull request closed