Repository navigation
Run wave64 compute programs in a paired form on 32-lane hosts (port of fxceless#854, stacked on #61) - #64
Run wave64 compute programs in a paired form on 32-lane hosts (port of fxceless#854, stacked on #61)#64Castyan wants to merge 24 commits into
Conversation
…to combined-preload-pops # Conflicts: # Setup-DexNomRuntime.ps1 # apps/victory/src/play_launcher.rs # apps/victory/src/translate.rs # crates/victory-gpu/src/descriptor/host.rs # crates/victory-gpu/src/host.rs # crates/victory-gpu/src/pipeline/make.rs # crates/victory-hle/src/modules/d3d12x.rs
… combined-preload-pops
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wn lanes Three wave64 compute shaders (a 512-thread prefix over per-wave totals) were refused on 32-lane hosts: inside a loop only one console wave's lanes run, v_readfirstlane copies a running sum built from scalars and LDS alone. Two host waves cannot exchange there (no group barrier inside the loop), but every lane holds the same sum, so each host wave's own first lane is exact. scalar_built() finds such VGPR values (VALU results and LDS reads of them, phis at loop headers or where every predecessor runs on all lanes; guards allowed), and remembers which a guarded write made: those are only taken by a read that is itself inside a branch. Fixes 9fc111d3be79364f, 77360df21e12ea43 and 39321a95223001ed on the RTX 5060; their pipelines are now created. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…change loop Compute 7f61193d2c0e5f22 was refused by CreateComputePipelineState with E_OUTOFMEMORY on the RTX 5060 and on WARP alike, although its DXIL validates. Bisecting the console code down to one instruction: ds_add_rtn_u32 of (0 - x) on group-shared memory. Host compilers turn atomicrmw add of a negation into atomicrmw sub, which DXIL has no group-shared form of, and refuse the pipeline; ds_sub_u32 (atomicrmw sub) fails the same way. Both are now a load and a cmpxchg loop on old - x (lds_subtract); other atomics keep their atomicrmw. A test runs ds_add of 0 - 1 and ds_sub of 0 - 1 over 32 threads and checks LDS on the card (32 and 96). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port of DexNom#40 (notquiteog), unchanged. A console wave64 compute program that no other form takes off 64-lane waves is refused by a 32-lane host and every dispatch of it is dropped; the exact wave-wide form is tried last, only for those. VICTORY_WAVE_WIDE=0 keeps the old refusal. On the RTX 5060 this creates 22 of the 31 compute pipelines the title's preload left refused for requiring WaveSize(64). The 9 left: 7 run groups of several console waves (128 to 1024 threads), which the wave-wide form does not take, and 2 are ray-tracing BVH builder programs (28918b7150a7aad5, caa78b8ca62bc3d6) whose waves exchange across halves. Co-Authored-By: notquiteog <notquiteog@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In-game test on the RTX 5060 (build
|
| Run 1 (cold cache) | Run 2 (warm cache) | |
|---|---|---|
| Preload | 25,758 shaders translated, 0 refused. 2,732 compute pipelines, 2 refused (the two BVH builder programs). 709 s | Same counts, 85 s |
| New paired pipelines used in game | 02384a60fda6f2d0, 2da4beb386509b77 |
02384a60fda6f2d0, 2da4beb386509b77, 6b82bc7d22016cb5 |
| D3D12 device removal / GPU hang | none | none |
| End | frame 1716: title null write 0xc0000005 at +0x23cf683 |
frame 1706, 8 min 30 s, intro Prestream: title breakpoint 0x80000003 at +0x5149aec, crash report INSTANCE_LIST: 44997/45000 |
Both endings are crashes that docs/nvidia-rtx5060.md already records on builds without this PR:
- Run 1: the same offset and the same next two stack frames.
- Run 2: the same breakpoint offset, during
Prestream, with the instance pool full (World load on NVIDIA with no device removal: title breakpoint (0x80000003) after ~6.7 min, INSTANCE_LIST pool full (45000/45000) Marvisak/VIctory#698).
Neither ending points at the paired form. Both runs show no device removal and no shader error before the crash.
Not seen yet: the other 4 paired programs never ran before the intro ended. The game ran at about 0.5 fps during Prestream. I have not checked rendering on screen.
Status: device method 0x218 (native compute pipelines)A follow-up commit is ready locally on
Checks (RTX 5060)
Open points
🤖 Generated with Claude Code |
Report: three commits pushed (
|
| Check | Result |
|---|---|
cargo clippy --workspace --all-targets --locked -- -D warnings (with and without --all-features) |
pass |
cargo test --workspace --locked |
pass |
cargo test -p victory-gpu --lib, 40 runs in a row |
40/40 |
| Replay of the five captured 0x218 descriptions | 5/5: hardware PSO and runtime creation |
These commits have not been run in game yet.
🤖 Generated with Claude Code
|
Independent RTX 2060 check on pinned
The two recovered builder container hashes are An earlier DexNom prologue capture on |
|
Ty @Artking175 for your independent test, i'm still working on it |
Report: in-game runs, decoder fixes pushed (
|
|
I ran the prologue game A/B on RTX 2060 with one release binary at the pinned Your The reported intermittent GPU-suite access violation predates this PR on |
warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset decommitted half of its allocation right after dropping the buffer placed over it. The pages of a heap opened on private memory stay locked until the runtime has destroyed the heap, and WARP may do that a moment after the last reference goes: under the load of the whole victory-gpu suite the decommit was sometimes refused (ERROR_INVALID_PARAMETER) and the test failed, or the run ended in an access violation. About 2 runs in 15 failed this way, already on a65db62. The test now retries the decommit for two seconds at most, drops its command queue before releasing the allocation, and checks that the release succeeds. 40 runs of the library in a row now pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Progress since
|
|
@Artking175 thanks for the RTX 2060 A/B and the careful write-up (re: #64 (comment)). I agree with the split. The runs on our side don't answer whether the paired wave path is reached in the prologue either. They were about device method 0x218, and we didn't count dispatches of the seven target hashes or keep frame captures. So your result stands as is: the paired run creates a host PSO for For the follow-up against the newer head, your proposal is the right measure:
On the access violation, agreed as well: it predates this PR ( One note for reading the 🤖 Generated with Claude Code |
The test binary's random access violations were d3d10warp.dll's own. Every test that asks for the software adapter gets the same device (one per adapter in a process), and two of them compiling and running compute shaders at once crash its shader compiler: in JITBaseVariable::OptimizeCopy as a ComputePipelineShaderJIT is torn down, under ExecuteCommandLists of the indirect tests' harness, or in Task_CompileShader on its own worker threads. Every stack caught under cdb had two or more indirect::tests::warp_* tests inside it at once. They take turns now, with the in-place tests that open the same adapter: under cdb, 50 of 588 runs of all tests crashed before, none of 240 after; 150 plain runs passed. frame's tick test tries again when a busy PC wakes a wait late. Ported from avatarmanz/VIctory-7900XTX 160d222 (its WARP turn and frame parts; its write watch change is left out here). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I opened the dispatch-count follow-up against your On RTX 2060, the same release executable reached the prologue in both modes and both lost the D3D12 device with Offline on that executable, both modes still validated all seven target shaders. With pairs off, 0/7 hardware PSOs were made. With pairs on, 7/7 were made. This isolates the earlier pipeline creation result from the game session, which ended before those commands were recorded. |
Report:
|
| Check | Result |
|---|---|
cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features |
pass |
cargo test --workspace --locked |
pass |
victory-gpu --lib, plain runs |
199/200; one failure left no output |
victory-gpu --lib, 100 pairs run at once (heavy load) |
2 failures, both in watch::tests, no access violation |
| Replay, the five original captures | 5/5 |
| Replay, the eight descriptions captured in game | all decode; 4 reach a hardware pipeline |
- The
watch::testsfailures already exist on Respect D3D12 limits, Preload and Play, POPS diagnostics, and RTX 5060 shader/pipeline fixes #61 alone. Same load, same failures:a_view_mapped_beside_a_guarded_one_makes_it_check_againatwatch.rs:1484, twice in 200. No commit here toucheswatch.rs. - The
watchpart of 160d222 (tests forget their guards before freeing their memory, plus a runtime race where a view guarded by a concurrent refresh stayed read-only) does not port mechanically: ourwatch.rshas diverged (aliased blocks, clean sets). It is left for its own change. - The four captured programs that do not translate yet now stop further along, at translator limits: "an address with two computed terms" (m005 to m008) and "a hardware SGPR input" (the four root-descriptor programs).
In game (RTX 5060, BVH builder off), before this push, with 9eac44a
- 0x218 made over 2048 pipelines and turned down 32 to 63 descriptions. The first run with
3a9874chad made about 512 and turned down over 1024. - No error, crash or device loss. In heavy scenes, about 0.5 to 2.5 s per frame once the pipeline cache is warm, as in earlier runs.
ed45fe9has not been run in game yet.
#61
#61's branch now carries the two test fixes as well (6684db0..2287c4b): 8cdfc63, the in-place decommit race, and 2287c4b, WARP tests taking turns. Checked alone: Clippy ×2 and cargo test --workspace pass, and victory-gpu --lib passed 100 plain runs out of 100.
Next
- Translator: "an address with two computed terms" and "a hardware SGPR input" on 0x218 programs.
- A game run with
ed45fe9andVICTORY_DUMP_NATIVE, to capture real root signatures. This would confirm or extend the placement rule. - The
watchrace, as its own change. - 0x1c8 (native graphics pipelines), still refused: it needs the draw's render-target formats.
🤖 Generated with Claude Code
Report:
|
Before (ed45fe9) |
77845b8 |
|
|---|---|---|
| First 200 captures reaching a hardware pipeline (replay) | 2 | 88 |
| Second 200 captures (programs that decode but don't translate) | 5 | 23 |
| In game: 0x218 descriptions turned down at decode | over 1024 | 0 |
| In game: 0x218 pipelines made | over 1024 | over 2048 |
| In game: errors, crashes, device losses | 0 | 0 |
The refusals fixed here are gone from the game log (measured at 7331754). The most common ones left in game are "an address not from a root parameter" and lane-mask emulation of wave64 programs on 32-lane hosts.
Checks at 77845b8: Clippy with and without --all-features and cargo test --workspace --locked pass. Replay: the five original captures 5/5, the two capture sets 88/200 and 23/200 (the rest stop at translator limits). One known flake remains: the watch::tests failures under heavy load also happen on #61 alone, about 1 run in 100.
In progress, on separate branches
- Lane masks of wave64 programs on 32-lane hosts.
- Addresses and descriptors read as data.
- The thread-group info SGPR, LDS addresses and missing instructions (
v_mad_u32_u16,s_sext_i32_i16, …). - The
watchpart of avatarmanz/VIctory-7900XTX@160d222: a runtime race where a view guarded during its mapping stays read-only, plus thewatchtests' guards outliving their memory.
🤖 Generated with Claude Code
|
I'm back babe |
Report:
|
| Replay (hardware pipeline reached) | 77845b8 |
f87ea51 |
|---|---|---|
| First 200 captures | 88 | 162 |
| Second 200 captures | 23 | 101 |
No program that passed on any of the four branches is lost after the merge (checked program by program). Clippy (-D warnings, with and without --all-features) and cargo test --workspace --locked pass on f87ea51.
Repositories used
| Repository | Owner | Used for |
|---|---|---|
| DexNom/VIctory | DexNom | Upstream project; this PR's target |
| Castyan/VIctory | Castyan | The fork carrying wave64-paired-form |
| avatarmanz/VIctory-7900XTX | avatarmanz | 160d222: the watch race fix (ported here) and the WARP test serialization (ported earlier in dddb8e3) |
| fxceless/victory-fork | fxceless | image_store with any channel mask (Marvisak#146, 67f7ff0 by Davi713), ported in 90580ec |
Next
A test will be run in game with f87ea51 to measure how many 0x218 pipelines are now made and which refusals remain. Its results will follow in this PR.
🤖 Generated with Claude Code
In-game test:
|
| In game | 6dbdf24 |
|---|---|
| 0x218 descriptions turned down at decode | 0 |
| 0x218 pipelines made | over 2,048 (the log counts in powers of two) |
| Compute shaders that do not translate (each distinct) | 553 |
The refusal count depends on how far the run goes in the game, so it cannot be compared directly with earlier runs of a different length.
Refusals that remain
| Reason | Shaders |
|---|---|
| a structured buffer made raw, read by index or format | 313 |
| a lane mask read as data | 72 |
| a descriptor's address or format read as data | 50 |
| a descriptor built around a table in the code | 24 |
| a whole-wave section step the simulation does not follow | 14 |
| a descriptor changed after loading | 12 |
| a lane mask exchanged where not every lane runs | 10 |
| a first-lane read where not every lane runs | 9 |
s_absdiff_i32 |
7 |
| a constant buffer's descriptor read as data | 7 |
| a hardware SGPR input | 5 |
| 16 other reasons, 1 to 4 shaders each | 30 |
"An address not from a root parameter", which was the first refusal in game, and "a lane mask whose lanes depend on its own value" no longer appear. The largest remaining refusal, "a structured buffer made raw", is deliberate: it stays until raw access to a structured buffer is reproduced exactly. The 200 refused descriptions captured in this run, with their root signatures and reasons, are kept for the next round.
🤖 Generated with Claude Code
…f fxceless#854) Port of 26600c6 from fxceless/victory-fork#854 by PiloteCode ("wave64 programs in a paired form on 32-lane hosts, mesh programs over 32 KiB linked with their pixel program, and more"). Each console wave runs as one host wave of 32 lanes, each thread two console lanes (n and n + 32), with every per-lane branch taken by the whole wave and EXEC as each lane's guard. It is tried after every other form for a wave64 compute program the host refuses (VICTORY_WAVE_PAIRS=0 turns it off). On the 31 wave64 compute containers from the RTX 5060 preload, 29 get a pipeline (22 before): 02384a60fda6f2d0, 1d434307d981352a, 22338086ea4c5364, 2da4beb386509b77, 3b02415f67c6b0d8, 6832a9da15c2e584 and 6b82bc7d22016cb5 now take the paired form; the other 22 are unchanged. Adapted to this branch: - Kept from this branch: scalar_built() and the v_readfirstlane own-lane read, lds_subtract() with Module::negated() (the PR's own LDS subtraction loop is left out), the wave-wide last resort from DexNom#40 (now inside emit_forms), the POPS translation from pops.rs, the structured view record count / picked address / puddle texture size paths and scalar UINT views (moved into descriptor_data.rs next to the PR's unused-descriptor path, which now only runs where this branch refused). - Left out: the PR's second POPS implementation (ir::without_pops_wait, Shader::ordered and its test), which would have run beside pops.rs. - The ray-tracing structure builder's programs (a spilled user-data table, as victory-gpu classifies them) are refused by the paired form: forcing them onto 32-lane hosts hung NVIDIA GPUs in Marvisak#2711. 28918b7150a7aad5 and caa78b8ca62bc3d6 stay refused. - The new modules are classified in lib.rs; a test that expected the parked mask to be opaque when built alone checks only the shared build; the descriptor size test fills the record-count root word the runtime fills. Co-Authored-By: Pilote Production <75377040+PiloteCode@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two BVH builder programs (28918b7150a7aad5, caa78b8ca62bc3d6) were the last wave64 compute programs refused on 32-lane hosts. They exchange across the console wave's halves, which the per-half form got wrong and which hung NVIDIA cards (Marvisak#2711). The paired form keeps both halves in one host wave, so the refusal is dropped: all 31 wave64 compute containers from the RTX 5060 preload now get a pipeline. The builder still runs only when victory-gpu allows it (VICTORY_BVH_BUILDER=1 or VICTORY_RAY_TRACING=1) and every one of its pipelines has a host pipeline; by default its dispatches stay dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6dbdf24 to
53f1f19
Compare
Stacked on #61. This branch holds #61's commits (up to
2287c4b). The changes to review are the last two commits,082e528and53f1f19(the former40c2f29anda65db62, rebased onto #61's head). I'll rebase once #61 is merged.What
This ports
26600c6from fxceless/victory-fork#854 by @PiloteCode: wave64 compute programs run in a paired form on hosts with 32-lane waves only. Each console wave runs as one host wave of 32 lanes, and each thread does the work of two console lanes (n and n + 32). The whole wave takes every per-lane branch, with EXEC as each lane's guard. Lane reads, permutes, lane masks and reductions cover both halves through the host wave's own operations. The paired form is tried after every other form, for a wave64 program the host still refuses.VICTORY_WAVE_PAIRS=0turns it off. All credit for the technique goes to PiloteCode. Any mistakes in the port are mine.#61 got 22 of 31 wave64-only compute pipelines working on the RTX 5060. All 9 left need this form. 7 of them have groups of 128 to 1024 threads and read and write LDS inside lane branches. The other 2 are the BVH builder programs.
The commit is the whole of
26600c6, so it also brings in that commit's other parts: mesh programs over 32 KiB linked with their pixel program (emit/link.rs,pipeline/host.rs,VICTORY_MESH_LINK=0), signature row order, 64-bit floats (float64.rs), descriptors read only for their size (descriptor_data.rs), whole-wave sections that a jump splits, and the other changes listed in its message.Adapted to this branch
scalar_built()and thev_readfirstlaneown-lane read.lds_subtract()withModule::negated(). Test report: NVIDIA RTX 5070 Ti (Blackwell), Windows 11: cargo test --workspace 342 passed, 0 failed Marvisak/VIctory#854's own LDS subtraction loop is left out.emit_forms, before the paired retry.pops.rs.descriptor_data.rsand run first. Test report: NVIDIA RTX 5070 Ti (Blackwell), Windows 11: cargo test --workspace 342 passed, 0 failed Marvisak/VIctory#854's unused-descriptor path runs only where this branch used to refuse.ir::without_pops_wait,Shader::orderedand their tests). It would have run alongsidepops.rs.a65db62): the paired form also takes the ray-tracing structure builder's two programs. These programs exchange data across the console wave's halves. The per-half form got that wrong and hung NVIDIA GPUs in Shaders, GPU: on 32-lane hosts, wave64 halves act as waves; the BVH builder waits (stacked on #2176, #2118) Marvisak/VIctory#2711. The paired form keeps both halves in one host wave. The builder still runs only whenvictory-gpuallows it (VICTORY_BVH_BUILDER=1orVICTORY_RAY_TRACING=1) and every builder pipeline has a host pipeline. By default its dispatches are still dropped, so this commit changes nothing at run time unless that switch is on.lib.rs.a_mask_parked_in_lanes_…now checks only the shared build: on this branch, the mask built alone is no longer opaque.USER_VIEW_RECORDSroot word, as the runtime does.Results (RTX 5060, 32-lane waves)
victory translate --validate --pipelines --listover the 31 wave64 compute containers from the RTX 5060 preload.VICTORY_DATA_DIRandVICTORY_CACHE_DIRpointed to empty scratch folders. All 31 validate in both builds.6684db0)02384a60fda6f2d01d434307d981352a22338086ea4c53642da4beb386509b773b02415f67c6b0d86832a9da15c2e5846b82bc7d22016cb528918b7150a7aad5(BVH builder)caa78b8ca62bc3d6(BVH builder)Total: 31 of 31 created (was 22). With
VICTORY_WAVE_WHY=1, exactly the 9 programs above reportWAVE64-RETRY paired lanes: wave Some(32).Checks (local, Windows, since CI here waits for approval)
cargo clippy --workspace --all-targets --locked -- -D warnings: cleancargo clippy --workspace --all-targets --all-features --locked -- -D warnings: cleancargo test --workspace --lockedwithVICTORY_TESTS_ALLOW_SOFTWARE_SKIP=1: 719 passed, 0 failed, 11 ignored. This includes Test report: NVIDIA RTX 5070 Ti (Blackwell), Windows 11: cargo test --workspace 342 passed, 0 failed Marvisak/VIctory#854's on-card tests of the paired form against the console's 64 lanes.Not verified
The BVH builder with
VICTORY_BVH_BUILDER=1. Its programs now get pipelines, but the builder has not run in game on this card. That run is where the Shaders, GPU: on 32-lane hosts, wave64 halves act as waves; the BVH builder waits (stacked on #2176, #2118) Marvisak/VIctory#2711 hang would show up.Gameplay. No run of the title with these pipelines yet. A pipeline that gets created is not proof that the program computes what it should in the game. This needs a play test on the RTX 5060.
The rest of
26600c6(mesh linking, interpolation and signature changes, 64-bit floats) was checked only by the test suite and this compute set. I did not run the full shader pack through it.AMD (64-lane) hosts should be unaffected, because the paired form is only tried when the host's largest wave is 32. I have not checked this on an AMD card.
🤖 Generated with Claude Code