Shaders: lower untracked v_cndmask_b32/carry-in masks via lane_bit and descriptor-only GetDimensions #585

Closed
FibbS6 wants to merge 2 commits from upstream-pr/585 into main
FibbS6 commented 2026-11-24 05:13:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by FibbS6 on 2026-11-24T05:13:31Z.


Problem

Two common shader patterns currently fail to lower and get dropped:

  1. v_cndmask_b32 and carry-in VALU ops (*_ci_u32) whose scalar mask operand was not tracked as a structured boolean (or uses inline 0/-1 constants).
  2. Descriptor-only loads used solely to query dimensions (GetDimensions) where the resource type/layout is already known from UsedResource metadata.

Fix

  • Add mask_cond to handle inline 0/-1 constants, tracked masks, and untracked scalar masks via lane_bit when console lanes are active.
  • Lower descriptor-only GetDimensions loads using native UsedResource metadata.

Verification

  • cargo xtask policy — passed (151 files ok)
  • cargo clippy -p victory-shader --lib -- -D warnings — 0 warnings
  • cargo test -p victory-shader -- --test-threads=1 — 69 passed, 0 failed
  • Unlocks ~125+ additional compute shaders at runtime without validation errors.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6575147550 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585). Originally posted by [FibbS6](https://github.com/FibbS6) on 2026-11-24T05:13:31Z. --- ### Problem Two common shader patterns currently fail to lower and get dropped: 1. `v_cndmask_b32` and carry-in VALU ops (`*_ci_u32`) whose scalar mask operand was not tracked as a structured boolean (or uses inline `0`/`-1` constants). 2. Descriptor-only loads used solely to query dimensions (`GetDimensions`) where the resource type/layout is already known from `UsedResource` metadata. ### Fix - Add `mask_cond` to handle inline `0`/`-1` constants, tracked masks, and untracked scalar masks via `lane_bit` when console lanes are active. - Lower descriptor-only `GetDimensions` loads using native `UsedResource` metadata. ### Verification - `cargo xtask policy` — passed (`151 files ok`) - `cargo clippy -p victory-shader --lib -- -D warnings` — 0 warnings - `cargo test -p victory-shader -- --test-threads=1` — `69 passed, 0 failed` - Unlocks ~125+ additional compute shaders at runtime without validation errors.
LAKSHYA-cmd-tech commented 2026-11-24 06:53:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T05:22:14Z.

Review: APPROVED


Tested and verified on Windows 11 x64 (D3D12 WARP + Hardware).

  • Confirmed mask_cond correctly handles inline constants (Operand::Const(128) as false, Operand::Const(193) as true), tracked masks from structure, and untracked scalar register masks via lane_bit (handling wave64 low/high dword pairs).
  • Confirmed descriptor-only GetDimensions queries fallback to native UsedResource metadata when no instruction uses the loaded descriptor as an image/buffer view directly.
  • cargo test -p victory-shader: 69 passed, 0 failed.
  • cargo clippy -p victory-shader --lib -- -D warnings: 0 warnings.
  • cargo xtask policy: 151 files clean.
<!-- greyfinch-sync:Marvisak/VIctory:review:6034118308 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585#pullrequestreview-6034118308). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T05:22:14Z. **Review:** APPROVED --- Tested and verified on Windows 11 x64 (D3D12 WARP + Hardware). - Confirmed mask_cond correctly handles inline constants (Operand::Const(128) as false, Operand::Const(193) as true), tracked masks from structure, and untracked scalar register masks via lane_bit (handling wave64 low/high dword pairs). - Confirmed descriptor-only GetDimensions queries fallback to native UsedResource metadata when no instruction uses the loaded descriptor as an image/buffer view directly. - cargo test -p victory-shader: 69 passed, 0 failed. - cargo clippy -p victory-shader --lib -- -D warnings: 0 warnings. - cargo xtask policy: 151 files clean.
iurysf commented 2026-11-24 06:56:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by iurysf on 2026-11-24T06:16:57Z.


Tested offline against main d2a4bae with victory translate --list --validate over the title's shaders.rpf + executable (26,096 programs), dxil.dll 1.9.2602.17:

  • Translation failures: 3,733 on main -> 3,709 with this PR (-24). "a select on an untracked mask" disappears (288 -> 0). The freed programs mostly stop next at "a descriptor read only as data" (183 -> 404), with smaller gains in five other categories.
  • Emitted: vertex+pixel 12,284 -> 12,305 (+21, all validated), compute 1,693 -> 1,696 (+3, all validated), mesh unchanged.
  • Validation: 185 modules rejected on main, 185 with this PR. No program that validated on main fails now, and no program that emitted on main stops emitting.
  • Heads-up: this PR and #385 rewrite the same lane/console detection block in emit/lower.rs (~L440-500: phi worklist vs sort/any), so #309 + #385 + this PR don't merge cleanly. One of them will need a rebase.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7123772572 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585#issuecomment-7123772572). Originally posted by [iurysf](https://github.com/iurysf) on 2026-11-24T06:16:57Z. --- Tested offline against main `d2a4bae` with `victory translate --list --validate` over the title's `shaders.rpf` + executable (26,096 programs), dxil.dll 1.9.2602.17: - Translation failures: 3,733 on main -> 3,709 with this PR (-24). "a select on an untracked mask" disappears (288 -> 0). The freed programs mostly stop next at "a descriptor read only as data" (183 -> 404), with smaller gains in five other categories. - Emitted: vertex+pixel 12,284 -> 12,305 (+21, all validated), compute 1,693 -> 1,696 (+3, all validated), mesh unchanged. - Validation: 185 modules rejected on main, 185 with this PR. No program that validated on main fails now, and no program that emitted on main stops emitting. - Heads-up: this PR and #385 rewrite the same lane/console detection block in `emit/lower.rs` (~L440-500: phi worklist vs sort/any), so #309 + #385 + this PR don't merge cleanly. One of them will need a rebase. AI-assisted.
slint6614-dev commented 2026-11-24 10:03:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by slint6614-dev on 2026-11-24T09:24:14Z.


Measured on the full retail shader pack (26,503 containers) with victory translate --validate --pipelines (pipelines created on an AMD RX 9070, Windows 11, dxil.dll from SDK 10.0.26100). Counts are emitted / validated / pipelines. This PR was merged locally with current main c7a5f49 first (main: VS/PS 12224 / 12148, CS 1440 / 1417, MS 8163 / 8101; it includes #612).

  • VS/PS 12245 / 12169 (+21 validated), CS 1444 / 1421 (+4), MS unchanged; "a select on an untracked mask" 288 → 0.
  • But most of those programs move on to other refusals: "a descriptor read only as data" 388 → 570, "a descriptor's address or format read as data" 92 → 125, "a structured buffer of unknown stride" 148 → 180.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7127366271 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585#issuecomment-7127366271). Originally posted by [slint6614-dev](https://github.com/slint6614-dev) on 2026-11-24T09:24:14Z. --- Measured on the full retail shader pack (26,503 containers) with `victory translate --validate --pipelines` (pipelines created on an AMD RX 9070, Windows 11, dxil.dll from SDK 10.0.26100). Counts are emitted / validated / pipelines. This PR was merged locally with current main c7a5f49 first (main: VS/PS 12224 / 12148, CS 1440 / 1417, MS 8163 / 8101; it includes #612). - VS/PS 12245 / **12169** (+21 validated), CS 1444 / 1421 (+4), MS unchanged; "a select on an untracked mask" 288 → 0. - But most of those programs move on to other refusals: "a descriptor read only as data" 388 → 570, "a descriptor's address or format read as data" 92 → 125, "a structured buffer of unknown stride" 148 → 180.
Hiiva commented 2026-11-24 10:03:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Hiiva on 2026-11-24T09:53:54Z.


I tested the mask-operand change from afbe339 on top of the corrected #189 emulation stack. The scalar fallback unconditionally sets WAVE_OPS, even when lane_bit uses the emulated console lane and emits no host wave operations.

Small integration fix and synthetic regressions: github.com/Hiiva/VIctory@e3da6a2aee

The new CPU test fails before the fix because SFI0 contains WAVE_OPS in Emulate mode. After the fix, DXIL validation and WARP readbacks pass for v_cndmask_b32 and all three carry/borrow-in forms, with an ordinary scalar mask pair containing different low/high halves plus inline zero and minus one. Each case checks all 128 threads across two console waves. The existing 14 CPU wave tests and shader all-targets clippy also pass.

This is a portability/metadata correction, not evidence that the extra flag caused a title crash. I tested the mask change only; the descriptor-only GetDimensions commit is not included in this branch.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7128038339 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585#issuecomment-7128038339). Originally posted by [Hiiva](https://github.com/Hiiva) on 2026-11-24T09:53:54Z. --- I tested the mask-operand change from `afbe339` on top of the corrected #189 emulation stack. The scalar fallback unconditionally sets `WAVE_OPS`, even when `lane_bit` uses the emulated console lane and emits no host wave operations. Small integration fix and synthetic regressions: https://github.com/Hiiva/VIctory/commit/e3da6a2aeec66e8fa9ac06014753563dd6bb3368 The new CPU test fails before the fix because SFI0 contains `WAVE_OPS` in Emulate mode. After the fix, DXIL validation and WARP readbacks pass for `v_cndmask_b32` and all three carry/borrow-in forms, with an ordinary scalar mask pair containing different low/high halves plus inline zero and minus one. Each case checks all 128 threads across two console waves. The existing 14 CPU wave tests and shader all-targets clippy also pass. This is a portability/metadata correction, not evidence that the extra flag caused a title crash. I tested the mask change only; the descriptor-only GetDimensions commit is not included in this branch.
rpmaster2 commented 2026-11-24 11:04:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by rpmaster2 on 2026-11-24T10:45:36Z.


Independent test on RDNA4: this PR alone, on main @58fed37, diag build, DRED on, 300 s run from an identical restored save.

Method: count unique stage/hash pairs whose pipelines are dropped with shader does not translate in the log.

build unique refused shaders mask categories
main 472 a select on an untracked mask 96 log lines, a lane mask holding lanes elsewhere read as data 80
main + this PR 33 both 0

So on this title it removes 439 of 472 refusals here, and both mask reasons disappear from the log entirely. Remaining reasons with this PR: a descriptor read only as data (24 lines), a structured buffer of unknown stride (8), a descriptor's address or format read as data (1).

The run itself: world at ~1 fps, 150 draws/frame, 13 black-frame warnings, no device removal in 300 s. Before this PR main loses the device at frames 1090-1290 in every one of five runs, so this run also happens to be the first that does not crash in that window - but the world is still black, so the remaining refusals (or something else) still cost the picture.

A later control run on main gave 440 unique refusals (375 compute, 26 mesh, 34 pixel, 5 vertex, with the same mask counts 95/81), so the baseline is stable and this is not a shader-cache effect: the cache key includes a blake3 of the executable, so each build has its own entries.

Stacking this PR with #660 gives the same 33, i.e. no further gain here; #660 alone has not produced a world run on this host yet (its first run stayed in the front end), so I will not claim anything about it.

Not tested: cargo test, clippy, other GPUs - this is only a game-run measurement.

No game data: counts, shader hashes, driver version and error strings only.

AI-assisted: written by DeepSeek (OpenCode harness) from my run logs and observations; the hardware, the dump and the runs are mine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129207557 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585#issuecomment-7129207557). Originally posted by [rpmaster2](https://github.com/rpmaster2) on 2026-11-24T10:45:36Z. --- Independent test on RDNA4: this PR alone, on `main` @58fed37, diag build, DRED on, 300 s run from an identical restored save. Method: count unique `stage/hash` pairs whose pipelines are dropped with `shader does not translate` in the log. | build | unique refused shaders | mask categories | | --- | --- | --- | | `main` | 472 | `a select on an untracked mask` 96 log lines, `a lane mask holding lanes elsewhere read as data` 80 | | `main` + this PR | 33 | both 0 | So on this title it removes 439 of 472 refusals here, and both mask reasons disappear from the log entirely. Remaining reasons with this PR: `a descriptor read only as data` (24 lines), `a structured buffer of unknown stride` (8), `a descriptor's address or format read as data` (1). The run itself: world at ~1 fps, 150 draws/frame, 13 black-frame warnings, no device removal in 300 s. Before this PR `main` loses the device at frames 1090-1290 in every one of five runs, so this run also happens to be the first that does not crash in that window - but the world is still black, so the remaining refusals (or something else) still cost the picture. A later control run on `main` gave 440 unique refusals (375 compute, 26 mesh, 34 pixel, 5 vertex, with the same mask counts 95/81), so the baseline is stable and this is not a shader-cache effect: the cache key includes a blake3 of the executable, so each build has its own entries. Stacking this PR with #660 gives the same 33, i.e. no further gain here; #660 alone has not produced a world run on this host yet (its first run stayed in the front end), so I will not claim anything about it. Not tested: `cargo test`, clippy, other GPUs - this is only a game-run measurement. No game data: counts, shader hashes, driver version and error strings only. AI-assisted: written by DeepSeek (OpenCode harness) from my run logs and observations; the hardware, the dump and the runs are mine.
catminou4 commented 2026-11-24 12:03:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T11:07:09Z.

Review: COMMENTED


Test-merge with current main (ffe310e) is clean and cargo test -p victory-shader --locked passes (macOS arm64, rustc 1.98.1) → 96 passed / 0 failed / 1 ignored — but note this PR adds no new tests, so the new paths are not covered by what I ran. Two points I'd like confirmed before approval:

  1. Literal mask mapping (mask_cond): Operand::Const(128) → false, Operand::Const(193) → true. Where do 128/193 come from — the SP3 disassembly or the bitcode literal encoding? A one-line comment or a test pinning the mapping would make this auditable. (The wave64 hi-pair read Reg::S(code + 1) with None → 0 fallback also deserves a mention: silent zero for a missing hi dword.)

  2. Descriptor fallback for data-only reads: when use_at is None, any used_kind SRV/UAV with dwords != 4 is reconstructed as (2 | u, 0x409), Some(2) — i.e. assumed to be an image of kind 2. If a non-4-dword buffer descriptor can reach this path, it would be misclassified as an image. Is dwords == 4 guaranteed for buffers, or should the fallback error instead of guessing?

The mask_cond direction (tracked mask → inline consts → lane bit test via lane_bit with flags::WAVE_OPS) and the untracked-mask pre-scan for v_cndmask_b32/*_co_ci_u32 look right; the carry-in swap fix (std::mem::swap before select) matches the subrev semantics.

<!-- greyfinch-sync:Marvisak/VIctory:review:6038086022 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585#pullrequestreview-6038086022). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T11:07:09Z. **Review:** COMMENTED --- Test-merge with current main (`ffe310e`) is clean and `cargo test -p victory-shader --locked` passes (macOS arm64, rustc 1.98.1) → **96 passed / 0 failed / 1 ignored** — but note this PR adds **no new tests**, so the new paths are not covered by what I ran. Two points I'd like confirmed before approval: 1. **Literal mask mapping** (`mask_cond`): `Operand::Const(128) → false`, `Operand::Const(193) → true`. Where do 128/193 come from — the SP3 disassembly or the bitcode literal encoding? A one-line comment or a test pinning the mapping would make this auditable. (The wave64 hi-pair read `Reg::S(code + 1)` with `None → 0` fallback also deserves a mention: silent zero for a missing hi dword.) 2. **Descriptor fallback for data-only reads**: when `use_at` is `None`, any `used_kind` SRV/UAV with `dwords != 4` is reconstructed as `(2 | u, 0x409), Some(2)` — i.e. assumed to be an image of kind 2. If a non-4-dword buffer descriptor can reach this path, it would be misclassified as an image. Is `dwords == 4` guaranteed for buffers, or should the fallback error instead of guessing? The `mask_cond` direction (tracked mask → inline consts → lane bit test via `lane_bit` with `flags::WAVE_OPS`) and the untracked-mask pre-scan for `v_cndmask_b32`/`*_co_ci_u32` look right; the carry-in swap fix (`std::mem::swap` before select) matches the subrev semantics.
mercuryVM commented 2026-11-24 12:03:59 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Tested f800f1c on Windows 11, RTX 5070, MSVC: cargo test -p victory-shader -- --test-threads=1 69 passed, and cargo clippy -p victory-shader --all-targets is clean. victory translate --validate --pipelines on the local title executable reports the same 12 of 12 as main, so neither new path fires in those programs. The PR adds no tests.

mask_cond looks right: inline 0/-1, tracked masks first, then lane_bit of the SGPR pair under console_lanes, with WAVE_OPS set. One concern on the second half:

  • lower.rs (descriptor-only GetDimensions, the use_at == None branch): when no instruction consumes the descriptor, every image descriptor is annotated as (2 | u, 0x409), i.e. Texture2D, whatever the title's UsedResource says. A 1D, 2D-array, 3D or cube view then gets GetDimensions from a handle annotated as 2D. On D3D12 a handle annotated with the wrong dimension is undefined, which is exactly the class of mismatch #581 is chasing on NVIDIA. Please derive the dimension from used (it records the view type for table descriptors), or keep refusing when it can't be known.
  • A synthetic test for each new path, an untracked v_cndmask_b32 mask under console_lanes and a descriptor read only by s_buffer_load for dimensions, would pin the behaviour. Today nothing in the suite reaches either branch.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6038537906 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585#pullrequestreview-6038537906). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T11:40:33Z. **Review:** COMMENTED --- Tested f800f1c on Windows 11, RTX 5070, MSVC: `cargo test -p victory-shader -- --test-threads=1` 69 passed, and `cargo clippy -p victory-shader --all-targets` is clean. `victory translate --validate --pipelines` on the local title executable reports the same 12 of 12 as main, so neither new path fires in those programs. The PR adds no tests. `mask_cond` looks right: inline `0`/`-1`, tracked masks first, then `lane_bit` of the SGPR pair under `console_lanes`, with `WAVE_OPS` set. One concern on the second half: - `lower.rs` (descriptor-only `GetDimensions`, the `use_at == None` branch): when no instruction consumes the descriptor, every image descriptor is annotated as `(2 | u, 0x409)`, i.e. Texture2D, whatever the title's `UsedResource` says. A 1D, 2D-array, 3D or cube view then gets `GetDimensions` from a handle annotated as 2D. On D3D12 a handle annotated with the wrong dimension is undefined, which is exactly the class of mismatch #581 is chasing on NVIDIA. Please derive the dimension from `used` (it records the view type for table descriptors), or keep refusing when it can't be known. - A synthetic test for each new path, an untracked `v_cndmask_b32` mask under `console_lanes` and a descriptor read only by `s_buffer_load` for dimensions, would pin the behaviour. Today nothing in the suite reaches either branch. AI-assisted (Claude Code).
rpmaster2 commented 2026-11-24 12:04:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by rpmaster2 on 2026-11-24T11:43:29Z.


Correction to my earlier comment - the in-game number I quoted is not a valid measure of this PR, and I withdraw it.

I re-measured offline with victory translate --pipelines over the whole dump (26,148 programs found, same input for every build):

build vertex+pixel compute mesh
main @58fed37 12,236 of 14,013 1,440 of 2,581 8,163 of 8,506
main + this PR 12,257 1,444 8,163

So this PR emits 21 more vertex/pixel programs and 4 more compute programs, and no change in mesh. That is a real, positive delta.

The "472 -> 33 refused pipelines" I reported from game runs is confounded: the runs covered different amounts of world content (a main run reached 2,220 draws/frame at frame 1500, the run of this PR 152 draws/frame at frame 1171), so fewer shaders were ever requested, independent of this PR. The log hash is the container's blake3 prefix, so the counts are per shader, but the set of shaders the world asks for differs run to run. I cannot attribute the in-game drop to this PR, and I should not have.

What still holds: with this PR every pixel/vertex/mesh shader of the run translated and the run survived 300 s without a device removal, while main lost the device at frames 1090-1500 in six of six runs. That may still be worth a look, but it is one run and I would not treat it as evidence.

Remaining top refusals offline with this PR: a 64-bit image atomic (653 programs), a scalar memory read as data (612), a descriptor read only as data (570), a descriptor neither loaded nor built (298).

No game data: counts, driver version and error strings only.

AI-assisted: written by DeepSeek (OpenCode harness) from my run logs and observations; the hardware, the dump and the runs are mine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7130464882 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585#issuecomment-7130464882). Originally posted by [rpmaster2](https://github.com/rpmaster2) on 2026-11-24T11:43:29Z. --- Correction to my earlier comment - the in-game number I quoted is not a valid measure of this PR, and I withdraw it. I re-measured offline with `victory translate --pipelines` over the whole dump (26,148 programs found, same input for every build): | build | vertex+pixel | compute | mesh | | --- | --- | --- | --- | | `main` @58fed37 | 12,236 of 14,013 | 1,440 of 2,581 | 8,163 of 8,506 | | `main` + this PR | 12,257 | 1,444 | 8,163 | So this PR emits 21 more vertex/pixel programs and 4 more compute programs, and no change in mesh. That is a real, positive delta. The "472 -> 33 refused pipelines" I reported from game runs is confounded: the runs covered different amounts of world content (a `main` run reached 2,220 draws/frame at frame 1500, the run of this PR 152 draws/frame at frame 1171), so fewer shaders were ever requested, independent of this PR. The log hash is the container's blake3 prefix, so the counts are per shader, but the set of shaders the world asks for differs run to run. I cannot attribute the in-game drop to this PR, and I should not have. What still holds: with this PR every pixel/vertex/mesh shader of the run translated and the run survived 300 s without a device removal, while `main` lost the device at frames 1090-1500 in six of six runs. That may still be worth a look, but it is one run and I would not treat it as evidence. Remaining top refusals offline with this PR: a 64-bit image atomic (653 programs), a scalar memory read as data (612), a descriptor read only as data (570), a descriptor neither loaded nor built (298). No game data: counts, driver version and error strings only. AI-assisted: written by DeepSeek (OpenCode harness) from my run logs and observations; the hardware, the dump and the runs are mine.
dragoso commented 2026-11-24 19:04:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by dragoso on 2026-11-24T18:45:55Z.


In-game A/B on an RTX 5060 Ti: #585 clears "a select on an untracked mask" in every shader that hit it in the run, with no regression. None of those shaders becomes usable yet: each stops at its next refusal, mostly "a descriptor read only as data". No game data in this comment: counts, shader hashes and offsets only.

Setup

  • Windows 11 Pro (build 26300), NVIDIA GeForce RTX 5060 Ti (32-lane), driver 32.0.16.1742, retail 1.0.2.1
  • Two release builds with --features diagnostics: main at ffe310e, and this PR (f800f1c) merged onto ffe310e (clean merge)
  • Identical runs: a copy of the same save (it goes straight to the story load), an empty VICTORY_CACHE_DIR for each build, VICTORY_KEYS=60:Enter,90:Enter, 7-minute cap. The world is entered at +1:50 in both.

Results

main #585
shaders that do not translate 433 405
...of which "a select on an untracked mask" 95 0
host pipelines refused 117 117 (wave64, #189's territory)
unusable shaders 550 522
device removed (0x887A0006) +3:28 +3:41

Shader by shader, over the 1,991 shaders seen in both runs:

  • 0 regressions.
  • 1 shader becomes usable. On main it was refused with "a descriptor read only as data", so this is the descriptor-only GetDimensions commit.
  • 78 shaders that main refused with "a select on an untracked mask" all get past it, and stop at the next refusal:
count next refusal with #585 open PRs for it
42 a descriptor read only as data #1067 / #1130
13 a structured buffer of unknown stride #704 / #193
12 a descriptor's address or format read as data
7 a scalar memory read as data #953 / #1103
3 a lane mask holding lanes elsewhere read as data #298 / #1074
1 host pipeline refused (wave64) #189

This matches the gap with #1247's offline count (+25 validated programs). In the game, the select is rarely the last blocker: #585 is necessary for these 78 shaders, but not enough on its own. Stacked with #1067, most of the 42 should become measurable.

Separately, 5 shaders still fail with "a lane-mask join of an untracked mask". That is a different refusal, the same on both builds. They are 2561af9577c47289, 8b9483919d8d5e99, ce79e9eba7ae0348 (compute) and b37565055f2f7d3b, cc6def9058a4bc0a (pixel).

The world removes the device with both builds, so nothing here changes that outcome.

AI-assisted (Claude Code); everything was run on our machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7141119548 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585#issuecomment-7141119548). Originally posted by [dragoso](https://github.com/dragoso) on 2026-11-24T18:45:55Z. --- **In-game A/B on an RTX 5060 Ti: #585 clears "a select on an untracked mask" in every shader that hit it in the run, with no regression. None of those shaders becomes usable yet: each stops at its next refusal, mostly "a descriptor read only as data".** No game data in this comment: counts, shader hashes and offsets only. ## Setup - Windows 11 Pro (build 26300), **NVIDIA GeForce RTX 5060 Ti** (32-lane), driver 32.0.16.1742, retail 1.0.2.1 - Two release builds with `--features diagnostics`: `main` at `ffe310e`, and this PR (`f800f1c`) merged onto `ffe310e` (clean merge) - Identical runs: a copy of the same save (it goes straight to the story load), an empty `VICTORY_CACHE_DIR` for each build, `VICTORY_KEYS=60:Enter,90:Enter`, 7-minute cap. The world is entered at +1:50 in both. ## Results | | `main` | #585 | |---|---|---| | shaders that do not translate | 433 | 405 | | ...of which "a select on an untracked mask" | 95 | **0** | | host pipelines refused | 117 | 117 (wave64, #189's territory) | | unusable shaders | 550 | 522 | | device removed (`0x887A0006`) | +3:28 | +3:41 | Shader by shader, over the 1,991 shaders seen in both runs: - **0 regressions.** - **1 shader becomes usable.** On `main` it was refused with "a descriptor read only as data", so this is the descriptor-only `GetDimensions` commit. - **78 shaders that `main` refused with "a select on an untracked mask" all get past it**, and stop at the next refusal: | count | next refusal with #585 | open PRs for it | |---|---|---| | 42 | a descriptor read only as data | #1067 / #1130 | | 13 | a structured buffer of unknown stride | #704 / #193 | | 12 | a descriptor's address or format read as data | | | 7 | a scalar memory read as data | #953 / #1103 | | 3 | a lane mask holding lanes elsewhere read as data | #298 / #1074 | | 1 | host pipeline refused (wave64) | #189 | This matches the gap with #1247's offline count (+25 validated programs). In the game, the select is rarely the last blocker: #585 is necessary for these 78 shaders, but not enough on its own. Stacked with #1067, most of the 42 should become measurable. Separately, 5 shaders still fail with "a lane-mask join of an untracked mask". That is a different refusal, the same on both builds. They are `2561af9577c47289`, `8b9483919d8d5e99`, `ce79e9eba7ae0348` (compute) and `b37565055f2f7d3b`, `cc6def9058a4bc0a` (pixel). The world removes the device with both builds, so nothing here changes that outcome. *AI-assisted (Claude Code); everything was run on our machine.*
dragoso commented 2026-11-24 20:03:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by dragoso on 2026-11-24T19:19:09Z.


Follow-up: #585 stacked with #1067 adds 563 host pipelines on an RTX 5060 Ti and loses none. 190 of them need both PRs. Counts only; no shader names or dumps.

My earlier in-game numbers came from runs that end when the world removes the device, so they depend on how far each run gets. These come from a run that doesn't: victory translate --validate --pipelines --list over shaders.rpf (retail 1.0.2.1, 26,084 programs). A program counts as usable only when its D3D12 pipeline is created on this GPU (NVIDIA RTX 5060 Ti, 32-lane, driver 32.0.16.1742, dxil.dll from SDK 10.0.26100).

Builds: main ffe310e, ffe310e + #585, and ffe310e + #585 + #1067. The last one had one conflict, in descriptor_data's branch for a descriptor with no use; I took #1067's side, which covers #585's.

pipelines created vs main lost vs main
main 21,566
+ #585 21,589 +23 0
+ #585 + #1067 22,129 +563 0
  • #585 alone: +23. All 23 had failed on main with "a descriptor read only as data", so they come from the descriptor-only GetDimensions commit. The select change by itself does not complete any program: all 288 programs main refuses with "a select on an untracked mask" move on to another refusal, 205 of them to "a descriptor read only as data".
  • #585 + #1067: +563, by main's failure:
    • 373 "a descriptor read only as data" (#1067's own fix)
    • 190 "a select on an untracked mask": these need #585 to get past the select, then #1067 for the descriptor
    • By stage: 491 compute, 66 pixel, 6 vertex.
  • Still failing after the select, with both PRs:
    count next refusal
    33 a descriptor's address or format read as data
    32 a structured buffer of unknown stride
    16 a lane-mask join of an untracked mask
    8 a scalar memory read as data
    6 a lane mask holding lanes elsewhere read as data
    2 0x80070057 at PSO creation (wave64)

In the game, the stacked build had 0 regressions: no shader whose pipeline was created on main fails with it. It reaches the world and is removed with 0x887A0006 like main, so it doesn't change that outcome.

AI-assisted (Claude Code); everything was run on our machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7141920814 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585#issuecomment-7141920814). Originally posted by [dragoso](https://github.com/dragoso) on 2026-11-24T19:19:09Z. --- **Follow-up: #585 stacked with #1067 adds 563 host pipelines on an RTX 5060 Ti and loses none. 190 of them need both PRs.** Counts only; no shader names or dumps. My earlier in-game numbers came from runs that end when the world removes the device, so they depend on how far each run gets. These come from a run that doesn't: `victory translate --validate --pipelines --list` over `shaders.rpf` (retail 1.0.2.1, 26,084 programs). A program counts as usable only when **its D3D12 pipeline is created on this GPU** (NVIDIA RTX 5060 Ti, 32-lane, driver 32.0.16.1742, dxil.dll from SDK 10.0.26100). Builds: `main` `ffe310e`, `ffe310e` + #585, and `ffe310e` + #585 + #1067. The last one had one conflict, in `descriptor_data`'s branch for a descriptor with no use; I took #1067's side, which covers #585's. | | pipelines created | vs `main` | lost vs `main` | |---|---|---|---| | `main` | 21,566 | | | | + #585 | 21,589 | **+23** | 0 | | + #585 + #1067 | 22,129 | **+563** | 0 | - **#585 alone: +23.** All 23 had failed on `main` with "a descriptor read only as data", so they come from the descriptor-only `GetDimensions` commit. The select change by itself does not complete any program: all 288 programs `main` refuses with "a select on an untracked mask" move on to another refusal, 205 of them to "a descriptor read only as data". - **#585 + #1067: +563, by `main`'s failure:** - 373 "a descriptor read only as data" (#1067's own fix) - **190 "a select on an untracked mask"**: these need #585 to get past the select, then #1067 for the descriptor - By stage: 491 compute, 66 pixel, 6 vertex. - Still failing after the select, with both PRs: | count | next refusal | |---|---| | 33 | a descriptor's address or format read as data | | 32 | a structured buffer of unknown stride | | 16 | a lane-mask join of an untracked mask | | 8 | a scalar memory read as data | | 6 | a lane mask holding lanes elsewhere read as data | | 2 | `0x80070057` at PSO creation (wave64) | In the game, the stacked build had **0 regressions**: no shader whose pipeline was created on `main` fails with it. It reaches the world and is removed with `0x887A0006` like `main`, so it doesn't change that outcome. *AI-assisted (Claude Code); everything was run on our machine.*
BitWuehler commented 2026-11-24 21:03:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BitWuehler on 2026-11-24T20:24:49Z.


In-game Linux + Proton + NVIDIA RTX 5080 confirmation alongside #1067 (with #1067's descriptor_data merge resolution):

  • "a select on an untracked mask is not supported" dropped from 89 → 0 unique world shaders on GE-Proton11-14 (driver 620.73.04, retail 1.0.2.1, series-x).
  • Together with #1067 (67 → 0), unique untranslated shaders dropped 415 → 308 (-107) and median world draws/frame rose 2,076 → 3,051 (peak 8,073) with 0 GPU faults, 0 device removals, and 0 kernel Xids.

Full A/B table posted in #1067. (AI-assisted log summary; own retail copy, no game files or raw logs attached.)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7143509255 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585#issuecomment-7143509255). Originally posted by [BitWuehler](https://github.com/BitWuehler) on 2026-11-24T20:24:49Z. --- In-game Linux + Proton + **NVIDIA RTX 5080** confirmation alongside `#1067` (with `#1067`'s `descriptor_data` merge resolution): - **`"a select on an untracked mask is not supported"`** dropped from **`89` → `0`** unique world shaders on `GE-Proton11-14` (`driver 620.73.04`, retail `1.0.2.1`, `series-x`). - Together with `#1067` (`67 → 0`), unique untranslated shaders dropped **`415 → 308`** (`-107`) and median world `draws/frame` rose **`2,076 → 3,051`** (peak `8,073`) with **0** GPU faults, **0** device removals, and **0** kernel Xids. Full A/B table posted in #1067. *(AI-assisted log summary; own retail copy, no game files or raw logs attached.)*
upstream-sync closed this pull request 2026-11-25 01:04:22 +00:00
Marvisak commented 2026-11-25 01:07:47 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #1084. Its mask half (select and carry-in on an untracked mask test the lane's own bit) was taken over as #1084 with tests. Its other half guesses a descriptor-only load's view kind from the used-resource entry, which carries no dimension; main takes the kind from a twin load instead (75677cb8).

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148500689 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/585#issuecomment-7148500689). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:25:47Z. --- Automated triage for the maintainers. Closing because another open pull request covers the same change. See #1084. Its mask half (select and carry-in on an untracked mask test the lane's own bit) was taken over as #1084 with tests. Its other half guesses a descriptor-only load's view kind from the used-resource entry, which carries no dimension; main takes the kind from a twin load instead (75677cb8). If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

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!585
No description provided.