Skip to content

Shaders: share and serialize WARP host operations across threads - #244

Merged
Marvisak merged 2 commits into
Marvisak:mainfrom
AndyLatimer:fix/shader-warp-parallel-crash
Nov 25, 2026
Merged

Marvisak merged 2 commits into
Marvisak:mainfrom
AndyLatimer:fix/shader-warp-parallel-crash

Conversation

@AndyLatimer

Copy link
Copy Markdown
Contributor

Fixes #181.

Cause

On Windows 11, concurrent d3d10warp.dll activity across threads crashes with 0xC0000005 (STATUS_ACCESS_VIOLATION). Sharing a single process-wide WARP ID3D12Device via OnceLock alone was not enough — VICTORY_WARP=1 cargo test -q -p victory-shader --lib still crashed on the first run — showing that concurrent WARP pipeline compilation / execution itself races inside d3d10warp.dll.

Change

  • crates/victory-shader/src/emit/host.rs:
    • Keep a single process-wide WARP ID3D12Device in Host::new whenever WARP is used (warp == true, VICTORY_WARP=1, or when DXGI's default adapter carries DXGI_ADAPTER_FLAG_SOFTWARE).
    • Serialize WARP operations (Host::new initialization, root_signature_bytes / root_signature_for, compute_pipeline_with, pipeline_with, mesh_pipeline_with, draw, and dispatch) behind a process-wide Mutex.
    • Per-operation locking (rather than holding a guard for Host's lifetime) keeps Host's public API intact and preserves multi-threaded IR/lowering/validation parallelism in apps/victory/src/translate.rs (--jobs N), while leaving hardware D3D12 devices completely unserialized.
    • Add a multi-threaded regression test (emit::host::tests::parallel_warp_pipelines_and_draws) that launches 8 threads behind a Barrier to create WARP hosts, compile graphics pipelines, and draw concurrently.
  • crates/victory-shader/src/emit/diff_tests.rs:
    • Replace the three direct host.device.CreateRootSignature(...) calls with host.root_signature_bytes(...) so differential tests also serialize under VICTORY_WARP=1.

Verification

Tested on Windows 11 (debug build, synthetic tests only — no game data or console SDK used):

Command Before (d2a4bae) After (7f95b87)
VICTORY_WARP=1 cargo test -q -p victory-shader --lib 10 / 10 crashed (0xC0000005) 0 / 25 failed
VICTORY_WARP=1 cargo test -q -p victory-shader --lib -- --test-threads=16 — 0 / 50 failed
cargo test -q -p victory-shader --lib (default: hardware + WARP) intermittent crashes (#181) 0 / 25 failed
cargo test -p victory-shader — 70 / 70 passed
cargo clippy -p victory-shader --all-targets -- -D warnings — 0 warnings
cargo clippy -p victory --all-targets — 0 warnings in victory / victory-shader
rustfmt --edition 2024 --check (touched files) — clean
cargo xtask policy — 151 files ok

(Sharing one WARP ID3D12Device without the mutex was also tested and crashed on run 1 with 0xC0000005.)

AI assistance

Assisted by Google Antigravity in reproducing the crash, isolating that a shared WARP device without serialization still faults, implementing the fix and regression test, and running the stress and verification checks above.

Fixes Marvisak#181.

Concurrent WARP (d3d10warp.dll) usage across threads crashes with
0xC0000005 on Windows 11, both when creating/tearing down separate
WARP devices and when compiling pipelines or executing work concurrently
on a single shared WARP device.

Keep one process-wide WARP ID3D12Device in Host::new (for explicit
warp = true, VICTORY_WARP=1, and systems whose default DXGI adapter
has DXGI_ADAPTER_FLAG_SOFTWARE) and serialize WARP root signature
creation, pipeline compilation, draws, and dispatches behind a
process-wide mutex. Hardware D3D12 devices remain unserialized.

Route diff_tests's direct CreateRootSignature calls through
Host::root_signature_bytes so they share the same serialization, and
add a multi-threaded WARP regression test (parallel_warp_pipelines_and_draws).
@ghost

ghost commented Nov 24, 2026

Copy link
Copy Markdown

Verified the fix for #181 with the same runs that reproduced it. 7f95b87 merged onto main d2a4bae (clean merge), AMD Radeon RX 9060 XT, Windows 11 26200 (d3d10warp.dll 10.0.26100.9818), Rust 1.98.1, debug:

cargo test -q -p victory-shader --lib main this PR
WARP only (VICTORY_WARP=1) 10 / 10 crashed 0 / 20
default (hardware + WARP) 3 / 25 crashed 0 / 25

cargo test --workspace: 265 passed, 0 failed, 4 ignored.

AI use

  • Claude Code (Claude Opus 5.5) ran the commands and wrote this report from the logs; I checked it before posting.

@rhuantac

Copy link
Copy Markdown

Tested 7f95b87 on an NVIDIA RTX 3060 Ti (driver 32.0.16.1088), Windows 11 build 26300, d3d10warp.dll 10.0.26100.9818, debug, victory-shader lib tests:

main (d2a4bae) #244 (7f95b87)
VICTORY_WARP=1, default threads 10 / 10 runs crash (0xC0000005) 20 / 20 pass (~0.3 s)
default (hardware + WARP) passes 10 / 10 pass (~2.7-3.3 s)
parallel_warp_pipelines_and_draws alone — 10 / 10 pass

No hangs (each run under a 180 s timeout). Not covered here: a default adapter that is itself WARP, and victory translate --pipelines.

AI use: Claude Code ran the commands and drafted this from the logs; I checked it before posting.

@MisaXz

MisaXz commented Nov 24, 2026

Copy link
Copy Markdown

Test report on NVIDIA (#181 lists NVIDIA as not tested).

Tested

  • NVIDIA GeForce RTX 5080, driver 621.14; Ryzen 7 9800X3D; Windows 11 Pro 26300; Rust 1.98.1; debug build
  • Command, run in a loop, default test threads: cargo test -q -p victory-shader --lib
Commit Runs 0xC0000005 crashes Other failures
main d2a4bae 100 1 0
this PR 7f95b87 100 0 0

Not tested

AI use

  • Claude Code (Claude Fable 5.2) ran the loops and wrote this report from their output.

@Aefekaa

Aefekaa commented Nov 24, 2026

Copy link
Copy Markdown

One more NVIDIA data point: RTX 4060 (driver 617.42), Windows 11 26200, Rust 1.98.1, debug. Same result as above. With VICTORY_WARP=1, main crashed 10 of 10 runs and this PR 0 of 10. With default threads, main crashed 1 of 25 and this PR 0 of 55.

One thing not mentioned above: twice the test binary hung instead of finishing, once on main and once with this PR (1 of 55 runs). It kept a core busy until my 120 s limit. I couldn't catch which test it was in 30 more runs, so it's probably a separate, rarer race and not caused by this PR. I'm mentioning it in case someone else hits a run that never ends.

AI-assisted: yes

@GamingRipperDoc

Copy link
Copy Markdown

Windows 10 data point (the reports so far are Windows 11). Short version: #181 cannot happen on Windows 10, because WARP there has no SM 6.6 device; #244 is harmless there, but it conflicts with #175.

Setup: Windows 10 22H2 19045.7846, d3d10warp.dll 10.0.19041.7811, AMD RX 9070 XT (driver 32.0.32015.7029), Rust 1.98.1, debug. On Windows 10 the victory-shader tests only get an SM 6.6 device at all with the Agility SDK runtime in the test executable, so I tested on top of #175 + #362 (which gives the test executables that runtime).

victory-shader lib tests #175 + #362 + #244 (7f95b87)
default (hardware + WARP), 25 runs 25 / 25 pass, 0 crashes (69 tests) 25 / 25 pass, 0 crashes (70 tests)
VICTORY_WARP=1 7 valu_tests fail: neither hardware nor WARP SM 6.6 device available same
parallel_warp_pipelines_and_draws alone – passes, printing no SM 6.6 warp device; skipped

No game data used.

AI-assisted (Claude Code); I ran everything above on my machine.

@lordon1a

Copy link
Copy Markdown
Contributor

AI-assisted.

Tested 7f95b87ea on Windows 11 Home 26H2 (build 26200) with Intel(R) Iris(R) Xe Graphics (8086:46a6, driver 32.0.101.7088, DXGI Adapter 0) + WARP (Microsoft Basic Render Driver), rustc 1.100.0 (x86_64-pc-windows-gnullvm):

  • cargo xtask policy: 151 files ok
  • cargo test -p victory-shader (default parallel test threads, no --test-threads=1): 69/70 passed in 0.78s, zero 0xC0000005 WARP crashes (emit::host::tests::parallel_warp_pipelines_and_draws passed).
  • Stress check: cargo test -p victory-shader --lib parallel_warp_pipelines_and_draws passed 5/5 consecutive runs with zero crashes.

Verified clean on Windows 11 26200 + Intel Xe / WARP.

@r4tedx

r4tedx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

A data point on the hang mentioned above as probably separate: it reproduces here, and it is separate.

Tested

  • NVIDIA RTX 5070 with an AMD Radeon iGPU; Windows 11; Rust 1.98.1; debug.
  • The workspace build of the victory-shader test binary in a loop, filter valu_tests (the seven tests that run on the hardware adapter and on WARP), 45 s limit per run; a good run takes about 3 s:
runs hung crashed
main d2a4bae 30 3 0
this PR 7f95b87 60 3 1 (access violation, exit 139)

In a hung run none of the seven tests finishes and one core stays busy. With --skip valu_tests nothing hung in 14 runs.

So on this machine the hang survives serialising WARP alone. Taking a lock around valu_tests::run_cases, so those tests do not overlap on the hardware adapter either, gave 0 hung of 60 on main; that is #433 (five lines, tests only). It composes with this PR, which covers every WARP user.

The one crash in 60 runs on this PR I cannot explain and did not see again; I did not run VICTORY_WARP=1, where this PR's effect was measured by others.

No game data used. AI-assisted.

@mercuryVM mercuryVM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 7f95b87 on Windows 11, RTX 5070, MSVC: cargo test -p victory-shader -- --test-threads=1 70 passed. VICTORY_WARP=1 cargo test -p victory-shader --lib, run in parallel (the #181 repro), also passed (70 tests, no 0xC0000005), as did a default parallel run on the hardware adapter. cargo clippy -p victory-shader --all-targets is clean.

  • One shared device per adapter kind, kept for the process, plus a mutex around WARP operations only (default_adapter_is_warp() decides when the default device is WARP), fixes the cross-thread race without serialising hardware runs.
  • Caveat on attribution: on mercuryVM/VIctory main, without this change, a parallel cargo test -p victory-shader --lib on the hardware adapter now also passes (the serialisation from #433 is there). So I could only confirm the WARP part of #181 as fixed by this PR, not the hardware one.

AI-assisted (Claude Code).

@Marvisak
Marvisak merged commit bde8e7d into Marvisak:main Nov 25, 2026
1 check passed
gmankab pushed a commit to gmankab/victory that referenced this pull request Nov 25, 2026
…visak#244)

Fixes Marvisak#181.

Concurrent WARP (d3d10warp.dll) usage across threads crashes with
0xC0000005 on Windows 11, both when creating/tearing down separate
WARP devices and when compiling pipelines or executing work concurrently
on a single shared WARP device.

Keep one process-wide WARP ID3D12Device in Host::new (for explicit
warp = true, VICTORY_WARP=1, and systems whose default DXGI adapter
has DXGI_ADAPTER_FLAG_SOFTWARE) and serialize WARP root signature
creation, pipeline compilation, draws, and dispatches behind a
process-wide mutex. Hardware D3D12 devices remain unserialized.

Route diff_tests's direct CreateRootSignature calls through
Host::root_signature_bytes so they share the same serialization, and
add a multi-threaded WARP regression test (parallel_warp_pipelines_and_draws).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
gmankab added a commit to gmankab/victory that referenced this pull request Nov 25, 2026
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection.

Based-on: Marvisak#139
Based-on: Marvisak#244
Based-on: Marvisak#573
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks
Assisted-by: gpt-6.2 sol xhigh
gmankab pushed a commit to gmankab/victory that referenced this pull request Nov 25, 2026
…visak#244)

Fixes Marvisak#181.

Concurrent WARP (d3d10warp.dll) usage across threads crashes with
0xC0000005 on Windows 11, both when creating/tearing down separate
WARP devices and when compiling pipelines or executing work concurrently
on a single shared WARP device.

Keep one process-wide WARP ID3D12Device in Host::new (for explicit
warp = true, VICTORY_WARP=1, and systems whose default DXGI adapter
has DXGI_ADAPTER_FLAG_SOFTWARE) and serialize WARP root signature
creation, pipeline compilation, draws, and dispatches behind a
process-wide mutex. Hardware D3D12 devices remain unserialized.

Route diff_tests's direct CreateRootSignature calls through
Host::root_signature_bytes so they share the same serialization, and
add a multi-threaded WARP regression test (parallel_warp_pipelines_and_draws).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
gmankab added a commit to gmankab/victory that referenced this pull request Nov 25, 2026
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection.

Based-on: Marvisak#139
Based-on: Marvisak#244
Based-on: Marvisak#573
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks
Assisted-by: gpt-6.2 sol xhigh
gmankab pushed a commit to gmankab/victory that referenced this pull request Nov 25, 2026
…visak#244)

Fixes Marvisak#181.

Concurrent WARP (d3d10warp.dll) usage across threads crashes with
0xC0000005 on Windows 11, both when creating/tearing down separate
WARP devices and when compiling pipelines or executing work concurrently
on a single shared WARP device.

Keep one process-wide WARP ID3D12Device in Host::new (for explicit
warp = true, VICTORY_WARP=1, and systems whose default DXGI adapter
has DXGI_ADAPTER_FLAG_SOFTWARE) and serialize WARP root signature
creation, pipeline compilation, draws, and dispatches behind a
process-wide mutex. Hardware D3D12 devices remain unserialized.

Route diff_tests's direct CreateRootSignature calls through
Host::root_signature_bytes so they share the same serialization, and
add a multi-threaded WARP regression test (parallel_warp_pipelines_and_draws).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
gmankab added a commit to gmankab/victory that referenced this pull request Nov 25, 2026
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection.

Based-on: Marvisak#139
Based-on: Marvisak#244
Based-on: Marvisak#573
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks
Assisted-by: gpt-6.2 sol xhigh
gmankab pushed a commit to gmankab/victory that referenced this pull request Nov 25, 2026
…visak#244)

Fixes Marvisak#181.

Concurrent WARP (d3d10warp.dll) usage across threads crashes with
0xC0000005 on Windows 11, both when creating/tearing down separate
WARP devices and when compiling pipelines or executing work concurrently
on a single shared WARP device.

Keep one process-wide WARP ID3D12Device in Host::new (for explicit
warp = true, VICTORY_WARP=1, and systems whose default DXGI adapter
has DXGI_ADAPTER_FLAG_SOFTWARE) and serialize WARP root signature
creation, pipeline compilation, draws, and dispatches behind a
process-wide mutex. Hardware D3D12 devices remain unserialized.

Route diff_tests's direct CreateRootSignature calls through
Host::root_signature_bytes so they share the same serialization, and
add a multi-threaded WARP regression test (parallel_warp_pipelines_and_draws).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
gmankab added a commit to gmankab/victory that referenced this pull request Nov 25, 2026
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection.

Based-on: Marvisak#139
Based-on: Marvisak#244
Based-on: Marvisak#573
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks
Assisted-by: gpt-6.2 sol xhigh
gmankab pushed a commit to gmankab/victory that referenced this pull request Nov 25, 2026
…visak#244)

Fixes Marvisak#181.

Concurrent WARP (d3d10warp.dll) usage across threads crashes with
0xC0000005 on Windows 11, both when creating/tearing down separate
WARP devices and when compiling pipelines or executing work concurrently
on a single shared WARP device.

Keep one process-wide WARP ID3D12Device in Host::new (for explicit
warp = true, VICTORY_WARP=1, and systems whose default DXGI adapter
has DXGI_ADAPTER_FLAG_SOFTWARE) and serialize WARP root signature
creation, pipeline compilation, draws, and dispatches behind a
process-wide mutex. Hardware D3D12 devices remain unserialized.

Route diff_tests's direct CreateRootSignature calls through
Host::root_signature_bytes so they share the same serialization, and
add a multi-threaded WARP regression test (parallel_warp_pipelines_and_draws).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
gmankab added a commit to gmankab/victory that referenced this pull request Nov 25, 2026
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection.

Based-on: Marvisak#139
Based-on: Marvisak#244
Based-on: Marvisak#573
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks
Assisted-by: gpt-6.2 sol xhigh
gmankab pushed a commit to gmankab/victory that referenced this pull request Nov 26, 2026
…visak#244)

Fixes Marvisak#181.

Concurrent WARP (d3d10warp.dll) usage across threads crashes with
0xC0000005 on Windows 11, both when creating/tearing down separate
WARP devices and when compiling pipelines or executing work concurrently
on a single shared WARP device.

Keep one process-wide WARP ID3D12Device in Host::new (for explicit
warp = true, VICTORY_WARP=1, and systems whose default DXGI adapter
has DXGI_ADAPTER_FLAG_SOFTWARE) and serialize WARP root signature
creation, pipeline compilation, draws, and dispatches behind a
process-wide mutex. Hardware D3D12 devices remain unserialized.

Route diff_tests's direct CreateRootSignature calls through
Host::root_signature_bytes so they share the same serialization, and
add a multi-threaded WARP regression test (parallel_warp_pipelines_and_draws).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
gmankab added a commit to gmankab/victory that referenced this pull request Nov 26, 2026
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection.

Based-on: Marvisak#139
Based-on: Marvisak#244
Based-on: Marvisak#573
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks
Assisted-by: gpt-6.2 sol xhigh
gmankab pushed a commit to gmankab/victory that referenced this pull request Nov 26, 2026
…visak#244)

Fixes Marvisak#181.

Concurrent WARP (d3d10warp.dll) usage across threads crashes with
0xC0000005 on Windows 11, both when creating/tearing down separate
WARP devices and when compiling pipelines or executing work concurrently
on a single shared WARP device.

Keep one process-wide WARP ID3D12Device in Host::new (for explicit
warp = true, VICTORY_WARP=1, and systems whose default DXGI adapter
has DXGI_ADAPTER_FLAG_SOFTWARE) and serialize WARP root signature
creation, pipeline compilation, draws, and dispatches behind a
process-wide mutex. Hardware D3D12 devices remain unserialized.

Route diff_tests's direct CreateRootSignature calls through
Host::root_signature_bytes so they share the same serialization, and
add a multi-threaded WARP regression test (parallel_warp_pipelines_and_draws).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
gmankab added a commit to gmankab/victory that referenced this pull request Nov 26, 2026
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection.

Based-on: Marvisak#139
Based-on: Marvisak#244
Based-on: Marvisak#573
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks
Assisted-by: gpt-6.2 sol xhigh
Airamek added a commit to Airamek/VIctory that referenced this pull request Nov 26, 2026
Upstream model everywhere, our additive diagnostics kept. 15 files
conflicted, all resolved file-by-file:

- README: our fuzz_tests/ship-profile/VICTORY_DIFF_ONLY/VICTORY_NAME_SHADERS
  notes beside upstream's status/blake3-paths/translate-jobs wording.
- descriptor/host.rs: upstream Marvisak#2462 (no typed UAV in a format the host
  cannot store to) lands untouched through the merge; keeps its
  device-removal fix, no behavior change on capable hosts.
- descriptor.rs: our monotonic heap-id guard + upstream Marvisak#2234
  (released view heap takes its page table with it).
- pipeline/library.rs: upstream Marvisak#2179 (lock-free loads via Shared) +
  our best-effort periodic save (try_lock on state).
- capture.rs: our Marvisak#2607 signed-32 decode + test beside upstream's
  r32_integer_to_rgba.
- draw.rs: our buffer_state tracking + root-signature test beside
  upstream's marked page-range refresh (Marvisak#2172) + sampler-heap test.
- pipeline/host.rs: upstream vertex/depth-bounds/integer-blend model
  (stream_pipeline, host_blend, depth_with_bounds) + our padding-zeroing
  clean_* and Stream zeroing; both test batches kept.
- pipeline/make.rs: keep lost/screen fields + upstream skipped_shader.
- pipeline.rs: keep bytes()/pipelines_waiting() beside for_test.
- host.rs: multi-plane present (Marvisak#1997, Compositor) + our previous-frame
  wait, presented/probed frame tracking, keep-textures, drain-before-save;
  both test modules (submissions + present_plane_tests).
- queue.rs: upstream blinks (Option<bool>) supersedes ours.
- shadow.rs: upstream update_tracked/update + merge_writeback (Marvisak#2054) +
  our stale/submission_done/Part snapshots/buffer_states; update_free and
  update_busy retired as subsumed (no callers left).
- xmem.rs: upstream shared system_commit() supersedes our inline version.
- emit/host.rs: our fence-event wait() + upstream SharedDevice/Marvisak#244
  (shared/serialized WARP device).
- emit/lower.rs: upstream i64 dword ordering (Marvisak#1599) + our f/t lane path
  and RDNA2 opcode names; tests moved verbatim to lower_tests.rs via
  #[path] (lower.rs exceeded the 512 KiB asset-policy limit after the
  merge; module path unchanged, content byte-identical).
- emit/valu_tests.rs: our s_load_dwordx4_at + upstream sopk helper.
- gfx10/opcodes.rs: upstream pub(crate) + our RDNA2 names.
- fuzz_tests.rs: Host::from_device() for upstream's new warp field.

Test adaptations (same execution-model class as the 13f91ca merge):
8 upstream tests written for synchronous execute() drain explicitly on
our async-completion queue (marked-UAV/placed-view/rebind tests);
Host::from_device() port; words() accessor for privatized field.

Gates: cargo test --workspace --locked green, clippy --workspace
--all-targets --all-features -D warnings clean, xtask policy 197 ok.
gmankab pushed a commit to gmankab/victory that referenced this pull request Nov 26, 2026
…visak#244)

Fixes Marvisak#181.

Concurrent WARP (d3d10warp.dll) usage across threads crashes with
0xC0000005 on Windows 11, both when creating/tearing down separate
WARP devices and when compiling pipelines or executing work concurrently
on a single shared WARP device.

Keep one process-wide WARP ID3D12Device in Host::new (for explicit
warp = true, VICTORY_WARP=1, and systems whose default DXGI adapter
has DXGI_ADAPTER_FLAG_SOFTWARE) and serialize WARP root signature
creation, pipeline compilation, draws, and dispatches behind a
process-wide mutex. Hardware D3D12 devices remain unserialized.

Route diff_tests's direct CreateRootSignature calls through
Host::root_signature_bytes so they share the same serialization, and
add a multi-threaded WARP regression test (parallel_warp_pipelines_and_draws).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
gmankab added a commit to gmankab/victory that referenced this pull request Nov 26, 2026
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection.

Based-on: Marvisak#139
Based-on: Marvisak#244
Based-on: Marvisak#573
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks
Assisted-by: gpt-6.2 sol xhigh
desplmfao added a commit to desplmfao/VIctory that referenced this pull request Nov 26, 2026
Upstream main merged Marvisak#2143, Marvisak#2162, Marvisak#158, Marvisak#1906 and Marvisak#1152 and took up what
Marvisak#1769 (LDS bounds, Marvisak#1949) and Marvisak#1763 (typed UAV formats, Marvisak#2462) did; main's
code is kept for those.
- emit/lower.rs: ds_bpermute within each half (main's Marvisak#573, same as
  Marvisak#439's); LDS bounds as main's Marvisak#1949 (Marvisak#1769's test-only counter kept, its
  and_guard dropped); title-memory marks: main's straddling-write lookup
  (Marvisak#2484) with Marvisak#2167's current head (3cb308d, rebased on 63bcca4): guarded
  dirty atomics, raw_dword2, memory_null, synthetic_mark_dxil in
  lower/mark_tests.rs; the old Marvisak#2167 head taken out first.
- emit/host.rs: main's shared WARP device and lock (Marvisak#244) with Marvisak#439's
  adapter list and Host::on (create_device takes an optional adapter).
- descriptor/host.rs: main's Marvisak#2462 format checks; Marvisak#1763's tests kept.
- gpu host.rs: main's multi-plane present with Marvisak#2310's crumbed copy.
- pipeline.rs: Marvisak#2118/Marvisak#2311's builder and BVH checks with main's skip
  hashes (Marvisak#1320); draw.rs, shadow.rs, main.rs: both sides.
- Tests main added since get Marvisak#439's Parts fields and emit's Target.
- README: base 63bcca4; rows of PRs merged upstream, superseded or closed
  taken out, with a note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gmankab pushed a commit to gmankab/victory that referenced this pull request Nov 26, 2026
…visak#244)

Fixes Marvisak#181.

Concurrent WARP (d3d10warp.dll) usage across threads crashes with
0xC0000005 on Windows 11, both when creating/tearing down separate
WARP devices and when compiling pipelines or executing work concurrently
on a single shared WARP device.

Keep one process-wide WARP ID3D12Device in Host::new (for explicit
warp = true, VICTORY_WARP=1, and systems whose default DXGI adapter
has DXGI_ADAPTER_FLAG_SOFTWARE) and serialize WARP root signature
creation, pipeline compilation, draws, and dispatches behind a
process-wide mutex. Hardware D3D12 devices remain unserialized.

Route diff_tests's direct CreateRootSignature calls through
Host::root_signature_bytes so they share the same serialization, and
add a multi-threaded WARP regression test (parallel_warp_pipelines_and_draws).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
gmankab added a commit to gmankab/victory that referenced this pull request Nov 26, 2026
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection.

Based-on: Marvisak#139
Based-on: Marvisak#244
Based-on: Marvisak#573
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks
Assisted-by: gpt-6.2 sol xhigh
gmankab pushed a commit to gmankab/victory that referenced this pull request Nov 26, 2026
…visak#244)

Fixes Marvisak#181.

Concurrent WARP (d3d10warp.dll) usage across threads crashes with
0xC0000005 on Windows 11, both when creating/tearing down separate
WARP devices and when compiling pipelines or executing work concurrently
on a single shared WARP device.

Keep one process-wide WARP ID3D12Device in Host::new (for explicit
warp = true, VICTORY_WARP=1, and systems whose default DXGI adapter
has DXGI_ADAPTER_FLAG_SOFTWARE) and serialize WARP root signature
creation, pipeline compilation, draws, and dispatches behind a
process-wide mutex. Hardware D3D12 devices remain unserialized.

Route diff_tests's direct CreateRootSignature calls through
Host::root_signature_bytes so they share the same serialization, and
add a multi-threaded WARP regression test (parallel_warp_pipelines_and_draws).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
gmankab added a commit to gmankab/victory that referenced this pull request Nov 26, 2026
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection.

Based-on: Marvisak#139
Based-on: Marvisak#244
Based-on: Marvisak#573
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks
Assisted-by: gpt-6.2 sol xhigh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests: victory-shader tests crash (0xC0000005) when several tests use WARP devices in parallel

10 participants