Shaders: translate for the host's wave sizes #223

Open
github-bot wants to merge 7 commits from github-bot/gh-223 into main AGit
Owner

@⁠r4tedx on GitHub · 2026-11-24 01:35 UTC · original
r4tedx:shader/host-wave-sizes → main · +390 −35 · 20 files · 7 commits · open

Current head 714b818, integrated with main at ffe310e. The emitter and its tests pass the host wave target through upstream’s structured descriptor tracking. Local Windows verification: cargo test --workspace --locked (346 passed, 6 ignored) and all-target, all-feature Clippy with warnings denied. No title run for this update. AI-assisted (Codex).

Rebased onto main 8e79c80 on 2026-11-24 (twice that day; upstream merged about 55 PRs and added CI). New upstream tests call emit and build lower::Parts directly, so they now pass Target::ANY. Nothing else changed. Head 1dfb859, was e0865d2 before the rebases. CI's two clippy commands (-D warnings, with and without --all-features) are clean at this head. CI's first run here failed in one test of this PR, what_translates_for_the_host_creates_a_pipeline: the runner's default device is Windows' software renderer, whose waves are 4 lanes, so not even the wave32 program translates for it, and the test only expected that of the wave64 one. The test now accepts a host without waves of the program's size; reproduced and checked here with VICTORY_WARP=1.

What

A compute shader that depends on the lane layout declares the console's wave size. On a host whose D3D12 wave range does not contain it (NVIDIA reports 32..32), a console wave64 program of that kind was refused at pipeline creation. Its dispatches were then dropped, and the log said only "host pipeline refused".

  • emit::Target { lanes_min, lanes_max } (D3D12 options 1, WaveLaneCountMin / Max) goes into translation: emit::translate_for(container, target), and emit::emit takes it too (translate keeps its old meaning as Target::ANY). A shader whose declared wave size the host does not run stops at translation, with the reason (console wave64 lanes on a host without 64-lane waves, or the one-wave-LDS case).
  • victory-gpu: Host::target() reads the range once, logs it, and warns when there are no 64-lane waves. The shader cache keys entries by the build and the range, so a translation for one host's waves is never served to another.
  • victory translate --host-lanes 32-32 (or 32-64, or a single size) counts these shaders without a GPU. --pipelines translates for the local device's range.
  • The shader::host::Host used by tests and tools gets target().

This changes nothing for hosts that run 64-lane waves.

#208 also reads options 1, into HostCaps (supports_wave64, wave_lane_count_max) for logging. It does not feed translation or the cache key. Whichever merges second, Host::target() can become a thin wrapper over those caps. #189, #192 and #54 change what the translator emits on such hosts. This PR only adds the plumbing they can key their choice on (and the cache key they need to stay correct when one machine has GPUs of both kinds), plus an explicit refusal where nothing handles the program yet.

#235 (the non-Windows build) adds a stub Host for hosts other than Windows that has no target method, and translate.rs calls it here. The two merge without a textual conflict and then the app crate does not build on macOS or Linux (found by a reviewer on #439). Whichever lands second adds target() returning Target::ANY to that stub; I will do it on my side if #235 goes in first.

Not verified

I did not count how many of the title's programs the refusal hits; --host-lanes 32-32 is there to do that. A tester has since counted it on their own copy: 321 compute programs declare WaveSize(64) on main and are refused by a 32-lane driver.

#54 has since gained a commit (4083d25) that also queries the device's wave range and puts it in the shader cache key, through its own WaveRange type. The two overlap there; I have not merged them together, and whichever lands second has to adopt the other's type.

Tested

Windows 11, an NVIDIA RTX 5070 (32..32), synthetic only:

  • New emit::tests: a hand-assembled wave64 compute program with v_readlane translates for Target::ANY and for 32..64, and stops with the reason for 32..32. The same code as wave32 translates for both. A program reading no other lanes translates for any range.
  • On the device, what translates for its range creates a pipeline; the wave64 one translated for ANY is refused by it (what this replaces).
  • shader_cache: keys differ between 32..32 and 32..64 and between builds.
  • cargo test --workspace: 268 passed, 0 failed, 4 ignored. cargo clippy --workspace --all-targets: nothing new. cargo xtask policy: ok.

AI-assisted; no game assets were used.

🤖 Generated with Claude Code

**@⁠r4tedx** on GitHub · 2026-11-24 01:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/223) `r4tedx:shader/host-wave-sizes` → `main` · +390 −35 · 20 files · 7 commits · open **Current head `714b818`, integrated with `main` at `ffe310e`.** The emitter and its tests pass the host wave target through upstream’s structured descriptor tracking. Local Windows verification: `cargo test --workspace --locked` (346 passed, 6 ignored) and all-target, all-feature Clippy with warnings denied. No title run for this update. AI-assisted (Codex). Rebased onto `main` `8e79c80` on 2026-11-24 (twice that day; upstream merged about 55 PRs and added CI). New upstream tests call `emit` and build `lower::Parts` directly, so they now pass `Target::ANY`. Nothing else changed. Head `1dfb859`, was `e0865d2` before the rebases. CI's two clippy commands (`-D warnings`, with and without `--all-features`) are clean at this head. CI's first run here failed in one test of this PR, `what_translates_for_the_host_creates_a_pipeline`: the runner's default device is Windows' software renderer, whose waves are 4 lanes, so not even the wave32 program translates for it, and the test only expected that of the wave64 one. The test now accepts a host without waves of the program's size; reproduced and checked here with `VICTORY_WARP=1`. ## What A compute shader that depends on the lane layout declares the console's wave size. On a host whose D3D12 wave range does not contain it (NVIDIA reports 32..32), a console wave64 program of that kind was refused at pipeline creation. Its dispatches were then dropped, and the log said only "host pipeline refused". - `emit::Target { lanes_min, lanes_max }` (D3D12 options 1, `WaveLaneCountMin` / `Max`) goes into translation: `emit::translate_for(container, target)`, and `emit::emit` takes it too (`translate` keeps its old meaning as `Target::ANY`). A shader whose declared wave size the host does not run stops at translation, with the reason (`console wave64 lanes on a host without 64-lane waves`, or the one-wave-LDS case). - `victory-gpu`: `Host::target()` reads the range once, logs it, and warns when there are no 64-lane waves. The shader cache keys entries by the build and the range, so a translation for one host's waves is never served to another. - `victory translate --host-lanes 32-32` (or `32-64`, or a single size) counts these shaders without a GPU. `--pipelines` translates for the local device's range. - The `shader::host::Host` used by tests and tools gets `target()`. This changes nothing for hosts that run 64-lane waves. #208 also reads options 1, into `HostCaps` (`supports_wave64`, `wave_lane_count_max`) for logging. It does not feed translation or the cache key. Whichever merges second, `Host::target()` can become a thin wrapper over those caps. #189, #192 and #54 change what the translator emits on such hosts. This PR only adds the plumbing they can key their choice on (and the cache key they need to stay correct when one machine has GPUs of both kinds), plus an explicit refusal where nothing handles the program yet. #235 (the non-Windows build) adds a stub `Host` for hosts other than Windows that has no `target` method, and `translate.rs` calls it here. The two merge without a textual conflict and then the app crate does not build on macOS or Linux ([found by a reviewer on #439](https://git.gtahub.st/github/Marvisak--VIctory/pulls/439)). Whichever lands second adds `target()` returning `Target::ANY` to that stub; I will do it on my side if #235 goes in first. ## Not verified I did not count how many of the title's programs the refusal hits; `--host-lanes 32-32` is there to do that. A tester has since counted it on their own copy: [321 compute programs declare `WaveSize(64)` on `main` and are refused by a 32-lane driver](https://git.gtahub.st/github/Marvisak--VIctory/pulls/233). #54 has since gained a commit (`4083d25`) that also queries the device's wave range and puts it in the shader cache key, through its own `WaveRange` type. The two overlap there; I have not merged them together, and whichever lands second has to adopt the other's type. ## Tested Windows 11, an NVIDIA RTX 5070 (32..32), synthetic only: - New `emit::tests`: a hand-assembled wave64 compute program with `v_readlane` translates for `Target::ANY` and for 32..64, and stops with the reason for 32..32. The same code as wave32 translates for both. A program reading no other lanes translates for any range. - On the device, what translates for its range creates a pipeline; the wave64 one translated for `ANY` is refused by it (what this replaces). - `shader_cache`: keys differ between 32..32 and 32..64 and between builds. - `cargo test --workspace`: 268 passed, 0 failed, 4 ignored. `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)
A compute shader that reads other lanes declares the console's wave
size. NVIDIA runs waves of 32 lanes only (D3D12 reports 32..32), so a
console wave64 program of that kind was refused at pipeline creation
and its dispatches were dropped without saying why.

The host's wave range (D3D12 options 1) now goes into translation as
`emit::Target`. A shader that needs a wave size the host does not run
stops there with the reason, the shader cache keys entries by the range,
and the run logs the range once with a warning when 64-lane waves are
missing. `victory translate --host-lanes 32-32` counts these shaders
without a GPU.

This is the first step towards running these programs as two 32-lane
waves on such hosts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts were where main's write marks (`emit::Options`, `emit_with`,
`translate_with`, `Parts::view_marks`) and its warm-up (`translate
--cache`, `host_shader` returning whether the entry was cached) met the
branch's `Target`:

- emit: `Options` gains `target` (default `Target::ANY`), so main's
  `emit_with` and `translate_with` keep their signatures; `emit(..,
  target)` and `translate_for(c, target)` stay as they were and fill it
  in. `Parts` has both `target` and `view_marks`. Main's retry with
  `structure::killing` is kept as it is.
- shader cache: `host_shader(container, target)` translates with main's
  write marks for `target` and keeps main's (result, cached) pair; the
  branch's key function is renamed `host_key`, since main now has a
  `key` for the build.
- `translate --cache` (new on main) asks `shader_cache::host_target()`,
  which is what a run's `pipeline::translate` uses, so warm entries are
  keyed as the run looks them up; `--cache` refuses `--host-lanes`.
- `translate` (the census) passes its target with main's `view_marks:
  true`; `--pipelines` documents both the host's wave sizes and main's
  pipeline library.
- victory-gpu `Host` keeps both `target` and main's `heap_atomics64`.
- The `Parts` and `emit` call sites main added (the `fuses_fmad` probe
  in `emit/host.rs` and tests in bvh, memory, semantics, stride,
  synthetic, valu and `emit::tests`) pass `Target::ANY`.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: GPT-6.2 Sol (Codex) <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:55:29 +00:00
Author
Owner

@⁠ghost on GitHub · 2026-11-24 02:06 UTC · original

AMD run on a host that offers both wave sizes (RDNA4, 32–64): head e0865d2 (already on main d2a4bae) passes. AMD Radeon RX 9060 XT, driver 32.0.32029.2010, Windows 11 Pro 26200, Rust 1.98.1, debug.

  • cargo test --workspace: 268 passed, 0 failed, 4 ignored.
  • cargo test -p victory-shader wave: 5 passed, including console_lanes_translate_only_for_hosts_with_that_wave_size and programs_reading_no_other_lanes_translate_for_any_wave_size.

AI use

  • Claude Code (Claude Opus 5.5) ran the commands and wrote this report from the logs; I checked it before posting.
**@⁠ghost** on GitHub · 2026-11-24 02:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7119763221) AMD run on a host that offers both wave sizes (RDNA4, 32–64): head `e0865d2` (already on `main` `d2a4bae`) **passes**. AMD Radeon RX 9060 XT, driver 32.0.32029.2010, Windows 11 Pro 26200, Rust 1.98.1, debug. - `cargo test --workspace`: 268 passed, 0 failed, 4 ignored. - `cargo test -p victory-shader wave`: 5 passed, including `console_lanes_translate_only_for_hosts_with_that_wave_size` and `programs_reading_no_other_lanes_translate_for_any_wave_size`. **AI use** - Claude Code (Claude Opus 5.5) ran the commands and wrote this report from the logs; I checked it before posting.
The one conflict was in apps/victory/src/main.rs, where main's
`--jobs` became a `NonZeroUsize` and the branch added `--host-lanes`:
`translate::run` takes both, `jobs.map(NonZeroUsize::get)` as main
passes it and the branch's `host_lanes` after it.

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main's view-mark test builds emit::Options by hand; this branch adds a
target field to Options, so the test now fills the rest from Default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main's placed-UAV diagnostics test calls emit::emit with the six arguments
it had before this branch added the target.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 08:35 UTC · original

Rebased onto main 2e4e280, force-pushed with lease: head is b2adc37, was e0865d2.

Upstream merged 32 PRs. This PR still merged without a textual conflict, but two new upstream tests in emit/mod.rs call emit directly, and this PR adds the wave-range argument to it, so the merged tree did not build its tests. Those two calls now pass Target::ANY; nothing else changed. cargo check --workspace --all-targets passes at this commit, and the three PRs stacked on it (#233, #320, #439) are rebased onto it.

The title was not used in these tests. AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-24 08:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7126327629) **Rebased onto `main` `2e4e280`**, force-pushed with lease: head is `b2adc37`, was `e0865d2`. Upstream merged 32 PRs. This PR still merged without a textual conflict, but two new upstream tests in `emit/mod.rs` call `emit` directly, and this PR adds the wave-range argument to it, so the merged tree did not build its tests. Those two calls now pass `Target::ANY`; nothing else changed. `cargo check --workspace --all-targets` passes at this commit, and the three PRs stacked on it (#233, #320, #439) are rebased onto it. The title was not used in these tests. AI-assisted (Claude Code).
Author
Owner

@⁠MD5Visual on GitHub · 2026-11-24 11:12 UTC · original

RTX 3090 / 24 GB result for this branch, standalone on main (not the integration tree), to see what the wave-size naming does on its own.

Build main ffe310e + this PR's diff (1dfb859), diagnostics, DRED on, no debug layer, VICTORY_SHADER_LOOP_LIMIT=32, same manual menu route. Windows 11 Pro 26200, Ryzen 7 5800X3D, 64 GB, RTX 3090 24 GB, driver 32.0.16.1088 (610.88), title 1.0.2.1 b99f876b.... (Local-only patch: the host device is created on an adapter picked by name, because D3D12CreateDevice(None) takes the display adapter here. Nothing else is patched.)

main ffe310e main + this PR
host pipeline refused 124, all 0x80070057 0
shader does not translate 453 656, of which 112 console wave64 lanes on a host without 64-lane waves and 43 a wave64 group sharing LDS without barriers on a host without 64-lane waves
device removed 0x887A0006 at 145 s 0x887A0006 at 124 s
the submission before it ms=8905 lists=26 ms=9069 lists=12
no host texture 2 2
heap capped 1 (1000000 of 1245184) 1

So the naming works exactly as intended - every refusal becomes a translation stop with a reason, and the 112 program hashes are the concrete list behind #293 - but on its own it does not stop the hang, and the draws still drop (668-1577 of 1191-2790 per frame), just for a different stated reason.

What the 112 are: all compute. The 43 LDS ones are the wave64 programs that need their whole wave to share LDS without a barrier, i.e. the case the two-halves emulation cannot do. v_permlanex16_b32, the first half of an interpolation and a cross-lane operation outside compute appear once each among the rest.

The fatal submission this time is mixed compute and mesh, 16 compute plus a long list of mesh/pixel pairs, e.g. compute 9146291b38ea9ce1, mesh 0a2ea81ca59d6510 / pixel 19acd330dacc8f32, mesh 1205b8f2c7f6b1ad / pixel 7333603e0e1b4e90. The DRED breadcrumb on its dispatches has the shape I keep seeing on this card: 9146291b38ea9ce1 u4=0xf3f280 [heap 499604: Unordered(...)] u5=0x20 [heap 32: null] - the same program bound once into a real slot and once at index 32 of a 32-slot heap, which reads null.

Frames, finally (this PR is the first tree I captured; VICTORY_CAPTURE was pointed at a folder and power-of-two frames are saved at half size): frames 1-128 fully black (boot), 256-1024 the Rockstar logo on #21212C (renders correctly), 2048 uniform #2C2C2C - the world load phase is a single flat fill, no geometry, no letterbox bars.

**@⁠MD5Visual** on GitHub · 2026-11-24 11:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7129789777) RTX 3090 / 24 GB result for this branch, standalone on main (not the integration tree), to see what the wave-size naming does on its own. **Build** `main ffe310e` + this PR's diff (`1dfb859`), diagnostics, DRED on, no debug layer, `VICTORY_SHADER_LOOP_LIMIT=32`, same manual menu route. Windows 11 Pro 26200, Ryzen 7 5800X3D, 64 GB, RTX 3090 24 GB, driver 32.0.16.1088 (610.88), title 1.0.2.1 `b99f876b...`. (Local-only patch: the host device is created on an adapter picked by name, because `D3D12CreateDevice(None)` takes the display adapter here. Nothing else is patched.) | | `main ffe310e` | main + this PR | |---|---|---| | `host pipeline refused` | 124, all `0x80070057` | **0** | | `shader does not translate` | 453 | 656, of which **112 `console wave64 lanes on a host without 64-lane waves`** and **43 `a wave64 group sharing LDS without barriers on a host without 64-lane waves`** | | device removed | `0x887A0006` at 145 s | `0x887A0006` at 124 s | | the submission before it | `ms=8905 lists=26` | `ms=9069 lists=12` | | `no host texture` | 2 | 2 | | heap capped | 1 (1000000 of 1245184) | 1 | So the naming works exactly as intended - every refusal becomes a translation stop with a reason, and the 112 program hashes are the concrete list behind #293 - but on its own it does not stop the hang, and the draws still drop (668-1577 of 1191-2790 per frame), just for a different stated reason. What the 112 are: all compute. The 43 LDS ones are the wave64 programs that need their whole wave to share LDS without a barrier, i.e. the case the two-halves emulation cannot do. `v_permlanex16_b32`, `the first half of an interpolation` and `a cross-lane operation outside compute` appear once each among the rest. The fatal submission this time is mixed compute and mesh, 16 compute plus a long list of mesh/pixel pairs, e.g. `compute 9146291b38ea9ce1`, `mesh 0a2ea81ca59d6510` / `pixel 19acd330dacc8f32`, `mesh 1205b8f2c7f6b1ad` / `pixel 7333603e0e1b4e90`. The DRED breadcrumb on its dispatches has the shape I keep seeing on this card: `9146291b38ea9ce1 u4=0xf3f280 [heap 499604: Unordered(...)] u5=0x20 [heap 32: null]` - the same program bound once into a real slot and once at index 32 of a 32-slot heap, which reads null. Frames, finally (this PR is the first tree I captured; `VICTORY_CAPTURE` was pointed at a folder and power-of-two frames are saved at half size): frames 1-128 fully black (boot), 256-1024 the Rockstar logo on `#21212C` (renders correctly), **2048 uniform `#2C2C2C`** - the world load phase is a single flat fill, no geometry, no letterbox bars.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 11:14 UTC · original

@⁠MD5Visual, thanks for isolating #223 on the RTX 3090. The host pipeline refusals fell from 124 to zero, and the translator reported 112 compute wave-size stops plus 43 LDS stops. Those counts come from separate runs, so I wouldn’t match individual refusals across them without the hashes. Both runs still hit DEVICE_HUNG. The null UAV breadcrumb is worth keeping with the capture, but it doesn’t identify which operation caused the removal. The flat world-load frame gives the later stack a concrete comparison point.

AI-assisted (Codex).

**@⁠r4tedx** on GitHub · 2026-11-24 11:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7129840032) @⁠MD5Visual, thanks for isolating #223 on the RTX 3090. The host pipeline refusals fell from 124 to zero, and the translator reported 112 compute wave-size stops plus 43 LDS stops. Those counts come from separate runs, so I wouldn’t match individual refusals across them without the hashes. Both runs still hit `DEVICE_HUNG`. The null UAV breadcrumb is worth keeping with the capture, but it doesn’t identify which operation caused the removal. The flat world-load frame gives the later stack a concrete comparison point. AI-assisted (Codex).
Author
Owner

@⁠Ilokaxt on GitHub · 2026-11-24 12:16 UTC · original

Tested on an RTX 3070 Ti Laptop (wave lanes 32..32, NVIDIA driver 610.88, Windows 11 build 26300), merged onto main ffe310e, plus a local fix that creates the device on the high-performance adapter. Scripted run into the world, as in my note on #439.

  • wave64 compute programs refused by the driver: 124 → 0
  • shaders not translated: 399 on main, 344 with this PR
  • device hung (TDR) at 89 s in an ExecuteIndirect. main alone hangs the same way, at 199 s. That looks like #778 (wave64 mesh programs), not this PR's compute work.
**@⁠Ilokaxt** on GitHub · 2026-11-24 12:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7131204888) Tested on an **RTX 3070 Ti Laptop** (wave lanes 32..32, NVIDIA driver 610.88, Windows 11 build 26300), merged onto `main` `ffe310e`, plus a local fix that creates the device on the high-performance adapter. Scripted run into the world, as in my note on #439. - wave64 compute programs refused by the driver: **124 → 0** - shaders not translated: 399 on `main`, 344 with this PR - **device hung (TDR) at 89 s in an `ExecuteIndirect`**. `main` alone hangs the same way, at 199 s. That looks like #778 (wave64 mesh programs), not this PR's compute work.
Author
Owner

@⁠juniorteixeiradev on GitHub · 2026-11-24 13:08 UTC · original

Tested on NVIDIA (wave32-only host) at head 714b818.

Result

  • cargo test --workspace --locked: 346 passed, 0 failed, 6 ignored. On main at ffe310e, the same machine gives 342 passed, 0 failed, 6 ignored, so the 4 extra tests are this PR's and nothing regressed.
  • what_translates_for_the_host_creates_a_pipeline with --nocapture prints host waves 32-32. So on this card the wave32 program translated and got a pipeline, and the wave64 one stopped at translation. The test also confirmed that the old Target::ANY translation of the wave64 program is still refused by the driver, which is the case this PR replaces.
  • The other wave tests in the PR pass too: console_lanes_translate_only_for_hosts_with_that_wave_size, programs_reading_no_other_lanes_translate_for_any_wave_size and shader_cache::tests::keys_tell_hosts_wave_sizes_apart.

Setup

  • GPU: NVIDIA GeForce RTX 3070 Ti, 8 GB, driver 610.88. A Ryzen 5 5600G iGPU is also present.
  • OS: Windows 11 Pro, build 26200
  • Rust: 1.98.1 from rust-toolchain.toml, debug build

Not tested

  • No title run: no game files on this machine.
  • Clippy.

AI use

  • Claude Code (Claude Opus 5.5) fetched the branch, ran the tests and drafted this comment. The counts come from the test logs of those runs.
**@⁠juniorteixeiradev** on GitHub · 2026-11-24 13:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7132413667) Tested on NVIDIA (wave32-only host) at head `714b818`. **Result** - `cargo test --workspace --locked`: 346 passed, 0 failed, 6 ignored. On `main` at `ffe310e`, the same machine gives 342 passed, 0 failed, 6 ignored, so the 4 extra tests are this PR's and nothing regressed. - `what_translates_for_the_host_creates_a_pipeline` with `--nocapture` prints `host waves 32-32`. So on this card the wave32 program translated and got a pipeline, and the wave64 one stopped at translation. The test also confirmed that the old `Target::ANY` translation of the wave64 program is still refused by the driver, which is the case this PR replaces. - The other wave tests in the PR pass too: `console_lanes_translate_only_for_hosts_with_that_wave_size`, `programs_reading_no_other_lanes_translate_for_any_wave_size` and `shader_cache::tests::keys_tell_hosts_wave_sizes_apart`. **Setup** - GPU: NVIDIA GeForce RTX 3070 Ti, 8 GB, driver 610.88. A Ryzen 5 5600G iGPU is also present. - OS: Windows 11 Pro, build 26200 - Rust: 1.98.1 from `rust-toolchain.toml`, debug build **Not tested** - No title run: no game files on this machine. - Clippy. **AI use** - Claude Code (Claude Opus 5.5) fetched the branch, ran the tests and drafted this comment. The counts come from the test logs of those runs.
Author
Owner

@⁠465d6a0eac on GitHub · 2026-11-24 16:29 UTC · original · edited 2026-11-24 17:20 UTC

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/29. It went in together with #233, 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): with #233 on top, cargo clippy (both variants) and cargo test --workspace pass (358 passed, 0 failed); --host-lanes 32-32 works and reports the host's 32-32 wave range.
  • victory translate over the 26,148 shader programs in my own copy of the game with --host-lanes 32-32: 1,221 of 2,582 compute programs emit DXIL for a 32-lane host.
  • 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.
**@⁠465d6a0eac** on GitHub · 2026-11-24 16:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7137736688) · edited 2026-11-24 17:20 UTC 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/29. It went in together with #233, 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): with #233 on top, `cargo clippy` (both variants) and `cargo test --workspace` pass (358 passed, 0 failed); `--host-lanes 32-32` works and reports the host's 32-32 wave range. - `victory translate` over the 26,148 shader programs in my own copy of the game with `--host-lanes 32-32`: 1,221 of 2,582 compute programs emit DXIL for a 32-lane host. - 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.
Author
Owner

@⁠Ryanarcx2 on GitHub · 2026-11-24 20:54 UTC · original

Tested head 714b818 on an RTX 5070 Ti (wave32 only, driver 32.0.16.1742), Windows 11, diag build with VICTORY_D3D12_DEBUG=1. Same route as a main (ffe310e) baseline: boot, account picker, settings, first story cutscene.

main ffe310e PR 714b818
CreateComputeShader: wants wave lane count 64, device max 32 117 0
"does not translate" warnings 443 541
...of which: console wave64 lanes on a host without 64-lane waves is not supported n/a 88
...of which: a wave64 group sharing LDS without barriers on a host without 64-lane waves is not supported n/a 32
UAV-state resource "invalid for use as a vertex buffer" 162 94
Transition barrier before-state mismatch 199 156
Cutscene frame rate 1.5 to 2.9 fps 1.6 to 2.9 fps
Outcome DXGI_ERROR_DEVICE_HUNG (TDR) DXGI_ERROR_DEVICE_HUNG (TDR), 30 lists in the last submission

The pipeline-creation refusals are gone. On this title, though, about 120 wave64 programs are now refused at translation instead, so their work is still dropped (counts are of log lines, not unique shaders). Menus are unaffected. The cutscene still hangs the device at about the same point, so on this card wave64 alone does not appear to explain the hang. Other common translation failures in the same run: a select on an untracked mask (84), a lane mask holding lanes elsewhere read as data (60), a descriptor read only as data (58).

Happy to run another build.

**@⁠Ryanarcx2** on GitHub · 2026-11-24 20:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7144218113) Tested head `714b818` on an RTX 5070 Ti (wave32 only, driver 32.0.16.1742), Windows 11, diag build with `VICTORY_D3D12_DEBUG=1`. Same route as a `main` (`ffe310e`) baseline: boot, account picker, settings, first story cutscene. | | main `ffe310e` | PR `714b818` | |---|---|---| | `CreateComputeShader`: wants wave lane count 64, device max 32 | 117 | **0** | | "does not translate" warnings | 443 | 541 | | ...of which: `console wave64 lanes on a host without 64-lane waves is not supported` | n/a | 88 | | ...of which: `a wave64 group sharing LDS without barriers on a host without 64-lane waves is not supported` | n/a | 32 | | UAV-state resource "invalid for use as a vertex buffer" | 162 | 94 | | Transition barrier before-state mismatch | 199 | 156 | | Cutscene frame rate | 1.5 to 2.9 fps | 1.6 to 2.9 fps | | Outcome | `DXGI_ERROR_DEVICE_HUNG` (TDR) | `DXGI_ERROR_DEVICE_HUNG` (TDR), 30 lists in the last submission | The pipeline-creation refusals are gone. On this title, though, about 120 wave64 programs are now refused at translation instead, so their work is still dropped (counts are of log lines, not unique shaders). Menus are unaffected. The cutscene still hangs the device at about the same point, so on this card wave64 alone does not appear to explain the hang. Other common translation failures in the same run: `a select on an untracked mask` (84), `a lane mask holding lanes elsewhere read as data` (60), `a descriptor read only as data` (58). Happy to run another build.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:21 UTC · original · edited 2026-11-26 07:21 UTC

Automated triage for the maintainers.

Merge candidate (as before the rebase). Reviewed head fbfd3c6, which merges main 63bcca4 and adds two test-call fixes (draw.rs view-mark test uses ..Options::default(), pipeline/placed_uav_tests.rs passes emit::Target::ANY).

What I checked: emit::Target and Options::target in crates/victory-shader/src/emit/mod.rs; the refusal at the start of Lower::run (emit/lower.rs) reads wave_size, which Lower::new already sets, so it fires before any lowering; Host::target (victory-gpu/src/host.rs) reads D3D12 options 1 once and falls back to ANY; shader_cache::host_key keys entries by build and wave range, and the warm-up uses the same host_target() as a run. Hosts with 64-lane waves see no change. The testers' NVIDIA runs show driver refusals replaced by named translation refusals, which is the stated intent; it does not by itself make more programs run.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7148423703) · edited 2026-11-26 07:21 UTC <!-- victory-triage v1 head=fbfd3c67a03855a37d4122d4e2bc7ed0540850cf verdict=merge-candidate at=2026-11-26T07:21:05Z --> Automated triage for the maintainers. **Merge candidate** (as before the rebase). Reviewed head `fbfd3c6`, which merges `main` `63bcca4` and adds two test-call fixes (`draw.rs` view-mark test uses `..Options::default()`, `pipeline/placed_uav_tests.rs` passes `emit::Target::ANY`). What I checked: `emit::Target` and `Options::target` in `crates/victory-shader/src/emit/mod.rs`; the refusal at the start of `Lower::run` (`emit/lower.rs`) reads `wave_size`, which `Lower::new` already sets, so it fires before any lowering; `Host::target` (`victory-gpu/src/host.rs`) reads D3D12 options 1 once and falls back to `ANY`; `shader_cache::host_key` keys entries by build and wave range, and the warm-up uses the same `host_target()` as a run. Hosts with 64-lane waves see no change. The testers' NVIDIA runs show driver refusals replaced by named translation refusals, which is the stated intent; it does not by itself make more programs run. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠r4tedx on GitHub · 2026-11-25 07:08 UTC · original

Updated for the needs-rebase triage: main (940d32f) is merged in, head 02b955f (a merge commit, not a rebase: testers quote this stack's hashes). It merges cleanly into main.

Conflict resolutions worth reading:

  • main's new emit::Options { view_marks } / emit_with / translate_with: the host's wave range is now a field of Options (target, default Target::ANY), so main's signatures stay and emit(.., target) fills it in.
  • The shader cache keeps main's (result, cached) pair and write marks; this PR's key is host_key.
  • translate --cache's warm path now keys entries by the run's own host range (shader_cache::host_target(), the same function the runtime uses), so warm entries are not keyed ANY and then missed on a 32-lane host. Thanks to @⁠slatefield for pointing that path out on #1929. --cache and --host-lanes now conflict instead of one being ignored.
  • Every new emit / Parts call site of main's passes Target::ANY.

Both CI clippy commands are clean. Tests ran on the software renderer only at this level (the machine's GPUs are on a hold today), plus the CPU-only crates.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-25 07:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7155539237) Updated for the needs-rebase triage: `main` (`940d32f`) is merged in, head **`02b955f`** (a merge commit, not a rebase: testers quote this stack's hashes). It merges cleanly into `main`. Conflict resolutions worth reading: - `main`'s new `emit::Options { view_marks }` / `emit_with` / `translate_with`: the host's wave range is now a field of `Options` (`target`, default `Target::ANY`), so `main`'s signatures stay and `emit(.., target)` fills it in. - The shader cache keeps `main`'s `(result, cached)` pair and write marks; this PR's key is `host_key`. - `translate --cache`'s warm path now keys entries by the run's own host range (`shader_cache::host_target()`, the same function the runtime uses), so warm entries are not keyed `ANY` and then missed on a 32-lane host. Thanks to @⁠slatefield for pointing that path out on #1929. `--cache` and `--host-lanes` now conflict instead of one being ignored. - Every new `emit` / `Parts` call site of `main`'s passes `Target::ANY`. Both CI clippy commands are clean. Tests ran on the software renderer only at this level (the machine's GPUs are on a hold today), plus the CPU-only crates. AI-assisted (Claude Code).
Author
Owner

@⁠r4tedx on GitHub · 2026-11-25 10:21 UTC · original

Fixed in 0d20521: the tracing::warn! literal in Host::target (crates/victory-gpu/src/host.rs) had the next line's indentation inside it; it now reads as one sentence. No other change; clippy (default and all features) is clean on this head. The shared CheckFeatureSupport query is left as it is. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-25 10:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7159589296) Fixed in `0d20521`: the `tracing::warn!` literal in `Host::target` (`crates/victory-gpu/src/host.rs`) had the next line's indentation inside it; it now reads as one sentence. No other change; clippy (default and all features) is clean on this head. The shared `CheckFeatureSupport` query is left as it is. AI-assisted.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-26 05:07 UTC · original

Merged current main (63bcca4) in, with no rebase or force-push. Head now 91aa056, and it merges cleanly with main. The PRs above (#233,#320,#439) are merged from this head in turn. Details, conflict notes and the per-level checks are on #439 (policy ok, clippy clean, the WARP shader suite has only main's own 4 failures).

Synthetic tests only; no title data used.

AI-assisted

**@⁠r4tedx** on GitHub · 2026-11-26 05:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7183205085) Merged current `main` (`63bcca4`) in, with no rebase or force-push. Head now **`91aa056`**, and it merges cleanly with `main`. The PRs above (#233,#320,#439) are merged from this head in turn. Details, conflict notes and the per-level checks are on #439 (policy ok, clippy clean, the WARP shader suite has only `main`'s own 4 failures). Synthetic tests only; no title data used. AI-assisted
Author
Owner

@⁠r4tedx on GitHub · 2026-11-26 05:14 UTC · original

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 0f6dec04 has the fix: 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** on GitHub · 2026-11-26 05:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7183301553) 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 `0f6dec04` has the fix: 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
Author
Owner

@⁠r4tedx on GitHub · 2026-11-26 05:18 UTC · original

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 fbfd3c67 has the fix: 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** on GitHub · 2026-11-26 05:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#issuecomment-7183373247) 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 `fbfd3c67` has the fix: 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
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 12:39 UTC · original · approved these changes

Reviewed and verified at head fbfd3c67 against origin/main (63bcca43) on Windows 11 across both an NVIDIA RTX 5090 (wave32-only: 32-32) and WARP (4-4), with VICTORY_D3D12_DEBUG=1 and Windows SDK dxil.dll:

  • Design & correctness:
    • Host::target() (crates/victory-gpu/src/host.rs:1074-1105) and emit::host::Host::target() (crates/victory-shader/src/emit/host.rs:201-221) query D3D12_FEATURE_D3D12_OPTIONS1 once (WaveOps && WaveLaneCountMin > 0), fall back cleanly to Target::ANY (4..=128), and warn clearly when 64-lane waves are absent.
    • shader_cache::host_key (crates/victory-gpu/src/shader_cache.rs:84-114) hashes build || target.key() (lanes_min || lanes_max) with BLAKE3 so shader cache entries are isolated per host wave range; victory translate --cache (apps/victory/src/translate.rs:360, 392) uses the same host_target() and conflicts with --host-lanes (apps/victory/src/main.rs:108), preventing mismatched warm-up entries.
    • s.wave_size is only set in Lower::new (crates/victory-shader/src/emit/lower.rs:606) before Lower::run (lower.rs:1298-1314) checks !self.x.target.runs(n), so every compute program declaring an unsupported wave size (cross-lane operations or single-wave barrierless LDS) stops cleanly at translation with a concrete reason instead of emitting DXIL refused at pipeline creation. Programs without lane-layout dependence and hosts supporting 64-lane waves are unaffected.
    • File-size check: crates/victory-shader/src/emit/lower.rs is 521,592 bytes (2,696 bytes below the 512 KiB policy limit).
  • Verification:
    • Clean git merge-tree against origin/main (63bcca43); cargo xtask policy (191 files ok); cargo clippy --workspace --all-targets --locked -- -D warnings clean with both default features and --all-features.
    • RTX 5090 + SDK dxil.dll: emit::tests::what_translates_for_the_host_creates_a_pipeline prints host waves 32-32 and passes (wave32 creates a pipeline, wave64 stops at translation, and the Target::ANY wave64 fallback is confirmed refused by the driver); all 3 new emit::tests wave tests pass; crosslane_tests + waterfall_tests + valu_tests + bvh_tests + semantics_tests 93 passed, 0 failed, 1 ignored; apps/victory 14 unit + 4 integration passed; victory-gpu (--features diagnostics, VICTORY_D3D12_DEBUG=1) shader_cache::tests + draw::tests 25/25 passed.
    • WARP (VICTORY_WARP=1, VICTORY_D3D12_WARP=1, VICTORY_D3D12_DEBUG=1): emit::tests::what_translates_for_the_host_creates_a_pipeline prints host waves 4-4 and passes; victory-gpu shader_cache::tests + draw::tests 25/25 passed.

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 12:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/223#pullrequestreview-6074270558) · **approved these changes** Reviewed and verified at head `fbfd3c67` against `origin/main` (`63bcca43`) on Windows 11 across both an NVIDIA RTX 5090 (wave32-only: `32-32`) and WARP (`4-4`), with `VICTORY_D3D12_DEBUG=1` and Windows SDK `dxil.dll`: - **Design & correctness**: - `Host::target()` (`crates/victory-gpu/src/host.rs:1074-1105`) and `emit::host::Host::target()` (`crates/victory-shader/src/emit/host.rs:201-221`) query `D3D12_FEATURE_D3D12_OPTIONS1` once (`WaveOps && WaveLaneCountMin > 0`), fall back cleanly to `Target::ANY` (`4..=128`), and warn clearly when 64-lane waves are absent. - `shader_cache::host_key` (`crates/victory-gpu/src/shader_cache.rs:84-114`) hashes `build || target.key()` (`lanes_min || lanes_max`) with BLAKE3 so shader cache entries are isolated per host wave range; `victory translate --cache` (`apps/victory/src/translate.rs:360, 392`) uses the same `host_target()` and conflicts with `--host-lanes` (`apps/victory/src/main.rs:108`), preventing mismatched warm-up entries. - `s.wave_size` is only set in `Lower::new` (`crates/victory-shader/src/emit/lower.rs:606`) before `Lower::run` (`lower.rs:1298-1314`) checks `!self.x.target.runs(n)`, so every compute program declaring an unsupported wave size (cross-lane operations or single-wave barrierless LDS) stops cleanly at translation with a concrete reason instead of emitting DXIL refused at pipeline creation. Programs without lane-layout dependence and hosts supporting 64-lane waves are unaffected. - File-size check: `crates/victory-shader/src/emit/lower.rs` is **521,592 bytes** (2,696 bytes below the 512 KiB policy limit). - **Verification**: - Clean `git merge-tree` against `origin/main` (`63bcca43`); `cargo xtask policy` (`191 files ok`); `cargo clippy --workspace --all-targets --locked -- -D warnings` clean with both default features and `--all-features`. - **RTX 5090 + SDK `dxil.dll`**: `emit::tests::what_translates_for_the_host_creates_a_pipeline` prints `host waves 32-32` and passes (wave32 creates a pipeline, wave64 stops at translation, and the `Target::ANY` wave64 fallback is confirmed refused by the driver); all 3 new `emit::tests` wave tests pass; `crosslane_tests` + `waterfall_tests` + `valu_tests` + `bvh_tests` + `semantics_tests` **93 passed, 0 failed, 1 ignored**; `apps/victory` **14 unit + 4 integration** passed; `victory-gpu` (`--features diagnostics`, `VICTORY_D3D12_DEBUG=1`) `shader_cache::tests` + `draw::tests` **25/25** passed. - **WARP (`VICTORY_WARP=1`, `VICTORY_D3D12_WARP=1`, `VICTORY_D3D12_DEBUG=1`)**: `emit::tests::what_translates_for_the_host_creates_a_pipeline` prints `host waves 4-4` and passes; `victory-gpu` `shader_cache::tests` + `draw::tests` **25/25** passed. LGTM.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/223/head:github-bot/gh-223'
git switch 'github-bot/gh-223'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-223'
git switch 'github-bot/gh-223'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-223'
git switch 'github-bot/gh-223'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-223'
git switch 'main'
git merge --squash 'github-bot/gh-223'
git switch 'main'
git merge --ff-only 'github-bot/gh-223'
git switch 'main'
git merge 'github-bot/gh-223'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!223
No description provided.