Shaders: lane reads and writes where lanes branch differently run in the console flow #320

Open
r4tedx wants to merge 46 commits from upstream-pr/320 into main
r4tedx commented 2026-11-24 02:16:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-24T02:16:41Z.


Current head 0fa6af4, integrated with main at ffe310e. The lane-read tests use structured resource tracking. The translator retains both the mask information used by console flow and the reach conditions used by the descriptor tracker. Local Windows verification: cargo test --workspace --locked (359 passed, 6 ignored) and all-target, all-feature Clippy with warnings denied. No title run for this update. AI-assisted (Codex).

Validation, resolved as not from this PR. A whole-title run on this head found that 20 of the 21 compute programs this PR newly translates fail dxil.dll validation, and I marked it a draft until the cause was known. It is: compute programs that sample with implicit derivatives (image_sample) are emitted as dx.op.sample, which validator 1.6 / 1.7 rules do not allow outside pixel shaders; main already emits 23 such modules. Diagnosis with a hand-assembled reproduction; #180 replaces these samples and #201 tracks the class. A census rerun by another tester measured it: with #180 (and #459) on main, the 23 compute failures of this class go to 0 and nothing that validated before fails. The console flow emits nothing different for them; this PR only lets 20 more such programs translate. Merging #180 first, or together, keeps those modules from reaching a driver unvalidated.

Fixes #225. Stacked on #233 (which is stacked on #223); the last three commits are new here (36e05dc, c223206, fd8b8fe; before the rebases onto main (now 8e79c80) on 2026-11-24 they were 6ec772f, 4c197a0, a5ba4a4, the ids testers' reports use; replayed unchanged, except that a new upstream test gets the field this PR adds to lower::Parts; CI's two clippy commands are clean at this head; the lane-read loop test now takes its devices from the SM 6.6 hardware-adapter list and skips when there is none, a fix first made at the top of the stack and folded in here).

What

On the console v_readlane and v_writelane ignore EXEC, and a wave runs a loop while any of its lanes does. The per-lane form runs branches and loops per lane, so a lane that left a loop or skipped a branch is not there to be read or written, and never sees the scalars set inside. Two measured cases on main:

  • A loop lane t runs t times, reading lane L in each iteration, then stores t + s9: 12 of 32 lanes wrong in waves of 32 (RTX 5070 and Radeon iGPU), 24 of 64 in waves of 64 (Radeon). This is the #225 repro.
  • v_writelane to lane 40 inside a branch only lanes below 20 take: lane 40 is never written (Radeon).

A compute program with v_readlane or v_writelane and at least one branch that is not uniform now runs in the console flow from #233 on every host: every lane of a wave runs every block, EXEC guards the vector instructions, and branches are the console's s_cbranch_*, taken wave-wide.

  • Where the host runs the console's wave size, one host wave is the console wave. Ballots are the wave's own and nothing is exchanged, so there are no group-shared slots or barriers, and any group size and LDS are fine.
  • Where it does not (wave64 on a 32..32 host), #233's exchange applies as before.
  • A program the console flow cannot lower keeps the per-lane form (Parts::per_lane_only), so nothing that translated before is refused.
  • Not chosen for programs with whole-wave sections (their reductions are lowered as wave operations already) or ds_(b)permute.

SGPR spills (v_writelane to stash an SGPR, v_readlane restoring it) stay on main's per-lane form, since each restore is proven to be its SGPR: with the console's wave size on a host that runs it (as main), and with no wave size on a 32..32 host, where each restore is lowered as its SGPR. Spill-only wave64 programs therefore now translate on 32-lane hosts instead of being dropped, and spill + DPP programs run split rather than in the console flow. Test: sgpr_spills_across_a_divergent_branch_stay_per_lane.

docs/wave64-on-wave32.md shows as deleted in this diff: #233 folded that plan into docs/architecture.md, and the merge carries that up.

Small generalisations of #233's helpers: console_lane masks with the console wave size (waves of 32 too), console_ballot returns the host wave's ballot when nothing is split, and v_readfirstlane reads no high EXEC word in waves of 32.

The second commit closes a gap in the console flow itself, found through the test report on #233: the loop form compilers emit keeps finished lanes in an exit mask that starts as a constant 0, and the console flow's mask joins took only masks derived from EXEC or a VALU result, so such a loop stopped with a lane-mask join of an untracked mask. Structured::others now gives the lane's bit of constant and scalar-built masks for those joins. The per-lane form is unchanged.

How this relates to other open PRs

#269 makes scalars leave divergent loops and branches as the wave left them, with maxima over the host wave. In the console flow scalars are the wave's own by construction: with a local switch sending #269's four test programs through it, all four are exact on both adapters here, where #269's two scalar tests give per-half values on hosts that form 32-lane waves (details). This PR does not select the console flow for those programs.

In compiled shaders, the usual source of v_writelane / v_readlane outside whole-wave sections is SGPR spill slots: a scalar parked in a lane of a VGPR and read back later, whatever EXEC holds. #54 and #189 resolve spills at constant lanes in SSA, so the lane accesses disappear and the control flow stays per lane. Where that applies it is cheaper than this PR, and the two compose: with spills resolved first, fewer programs would ask for the console flow. This PR covers what is left: lanes computed at run time, and reads of another lane's own data.

Not verified

No game files and no console hardware were used: the expected values follow the ISA's EXEC and lane-access semantics. I did not measure how many of the title's programs take this path, or its cost on them. A tester's whole-title translate found 21 more compute pipelines than #233, 20 of them in the validation class above. The console flow guards instructions where the per-lane form branches around them, so a divergent program does more work per lane.

The fallback to the per-lane form has no test of its own; I found no hand-assembled program that the console flow refuses and the per-lane form takes.

Vertex, pixel and mesh programs are unchanged.

Tested

Windows 11, an NVIDIA RTX 5070 (32..32) and an AMD Radeon iGPU (RDNA2, 32..64) in one machine, hand-assembled GFX10, every lane checked:

  • emit/lane_read_loop_tests.rs (the #225 repro, no longer ignored): exact on both adapters in waves of 32 and of 64 (on the RTX 5070 the wave64 program runs in two halves).
  • split_tests::lane_writes_reach_lanes_outside_the_branch: exact on both. With the new condition switched off it fails on the Radeon (lane 40 keeps 1).
  • split_tests::loops_run_while_any_lane_of_the_console_wave_does now checks 64-lane hosts too.
  • split_tests::loops_with_an_exit_mask_grown_from_zero (the compilers' loop form, a lane read in each iteration, the exit mask counted afterwards): refused on the RTX 5070 before the second commit, exact on both adapters now.
  • cargo test --workspace: 281 passed, 0 failed, 4 ignored at a5ba4a4 (two testers report the same count; 280 was the head before it). cargo clippy --workspace --all-targets: nothing new. cargo xtask policy: ok.

AI-assisted; no game assets were used.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5464812231 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-24T02:16:41Z. --- **Current head `0fa6af4`, integrated with `main` at `ffe310e`.** The lane-read tests use structured resource tracking. The translator retains both the mask information used by console flow and the reach conditions used by the descriptor tracker. Local Windows verification: `cargo test --workspace --locked` (359 passed, 6 ignored) and all-target, all-feature Clippy with warnings denied. No title run for this update. AI-assisted (Codex). > **Validation, resolved as not from this PR.** A [whole-title run on this head](https://github.com/Marvisak/VIctory/pull/233#issuecomment-7120941410) found that 20 of the 21 compute programs this PR newly translates fail `dxil.dll` validation, and I marked it a draft until the cause was known. It is: compute programs that sample with implicit derivatives (`image_sample`) are emitted as `dx.op.sample`, which validator 1.6 / 1.7 rules do not allow outside pixel shaders; `main` already emits 23 such modules. [Diagnosis with a hand-assembled reproduction](https://github.com/Marvisak/VIctory/pull/233#issuecomment-7121852191); #180 replaces these samples and #201 tracks the class. A [census rerun](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7122527604) by another tester measured it: with #180 (and #459) on `main`, the 23 compute failures of this class go to 0 and nothing that validated before fails. The console flow emits nothing different for them; this PR only lets 20 more such programs translate. Merging #180 first, or together, keeps those modules from reaching a driver unvalidated. Fixes #225. Stacked on #233 (which is stacked on #223); the last three commits are new here (`36e05dc`, `c223206`, `fd8b8fe`; before the rebases onto `main` (now `8e79c80`) on 2026-11-24 they were `6ec772f`, `4c197a0`, `a5ba4a4`, the ids testers' reports use; replayed unchanged, except that a new upstream test gets the field this PR adds to `lower::Parts`; CI's two clippy commands are clean at this head; the lane-read loop test now takes its devices from the SM 6.6 hardware-adapter list and skips when there is none, a fix first made at the top of the stack and folded in here). ## What On the console `v_readlane` and `v_writelane` ignore EXEC, and a wave runs a loop while any of its lanes does. The per-lane form runs branches and loops per lane, so a lane that left a loop or skipped a branch is not there to be read or written, and never sees the scalars set inside. Two measured cases on `main`: - A loop lane t runs t times, reading lane L in each iteration, then stores t + s9: 12 of 32 lanes wrong in waves of 32 (RTX 5070 and Radeon iGPU), 24 of 64 in waves of 64 (Radeon). This is the #225 repro. - `v_writelane` to lane 40 inside a branch only lanes below 20 take: lane 40 is never written (Radeon). A compute program with `v_readlane` or `v_writelane` and at least one branch that is not uniform now runs in the console flow from #233 on every host: every lane of a wave runs every block, EXEC guards the vector instructions, and branches are the console's `s_cbranch_*`, taken wave-wide. - Where the host runs the console's wave size, one host wave is the console wave. Ballots are the wave's own and nothing is exchanged, so there are no group-shared slots or barriers, and any group size and LDS are fine. - Where it does not (wave64 on a 32..32 host), #233's exchange applies as before. - A program the console flow cannot lower keeps the per-lane form (`Parts::per_lane_only`), so nothing that translated before is refused. - Not chosen for programs with whole-wave sections (their reductions are lowered as wave operations already) or `ds_(b)permute`. SGPR spills (`v_writelane` to stash an SGPR, `v_readlane` restoring it) stay on main's per-lane form, since each restore is proven to be its SGPR: with the console's wave size on a host that runs it (as `main`), and with no wave size on a 32..32 host, where each restore is lowered as its SGPR. Spill-only wave64 programs therefore now translate on 32-lane hosts instead of being dropped, and spill + DPP programs run split rather than in the console flow. Test: `sgpr_spills_across_a_divergent_branch_stay_per_lane`. `docs/wave64-on-wave32.md` shows as deleted in this diff: #233 folded that plan into `docs/architecture.md`, and the merge carries that up. Small generalisations of #233's helpers: `console_lane` masks with the console wave size (waves of 32 too), `console_ballot` returns the host wave's ballot when nothing is split, and `v_readfirstlane` reads no high EXEC word in waves of 32. The second commit closes a gap in the console flow itself, found through the [test report on #233](https://github.com/Marvisak/VIctory/pull/233#issuecomment-7119856284): the loop form compilers emit keeps finished lanes in an exit mask that starts as a constant 0, and the console flow's mask joins took only masks derived from EXEC or a VALU result, so such a loop stopped with `a lane-mask join of an untracked mask`. `Structured::others` now gives the lane's bit of constant and scalar-built masks for those joins. The per-lane form is unchanged. ### How this relates to other open PRs #269 makes scalars leave divergent loops and branches as the wave left them, with maxima over the host wave. In the console flow scalars are the wave's own by construction: with a local switch sending #269's four test programs through it, all four are exact on both adapters here, where #269's two scalar tests give per-half values on hosts that form 32-lane waves ([details](https://github.com/Marvisak/VIctory/pull/233#issuecomment-7120083839)). This PR does not select the console flow for those programs. In compiled shaders, the usual source of `v_writelane` / `v_readlane` outside whole-wave sections is SGPR spill slots: a scalar parked in a lane of a VGPR and read back later, whatever EXEC holds. #54 and #189 resolve spills at constant lanes in SSA, so the lane accesses disappear and the control flow stays per lane. Where that applies it is cheaper than this PR, and the two compose: with spills resolved first, fewer programs would ask for the console flow. This PR covers what is left: lanes computed at run time, and reads of another lane's own data. ## Not verified No game files and no console hardware were used: the expected values follow the ISA's EXEC and lane-access semantics. I did not measure how many of the title's programs take this path, or its cost on them. A tester's whole-title translate found [21 more compute pipelines than #233, 20 of them in the validation class above](https://github.com/Marvisak/VIctory/pull/233#issuecomment-7120941410). The console flow guards instructions where the per-lane form branches around them, so a divergent program does more work per lane. The fallback to the per-lane form has no test of its own; I found no hand-assembled program that the console flow refuses and the per-lane form takes. Vertex, pixel and mesh programs are unchanged. ## Tested Windows 11, an NVIDIA RTX 5070 (32..32) and an AMD Radeon iGPU (RDNA2, 32..64) in one machine, hand-assembled GFX10, every lane checked: - `emit/lane_read_loop_tests.rs` (the #225 repro, no longer ignored): exact on both adapters in waves of 32 and of 64 (on the RTX 5070 the wave64 program runs in two halves). - `split_tests::lane_writes_reach_lanes_outside_the_branch`: exact on both. With the new condition switched off it fails on the Radeon (lane 40 keeps 1). - `split_tests::loops_run_while_any_lane_of_the_console_wave_does` now checks 64-lane hosts too. - `split_tests::loops_with_an_exit_mask_grown_from_zero` (the compilers' loop form, a lane read in each iteration, the exit mask counted afterwards): refused on the RTX 5070 before the second commit, exact on both adapters now. - `cargo test --workspace`: 281 passed, 0 failed, 4 ignored at `a5ba4a4` (two testers report the same count; 280 was the head before it). `cargo clippy --workspace --all-targets`: nothing new. `cargo xtask policy`: ok. AI-assisted; no game assets were used. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SpaghettiMaster545 commented 2026-11-24 06:55:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SpaghettiMaster545 on 2026-11-24T02:34:03Z.


Update: the head is now fabe8bc, which adds only test validation in split_tests.rs; the translator is the same as in 5cc9a7e, so the title measurement below applies to it too.

Test report with the title itself on a 32-lane host, which the earlier reports did not cover. This PR's head 5cc9a7e (with #223 and #233 under it) against main d2a4bae.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124), 32-lane waves only; AMD Ryzen 7 9800X3D, 31 GB; Windows 11 10.0.26100; Rust 1.98.1 (pinned).
  • cargo test --workspace --no-fail-fast on 5cc9a7e (debug): 280 passed, 0 failed, 4 ignored.
  • The title (Xbox Series 1.0.2.1, build unknown (b99f876b…) as in #5), diag build (--profile diag --features diagnostics) of each commit, each with its own empty VICTORY_CACHE_DIR, the same VICTORY_KEYS (Enter every 3 s from 8 s to 47 s: through the first-boot screens into story mode, which opens at 24 s in both runs), until the host GPU failure:
main d2a4bae this PR 5cc9a7e
shaders that do not translate 382 (compute 311, pixel 43, mesh 24, vertex 4) 465 (compute 401, pixel 39, mesh 21, vertex 4)
host pipelines refused by the driver (E_INVALIDARG) 119, all compute 0
fps before story mode / in the world 30 / ~1.2 30 / ~1.15
host GPU failure device removed at 111 s device removed at 115 s
  • Per program: of the 119 compute programs the driver refused on main, 26 translate and run with this PR, 90 now stop in translation with a reason (console wave64 lanes on a host without 64-lane waves: 67, a wave64 group sharing LDS without barriers on a host without 64-lane waves: 38, counted over all programs), and 3 were not reached in this run. The 97 programs that translate only on main are 90 of those driver-refused ones, plus 7 not reached on main. So nothing that ran on main stops running here, and 26 compute programs run that did not.
  • The world hang on this card (#71) is unchanged: the device is removed at the same point, and world fps is the same.

Not tested

  • A 64-lane adapter (the Ryzen's RDNA2 iGPU has no mesh shaders, so it cannot run the world), VICTORY_ADAPTER, a release build of the PR.

AI use

  • Claude Code (Claude Opus 5.5) built both commits, ran the title and the tests, compared the two logs program by program and wrote this report.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7120271524 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7120271524). Originally posted by [SpaghettiMaster545](https://github.com/SpaghettiMaster545) on 2026-11-24T02:34:03Z. --- _Update: the head is now `fabe8bc`, which adds only test validation in `split_tests.rs`; the translator is the same as in `5cc9a7e`, so the title measurement below applies to it too._ Test report with the title itself on a 32-lane host, which the earlier reports did not cover. This PR's head `5cc9a7e` (with #223 and #233 under it) against `main` `d2a4bae`. **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124), 32-lane waves only; AMD Ryzen 7 9800X3D, 31 GB; Windows 11 10.0.26100; Rust 1.98.1 (pinned). - `cargo test --workspace --no-fail-fast` on `5cc9a7e` (debug): 280 passed, 0 failed, 4 ignored. - The title (Xbox Series 1.0.2.1, `build unknown (b99f876b…)` as in #5), diag build (`--profile diag --features diagnostics`) of each commit, each with its own empty `VICTORY_CACHE_DIR`, the same `VICTORY_KEYS` (Enter every 3 s from 8 s to 47 s: through the first-boot screens into story mode, which opens at 24 s in both runs), until the host GPU failure: | | `main` `d2a4bae` | this PR `5cc9a7e` | |---|---|---| | shaders that do not translate | 382 (compute 311, pixel 43, mesh 24, vertex 4) | 465 (compute 401, pixel 39, mesh 21, vertex 4) | | host pipelines refused by the driver (E_INVALIDARG) | 119, all compute | 0 | | fps before story mode / in the world | 30 / ~1.2 | 30 / ~1.15 | | host GPU failure | device removed at 111 s | device removed at 115 s | - Per program: of the 119 compute programs the driver refused on `main`, 26 translate and run with this PR, 90 now stop in translation with a reason (`console wave64 lanes on a host without 64-lane waves`: 67, `a wave64 group sharing LDS without barriers on a host without 64-lane waves`: 38, counted over all programs), and 3 were not reached in this run. The 97 programs that translate only on `main` are 90 of those driver-refused ones, plus 7 not reached on `main`. So nothing that ran on `main` stops running here, and 26 compute programs run that did not. - The world hang on this card (#71) is unchanged: the device is removed at the same point, and world fps is the same. **Not tested** - A 64-lane adapter (the Ryzen's RDNA2 iGPU has no mesh shaders, so it cannot run the world), `VICTORY_ADAPTER`, a release build of the PR. **AI use** - Claude Code (Claude Opus 5.5) built both commits, ran the title and the tests, compared the two logs program by program and wrote this report.
r4tedx commented 2026-11-24 06:55:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-24T02:56:39Z.


Thank you for running the title, and for the per-program comparison: "nothing that ran on main stops, 26 run that did not" is exactly what I could not check.

Two things changed since 5cc9a7e that touch your numbers:

  • The head is now a5ba4a4, rebased onto a fix in #233 (3098672): a program with DPP or ds_swizzle and a v_readfirstlane is no longer split in halves, because the upper half read lane 32 where the console reads the wave's first lane (found with a hand-assembled case, wrong on an RTX 5070 before). Such programs now take the console flow if their group is at most 64 threads without LDS, and stop with the reason otherwise. So some of the 26 may move; if you rerun, the new count would tell how common that is.
  • A whole-title translate run on #233 gives the same picture over all programs: 98 gained, 0 lost, the rest stopped by the same two reasons.

Next, from your counts and that one: the programs that stop with a wave64 group sharing LDS without barriers (38 in your run) are all groups of one console wave, which the console flow can take with a group barrier before each LDS access. I am working on that as a follow-up on top of this PR, together with more specific reasons for the other 67, so a rerun shows what stops them.

The unchanged device removal is what I would expect: nothing in this stack touches #71.

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7120625085 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7120625085). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-24T02:56:39Z. --- Thank you for running the title, and for the per-program comparison: "nothing that ran on `main` stops, 26 run that did not" is exactly what I could not check. Two things changed since `5cc9a7e` that touch your numbers: - The head is now `a5ba4a4`, rebased onto a fix in #233 (`3098672`): a program with DPP or `ds_swizzle` and a `v_readfirstlane` is no longer split in halves, because the upper half read lane 32 where the console reads the wave's first lane (found with a hand-assembled case, wrong on an RTX 5070 before). Such programs now take the console flow if their group is at most 64 threads without LDS, and stop with the reason otherwise. So some of the 26 may move; if you rerun, the new count would tell how common that is. - A [whole-title translate run on #233](https://github.com/Marvisak/VIctory/pull/233#issuecomment-7120440868) gives the same picture over all programs: 98 gained, 0 lost, the rest stopped by the same two reasons. Next, from your counts and that one: the programs that stop with `a wave64 group sharing LDS without barriers` (38 in your run) are all groups of one console wave, which the console flow can take with a group barrier before each LDS access. I am working on that as a follow-up on top of this PR, together with more specific reasons for the other 67, so a rerun shows what stops them. The unchanged device removal is what I would expect: nothing in this stack touches #71. No game data used on my side. AI-assisted.
SpaghettiMaster545 commented 2026-11-24 06:55:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SpaghettiMaster545 on 2026-11-24T03:03:12Z.


Rerun on a5ba4a4, the same way as before (diag build on main d2a4bae, its own empty cache, the same VICTORY_KEYS, RTX 5070 Ti, driver 621.24):

  • Against main (the same main run as in my first report): of the 119 compute programs the driver refused there, 26 translate and run, 90 stop in translation, and 3 were not reached. 0 programs that ran on main stop. This is the same split as on 5cc9a7e.
  • Against 5cc9a7e, program by program: 0 lost and 0 gained. So the v_readfirstlane change in 3098672 moved none of the 26 that this run reaches: they either have no DPP / ds_swizzle beside a v_readfirstlane, or they now take the console flow and still run.
  • Reasons that appear only with the stack, over every program the run reached: console wave64 lanes on a host without 64-lane waves 53, a wave64 group sharing LDS without barriers on a host without 64-lane waves 37. The 37 are the ones your LDS follow-up would take; I can rerun that when it is up.
  • 472 untranslated in this run against 465 on 5cc9a7e. The difference is in programs only one of the two runs reached (the runs end at the hang, at 92 s and 115 s), not in programs that changed outcome.
  • cargo test not rerun on a5ba4a4: the new commits since my run change the split's selection and its tests, and the title result above is what they affect.

(Claude Code, Claude Opus 5.5: ran the build and the title, compared the two logs program by program.)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7120726331 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7120726331). Originally posted by [SpaghettiMaster545](https://github.com/SpaghettiMaster545) on 2026-11-24T03:03:12Z. --- Rerun on `a5ba4a4`, the same way as before (diag build on `main` `d2a4bae`, its own empty cache, the same `VICTORY_KEYS`, RTX 5070 Ti, driver 621.24): - Against `main` (the same `main` run as in my first report): of the 119 compute programs the driver refused there, 26 translate and run, 90 stop in translation, and 3 were not reached. 0 programs that ran on `main` stop. This is the same split as on `5cc9a7e`. - Against `5cc9a7e`, program by program: 0 lost and 0 gained. So the `v_readfirstlane` change in `3098672` moved none of the 26 that this run reaches: they either have no DPP / `ds_swizzle` beside a `v_readfirstlane`, or they now take the console flow and still run. - Reasons that appear only with the stack, over every program the run reached: `console wave64 lanes on a host without 64-lane waves` 53, `a wave64 group sharing LDS without barriers on a host without 64-lane waves` 37. The 37 are the ones your LDS follow-up would take; I can rerun that when it is up. - 472 untranslated in this run against 465 on `5cc9a7e`. The difference is in programs only one of the two runs reached (the runs end at the hang, at 92 s and 115 s), not in programs that changed outcome. - `cargo test` not rerun on `a5ba4a4`: the new commits since my run change the split's selection and its tests, and the title result above is what they affect. (Claude Code, Claude Opus 5.5: ran the build and the title, compared the two logs program by program.)
MisaXz commented 2026-11-24 06:55:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MisaXz on 2026-11-24T02:25:02Z.


Test report for 5cc9a7e on a second machine with a 32-lane and a 64-lane adapter (following up on the #233 thread).

Tested

  • NVIDIA GeForce RTX 5080, driver 621.14 (32.0.16.2114), and the Ryzen 7 9800X3D's integrated AMD Radeon(TM) Graphics, driver 32.0.13018.6, in one machine; Windows 11 Pro 26300; Rust 1.98.1; debug
  • This PR at 5cc9a7e (base d2a4bae): cargo test --workspace --no-fail-fast: 280 passed, 0 failed, 4 ignored.
  • cargo test -p victory-shader --lib -- split_tests lane_read_loop --nocapture --test-threads=1: every case prints exact on both adapters, the RTX 5080 with split true and the Radeon with split false. That includes:
    • lane_reads_in_a_loop_lanes_leave_at_different_iterations (the #225 repro): wave32 and wave64 exact on both
    • loops_with_an_exit_mask_grown_from_zero (the new test for the untracked-mask join): exact on both
    • lane_writes_reach_lanes_outside_the_branch, loops_run_while_any_lane_of_the_console_wave_does, masks_read_whole_count_both_halves (64, 48 and 32 threads), lane_reads_cross_halves, dpp_row_masks_name_console_rows, in_half_lane_reads_match_the_console_on_every_adapter (32, 64, 128 threads), the 3-D groups

Not tested

  • #269's four programs on this head (I did not redo the merge), release build, the title itself (no game files used).

Re-run on the new head a5ba4a4 (same machine, both adapters): cargo test --workspace --no-fail-fast: 281 passed, 0 failed, 4 ignored. cargo test -p victory-shader --lib -- split_tests lane_read_loop --nocapture --test-threads=1: 12 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.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7120119656 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7120119656). Originally posted by [MisaXz](https://github.com/MisaXz) on 2026-11-24T02:25:02Z. --- Test report for `5cc9a7e` on a second machine with a 32-lane and a 64-lane adapter (following up on [the #233 thread](https://github.com/Marvisak/VIctory/pull/233#issuecomment-7119856284)). **Tested** - NVIDIA GeForce RTX 5080, driver 621.14 (32.0.16.2114), and the Ryzen 7 9800X3D's integrated AMD Radeon(TM) Graphics, driver 32.0.13018.6, in one machine; Windows 11 Pro 26300; Rust 1.98.1; debug - This PR at `5cc9a7e` (base `d2a4bae`): `cargo test --workspace --no-fail-fast`: 280 passed, 0 failed, 4 ignored. - `cargo test -p victory-shader --lib -- split_tests lane_read_loop --nocapture --test-threads=1`: every case prints `exact` on both adapters, the RTX 5080 with `split true` and the Radeon with `split false`. That includes: - `lane_reads_in_a_loop_lanes_leave_at_different_iterations` (the #225 repro): wave32 and wave64 exact on both - `loops_with_an_exit_mask_grown_from_zero` (the new test for the untracked-mask join): exact on both - `lane_writes_reach_lanes_outside_the_branch`, `loops_run_while_any_lane_of_the_console_wave_does`, `masks_read_whole_count_both_halves` (64, 48 and 32 threads), `lane_reads_cross_halves`, `dpp_row_masks_name_console_rows`, `in_half_lane_reads_match_the_console_on_every_adapter` (32, 64, 128 threads), the 3-D groups **Not tested** - #269's four programs on this head (I did not redo the merge), release build, the title itself (no game files used). **Re-run on the new head `a5ba4a4`** (same machine, both adapters): `cargo test --workspace --no-fail-fast`: 281 passed, 0 failed, 4 ignored. `cargo test -p victory-shader --lib -- split_tests lane_read_loop --nocapture --test-threads=1`: 12 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 commented 2026-11-24 06:55:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-24T03:25:21Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121073465 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7121073465). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-24T03:25:21Z. --- 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.
miniongk commented 2026-11-24 06:55:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by miniongk on 2026-11-24T03:33:39Z.


Tested a5ba4a4 on an RTX 5080, driver 621.24, Windows 11 26300, with a local Xbox Series 1.0.2.1 copy.

cargo test --workspace: 281 passed, 0 failed, 4 ignored. The single lane-read/divergent-loop synthetic case also passed on its own in 0.53 s.

On the real title path, this removed the host-pipeline refusals seen on main and the divergent cross-lane translation failures seen with #189. The run still ended in DXGI_ERROR_DEVICE_HUNG; DRED implicated mesh dispatch and indirect-execution commands. So this is a useful shader improvement, but does not by itself resolve #97 here.

Only aggregate counts and error classes shared, no game data or raw game logs. AI-assisted (Kimi Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121211421 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7121211421). Originally posted by [miniongk](https://github.com/miniongk) on 2026-11-24T03:33:39Z. --- Tested `a5ba4a4` on an RTX 5080, driver 621.24, Windows 11 26300, with a local Xbox Series 1.0.2.1 copy. `cargo test --workspace`: 281 passed, 0 failed, 4 ignored. The single lane-read/divergent-loop synthetic case also passed on its own in 0.53 s. On the real title path, this removed the host-pipeline refusals seen on `main` and the divergent cross-lane translation failures seen with #189. The run still ended in `DXGI_ERROR_DEVICE_HUNG`; DRED implicated mesh dispatch and indirect-execution commands. So this is a useful shader improvement, but does not by itself resolve #97 here. Only aggregate counts and error classes shared, no game data or raw game logs. AI-assisted (Kimi Code).
r4tedx commented 2026-11-24 06:55:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-24T03:40:33Z.


@miniongk thank you for the run on the title. Two counts would make it usable as evidence, if you still have the logs:

  • how many host pipelines main refused in that run and how many this head refuses (host pipeline refused lines), and
  • how many programs stopped with #189's a cross-lane read in divergent control flow and how many of those translate here.

Also, if you can run victory translate --validate over the same files: a whole-title run found 20 modules this head emits that the validator refuses, which is why this PR is a draft, and a title run does not show them. #439's head 9745f35 prints what each refused module declares and calls.

Counts and messages only, please. AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121316379 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7121316379). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-24T03:40:33Z. --- @miniongk thank you for the run on the title. Two counts would make it usable as evidence, if you still have the logs: - how many host pipelines `main` refused in that run and how many this head refuses (`host pipeline refused` lines), and - how many programs stopped with #189's `a cross-lane read in divergent control flow` and how many of those translate here. Also, if you can run `victory translate --validate` over the same files: a [whole-title run](https://github.com/Marvisak/VIctory/pull/233#issuecomment-7120941410) found 20 modules this head emits that the validator refuses, which is why this PR is a draft, and a title run does not show them. #439's head `9745f35` prints what each refused module declares and calls. Counts and messages only, please. AI-assisted.
EduAzevedo commented 2026-11-24 06:55:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by EduAzevedo on 2026-11-24T03:58:26Z.


Corpus-wide numbers for what was seen on one shader above: 077ec8b, retail shaders (v1.0.2.1), offline victory translate --list against main d2a4bae, all 26,148 programs.

  • a descriptor neither loaded nor built: 298 → 3.
  • 294 of those (259 mesh, 35 vertex) now stop at a descriptor read from the first lane of a phi, so only one more program translates on this branch alone.
  • No program that translated on main stops translating.

So nearly all of what this PR unlocks goes through that phi case, which matches the #320 combination results above.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121590211 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7121590211). Originally posted by [EduAzevedo](https://github.com/EduAzevedo) on 2026-11-24T03:58:26Z. --- Corpus-wide numbers for what was seen on one shader above: `077ec8b`, retail shaders (v1.0.2.1), offline `victory translate --list` against `main` `d2a4bae`, all 26,148 programs. - `a descriptor neither loaded nor built`: 298 → 3. - **294 of those (259 mesh, 35 vertex) now stop at `a descriptor read from the first lane of a phi`**, so only one more program translates on this branch alone. - No program that translated on `main` stops translating. So nearly all of what this PR unlocks goes through that phi case, which matches the #320 combination results above. AI-assisted.
r4tedx commented 2026-11-24 06:55:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-24T04:00:48Z.


@EduAzevedo thank you. I think this was meant for #307: 077ec8b is that PR's head, and the two things it refers to ("seen on one shader above", "the #320 combination results above") are comments on its thread, not this one. It is worth reposting there so @AntoninMichelq sees it, since "294 of the 298 now stop at a descriptor read from the first lane of a phi" tells them what to do next. Nothing in this PR touches descriptor tracing.

For whoever merges #307 and this PR together, since that combination was tested: I checked the merge of 077ec8b with this head. There is one textual conflict, in emit/lower.rs: both add a v_readfirstlane_b32 arm at the same place, #307 for a waterfall loop's recorded reads and this PR for the console flow. Keep both, #307's first, as that tester did: its guard is the more specific one, and a waterfall read should stay the lane's own dword in the console flow too. #307's test helper also needs the fields #233 adds to lower::Parts (target, console_cf, and per_lane_only with this PR). I will do that on my side if #307 lands first.

From reading the merge only; I did not build or run the combination. No game data used. AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121625305 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7121625305). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-24T04:00:48Z. --- @EduAzevedo thank you. I think this was meant for #307: `077ec8b` is that PR's head, and the two things it refers to ("seen on one shader above", "the #320 combination results above") are comments on its thread, not this one. It is worth reposting there so @AntoninMichelq sees it, since "294 of the 298 now stop at `a descriptor read from the first lane of a phi`" tells them what to do next. Nothing in this PR touches descriptor tracing. For whoever merges #307 and this PR together, since [that combination was tested](https://github.com/Marvisak/VIctory/pull/307#issuecomment-7121510250): I checked the merge of `077ec8b` with this head. There is one textual conflict, in `emit/lower.rs`: both add a `v_readfirstlane_b32` arm at the same place, #307 for a waterfall loop's recorded reads and this PR for the console flow. Keep both, #307's first, as that tester did: its guard is the more specific one, and a waterfall read should stay the lane's own dword in the console flow too. #307's test helper also needs the fields #233 adds to `lower::Parts` (`target`, `console_cf`, and `per_lane_only` with this PR). I will do that on my side if #307 lands first. From reading the merge only; I did not build or run the combination. No game data used. AI-assisted.
EduAzevedo commented 2026-11-24 06:55:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by EduAzevedo on 2026-11-24T04:03:10Z.


@EduAzevedo thank you. I think this was meant for #307: 077ec8b is that PR's head, and the two things it refers to ("seen on one shader above", "the #320 combination results above") are comments on its thread, not this one. It is worth reposting there so @AntoninMichelq sees it, since "294 of the 298 now stop at a descriptor read from the first lane of a phi" tells them what to do next. Nothing in this PR touches descriptor tracing.

For whoever merges #307 and this PR together, since that combination was tested: I checked the merge of 077ec8b with this head. There is one textual conflict, in emit/lower.rs: both add a v_readfirstlane_b32 arm at the same place, #307 for a waterfall loop's recorded reads and this PR for the console flow. Keep both, #307's first, as that tester did: its guard is the more specific one, and a waterfall read should stay the lane's own dword in the console flow too. #307's test helper also needs the fields #233 adds to lower::Parts (target, console_cf, and per_lane_only with this PR). I will do that on my side if #307 lands first.

From reading the merge only; I did not build or run the combination. No game data used. AI-assisted.

Im sorry, getting a little crazy here 😂

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121662235 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7121662235). Originally posted by [EduAzevedo](https://github.com/EduAzevedo) on 2026-11-24T04:03:10Z. --- > @EduAzevedo thank you. I think this was meant for #307: `077ec8b` is that PR's head, and the two things it refers to ("seen on one shader above", "the #320 combination results above") are comments on its thread, not this one. It is worth reposting there so @AntoninMichelq sees it, since "294 of the 298 now stop at `a descriptor read from the first lane of a phi`" tells them what to do next. Nothing in this PR touches descriptor tracing. > > For whoever merges #307 and this PR together, since [that combination was tested](https://github.com/Marvisak/VIctory/pull/307#issuecomment-7121510250): I checked the merge of `077ec8b` with this head. There is one textual conflict, in `emit/lower.rs`: both add a `v_readfirstlane_b32` arm at the same place, #307 for a waterfall loop's recorded reads and this PR for the console flow. Keep both, #307's first, as that tester did: its guard is the more specific one, and a waterfall read should stay the lane's own dword in the console flow too. #307's test helper also needs the fields #233 adds to `lower::Parts` (`target`, `console_cf`, and `per_lane_only` with this PR). I will do that on my side if #307 lands first. > > From reading the merge only; I did not build or run the combination. No game data used. AI-assisted. Im sorry, getting a little crazy here 😂
r4tedx commented 2026-11-24 06:56:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-24T05:55:01Z.


Housekeeping, so the thread and the description agree:

  • This PR is not a draft any more. My earlier comment still says it is; the reason for the draft (20 newly translated compute modules failing validation) turned out to be the compute image_sample class that main has too and #180 fixes, as the note at the top of the description says.
  • Corrected in the description: main emits 23 modules of that class, not 22 (22 is #233's count, per the tester's table); three commits are new here, not two; the test count at a5ba4a4 is 281, as @MisaXz and @miniongk reported, not 280.
  • A census rerun on #201 measured #180 taking that class from 23 to 0 on main with nothing regressing.

Head unchanged (a5ba4a4). AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7123396273 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7123396273). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-24T05:55:01Z. --- Housekeeping, so the thread and the description agree: - This PR is **not a draft** any more. [My earlier comment](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7121316379) still says it is; the reason for the draft (20 newly translated compute modules failing validation) turned out to be the compute `image_sample` class that `main` has too and #180 fixes, as the note at the top of the description says. - Corrected in the description: `main` emits 23 modules of that class, not 22 (22 is #233's count, [per the tester's table](https://github.com/Marvisak/VIctory/pull/233#issuecomment-7120941410)); three commits are new here, not two; the test count at `a5ba4a4` is 281, as @MisaXz and @miniongk reported, not 280. - A [census rerun on #201](https://github.com/Marvisak/VIctory/issues/201#issuecomment-7122527604) measured #180 taking that class from 23 to 0 on `main` with nothing regressing. Head unchanged (`a5ba4a4`). AI-assisted (Claude Code).
AKA0GHOST commented 2026-11-24 08:02:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AKA0GHOST on 2026-11-24T07:52:24Z.


Tested this PR on an RTX 5070 (Blackwell, 32..32, driver 621.14), and extended the console flow to LDS. Diff below in case it is useful.

Why: on Grand Theft Auto VI the screen-size lighting compute passes (160x90 / 320x180 dispatches) are dropped on NVIDIA, which leaves every full-screen HDR/lighting target at 0. Six of them still fail with this PR. All six are 8x8x1 = 64 threads, one console wave. What keeps them out of the console flow: 3 use only LDS (128 dwords, no s_barrier), 1 uses LDS + whole-wave sections, 2 use sections (+ v_permlanex16).

Change: allow LDS in the console flow for one-wave groups, with a group barrier after each LDS access. In the console flow both halves run the same instruction stream and every thread reaches every block, so a barrier after op n gives the console's in-wave lockstep order for LDS. It can't hang, for the same reason the exchanges can't.

@@ Lower::new
             wants_console_flow = console_lanes
                 && !split
                 && x.native.wave64
                 && !x.target.runs(64)
                 && x.target.runs(32)
-                && s.lds_dwords == 0
                 && cs.threads.iter().product::<u32>() <= 64
@@ instruction loop
+            Fields::Ds { .. } if self.console_cf && !name.starts_with("ds_swizzle") => {
+                // Console flow (one console wave per group, every thread in
+                // every block): a group barrier after each LDS access keeps
+                // the console's lockstep order between the two halves.
+                let r = self.ds(inst, b, i);
+                let mode = self.s.m.i32(1 | 8);
+                let void = self.s.t.void;
+                self.s
+                    .op(self.cur, "barrier", Attr::NoDuplicate, void, 80, &[mode]);
+                r
+            }
             Fields::Ds { .. } => self.ds(inst, b, i),

Test (split_tests.rs, hand-assembled): lane t writes 3t to LDS dword t, then reads dword 63 − t with no barrier, then adds v_readlane(v0, 40) to force the console flow. It expects 3(63 − t) + 40. Exact on the RTX 5070, and all 11 split tests pass.

In game: the 3 LDS-only passes (0e366d15868e17bd, 5e7cd6d3557a6c35, a14c1da4be7b9837) now emit, validate and run. A 480x270 RGBA16F target now holds a lit sky/horizon, and several 256x256 RGBA16F targets fill. The full-screen lighting targets are still 0. The remaining blockers are whole-wave sections in the console flow (the halves would exchange partial results through exchange()) and v_permlanex16 (#98).

Not done: the full test suite with this change; only the split tests ran.

AI-assisted (Claude Code); no game files attached.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7125466290 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7125466290). Originally posted by [AKA0GHOST](https://github.com/AKA0GHOST) on 2026-11-24T07:52:24Z. --- Tested this PR on an RTX 5070 (Blackwell, 32..32, driver 621.14), and extended the console flow to LDS. Diff below in case it is useful. **Why:** on Grand Theft Auto VI the screen-size lighting compute passes (160x90 / 320x180 dispatches) are dropped on NVIDIA, which leaves every full-screen HDR/lighting target at 0. Six of them still fail with this PR. All six are 8x8x1 = 64 threads, one console wave. What keeps them out of the console flow: 3 use only LDS (128 dwords, no `s_barrier`), 1 uses LDS + whole-wave sections, 2 use sections (+ `v_permlanex16`). **Change:** allow LDS in the console flow for one-wave groups, with a group barrier after each LDS access. In the console flow both halves run the same instruction stream and every thread reaches every block, so a barrier after op *n* gives the console's in-wave lockstep order for LDS. It can't hang, for the same reason the exchanges can't. ```diff @@ Lower::new wants_console_flow = console_lanes && !split && x.native.wave64 && !x.target.runs(64) && x.target.runs(32) - && s.lds_dwords == 0 && cs.threads.iter().product::<u32>() <= 64 @@ instruction loop + Fields::Ds { .. } if self.console_cf && !name.starts_with("ds_swizzle") => { + // Console flow (one console wave per group, every thread in + // every block): a group barrier after each LDS access keeps + // the console's lockstep order between the two halves. + let r = self.ds(inst, b, i); + let mode = self.s.m.i32(1 | 8); + let void = self.s.t.void; + self.s + .op(self.cur, "barrier", Attr::NoDuplicate, void, 80, &[mode]); + r + } Fields::Ds { .. } => self.ds(inst, b, i), ``` **Test** (`split_tests.rs`, hand-assembled): lane *t* writes `3t` to LDS dword *t*, then reads dword `63 − t` with no barrier, then adds `v_readlane(v0, 40)` to force the console flow. It expects `3(63 − t) + 40`. Exact on the RTX 5070, and all 11 split tests pass. **In game:** the 3 LDS-only passes (`0e366d15868e17bd`, `5e7cd6d3557a6c35`, `a14c1da4be7b9837`) now emit, validate and run. A 480x270 RGBA16F target now holds a lit sky/horizon, and several 256x256 RGBA16F targets fill. The full-screen lighting targets are still 0. The remaining blockers are whole-wave sections in the console flow (the halves would exchange partial results through `exchange()`) and `v_permlanex16` (#98). Not done: the full test suite with this change; only the split tests ran. AI-assisted (Claude Code); no game files attached.
AKA0GHOST commented 2026-11-24 08:02:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AKA0GHOST on 2026-11-24T07:58:23Z.


Follow-up to my comment above: I missed that #439, stacked on this PR, already does the LDS part (a barrier before each access, same effect as the one after in my diff). It also covers whole-wave sections across the halves, which my diff doesn't. Please disregard the diff here.

Checked #439 + #20 on the same RTX 5070 with the same seven lighting shaders from Grand Theft Auto VI: six now emit, validate and get pipelines (0e366d15868e17bd, 2f03a2df10503cef, 5e7cd6d3557a6c35, a14c1da4be7b9837, bfad8c6743ac5977, 3d002bca51069e01). Only a929109552ce1e84 still stops (v_permlanex16, #98). I'll put in-game results on #439.

AI-assisted (Claude Code); no game files attached.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7125577633 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7125577633). Originally posted by [AKA0GHOST](https://github.com/AKA0GHOST) on 2026-11-24T07:58:23Z. --- Follow-up to my comment above: I missed that #439, stacked on this PR, already does the LDS part (a barrier before each access, same effect as the one after in my diff). It also covers whole-wave sections across the halves, which my diff doesn't. Please disregard the diff here. Checked #439 + #20 on the same RTX 5070 with the same seven lighting shaders from Grand Theft Auto VI: six now emit, validate and get pipelines (`0e366d15868e17bd`, `2f03a2df10503cef`, `5e7cd6d3557a6c35`, `a14c1da4be7b9837`, `bfad8c6743ac5977`, `3d002bca51069e01`). Only `a929109552ce1e84` still stops (`v_permlanex16`, #98). I'll put in-game results on #439. AI-assisted (Claude Code); no game files attached.
r4tedx commented 2026-11-24 09:06:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-24T08:35:48Z.


@AKA0GHOST thank you, and no harm done with the diff: arriving at the same barrier independently is a useful check on the idea. Your finding is the more valuable part: that the screen-size lighting passes are among the programs dropped on NVIDIA, and that six of the seven emit, validate and get pipelines with #439 (+ #20) on an RTX 5070. That is the first report tying this stack to specific passes whose output is missing. In-game results on #439 would be very welcome, with one caution from other runs: the world needs the PR set from #71 (and VICTORY_SHADER_LOOP_LIMIT=32 on some cards) to stay up long enough to look.

The seventh (a929109552ce1e84, v_permlanex16) is outside whole-wave sections, I take it; inside a section the stack follows it, outside it nothing here lowers it, and #98 is the PR for that.

Rebased onto main 2e4e280, force-pushed with lease: head is 4a38a75, was a5ba4a4. Upstream merged 32 PRs and two of their new tests needed the argument #223 adds (fixed there). The three commits of this PR are replayed unchanged and each builds on its own; the description gives their old ids.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7126326867 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7126326867). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-24T08:35:48Z. --- @AKA0GHOST thank you, and no harm done with the diff: arriving at the same barrier independently is a useful check on the idea. Your finding is the more valuable part: that the screen-size lighting passes are among the programs dropped on NVIDIA, and that six of the seven emit, validate and get pipelines with #439 (+ #20) on an RTX 5070. That is the first report tying this stack to specific passes whose output is missing. In-game results on #439 would be very welcome, with one caution from other runs: the world needs the PR set from #71 (and `VICTORY_SHADER_LOOP_LIMIT=32` on some cards) to stay up long enough to look. The seventh (`a929109552ce1e84`, `v_permlanex16`) is outside whole-wave sections, I take it; inside a section the stack follows it, outside it nothing here lowers it, and #98 is the PR for that. **Rebased onto `main` `2e4e280`**, force-pushed with lease: head is `4a38a75`, was `a5ba4a4`. Upstream merged 32 PRs and two of their new tests needed the argument #223 adds (fixed there). The three commits of this PR are replayed unchanged and each builds on its own; the description gives their old ids. AI-assisted (Claude Code).
slint6614-dev commented 2026-11-24 09:06:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by slint6614-dev on 2026-11-24T08:44:06Z.


Measured on the full retail shader pack (26,503 containers) with victory translate --validate --pipelines (pipelines created on an AMD RX 9070, Adrenalin, Windows 11; dxil.dll from SDK 10.0.26100), against main 1f858b0. Counts are emitted / validated / pipelines.

  • #439: CS 1735 / 1681 / 1735 (main 1693 / 1670): +42 emitted, +11 validated; the other 31 fail the validator ("Entry function performs some operation that is incompatible with the shader stage"). It also adds 40 "an SCC the emitter did not compute" and 7 "a program the console structure cannot hold" refusals. VS/PS and MS unchanged.
  • #320: CS 1715 / 1672 / 1715: +22 emitted, +2 validated; "Entry function performs some operation that is incompatible…" goes 23 → 43. VS/PS and MS unchanged.

These were run on the RX 9070 (64-lane host), so the console-flow paths for 32-lane hosts are not what is measured here.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7126496329 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7126496329). Originally posted by [slint6614-dev](https://github.com/slint6614-dev) on 2026-11-24T08:44:06Z. --- Measured on the full retail shader pack (26,503 containers) with `victory translate --validate --pipelines` (pipelines created on an AMD RX 9070, Adrenalin, Windows 11; dxil.dll from SDK 10.0.26100), against main 1f858b0. Counts are emitted / validated / pipelines. - #439: CS 1735 / 1681 / 1735 (main 1693 / 1670): +42 emitted, +11 validated; the other 31 fail the validator ("Entry function performs some operation that is incompatible with the shader stage"). It also adds 40 "an SCC the emitter did not compute" and 7 "a program the console structure cannot hold" refusals. VS/PS and MS unchanged. - #320: CS 1715 / 1672 / 1715: +22 emitted, +2 validated; "Entry function performs some operation that is incompatible…" goes 23 → 43. VS/PS and MS unchanged. These were run on the RX 9070 (64-lane host), so the console-flow paths for 32-lane hosts are not what is measured here.
r4tedx commented 2026-11-24 11:04:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-24T11:02:31Z.


@slint6614-dev, the RX 9070 results give us a wave64 comparison for the RTX measurements. On #320, 22 more compute programs emit and two more validate. The increase of 20 stage-validation failures matches the class tracked in #201. The RTX opcode census on #233 found sample in every failing module. Confirming that diagnosis for the AMD set would require matching the modules or inspecting their emitted ops. #180 covers the implicit-derivative compute lowering.

AI-assisted (Codex).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129577222 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7129577222). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-24T11:02:31Z. --- @slint6614-dev, the RX 9070 results give us a wave64 comparison for the RTX measurements. On #320, 22 more compute programs emit and two more validate. The increase of 20 stage-validation failures matches the class tracked in #201. The RTX opcode census on #233 found `sample` in every failing module. Confirming that diagnosis for the AMD set would require matching the modules or inspecting their emitted ops. #180 covers the implicit-derivative compute lowering. AI-assisted (Codex).
AKA0GHOST commented 2026-11-24 16:05:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AKA0GHOST on 2026-11-24T15:55:42Z.


@r4tedx thanks. On the seventh (a929109552ce1e84, 8x8x1, no LDS): its three v_permlanex16_b32 are all inside whole-wave sections. Each follows an s_or_saveexec_b64 s[4:5], -1, and EXEC is restored from s[4:5] after it (DPP row ops alongside). Still, #439 at the head I built (055aef9, + #20 + main 56d5032) stops it with emit: v_permlanex16_b32. So it seems the section simulation doesn't cover this shape; I didn't dig into why.

The in-game results on #439 are still pending. My runs so far hung before reaching a world frame in the capture window, so I'll post once I have one, with the #71 PR set as you suggest.

AI-assisted (Claude Code); no game files attached.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7136845949 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7136845949). Originally posted by [AKA0GHOST](https://github.com/AKA0GHOST) on 2026-11-24T15:55:42Z. --- @r4tedx thanks. On the seventh (`a929109552ce1e84`, 8x8x1, no LDS): its three `v_permlanex16_b32` are all **inside** whole-wave sections. Each follows an `s_or_saveexec_b64 s[4:5], -1`, and EXEC is restored from `s[4:5]` after it (DPP row ops alongside). Still, #439 at the head I built (`055aef9`, + #20 + main `56d5032`) stops it with `emit: v_permlanex16_b32`. So it seems the section simulation doesn't cover this shape; I didn't dig into why. The in-game results on #439 are still pending. My runs so far hung before reaching a world frame in the capture window, so I'll post once I have one, with the #71 PR set as you suggest. AI-assisted (Claude Code); no game files attached.
r4tedx commented 2026-11-24 16:05:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-24T15:57:44Z.


@AKA0GHOST, thank you, that is the detail I was missing. Checked here offline (local title data, CPU only): a929109552ce1e84 stops at the same instruction (offset 0xd00) with emit: v_permlanex16_b32 on main ffe310e, and on #439 bf0f951 for a 32-lane host and for a 32-64 host alike. So it is not something this stack takes away or the wave split causes: the instruction has no lowering of its own anywhere yet, and the whole-wave section recogniser (emit::wave) follows v_permlanex16 only in the shapes it knows. Your description (each one after s_or_saveexec_b64 s[4:5], -1, EXEC restored from s[4:5], DPP row operations alongside) says this is a section shape the simulation does not follow, which fits the reason it falls through to.

Two ways to take it, both after this PR and #439 (they stay as they are for review): teach the section simulation this shape, or lower v_permlanex16_b32 on its own as an in-half read (each lane takes a lane of the other row of 16 in its 32-lane half), which also covers the instruction outside sections. @MichaelSmithAI's port of #404 on #439 does the second for the all-active form, with a test in both the split and the console flow; I will look at that first.

For the in-game runs: a hang before a world frame on a 32-lane card is most often the wave64 mesh programs (#71, #778), not compute, so the #71 set is the right one to add.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7136899211 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7136899211). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-24T15:57:44Z. --- @AKA0GHOST, thank you, that is the detail I was missing. Checked here offline (local title data, CPU only): `a929109552ce1e84` stops at the same instruction (offset `0xd00`) with `emit: v_permlanex16_b32` on `main` `ffe310e`, and on #439 `bf0f951` for a 32-lane host and for a 32-64 host alike. So it is not something this stack takes away or the wave split causes: the instruction has no lowering of its own anywhere yet, and the whole-wave section recogniser (`emit::wave`) follows `v_permlanex16` only in the shapes it knows. Your description (each one after `s_or_saveexec_b64 s[4:5], -1`, EXEC restored from `s[4:5]`, DPP row operations alongside) says this is a section shape the simulation does not follow, which fits the reason it falls through to. Two ways to take it, both after this PR and #439 (they stay as they are for review): teach the section simulation this shape, or lower `v_permlanex16_b32` on its own as an in-half read (each lane takes a lane of the other row of 16 in its 32-lane half), which also covers the instruction outside sections. @MichaelSmithAI's port of #404 on #439 does the second for the all-active form, with a test in both the split and the console flow; I will look at that first. For the in-game runs: a hang before a world frame on a 32-lane card is most often the wave64 mesh programs (#71, #778), not compute, so the #71 set is the right one to add. AI-assisted (Claude Code).
LooperSalty commented 2026-11-24 17:04:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LooperSalty on 2026-11-24T16:37:39Z.


From a tester working with Claude (AI-assisted); measured on my own machine (i7-13700KF, RTX 4070 Super). No game data involved.

Data point for the divergent-flow cross-lane work: we also handle the wave prefix (v_mbcnt allocation, ballot-count plus prefix) in a divergent flow on a 32-lane host, each 32-lane half of the console's 64-lane wave computed independently (half-wave sum, election, atomic, readfirstlane, prefix), under an opt-in approx mode. A test builds the allocation per half and checks the halves get disjoint ranges (it fails if the halves are merged).

Measured: the four InstanceCulling_CS_{Prop,Tree}_* programs get past the prefix; with a stride table for bindless heaps (#704) they emit, validate with dxil.dll and create their PSO on the RTX 4070 Super. Without that table they stop at "unknown stride".

It sits on top of the Wave64-on-Wave32 stack (#189/#439/#320 and our own cross-lane option), which is not on main, so I am not publishing a branch; I can post the diff of the prefix part here if it helps.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137960363 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7137960363). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-24T16:37:39Z. --- From a tester working with Claude (AI-assisted); measured on my own machine (i7-13700KF, RTX 4070 Super). No game data involved. Data point for the divergent-flow cross-lane work: we also handle the wave prefix (`v_mbcnt` allocation, ballot-count plus prefix) in a divergent flow on a 32-lane host, each 32-lane half of the console's 64-lane wave computed independently (half-wave sum, election, atomic, readfirstlane, prefix), under an opt-in `approx` mode. A test builds the allocation per half and checks the halves get disjoint ranges (it fails if the halves are merged). Measured: the four InstanceCulling_CS_{Prop,Tree}_* programs get past the prefix; with a stride table for bindless heaps (#704) they emit, validate with dxil.dll and create their PSO on the RTX 4070 Super. Without that table they stop at "unknown stride". It sits on top of the Wave64-on-Wave32 stack (#189/#439/#320 and our own cross-lane option), which is not on main, so I am not publishing a branch; I can post the diff of the prefix part here if it helps.
465d6a0eac commented 2026-11-24 17:04:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 465d6a0eac on 2026-11-24T17:02:38Z.


Thank you for this, @r4tedx! Many pull requests here are still waiting to be merged, so I've ported this one to 465d6a0eac/AgentRecompVI, a VIctory fork where AI agents review and merge each other's work: https://github.com/465d6a0eac/AgentRecompVI/pull/34. It went in together with #439, which builds on it. You're credited as the author there. This pull request stays the original.

Test results

  • Windows 11, NVIDIA GeForce RTX 3070 Ti (driver 32.0.16.1088, 32-lane waves): together with #439, #265, #492 and #1019, cargo clippy (both variants) and cargo test --workspace pass (407 passed, 0 failed).
  • victory translate over the 26,148 shader programs in my own copy of the game with --host-lanes 32-32, before → after #320/#439: compute programs emitted 1,221 → 1,422 of 2,582; "a select on an untracked mask" 284 → 0, "a lane mask holding lanes elsewhere read as data" 266 → 3, "console wave64 lanes on a host without 64-lane waves" 162 → 0.
  • With it in, the title boots and runs its menus at 30 fps on that machine, through the intro video, first-boot settings and legal screens up to the terms screen. I haven't reached the world yet.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7138597468 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7138597468). Originally posted by [465d6a0eac](https://github.com/465d6a0eac) on 2026-11-24T17:02:38Z. --- Thank you for this, @r4tedx! Many pull requests here are still waiting to be merged, so I've ported this one to [465d6a0eac/AgentRecompVI](https://github.com/465d6a0eac/AgentRecompVI), a VIctory fork where AI agents review and merge each other's work: https://github.com/465d6a0eac/AgentRecompVI/pull/34. It went in together with #439, which builds on it. You're credited as the author there. This pull request stays the original. **Test results** - Windows 11, NVIDIA GeForce RTX 3070 Ti (driver 32.0.16.1088, 32-lane waves): together with #439, #265, #492 and #1019, `cargo clippy` (both variants) and `cargo test --workspace` pass (407 passed, 0 failed). - `victory translate` over the 26,148 shader programs in my own copy of the game with `--host-lanes 32-32`, before → after #320/#439: compute programs emitted 1,221 → 1,422 of 2,582; "a select on an untracked mask" 284 → 0, "a lane mask holding lanes elsewhere read as data" 266 → 3, "console wave64 lanes on a host without 64-lane waves" 162 → 0. - With it in, the title boots and runs its menus at 30 fps on that machine, through the intro video, first-boot settings and legal screens up to the terms screen. I haven't reached the world yet.
Marvisak commented 2026-11-25 01:07:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:27:10Z.


Automated triage for the maintainers.

Needs work: needs the maintainer's decision. The clippy error named in the last triage is fixed: head 960b3e1 passes emit::Target::ANY in placed_uav_tests.rs (merged up from #223), and CI check passes. Nothing else changed since 85362ac.

The verdict stays because this PR's own part (the console flow for compute programs with v_readlane/v_writelane and a divergent branch, with the per-lane fallback, and SGPR spills kept per-lane since d5f8f2c) can only land on top of #223 and #233. #233 is waiting on a maintainer's choice between this stack and #2176/#2925. The evidence is the right kind: lane readbacks on 32-lane hardware (16 of 16 on an RTX 3070 at eb12838) and title translate counts with no program lost. Once #233 is decided, this needs a maintainer read in stack order.

CI: passing.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148524701 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7148524701). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:27:10Z. --- <!-- victory-triage v1 head=960b3e198eca2a1e618e50915943858fd5272567 verdict=needs-work at=2026-11-26T07:21:15Z --> Automated triage for the maintainers. **Needs work: needs the maintainer's decision.** The clippy error named in the last triage is fixed: head `960b3e1` passes `emit::Target::ANY` in `placed_uav_tests.rs` (merged up from #223), and CI `check` passes. Nothing else changed since `85362ac`. The verdict stays because this PR's own part (the console flow for compute programs with `v_readlane`/`v_writelane` and a divergent branch, with the per-lane fallback, and SGPR spills kept per-lane since `d5f8f2c`) can only land on top of #223 and #233. #233 is waiting on a maintainer's choice between this stack and #2176/#2925. The evidence is the right kind: lane readbacks on 32-lane hardware (16 of 16 on an RTX 3070 at `eb12838`) and title translate counts with no program lost. Once #233 is decided, this needs a maintainer read in stack order. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
r4tedx commented 2026-11-25 08:06:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-25T07:08:54Z.


Updated for the needs-rebase triage: main (940d32f) is merged in through #233, head eb12838 (merge commits, no rebase). It carries #233's three fixes (see there). Conflicts were in lower.rs, mod.rs, structure.rs and the test files: emit keeps the per-lane fallback when the console flow cannot lower a program that asked for it only for correctness; this PR's Structured::others becomes main's identical Structured::other.

One behaviour to know about: compute programs that spill SGPRs through v_writelane/v_readlane and have a divergent branch now take the console flow on every host by this PR's rule, although main's spill handling already makes the per-lane form exact for them; the per-lane fallback stays. On a host that runs the program's wave size that adds no barriers (one host wave is the console wave).

Checks: both CI clippy commands clean; victory-shader 270 passed, 0 failed, 3 ignored, on an AMD Radeon iGPU only. Not run on a 32-lane card today (see #233).

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7155540214 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7155540214). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-25T07:08:54Z. --- Updated for the needs-rebase triage: `main` (`940d32f`) is merged in through #233, head **`eb12838`** (merge commits, no rebase). It carries #233's three fixes (see there). Conflicts were in `lower.rs`, `mod.rs`, `structure.rs` and the test files: `emit` keeps the per-lane fallback when the console flow cannot lower a program that asked for it only for correctness; this PR's `Structured::others` becomes `main`'s identical `Structured::other`. One behaviour to know about: compute programs that spill SGPRs through `v_writelane`/`v_readlane` and have a divergent branch now take the console flow on every host by this PR's rule, although `main`'s spill handling already makes the per-lane form exact for them; the per-lane fallback stays. On a host that runs the program's wave size that adds no barriers (one host wave is the console wave). Checks: both CI clippy commands clean; `victory-shader` 270 passed, 0 failed, 3 ignored, on an AMD Radeon iGPU only. Not run on a 32-lane card today (see #233). AI-assisted (Claude Code).
r4tedx commented 2026-11-25 11:05:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-25T10:55:04Z.


Pushed d5f8f2ce for the triage note on SGPR spills: spill v_readlane/v_writelane keep main's per-lane form, with the console's wave size where the host runs it and none on a 32..32 host (each restore lowered as its SGPR). New test sgpr_spills_across_a_divergent_branch_stay_per_lane checks the wave size on both targets (64 on Target::ANY, none on 32..32) and that the first pass without the console flow gives the same DXIL; it fails with the lower.rs change reverted. Description updated.

Verified locally: clippy -D warnings clean (default and --all-features); victory-shader --lib on WARP, one test thread: 269 passed, 2 failed, 3 ignored, the 2 being the known hardware-only checks gathers_at_a_level_match_the_hardware and permutes_read_the_lane_named_and_zero_from_lanes_left_out. No hardware adapter and no title data used.

AI-assisted

<!-- greyfinch-sync:Marvisak/VIctory:comment:7160344982 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7160344982). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-25T10:55:04Z. --- Pushed `d5f8f2ce` for the triage note on SGPR spills: spill `v_readlane`/`v_writelane` keep main's per-lane form, with the console's wave size where the host runs it and none on a 32..32 host (each restore lowered as its SGPR). New test `sgpr_spills_across_a_divergent_branch_stay_per_lane` checks the wave size on both targets (64 on `Target::ANY`, none on 32..32) and that the first pass without the console flow gives the same DXIL; it fails with the `lower.rs` change reverted. Description updated. Verified locally: clippy `-D warnings` clean (default and `--all-features`); `victory-shader --lib` on WARP, one test thread: 269 passed, 2 failed, 3 ignored, the 2 being the known hardware-only checks `gathers_at_a_level_match_the_hardware` and `permutes_read_the_lane_named_and_zero_from_lanes_left_out`. No hardware adapter and no title data used. AI-assisted
r4tedx commented 2026-11-26 06:03:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-26T05:07:45Z.


Merged current main (63bcca4) in, with no rebase or force-push. Head now db85706, and it merges cleanly with main. The PRs above (#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).

Synthetic tests only; no title data used.

AI-assisted

<!-- greyfinch-sync:Marvisak/VIctory:comment:7183205835 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7183205835). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-26T05:07:45Z. --- Merged current `main` (`63bcca4`) in, with no rebase or force-push. Head now **`db85706`**, and it merges cleanly with `main`. The PRs above (#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). Synthetic tests only; no title data used. AI-assisted
r4tedx commented 2026-11-26 06:03:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-26T05:14:09Z.


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 85362ace has the fix merged up from #233: 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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7183302344 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7183302344). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-26T05:14:09Z. --- 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 `85362ace` has the fix merged up from #233: 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 commented 2026-11-26 06:03:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-26T05:18:49Z.


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 960b3e19 has the fix merged up from #233: 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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7183373958 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7183373958). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-26T05:18:49Z. --- 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 `960b3e19` has the fix merged up from #233: 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 commented 2026-11-26 06:03:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-26T05:23:05Z.


This triage reviewed 85362ace. The placed_uav_tests.rs:77 call it names is fixed on the current head 960b3e19: the call passes emit::Target::ANY, and it came up from #223 fbfd3c67. CI now passes on all four heads of the stack: #223 fbfd3c67, #233 87d1f423, #320 960b3e19 and #439 13be4c2c. Merge order is unchanged: #223, then #233, #320, #439.

AI-assisted

<!-- greyfinch-sync:Marvisak/VIctory:comment:7183437043 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7183437043). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-26T05:23:05Z. --- This triage reviewed `85362ace`. The `placed_uav_tests.rs:77` call it names is fixed on the current head `960b3e19`: the call passes `emit::Target::ANY`, and it came up from #223 `fbfd3c67`. CI now passes on all four heads of the stack: #223 `fbfd3c67`, #233 `87d1f423`, #320 `960b3e19` and #439 `13be4c2c`. Merge order is unchanged: #223, then #233, #320, #439. AI-assisted
Lyrnc commented 2026-11-26 18:38:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Lyrnc on 2026-11-26T18:38:45Z.


Wave64 hardware check of 960b3e1.

Checked against a hardware table measured on an AMD Radeon iGPU (gfx1036, RDNA 2, Ryzen 7 9800X3D) in native
wave64: 64 cross-lane instructions x 8 EXEC masks (all, lo32, hi32, all but lane 0, alternate lanes, lane 40 alone,
lanes 31+32, a sparse mask). Each case was assembled with the same assembler, run through VIctory as a wave64
compute program of 64 threads on the same Radeon through D3D12 (WaveSize 64, dxil.dll validated), and all 64
lanes compared with the hardware. EXEC is narrowed two ways: straight-line (v_cmpx_ne_u32, lowered with a lane
guard) and branched (s_and_saveexec_b64 + s_cbranch_execz, a DXIL if). Windows 11, Rust pinned, debug.
No game files were used.

Tested (merged onto main 63bcca4; the harness goes through the same console-flow retry as emit_with):

  • Radeon (Target 32..64), branched form: v_readlane_b32 at lanes 0/31/32/40/63 40 of 40 exact (main: 18 wrong,
    e.g. lane 63 read under lo32 gives 0 instead of 0x40) and v_writelane_b32 24 of 24 (main: 14 wrong).
    Straight-line form unchanged from main (#2830 / #1312 cover those cases).
  • RTX 5080 (Target 32..32, a wave64 split over two host waves): 264 cases exact, 0 wrong, in both forms (readlane,
    readfirstlane, writelane, v_mbcnt, compares, swizzle, DPP). ds_bpermute/ds_permute are refused there
    (console wave64 lanes on a host without 64-lane waves).
  • No case of the table got worse than main on either GPU.

Not tested: the title, cost per lane.

AI use: Claude Code (Claude Opus 5.5) built the harness and the hardware table, ran them on the GPUs named here and wrote this report; the numbers come from those runs.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7200695530 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7200695530). Originally posted by [Lyrnc](https://github.com/Lyrnc) on 2026-11-26T18:38:45Z. --- Wave64 hardware check of `960b3e1`. Checked against a hardware table measured on an AMD Radeon iGPU (gfx1036, RDNA 2, Ryzen 7 9800X3D) in native wave64: 64 cross-lane instructions x 8 EXEC masks (all, lo32, hi32, all but lane 0, alternate lanes, lane 40 alone, lanes 31+32, a sparse mask). Each case was assembled with the same assembler, run through VIctory as a wave64 compute program of 64 threads on the same Radeon through D3D12 (WaveSize 64, dxil.dll validated), and all 64 lanes compared with the hardware. EXEC is narrowed two ways: straight-line (`v_cmpx_ne_u32`, lowered with a lane guard) and branched (`s_and_saveexec_b64` + `s_cbranch_execz`, a DXIL `if`). Windows 11, Rust pinned, debug. No game files were used. **Tested** (merged onto main 63bcca4; the harness goes through the same console-flow retry as `emit_with`): - Radeon (Target 32..64), branched form: `v_readlane_b32` at lanes 0/31/32/40/63 40 of 40 exact (main: 18 wrong, e.g. lane 63 read under lo32 gives 0 instead of 0x40) and `v_writelane_b32` 24 of 24 (main: 14 wrong). Straight-line form unchanged from main (#2830 / #1312 cover those cases). - RTX 5080 (Target 32..32, a wave64 split over two host waves): 264 cases exact, 0 wrong, in both forms (readlane, readfirstlane, writelane, v_mbcnt, compares, swizzle, DPP). ds_bpermute/ds_permute are refused there (`console wave64 lanes on a host without 64-lane waves`). - No case of the table got worse than main on either GPU. **Not tested:** the title, cost per lane. **AI use:** Claude Code (Claude Opus 5.5) built the harness and the hardware table, ran them on the GPUs named here and wrote this report; the numbers come from those runs.
Lyrnc commented 2026-11-27 00:46:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Lyrnc on 2026-11-27T00:46:14Z.


Wave64 hardware check of 960b3e1 on a 32-lane host (RTX 5080): 151 more cases, inside branches and loops. This follows my table check above.

Setup. Windows 11, an RTX 5080 (32..32) and the Radeon iGPU of a Ryzen 7 9800X3D (gfx1036, RDNA 2) in one machine. 151 hand-written GFX10 wave64 compute programs (our own code, one 64-thread group): 13 kinds of construct (wave reductions in a branch, v_readfirstlane / v_readlane / v_writelane in a branch, LDS one wave shares, the allocation idiom, nested branches, loops, an early-out, vote and break loops), each under up to 10 EXEC masks. The 15 f32 wave sums are refused here like the integer reductions, so they add nothing. Expected values: the same code run natively in wave64 on the gfx1036; an independent Python model agrees with the hardware on every case. Each program goes through emit with Target { lanes_min: 32, lanes_max: 32 }, dxil.dll validation and a D3D12 dispatch; every output of every lane is compared.

Results on the 5080 (exact / differ / refused):

case kind n main #320
v_readlane in a branch 20 0 / 0 / 20 20 / 0 / 0
v_writelane in a branch (lanes 0, 33, 63; target lane outside the branch in 8) 18 0 / 0 / 18 18 / 0 / 0
v_readfirstlane in a branch (its only lane operation) 10 1 / 9 / 0 1 / 9 / 0
vote loop (s_cbranch_vccz) alone 5 2 / 3 / 0 2 / 3 / 0
wave reductions (in a branch, nested, in loops, after an early-out, with vote or break loops) 68 0 / 0 / 68 0 / 0 / 68
LDS one wave shares (min/max, read and write in one branch, allocation idiom) 30 0 / 0 / 30 0 / 0 / 30
all 151 3 / 12 / 136 41 / 12 / 98

The same translations dispatched on the Radeon give the same counts.

What it means.

  • Lane reads and lane writes inside a branch are exact on the 32-lane host, including lane writes to lanes outside the branch: v_writelane ignores EXEC on the console, and here it skips the guard (lower.rs guard).
  • The 98 refusals are whole-wave sections (console wave64 lanes on a host without 64-lane waves, 78) and LDS one wave shares (a wave64 group sharing LDS without barriers ..., 20). #439 on top translates all 98, and all 98 are exact.
  • The 12 that differ are the same as on main. 9 are a program whose only lane operation is v_readfirstlane (no console lanes, so no wave size, and it runs per host wave; mask all: lane 32 reads 0x65 instead of lane 0's 0x5). 3 are a vote loop with no lane operation, which runs per lane. I proposed a change for the first-lane case on #439.

Not tested: the title; cost per dispatch.

AI use: Claude Code (Claude Opus 5.5) wrote the cases, the harness and this report, and ran them on the GPUs named here; the numbers come from those runs.


Float wave sums on the same branch

Setup. Hand-written console wave64 compute programs, one 64-thread group each, translated by this branch's emit with Target { lanes_min: 32, lanes_max: 32 } (what an RTX 5080 reports), for the RTX 5080. The cases are 34 whole-wave f32 sums and 20 f64 sums in the compiler's WaveActiveSum shape (DPP8 x3, row_mirror bound_ctrl:1, v_permlanex16_b32, v_readlane_b32 32 / 0), inside per-lane branches or after an early-out. The reference is the gfx1036 iGPU of the same PC, running them in wave64.

54 cases, RTX 5080 exact differ refused
#320 0 0 54

Every case is refused with GFX10 code at 0x0: console wave64 lanes on a host without 64-lane waves.

Meaning. On its own, #320 does not take a wave64 whole-wave sum on a 32-lane host, so these cases cannot test the order of its additions. #439, which builds on it, takes the f32 ones: 20 exact and 14 differ on the 5080, all 14 in WaveActiveSum's order (see my note there).

AI use: Claude Code (Claude Opus 5.5) wrote the cases and the harness and ran them on this PC. The numbers come from those runs.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7206738224 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/320#issuecomment-7206738224). Originally posted by [Lyrnc](https://github.com/Lyrnc) on 2026-11-27T00:46:14Z. --- Wave64 hardware check of `960b3e1` on a 32-lane host (RTX 5080): 151 more cases, inside branches and loops. This follows my table check above. **Setup.** Windows 11, an RTX 5080 (32..32) and the Radeon iGPU of a Ryzen 7 9800X3D (gfx1036, RDNA 2) in one machine. 151 hand-written GFX10 wave64 compute programs (our own code, one 64-thread group): 13 kinds of construct (wave reductions in a branch, `v_readfirstlane` / `v_readlane` / `v_writelane` in a branch, LDS one wave shares, the allocation idiom, nested branches, loops, an early-out, vote and break loops), each under up to 10 EXEC masks. The 15 f32 wave sums are refused here like the integer reductions, so they add nothing. Expected values: the same code run natively in wave64 on the gfx1036; an independent Python model agrees with the hardware on every case. Each program goes through `emit` with `Target { lanes_min: 32, lanes_max: 32 }`, `dxil.dll` validation and a D3D12 dispatch; every output of every lane is compared. **Results** on the 5080 (exact / differ / refused): | case kind | n | main | #320 | |---|---|---|---| | `v_readlane` in a branch | 20 | 0 / 0 / 20 | **20 / 0 / 0** | | `v_writelane` in a branch (lanes 0, 33, 63; target lane outside the branch in 8) | 18 | 0 / 0 / 18 | **18 / 0 / 0** | | `v_readfirstlane` in a branch (its only lane operation) | 10 | 1 / 9 / 0 | 1 / 9 / 0 | | vote loop (`s_cbranch_vccz`) alone | 5 | 2 / 3 / 0 | 2 / 3 / 0 | | wave reductions (in a branch, nested, in loops, after an early-out, with vote or break loops) | 68 | 0 / 0 / 68 | 0 / 0 / 68 | | LDS one wave shares (min/max, read and write in one branch, allocation idiom) | 30 | 0 / 0 / 30 | 0 / 0 / 30 | | **all** | 151 | 3 / 12 / 136 | **41 / 12 / 98** | The same translations dispatched on the Radeon give the same counts. **What it means.** - Lane reads and lane writes inside a branch are exact on the 32-lane host, including lane writes to lanes outside the branch: `v_writelane` ignores EXEC on the console, and here it skips the guard (lower.rs `guard`). - The 98 refusals are whole-wave sections (`console wave64 lanes on a host without 64-lane waves`, 78) and LDS one wave shares (`a wave64 group sharing LDS without barriers ...`, 20). #439 on top translates all 98, and all 98 are exact. - The 12 that differ are the same as on main. 9 are a program whose only lane operation is `v_readfirstlane` (no console lanes, so no wave size, and it runs per host wave; mask all: lane 32 reads 0x65 instead of lane 0's 0x5). 3 are a vote loop with no lane operation, which runs per lane. I proposed a change for the first-lane case on #439. **Not tested:** the title; cost per dispatch. **AI use:** Claude Code (Claude Opus 5.5) wrote the cases, the harness and this report, and ran them on the GPUs named here; the numbers come from those runs. --- **Float wave sums on the same branch** **Setup.** Hand-written console wave64 compute programs, one 64-thread group each, translated by this branch's `emit` with `Target { lanes_min: 32, lanes_max: 32 }` (what an RTX 5080 reports), for the RTX 5080. The cases are 34 whole-wave f32 sums and 20 f64 sums in the compiler's `WaveActiveSum` shape (DPP8 x3, `row_mirror bound_ctrl:1`, `v_permlanex16_b32`, `v_readlane_b32` 32 / 0), inside per-lane branches or after an early-out. The reference is the gfx1036 iGPU of the same PC, running them in wave64. | 54 cases, RTX 5080 | exact | differ | refused | |---|---|---|---| | #320 | 0 | 0 | 54 | Every case is refused with `GFX10 code at 0x0: console wave64 lanes on a host without 64-lane waves`. **Meaning.** On its own, #320 does not take a wave64 whole-wave sum on a 32-lane host, so these cases cannot test the order of its additions. #439, which builds on it, takes the f32 ones: 20 exact and 14 differ on the 5080, all 14 in `WaveActiveSum`'s order (see my note there). AI use: Claude Code (Claude Opus 5.5) wrote the cases and the harness and ran them on this PC. The numbers come from those runs.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/320:upstream-pr/320'
git switch 'upstream-pr/320'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/320'
git switch 'upstream-pr/320'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/320'
git switch 'upstream-pr/320'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/320'
git switch 'main'
git merge --squash 'upstream-pr/320'
git switch 'main'
git merge --ff-only 'upstream-pr/320'
git switch 'main'
git merge 'upstream-pr/320'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!320
No description provided.