Tests: victory-shader tests crash (0xC0000005) when several tests use WARP devices in parallel #181
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#181
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@ghost on GitHub · 2026-11-24 01:11 UTC · original
On an AMD GPU,
cargo test -p victory-shader --libonmain(9aef3d9) sometimes dies with0xC0000005(access violation) when tests run in parallel, which is cargo's default. It never crashes single-threaded.Measured (AMD Radeon RX 9060 XT, RDNA4, driver 32.0.32029.2010; Ryzen 7 5800X3D; Windows 11 Pro 26200; Rust 1.98.1; debug;
cargo test -q -p victory-shader …):--lib--lib -- --test-threads=1valu_testsonly--lib -- --skip valu_tests--lib -- valu_tests emit::tests::stub_pipeline_is_created--lib -- emit::byte_and_halfword_writes+byte_and_halfword_readsonlyldsfilterThe log stops mid-run with
process didn't exit successfully: …victory_shader-….exe (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION). No test reports a panic.So it takes two tests that each create a D3D12 device or pipeline (the
Hosts invalu_tests,stub_pipeline_is_created, #116'slds_tests) running at the same time. More such tests make it more frequent. My guess, not checked: something in device or pipeline creation, or in the DXIL validator loaded per test, isn't safe to use from two threads at once on this driver. Either way, it makes the defaultcargo test --workspaceflaky on AMD, and new GPU tests will raise the rate. Serializing the GPU tests (one shared lock, or--test-threads=1for this crate) would avoid it.Not tested: NVIDIA or Intel (does it happen there?), a release build.
AI use
@DaviTostes on GitHub · 2026-11-24 01:16 UTC · original
Data point from a different host: it does not reproduce under Wine on Linux.
main(d2a4bae),cargo xwin test --no-run --release -p victory-shader, run under Wine 11.22 + vkd3d-proton 3.1 on an AMD RX 9060 XT (RADV 26.3.1), default test threads: 15 runs, 0 crashes (every run exits 101 only because ofemit::tests::stub_pipeline_is_created, which needsdxil.dll; that is the single failure in each run).--test-threads=1control: 5 runs, same result.The likely difference is the validator:
dxil.dllis absent under Wine, soValidator::loadreturnsNoneand the tests skip it, while on Windows it is loaded and used by several tests. That fits your guess about per-test DXIL validator state — a load/use from two threads at once — more than device or pipeline creation in general, since those run in parallel here without a fault.If it helps to narrow it down on Windows: run the suite with the validator forced off (e.g. a temporary
Validator::loadreturningNone, or movedxil.dllaside) for 25 runs. If the crashes stop, the shared state is in the validator rather than in the device/pipeline path.No game data used.
@ghost on GitHub · 2026-11-24 01:27 UTC · original
Thanks @DaviTostes. Your Wine result was the key, but on Windows the difference turns out to be WARP, not the validator. Under vkd3d-proton there's no WARP, so those tests only ever make the hardware host there. Same card here (RX 9060 XT), Windows 11 26200,
d3d10warp.dll/D3D12Core.dll10.0.26100.9818, debug:cargo test -q -p victory-shader …0xC0000005)lds, as shippedlds, validator off (VICTORY_DXILpointing at a missing file)lds, validator on,loadandvalidatebehind one globalMutex(local patch)lds, WARP only (VICTORY_WARP=1)lds, hardware only (local patch:Host::newrefuses WARP)maind2a4bae--lib, validator offmain--lib, WARP onlymainvalu_tests, WARP onlymain--lib, WARP only,--test-threads=1So it's two or more test threads each using their own WARP device at the same time. The validator and the AMD driver are cleared. It isn't AMD-specific either (I'll fix the title): any Windows machine with WARP should hit it. With a real GPU it's rarer only because WARP is just one of each test's two hosts.
Possible fixes, cheapest first: hold a process-wide lock for the WARP host's work in the tests (
hosts()/Host::new(true)and its dispatches), or share one WARPHostbetween tests. Running this crate with--test-threads=1also avoids it, at the cost of speed.AI use
@r4tedx on GitHub · 2026-11-24 04:29 UTC · original
Numbers from a second machine that confirm the WARP diagnosis here, from the thread of #433 (a test-only lock around
valu_tests::run_cases).valu_testsfilter with a local switch that makes the seven tests use one backend, 40 runs each:maind2a4bae0xC0000005)So the seven tests overlapping on WARP crash on
mainin 40 and 29 of 40 runs once nothing staggers them, on machines with NVIDIA cards too.What #433 does not do: it serialises only those seven tests.
stub_pipeline_is_created, #116's LDS tests and any new GPU test still overlap on WARP, so this issue stays open with it; #244 is the PR that addresses WARP for every test. I am posting the numbers here so they are in one place, not to claim the issue.No game data used. AI-assisted.
@draggygaggy-maker on GitHub · 2026-11-24 07:38 UTC · original
Additional Windows/NVIDIA test results:
Hardware: Ryzen 7 5800X, NVIDIA RTX 4060 Ti 8 GB, Windows 11
Rust: 1.98.1 (MSVC)
cargo test --workspace— sevenemit::valu_testsremained running for over 60 seconds without completing; manually interrupted.cargo test -p victory-shader --lib emit::valu_tests -- --test-threads=1 --nocapture— 7/7 passed in 6.41s.cargo test --workspace -- --test-threads=1— all 264 non-ignored tests passed; 0 failed, 4 ignored.This suggests a parallel-execution problem also affects this NVIDIA setup, although I haven't identified the underlying cause. No crash or access violation was observed.
AI-assisted investigation (OpenAI GPT-6).
@BaggyALPHA on GitHub · 2026-11-24 17:25 UTC · original
I rechecked current upstream after the VALU and waterfall tests began sharing their lock. I selected those two groups plus
stub_pipeline_is_created, which still runs outside that lock, and used 16 test threads on Windows 11 with an RTX 3080 available.VICTORY_WARP=1: 25 of 25 runs passed.No access violations or missing-device skips in either configuration. This is one machine and does not cover the original AMD system. Only synthetic tests were used.
AI-assisted (Codex).
@Marvisak on GitHub · 2026-11-25 01:47 UTC · original
Automated triage for the maintainers.
The cause found in the thread is several tests driving their own WARP device at the same time.
mainhas partly addressed it:ONE_AT_A_TIMEincrates/victory-shader/src/emit/valu_tests.rs(commits1106f43and74a9d33) is now taken by the VALU, waterfall, flow, memory, semantics, stride, synthetic and BVH tests and byedge_flagged_triangles_draw_as_unflagged_onesinemit/mod.rs. That fits the clean 16-thread runs in the last comment. Two tests still create a WARPHostwithout taking it: the cube-sampling test arounddiff_tests.rs:1266, and the geometry-stage test inemit/rect.rs(for warp in [false, true]). So the crash can still happen when either of them overlaps another WARP test.stub_pipeline_is_createduses the hardware adapter only.Open PR #244 serializes WARP host work for every test. The narrower alternative is to take
ONE_AT_A_TIMEin the two tests above.Generated by Claude Code
@xyzMikah on GitHub · 2026-11-25 19:37 UTC · original
RTX 5060 Ti 16 GB, Windows 11, Rust 1.98.1, upstream main.
cargo test -p victory-shader --libcrashes with 0xC0000005.Alone, one test crashes every run:
emit::memory_tests::heap_direct_texture_reads_mark_their_heap_indexSo it's not only parallel WARP devices.