Skip to content

Shaders: wave64 compute on 32-lane hosts, in halves and in the console flow - #233

Open
r4tedx wants to merge 29 commits into
Marvisak:mainfrom
r4tedx:shader/wave64-console-flow
Open

r4tedx wants to merge 29 commits into
Marvisak:mainfrom
r4tedx:shader/wave64-console-flow

Conversation

@r4tedx

@r4tedx r4tedx commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Current head 87d1f423, which merges main 63bcca4 (no rebase or force-push); CI check is green on it. 19f63196 moves lower.rs's inline tests, unchanged, into emit/lower/tests.rs, so lower.rs stays under the 512 KiB file-size limit with main merged in; that move is the bulk of the diff and changes no code. The design note docs/wave64-on-wave32.md was removed in 691ff20; a short summary is in docs/architecture.md. Merge notes and per-level checks: #439. The older notes below name the heads they were written for. AI-assisted.

Reports from the title, read before merging. Testers ran this on their own copies (their data, linked):

Stacked on #223 (its commit is the first one here); review that first.

Rebased onto main 8e79c80 on 2026-11-24 (twice that day; upstream merged about 55 PRs and added CI; new upstream tests needed the argument #223 adds and the field this PR adds to lower::Parts, fixed in the commits that introduce them). CI's two clippy commands (-D warnings, with and without --all-features) are clean at this head. CI's first run on these PRs failed in tests, not in clippy: GitHub's runner has no GPU and lists Windows' software renderer (4-lane waves) as an adapter, and tests here assumed every listed adapter runs 32-lane waves. The tests are fixed where they were introduced: the hardware-adapter list leaves that renderer out by its ids and name, and the one test that takes the default device accepts a host without 32-lane waves. No translator code changed. Head dd3c08c, was 3098672; the six commits here are replayed unchanged. Ids in testers' reports are from before the rebase: 727e884 is now 63f197d, 3098672 is now dd3c08c.

What

Console wave64 compute programs that depend on the lane layout run on hosts without 64-lane waves (NVIDIA: D3D12 range 32..32), as two 32-lane waves per console wave. Two forms, picked per program:

  • In-half split. A program whose cross-lane reads are only DPP and ds_swizzle (reads within 16, 8, 32 or 4 lanes), with no mask read whole, no LDS and no whole-wave sections, declares WaveSize(32). It uses the existing thread relabelling, and DPP row masks name the console's rows.

  • Console flow, for groups of at most 64 threads (one console wave) without LDS. Every lane runs every block, as on the console:

    • structure::structure_console builds the per-lane booleans without resolving mask joins from what arriving lanes know (every lane arrives), and Structured::execs gives the lane's EXEC bit at each vector instruction.
    • The lowering guards every vector instruction with EXEC (v_readlane, v_writelane and v_readfirstlane ignore it, as on the console).
    • Branches are the console's s_cbranch_*: EXEC, VCC and mask-operation SCC tests are taken for the whole console wave, from both halves' ballots.
    • Each half's dword is exchanged through two group-shared slots between two group barriers. Since both halves take every branch alike, every thread of the group reaches each barrier, inside divergent branches and loops too.
    • Masks read whole (s_bcnt1, s_ff1, scalar compares) are the exchanged ballots. v_readlane and v_readfirstlane read the owning half; v_writelane, v_mbcnt and mask bit tests use the console lane.

    lower tries the per-lane form first. A program that needs the console flow stops with CONSOLE_FLOW and is lowered again from the console structure.

Also: emit::host::Host::on(name), adapters() and VICTORY_ADAPTER for tests, so a machine with two GPUs can run each test natively (64-lane adapter, the reference) and split (32-lane adapter). docs/architecture.md summarizes the design (the longer docs/wave64-on-wave32.md was removed in 691ff20).

Nothing changes on hosts that run 64-lane waves.

How this relates to other open PRs

Not verified

No game files and no console hardware were used. The expected values in the tests follow the ISA's EXEC, v_readlane, ballot and DPP semantics, checked against the native form on an RDNA2 GPU where that form is right. I did not measure how many of the title's programs each form covers. Testers did, on their own copies: the counts are in the note at the top (98 of the 321 compute programs a 32-lane driver refuses on main).

The console flow runs both halves through every block, guarded, so a divergent program costs more than in the per-lane form. Each exchange is two group barriers. Not measured on real shaders.

Not covered yet: groups of more than 64 threads that need an exchange, LDS in split programs, whole-wave sections, ds_(b)permute across halves. These still stop at translation with the reason from #223.

Tested

Windows 11, an NVIDIA RTX 5070 (32..32, split) and an AMD Radeon iGPU (RDNA2, 32..64, native) in one machine. Hand-assembled GFX10 programs run on every hardware adapter (emit/split_tests.rs), every lane checked against the console's result:

  • In-half: ds_swizzle xor 16 plus DPP row_mirror, in groups of 32, 64 and 128 threads and 3-D groups 4x4x4, 8x8x2, 2x4x8, 16x2x4, 8x8x4 and 4x8x8. Exact on both, so the thread relabelling holds on this NVIDIA driver for all of them. DPP row_mask:0x3: exact on both; it failed on the RTX 5070 before 727e884.

  • Console flow, exact on the RTX 5070:

    • s_bcnt1 of lanes below 40 in groups of 64, 48 and 32 threads;
    • v_readlane 40;
    • a v_readlane inside a branch only lanes below 20 take (the upper half has no lane there);
    • a loop lane t runs t times with v_readlane 40 in every iteration.

    The last one is wrong in the per-lane form on the Radeon (Shaders: v_readlane inside a loop the lanes leave at different iterations reads wrong lanes (wave32 and wave64, every GPU) #225), so that test checks 64-lane hosts only for the other cases.

  • A 128-thread program that needs an exchange still stops at translation on 32..32.

  • Merged with Shaders: integer memory atomics and sub-dword buffer accesses #164 (64-bit LDS atomics): the exchange's group-shared slots and its LDS compose, and all tests pass once Shaders: integer memory atomics and sub-dword buffer accesses #164's new test passes the Target argument.

  • cargo test --workspace: 278 passed, 0 failed, 4 ignored (at 3098672, which adds the v_readfirstlane fix and its test). cargo clippy --workspace --all-targets: nothing new. cargo xtask policy: ok. Each commit builds on its own.

The approach of pairing two 32-lane waves through group-shared memory follows XCL's design notes (docs/wave64-on-wave32.md in ivall/xcl, GPL-2.0-only); no code from XCL or its forks is used.

AI-assisted; no game assets were used.

🤖 Generated with Claude Code

@MisaXz

MisaXz commented Nov 24, 2026 •

Copy link
Copy Markdown

Test report from a second Blackwell card.

Tested

  • NVIDIA GeForce RTX 5080, driver 621.14 (32-lane waves only); Ryzen 7 9800X3D; Windows 11 Pro 26300; Rust 1.98.1; debug
  • This PR at 727e884 (base d2a4bae): cargo test --workspace --no-fail-fast: 277 passed, 0 failed, 4 ignored. The same counts as in the description. main d2a4bae here: 264 / 0 / 4.

With #269 (scalars in divergent loops), local only

Not tested

Re-run on the new head 3098672 (same machine, both adapters): cargo test --workspace --no-fail-fast: 278 passed, 0 failed, 4 ignored. cargo test -p victory-shader --lib -- split_tests lane_read_loop --nocapture --test-threads=1: 9 passed, every case prints exact on the RTX 5080 (split) and on the AMD Radeon(TM) Graphics iGPU (native).

AI use

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

r4tedx added a commit to r4tedx/VIctory that referenced this pull request Nov 24, 2026
The loop form compilers emit keeps the lanes that are done in an exit
mask that starts as 0 (s_mov_b64 s[2:3], 0; in the loop s_or_b64
s[2:3], vcc, s[2:3] and s_andn2_b64 exec, exec, s[2:3]). In the console
flow every mask join is a phi, and its incoming values had to be masks
derived from EXEC or a VALU result, so such a loop stopped with "a
lane-mask join of an untracked mask".

`Structured::others` gives the lane's bit of the other values read as
masks (constants, uniform selects, opaque ones), and the console flow's
mask joins take them. The per-lane form is unchanged.

New test: a loop in that form with a lane read in every iteration and
the exit mask counted afterwards. It was refused on an RTX 5070 before
and is exact there (in two halves) and on a Radeon iGPU now.

Found through the test report on Marvisak#233 that tried Marvisak#269's programs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@r4tedx

r4tedx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the run on a second Blackwell card, and for trying the two together. I reproduced all of it on an RTX 5070 and a Radeon iGPU (RDNA2, 32..64) and followed it up.

The build break. Yes: whichever of #269 and this lands second needs target / console_cf in build_lanes_cs (and per_lane_only with #320). I will fix it on my side if #269 goes in first.

The per-half counts are not from this PR's split. #269's programs read no other lane, so they declare no wave size, and a 64-thread group runs as whatever waves the host forms: two of 32 on NVIDIA, with or without this PR. #269 takes its maxima over the host wave, which is the console wave only when the host forms 64-lane waves. The Radeon iGPU here shows the same thing on plain #269 9356bee (with a local patch only to pick the adapter): scalar_counted_in_a_divergent_loop_read_after_it gives 32 on lanes 0-31 and 64 on lanes 32-63, the nested test 8 and 16. That driver runs an undeclared compute shader in waves of 32 although it offers 64. I have left a note on #269.

The console flow gets #269's four programs right, after one fix. With a local switch that sends every compute program through the console flow (not in any PR), in a merge of #269 onto #320:

RTX 5070 (two halves) Radeon iGPU (native)
loop_exit_mask_counted_after_the_loop exact exact
scalar_counted_in_a_divergent_loop_read_after_it exact exact
scalar_counted_in_nested_divergent_loops exact exact
mask_grown_inside_a_branch_counted_after_it exact exact

Scalars are the wave's own there by construction (every lane runs every block, branches are taken wave-wide), so nothing needs a maximum.

The fix: a lane-mask join of an untracked mask, which you hit, was a gap in the console flow. A loop's exit mask starts as a constant 0, and the console flow's mask joins took only masks derived from EXEC or a VALU result. Fixed in 5cc9a7e on #320 with a test of its own (a loop in that form with a lane read in each iteration and the exit mask counted afterwards: refused on the RTX 5070 before, exact on both adapters now).

What is not done. Neither this PR nor #320 selects the console flow for #269's programs: they select on lane reads and on masks read whole, not on scalars leaving a divergent loop. So the combination still gives per-half counts for the two scalar tests on a 32-lane host until one of them makes that selection. I would rather add it as a follow-up once #269 or this has landed than guess at #269's condition here.

No game data used. AI-assisted.

@Raxstreams

Raxstreams commented Nov 24, 2026 •

Copy link
Copy Markdown

Tested the PR head at 727e884 on an RTX 3080 Ti. I replayed 96 distinct compute shaders from a run where every shader passed DXIL validation and every D3D12 compute pipeline creation failed. On this PR alone, 18 of the 96 passed both checks, including all three depth-pyramid shaders (8×8 groups). The driver created another seven pipelines whose DXIL failed validation. With this PR's lowering on our existing integration branch, 25/96 passed both checks, including all three depth shaders.

I also launched the local integration build. It reached the intro location card, then presented a black frame with 1,872 draws and exited with DXGI_ERROR_DEVICE_HUNG. The slow-submission trace included two of the depth-pyramid pipelines. That trace covers many pipelines per submission and does not identify the command responsible for the hang. I have not seen a rendered world from this change.

r4tedx added a commit to r4tedx/VIctory that referenced this pull request Nov 24, 2026
Drivers create pipelines from some modules the DXIL validator refuses
(D3D12 checks only the container hash we write). The hand-assembled
split and console-flow programs now go through dxil.dll's validator
before pipeline creation, where one is installed. All of them pass.

Prompted by a report on Marvisak#233 of pipelines created from modules that
fail validation.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@r4tedx

r4tedx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, this is the first result from real programs. The seven pipelines the driver created from modules that fail validation are the part I most want to fix: D3D12 checks only the container hash we write, so a driver taking them proves nothing.

I could not reproduce it with what I have. Every hand-assembled program in split_tests.rs (both forms: in halves, and the console flow with exchanges, branches and loops) passes dxil.dll's validator here, and as of fabe8bc on #320 the tests check that before creating the pipeline. So the seven hit something those programs do not. Could you post, for those seven:

  • the validator's message (the first one per shader is enough), and
  • whether the shader's group is at most 64 threads and whether it reads a mask whole or another lane (if your replay prints the reason or the form; otherwise the message alone will do).

Messages and counts only, please, no shader contents.

Two more things that would help decide what to do next, if they are cheap for you:

No game data used on my side. AI-assisted.

@SlopComp

Copy link
Copy Markdown

Tested on a real dump, which the description says wasn't available. Two NVIDIA GPUs (RTX 5080 and RTX 3080, both D3D12 wave lanes 32..32); run on the 3080.

victory translate --validate --pipelines --list over the whole title, main (d2a4bae) vs this PR (727e884):

main #233
Compute programs emitted 1,693 of 2,581 1,470 of 2,581
Compute pipelines created 1,372 1,470
Compute pipelines refused by the driver 321 (all E_INVALIDARG, WaveSize(64)) 0
Vertex/pixel pipelines 12,284 12,284
Mesh pipelines 8,191 8,191

Of the 321 programs main emits with WaveSize(64):

  • 98 now translate and create pipelines on 32-lane hosts.
  • The other 223 now stop at translation instead of at pipeline creation, mostly with the two new reasons: console wave64 lanes on a host without 64-lane waves (162 compute programs overall) and a wave64 group sharing LDS without barriers on a host without 64-lane waves (120). That matches the "not covered yet" list (LDS in split programs, groups over 64 threads).

No program that creates a pipeline on main fails on this branch (per-program comparison: 98 gained, 0 lost). Vertex, pixel and mesh results are identical.

Tests on the RTX 3080 (VICTORY_ADAPTER="RTX 3080"):

  • cargo test --release -p victory-shader split: 9 passed, 0 failed.
  • cargo test --release --workspace: 277 passed, 0 failed, 4 ignored (same totals as in the description).

Not checked: whether the 98 newly created pipelines compute the right results in the title (no 64-lane reference adapter here, and the world isn't run).

r4tedx added a commit to r4tedx/VIctory that referenced this pull request Nov 24, 2026
The loop form compilers emit keeps the lanes that are done in an exit
mask that starts as 0 (s_mov_b64 s[2:3], 0; in the loop s_or_b64
s[2:3], vcc, s[2:3] and s_andn2_b64 exec, exec, s[2:3]). In the console
flow every mask join is a phi, and its incoming values had to be masks
derived from EXEC or a VALU result, so such a loop stopped with "a
lane-mask join of an untracked mask".

`Structured::others` gives the lane's bit of the other values read as
masks (constants, uniform selects, opaque ones), and the console flow's
mask joins take them. The per-lane form is unchanged.

New test: a loop in that form with a lane read in every iteration and
the exit mask counted afterwards. It was refused on an RTX 5070 before
and is exact there (in two halves) and on a Radeon iGPU now.

Found through the test report on Marvisak#233 that tried Marvisak#269's programs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
r4tedx added a commit to r4tedx/VIctory that referenced this pull request Nov 24, 2026
Drivers create pipelines from some modules the DXIL validator refuses
(D3D12 checks only the container hash we write). The hand-assembled
split and console-flow programs now go through dxil.dll's validator
before pipeline creation, where one is installed. All of them pass.

Prompted by a report on Marvisak#233 of pipelines created from modules that
fail validation.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@r4tedx

r4tedx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thank you, this is the measurement the description could not give, and it orders what is left.

What I will do with it. The 120 programs that stop with a wave64 group sharing LDS without barriers are all groups of one console wave (that is what the reason means), so the console flow can take them: both halves reach every LDS access together, and a group barrier before each access gives the console's instruction order. I am working on that as a follow-up on top of #320 and will post here when it is up. In the same change the other reason gets split (group of more than 64 threads / LDS / ds_(b)permute / whole-wave section), so a rerun shows what stops the 162 without anyone having to look into the programs.

Three questions, counts and messages only, no shader contents:

  1. Did --validate reject any of the 1,470 emitted compute modules, in particular any of the 98 gained? On another card seven pipelines were created from modules that fail validation, and I cannot reproduce that with hand-assembled programs (all of mine validate). The validator's first message per failing shader would be enough.
  2. The head moved since your run: 3098672 stops splitting programs that have a v_readfirstlane (in the upper half it read lane 32 where the console reads the wave's first lane; found with a hand-assembled case). Those programs now take the console flow if their group is at most 64 threads without LDS, and stop otherwise, so the 98 will shift. The same comparison on 3098672, or on Shaders: lane reads and writes where lanes branch differently run in the console flow #320's head a5ba4a4 (which also takes the loop form compilers emit in the console flow), would show by how much.
  3. If you get to run the title on it: whether anything visible changes with the refused pipelines gone. A run on #320 found the device removal of NVIDIA RTX 5070 Ti: world hang (DEVICE_HUNG) on 97c78d1 is not one program, not loops, not barriers; 77 compute pipelines refused #71 unchanged, which I would expect, since nothing here touches it.

No game data used on my side. AI-assisted.

edsuuu added a commit to edsuuu/VI-BR-PORT that referenced this pull request Nov 24, 2026
…d in the console flow

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SlopComp

Copy link
Copy Markdown

Same setup (real dump, RTX 3080, 32..32), translate --validate --pipelines --list, compared per program against main d2a4bae.

1. Validation of the emitted compute modules

Yes. On 727e884, 22 of the 1,470 compute modules fail --validate and still create a pipeline. 5 of those are in the 98 gained. All 22 already failed validation on main (main has 23 such, 17 of which create a pipeline there too), so the PR doesn't add any. Every one has the same first (and only) message:

Function: main: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details.

2. Newer heads

Head Compute pipelines vs main vs 727e884 Created but fail --validate of those, new vs main
727e884 1,470 +98 / −0 — 22 0
3098672 1,470 +98 / −0 +0 / −0 22 0
a5ba4a4 (#320) 1,491 +119 / −0 +21 / −0 42 20
  • 3098672: same 98 programs, no shift. A handful of programs change which stop reason they report first; the set that creates pipelines is identical.
  • a5ba4a4: 21 more pipelines, but 20 of those 21 fail validation, all with the same message as above. Stop reasons that changed vs 727e884: a lane-mask join of an untracked mask 21 → 0, a descriptor chosen by control flow 1 → 0, a descriptor's address or format read as data 20 → 19, new an SCC the emitter did not compute 0 → 2.

So on this NVIDIA driver, modules that fail validation are accepted at pipeline creation (on main as well), and #320's head adds 20 of them.

3. Not run in the title yet.

No game data shared beyond counts and validator messages.

@r4tedx

r4tedx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

The follow-up I mentioned is up as #439 (head 88cb024, on top of #320): programs of one console wave per group that share LDS now take the console flow on 32-lane hosts, with a group barrier before each LDS access, and what still stops says why (a group of more than 64 threads, ds_permute across the halves, a whole-wave section).

If you rerun, the numbers that would tell the most are the count per reason on 88cb024 and, for the whole-title run, whether the validator accepts every emitted compute module. I could only check hand-assembled programs: they validate and are exact on an RTX 5070 and a Radeon iGPU, and I say in the PR that the LDS tests there do not prove the barrier is needed.

No game data used on my side. AI-assisted.

r4tedx added a commit to r4tedx/VIctory that referenced this pull request Nov 24, 2026
The validator's message for an operation the stage or the entry's
properties do not allow ("Entry function performs some operation that
is incompatible with the shader stage or other entry properties") names
neither the operation nor the property, and it is the only message when
the call is in the entry function itself.

`victory translate --validate` now adds to each validator failure what
our own module declares and calls: its thread-group size, its wave size
and its dx.op operations (`emit::last_module_summary`, kept per thread
when a module is finished). Nothing of the console program is in it, so
a report of counts per reason is enough to see what the refused modules
have in common.

Prompted by a report on Marvisak#233: modules that fail validation with that
message and still create pipelines, 20 of them new with Marvisak#320, which I
cannot reproduce with hand-assembled programs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@r4tedx

r4tedx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thank you. That answers all three, and the second table is a real finding against #320: its head adds 20 modules that fail validation and still create a pipeline. They are the programs the exit-mask fix (4c197a0) let into the console flow, so the console flow emits something for them that the per-lane form on main does not.

What I could and could not find. The message is the one the validator gives when the entry function itself calls an operation the stage or the entry's properties do not allow; with the call in the entry there is no second message naming it, which matches what you saw. I could not reproduce it:

  • every hand-assembled console-flow program I have validates here (dxil.dll from the 10.0.26100 SDK), now including the same programs in groups of 64x1x1, 8x8x1, 4x4x4, 16x4x1, 32x2x1, 1x64x1, 2x2x16, 8x4x1, 6x6x1 and 48x1x1, so it is not the group's shape;
  • none of the stage-limited operations the translator can emit (discard, quadReadLaneAt, mesh output) is reachable for a compute program;
  • texture sampling is lowered the same way with and without the console flow's guards.

So it is something real programs do that mine do not, and I would rather measure than keep guessing.

A diagnostic to settle it. 9745f35 (the head of #439, which contains #320) makes translate --validate add to each validator failure what our own module declares and calls: thread-group size, wave size and its dx.op operations. For example:

validator: Function: main: error: Entry function performs ... [threads 8x8x1, wave size 32; ops: annotateHandle, barrier, cbufferLoadLegacy, createHandleFromHeap, flattenedThreadIdInGroup, rawBufferStore, waveGetLaneIndex, waveReadLaneAt, waveReadLaneFirst]

Nothing of the console program is in that line. If you can rerun translate --validate on 9745f35, the validator reasons with their counts (they are in the summary without --list) would show what the refused modules have in common, on main's 22 as well as the new 20.

Until then I have marked #320 and #439 as drafts and put this at the top of both descriptions. #233 itself adds no such module by your first table, so I have left it as it is.

No game data used on my side. AI-assisted.

@justlovett0

Copy link
Copy Markdown

Tested on a real title (the #348 machine): the split works – compute refusals drop from 103 to 1 – but world entry then fails in a new way: a crash inside NVIDIA's shader compiler while creating the large split pipelines, an E_OUTOFMEMORY pipeline refusal, and a hang on a mesh-heavy submission.

Setup: Windows 10 21H2 19044.7846, RTX 3080 10 GB (driver 32.0.15.9649), Ryzen 9 7900X, 32 GB RAM (commit limit ~43 GB, ~21 GB free after the run). This PR's head 3098672 (includes #223) merged locally with #175 (Agility SDK 1.620.2, required on this Win10 box) + #346 + #334. Release build, GTA VI v1.0.2.1 (b99f876b74d4a77f), no input; auto-plays to the opening cutscene.

What improved

without this PR (#175+#346+#334) with it
host pipeline refused 103, all compute (WaveSize(64) on the 32-lane host) 1 – and that one is E_OUTOFMEMORY, not wave size
dispatches run by frame 2048 1,024 1,343
draws run by frame 2048 9,638 11,323 (all of them)

The new failure (frame ~2194, first world frames): a burst of large split compute pipelines binds – DXIL sizes 66,596 / 57,268 / 65,916 / 65,044 B (hashes 6a20509b65f9a5f1, b084beb3ae6e27e3, 2c2cefe06f048390, a0a074e2d868e618) – then:

VIctory: first-chance exception 0xc0000005 at nvgpucomp64.dll+0x2806b21 (read 0x8)
  #0..#13 nvgpucomp64.dll  #14 nvwgf2umx.dll+0x7ec91f
WARN host pipeline refused error=Not enough memory resources… (0x8007000E) shaders=[compute c4183d3cbee28e8e]
…
WARN slow host submission ms=3291 lists=7 pipelines={compute 9146291b38ea9ce1, compute ec982aaadc623a49, mesh 0384efa1b7bcd540/1d96551fdd673db7, mesh 09c742c58e9acb62/9ee9a1b0ecdf7b74, …}
ERROR host GPU device removed after a submission of 7 lists … (0x887A0006)

So the driver's compiler faults on (at least) one of the big split programs, one compute pipeline is refused for memory, and the run ends in a TDR on a 3.3 s mesh-heavy submission – the shape #71 describes. The remaining refusal is c4183d3cbee28e8e (E_OUTOFMEMORY); whether that is VRAM, commit, or a driver-internal limit is not established here.

Possible next steps I can test on this machine if useful: VICTORY_SKIP_PIPELINES for the suspect hashes, a lower DXC optimisation level for the large split programs (XCL uses -O1 for ~1 MB HLSL after driver E_OUTOFMEMORY on big DXIL, xcl-dev/xcl#156), or a diag run with VICTORY_D3D12_DEBUG=1 + DRED to name the faulting command.

Full log kept locally (pr233-run.log, 5,568 lines).

AI use: Qwen Code (underlying model name not disclosed by the tool) built the merged stack, ran the title, extracted the excerpts and drafted this comment at the user's request.

@r4tedx

r4tedx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thank you. This is the first run where the newly accepted pipelines visibly go wrong in the driver, so it matters more than the improved counts.

What I think is going on, and what is only a guess. Before this PR the driver rejected these programs up front for WaveSize(64), so its compiler never saw them. Now it does, and anything wrong with those modules shows for the first time. There is one concrete suspect: a whole-title translate --validate run found that 5 of the 98 compute pipelines this PR gains are created from modules that fail dxil.dll validation (Entry function performs some operation that is incompatible with the shader stage or other entry properties). main already emits 22 such modules, and D3D12 does not validate what we sign ourselves. A module the validator refuses is a plausible cause of a fault inside the driver's compiler, but I have not shown that these are the ones that fault for you. I cannot reproduce the validation failure with hand-assembled programs, so its cause is still open; #439's head (9745f35) adds a diagnostic to find it.

Two checks that would tell, if you have the time:

  1. Whether the hashes around the fault (6a20509b65f9a5f1, b084beb3ae6e27e3, 2c2cefe06f048390, a0a074e2d868e618, and the refused c4183d3cbee28e8e) are among the modules that fail translate --validate. On 9745f35 each validator failure also prints what our module declares and calls (thread-group size, wave size, dx.op operations; nothing of the console program), which is what I need to find the cause.
  2. Your VICTORY_SKIP_PIPELINES idea for those hashes: if the compiler fault and the E_OUTOFMEMORY go away and the run still ends in the mesh-heavy TDR, the hang is NVIDIA RTX 5070 Ti: world hang (DEVICE_HUNG) on 97c78d1 is not one program, not loops, not barriers; 77 compute pipelines refused #71's and separate from this PR.

One question on the baseline: without this PR, does the same run on that machine also end in a device removal at world entry, or does it get past frame ~2194? Two other title runs (RTX 5070 Ti, RTX 5080, both Windows 11) end in the same device removal with and without this stack, so I do not know yet whether what you see is a regression on your driver or the same hang reached with more work in flight.

On the optimisation level: VIctory writes DXIL itself, there is no DXC step to turn down. The split programs are larger because every vector instruction carries its EXEC guard; if size turns out to matter to this driver, that is where I would look.

I have added this report to the top of the description so nobody merges without seeing it.

No game data used on my side. AI-assisted.

@r4tedx

r4tedx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Four follow-ups on the compiler fault report, which would separate "our module is wrong" from "this driver's compiler", mostly without rerunning the title.

For @justlovett0:

  1. Was c4183d3cbee28e8e among the 103 pipelines refused in the baseline run? If it was, no pipeline that worked before is lost: the driver catches its own first-chance exception and refuses that pipeline, and what is left is the device removal.
  2. victory translate --validate --pipelines --list <paths> on that machine creates every compute pipeline offline, without the world. It would name exactly which programs fault or are refused on that driver, and whether they validate.
  3. Your driver is 32.0.15.9649 on Windows 10 with the Agility SDK from Windows 10: load the D3D12 Agility SDK runtime for shader model 6.6 #175. The other runs of this PR created every compute pipeline with none refused on newer drivers (an RTX 5070 Ti and an RTX 5080 on 621.24, and the whole-title run below on an RTX 3080). If a current driver is an option on that machine, the same run there would tell a lot.

For @SlopComp:

  1. Which driver was your RTX 3080 on for the whole-title run (1,470 compute pipelines created, 0 refused)? And could you post the hashes of the 5 gained pipelines whose modules fail validation? Compared with the five hashes in the report above, that settles whether the faulting programs are the invalid ones.

Hashes, counts and messages only, please.

No game data used on my side. AI-assisted.

@SlopComp

Copy link
Copy Markdown
  1. Driver 616.92 (RTX 3080). Run was on 727e884.

The 5 gained pipelines whose modules fail validation:

3e55d5ea47dbcfb1
58eaf4a171102e0a
c4183d3cbee28e8e
cabb87599722e59a
e8f6ae0597846841

Against the report's five: c4183d3cbee28e8e (the refused one) is in this list. The other four (6a20509b65f9a5f1, b084beb3ae6e27e3, 2c2cefe06f048390, a0a074e2d868e618) aren't emitted at all on 727e884 alone: three stop at a select on an untracked mask, one at a descriptor read only as data.

@neonbyte1

Copy link
Copy Markdown

Tested 691ff20 (with #223) on an RTX 5090 (driver 620.73.04, 32-lane waves) under Linux: Wine 11.22, vkd3d-proton 3.1-83, diagnostics build.

Base: main at 13f91ca, plus #2723, #1129, the one-line #747 heap change, and a constant-table fix equivalent to #2143. The only conflict was in lower.rs; I resolved it the same way #2651 resolves #233 against main.

Pipelines on the 5090:

  • Without this PR, main emits 164 compute programs from a game run with WaveSize(64), and vkd3d-proton refuses all of them (Required WaveSize range [64, 64], but supported range is [32, 32], E_INVALIDARG).
  • With it, 33 of the 164 build a pipeline; the other 131 are now refused at translation, with a reason:
Refusal Programs
console wave64 lanes on a host without 64-lane waves (groups of more than 64 threads) 83
a wave64 group sharing LDS 44
an implicit-derivative sample in the console flow 4

Whole-pack census (26,084 programs):

  • With a 32–64 host range, the emitted lists are identical to main.
  • With 32–32, compute goes from 2,658 to 2,365 emitted. All 293 programs lost are ones main emitted with WaveSize(64), which a 32-lane host refuses anyway. Vertex, pixel and mesh are unchanged.

Barriers: I instrumented the translator over the whole shader pack and XboxBvhBuilder.dll. It made 168 console-flow lowerings with 9,066 swaps between halves, and none was emitted inside a per-lane guard. This matters on NVIDIA: a group barrier reached by only some lanes hangs the GPU (Xid 109), as I saw with #1433's multi-wave groups.

In game: two 7-minute runs, one cold cache and one warm, with no hang or fault. Dropped draws and dispatches without a host pipeline went from about 555–562 to 518 per frame. Frame time went from 630–670 ms to 570–600 ms.

Tests under Wine on the 5090: the 12 split tests pass with exact results. The remaining Wine failures (22 in victory-gpu, 4 in victory-shader) are the same list as on main.

AI-assisted (Claude); measured on my machine, no game data shared.

desplmfao added a commit to desplmfao/VIctory that referenced this pull request Nov 26, 2026
…and Marvisak#320)

Conflicts in crates/victory-shader/src/emit/lower.rs, both sides kept:
- main's scalar_def/sgpr_operand/scalar_constant helpers beside Marvisak#439's
  numeric();
- Marvisak#439's console_read_lane beside main's helper-lane doc of helpers_read;
- main's uniform_join beside Marvisak#439's never_taken (false in the console flow);
- the lane-mask phi: main's number-at-a-uniform-join and no-lane-on-edge
  arms, with Marvisak#439's console-flow `other` masks as a fallback for the tracked
  mask; lane_bit now returns a Result (Marvisak#439), refused in a split program
  outside the console flow.
Tests main added since Marvisak#439's base get Marvisak#439's new Parts fields and emit's
Target argument (memory_tests heap test, mod.rs pixel-input test).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
r4tedx and others added 3 commits November 26, 2026 06:51
The one conflict was in apps/victory/src/main.rs, where main's
`--jobs` became a `NonZeroUsize` and the branch added `--host-lanes`:
`translate::run` takes both, `jobs.map(NonZeroUsize::get)` as main
passes it and the branch's `host_lanes` after it.

The `emit` and `lower::Parts` call sites main added in tests (census,
crosslane, memory, synthetic, `emit::tests`, `resource` and lower.rs's
own) pass `Target::ANY`, as the earlier merge did for the ones before
them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pure move, so that the merge of main (63bcca4) keeps emit/lower.rs
under the asset policy's 512 KiB limit: the inline `mod tests` becomes
`mod tests;` beside `mod bvh;`, and its body, one indent level less and
otherwise unchanged, is emit/lower/tests.rs. Its `super::` paths still
name `lower`.

Moving the tests out of lower.rs is desplmfao's idea (Marvisak#2309).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… flow

Conflicts, resolved with kawaii-shakal's notes on Marvisak#439:

- emit/host.rs: main's process-wide WARP device (`SharedDevice`,
  `WARP_LOCK`, `lock_warp`, `from_device`) is kept, and its
  `create_device` takes an optional adapter for the branch's
  `VICTORY_ADAPTER` and `Host::on`.
- emit/lower.rs: `console_read_lane` stays beside main's new
  `helpers_read` doc; main's `uniform_join` sits above `never_taken`,
  which keeps the branch's console-flow note.
- Lane-mask joins: main's path for data joined with masks at a uniform
  join (the BVH walks pop masks from memory) stays beside the console
  flow's masks; `lane_bit` now returns a `Result`, so it takes `?`.
  `no_mask_lane_on_edge` is kept out of the console flow, whose lanes go
  along the wave's edges.
- emit/lower/tests.rs (lower.rs's tests, moved out before this merge):
  main's test changes are ported there. Its `lowers` helper calls
  `lower` directly, so it now lowers a program again in the console flow
  when the first try asks for it, as `emit_with` does
  (`a_scalar_result_needs_no_exec`).
- The `lower::Parts` sites main added in tests (crosslane, memory,
  synthetic, lower's) pass `console_cf: false`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@r4tedx

r4tedx commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Merged current main (63bcca4) in, with no rebase or force-push. Head now 1c74ab4, and it merges cleanly with main. The PRs above (#320,#439) are merged from this head in turn. Details, conflict notes and the per-level checks are on #439 (policy ok, clippy clean, the WARP shader suite has only main's own 4 failures). This head also moves lower.rs's inline tests into emit/lower/tests.rs, unchanged, so lower.rs stays under the 512 KiB file-size limit with main merged in.

Synthetic tests only; no title data used.

AI-assisted

r4tedx and others added 2 commits November 26, 2026 07:11
Main's view-mark test builds emit::Options by hand; this branch adds a
target field to Options, so the test now fills the rest from Default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@r4tedx

r4tedx commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Correction to my last comment: CI's clippy failed on the previous head. Main's view-mark draw test (crates/victory-gpu/src/draw.rs) builds emit::Options { view_marks: true } by hand, and this stack adds a target field to Options. My local clippy run left out the test targets, so I missed it. New head df48a5e8 has the fix merged up from #223: the test fills the remaining fields with ..Options::default(). Nothing else changed.

Verified on #223 0f6dec04 and #439 8a320556: cargo clippy --workspace --all-targets --locked -- -D warnings is clean, and cargo xtask policy passes. No title data was used.

AI-assisted

r4tedx and others added 2 commits November 26, 2026 07:17
Main's placed-UAV diagnostics test calls emit::emit with the six arguments
it had before this branch added the target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@r4tedx

r4tedx commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Second follow-up: CI's diagnostics clippy (--all-features) found one more call from main that this stack's Target argument breaks. In crates/victory-gpu/src/pipeline/placed_uav_tests.rs:77, emit::emit was called with six arguments. New head 87d1f423 has the fix merged up from #223: the call passes emit::Target::ANY, the same default the other callers use.

Verified on #223 fbfd3c67 and #439 13be4c2c: both CI clippy commands are clean, cargo clippy --workspace --all-targets --locked -- -D warnings and the same command with --all-features. I didn't run the CI cargo test --workspace step on this PC, so CI will be the first to run it on this head. No title data was used.

AI-assisted

@r4tedx

r4tedx commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

On the triage at df48a5e:

  • CI: check passed on the current head 87d1f423 (the placed-UAV test fix, see the comment above).
  • Description: the top note now names 87d1f423 and main 63bcca4, and the reference to the removed docs/wave64-on-wave32.md points to the summary in docs/architecture.md.
  • Merge order: yes, this is stacked on Shaders: translate for the host's wave sizes #223 and goes in after it (or together with it).
  • The test move (19f63196): it moves lower.rs's inline tests into emit/lower/tests.rs unchanged. I can open it as its own PR on main first if the maintainers prefer that; I'll wait for a yes before opening it.

AI-assisted

@gmankab

gmankab commented Nov 26, 2026

Copy link
Copy Markdown

I adapted the single-wave console control flow from this PR to the native Linux runtime's shared-memory emulation. The retry covers both console Wave32 and Wave64 with one logical wave per workgroup. It keeps EXEC on vector instructions and uses the whole logical wave to decide scalar branches.

On an eight-lane Lavapipe device, matching compute shader identities across two Series S loading runs showed 179 previously rejected shaders created host pipelines. All 419 previously working compute keys still created pipelines. The native shader suite passed 99 tests. The new readbacks cover inactive-lane sources, first-active-lane selection, and a loop that ends when its last lane finishes. Native test commit

Tested-on: Fedora Linux 45, Xeon E5-2670 v3, Mesa Lavapipe 26.2.7 with eight-lane subgroups, native VKD3D-Proton
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.