Shaders: lane masks spilled to VGPR lanes and read back #298

Closed
permadiego wants to merge 1 commit from upstream-pr/298 into main
permadiego commented 2026-11-24 02:08:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by permadiego on 2026-11-24T02:08:08Z.


What changed

The console compiler spills lane masks like any other SGPR: v_writelane_b32 to a constant lane, then v_readlane_b32 of that lane later. In CS_RaytracingResolve, for example, a compare result (v_cmp_eq_f32 s7, 0, v21) is spilled to lane 1 of v128. Thousands of instructions later it is read back and fed to s_and_saveexec.

Two things failed on that pattern:

  • The lane pass took the read-back value for an opaque mask.
  • The spill write read the mask as data. This fails for a mask holding lanes that are not running there, such as the complement s_xor_b32 s8, s1, -1: "a lane mask holding lanes elsewhere read as data".

Changes:

  • structure.rs: a v_readlane_b32 of a constant lane is taken as the mask itself when it reads back a v_writelane_b32 of that mask. The lookup follows writes of other lanes and joins whose arguments agree, and only applies where the mask's value dominates the read. Each lane's bit is then the one it had when spilled. A wave64 mask needs both dwords read back from the same mask.
  • lower.rs (mask_spills): a read-back of this kind leaves its value to the mask's readers. The spill write is left out (the VGPR keeps its old value) when that VGPR lane is read only by such reads; no vector instruction or computed-lane read sees it. Neither instruction counts as reading the console's lanes.

This no longer depends on #54, which was closed. It applies on main alone.

Measured

victory translate --validate over the title's shaders.rpf, main ffe310e against this branch (54f97db):

main this branch
compute validated 1,417 1,424
vertex and pixel validated 12,155 12,182
mesh validated 8,152 8,152
"a lane mask holding lanes elsewhere read as data" 273 13

34 programs gain, 0 lose. Most CS_RaytracingResolve variants now stop at "a descriptor read only as data", which #180 covers.

cargo test -p victory-shader -- --skip valu_tests --skip wave_tests: 105 passed. The skipped tests and the two waterfall_tests need an SM 6.6 device, which this machine lacks (sampled() returns nothing). Clippy is clean.

Not verified

No GPU run here. @qntic's lane-spill hardware test and @Nixitov's world run were done on the earlier, #54-based head d0261f1, so they need a re-run on this head.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6572984711 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/298). Originally posted by [permadiego](https://github.com/permadiego) on 2026-11-24T02:08:08Z. --- ## What changed The console compiler spills lane masks like any other SGPR: `v_writelane_b32` to a constant lane, then `v_readlane_b32` of that lane later. In `CS_RaytracingResolve`, for example, a compare result (`v_cmp_eq_f32 s7, 0, v21`) is spilled to lane 1 of `v128`. Thousands of instructions later it is read back and fed to `s_and_saveexec`. Two things failed on that pattern: - The lane pass took the read-back value for an opaque mask. - The spill write read the mask as data. This fails for a mask holding lanes that are not running there, such as the complement `s_xor_b32 s8, s1, -1`: "a lane mask holding lanes elsewhere read as data". Changes: - **structure.rs:** a `v_readlane_b32` of a constant lane is taken as the mask itself when it reads back a `v_writelane_b32` of that mask. The lookup follows writes of other lanes and joins whose arguments agree, and only applies where the mask's value dominates the read. Each lane's bit is then the one it had when spilled. A wave64 mask needs both dwords read back from the same mask. - **lower.rs (`mask_spills`):** a read-back of this kind leaves its value to the mask's readers. The spill write is left out (the VGPR keeps its old value) when that VGPR lane is read only by such reads; no vector instruction or computed-lane read sees it. Neither instruction counts as reading the console's lanes. This no longer depends on #54, which was closed. It applies on `main` alone. ## Measured `victory translate --validate` over the title's `shaders.rpf`, `main` ffe310e against this branch (54f97db): | | `main` | this branch | |---|---|---| | compute validated | 1,417 | 1,424 | | vertex and pixel validated | 12,155 | 12,182 | | mesh validated | 8,152 | 8,152 | | "a lane mask holding lanes elsewhere read as data" | 273 | 13 | 34 programs gain, 0 lose. Most `CS_RaytracingResolve` variants now stop at "a descriptor read only as data", which #180 covers. `cargo test -p victory-shader -- --skip valu_tests --skip wave_tests`: 105 passed. The skipped tests and the two `waterfall_tests` need an SM 6.6 device, which this machine lacks (`sampled()` returns nothing). Clippy is clean. ## Not verified No GPU run here. @qntic's lane-spill hardware test and @Nixitov's world run were done on the earlier, #54-based head d0261f1, so they need a re-run on this head. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SpaghettiMaster545 commented 2026-11-24 06:55:32 +00:00 (Migrated from github.com)

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


Tested with the title at d0261f1. The branch also carries #54's three commits, so this measures #54 + this PR together.

  • NVIDIA GeForce RTX 5070 Ti, driver 621.24 (32.0.16.2124), 32-lane waves; Ryzen 7 9800X3D; Windows 11 10.0.26100; Rust 1.98.1. Diag build of the branch merged onto main d2a4bae (clean), its own empty VICTORY_CACHE_DIR, VICTORY_KEYS into story mode, until the host GPU failure (#71, unrelated); compared program by program with a main run made the same way (#400 has the setup).
  • 11 programs that stop on main translate and run, 4 of them compute programs whose pipelines the driver refused on main. 0 programs that ran on main stop.
  • The world hang is unchanged (64 s, within main's 59–111 s).

Not tested: #54 alone, AMD GPUs, a release build, image results.

(Claude Code, Claude Opus 5.5: ran the title on both builds and compared the logs program by program.)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121441920 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/298#issuecomment-7121441920). Originally posted by [SpaghettiMaster545](https://github.com/SpaghettiMaster545) on 2026-11-24T03:48:30Z. --- **Tested with the title** at `d0261f1`. The branch also carries #54's three commits, so this measures #54 + this PR together. - NVIDIA GeForce RTX 5070 Ti, driver 621.24 (32.0.16.2124), 32-lane waves; Ryzen 7 9800X3D; Windows 11 10.0.26100; Rust 1.98.1. Diag build of the branch merged onto `main` `d2a4bae` (clean), its own empty `VICTORY_CACHE_DIR`, `VICTORY_KEYS` into story mode, until the host GPU failure (#71, unrelated); compared program by program with a `main` run made the same way (#400 has the setup). - 11 programs that stop on `main` translate and run, 4 of them compute programs whose pipelines the driver refused on `main`. 0 programs that ran on `main` stop. - The world hang is unchanged (64 s, within `main`'s 59–111 s). **Not tested**: #54 alone, AMD GPUs, a release build, image results. (Claude Code, Claude Opus 5.5: ran the title on both builds and compared the logs program by program.)
jeremygold02 commented 2026-11-24 06:55:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:18:06Z.


Tested PR #298 at head d0261f1174368e2c203b42942e19b24f8f8d7787 (state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at d0261f1174368e2c203b42942e19b24f8f8d7787.

  • cargo test --locked -p victory-shader wave64_64thread_sgpr_spills_run_on_wave32_host — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 73 filtered out; finished in 0.59s ); cases: emit::wave_tests::wave64_64thread_sgpr_spills_run_on_wave32_host.
  • cargo test --locked -p victory-shader pixel_shader_sgpr_spill_lowers_and_draws — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 73 filtered out; finished in 0.32s ); cases: emit::wave_tests::pixel_shader_sgpr_spill_lowers_and_draws.

Behavior covered: Checks wave64 SGPR spill lowering on a wave32 host and pixel-shader SGPR spill drawing behavior; the latter cases require a supported host GPU.
Code: crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/emit/wave_tests.rs, crates/victory-gpu/src/host.rs

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121892873 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/298#issuecomment-7121892873). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-24T04:18:06Z. --- Tested PR #298 at head `d0261f1174368e2c203b42942e19b24f8f8d7787` (state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at `d0261f1174368e2c203b42942e19b24f8f8d7787`. - `cargo test --locked -p victory-shader wave64_64thread_sgpr_spills_run_on_wave32_host` — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 73 filtered out; finished in 0.59s ); cases: emit::wave_tests::wave64_64thread_sgpr_spills_run_on_wave32_host. - `cargo test --locked -p victory-shader pixel_shader_sgpr_spill_lowers_and_draws` — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 73 filtered out; finished in 0.32s ); cases: emit::wave_tests::pixel_shader_sgpr_spill_lowers_and_draws. Behavior covered: Checks wave64 SGPR spill lowering on a wave32 host and pixel-shader SGPR spill drawing behavior; the latter cases require a supported host GPU. Code: [crates/victory-shader/src/emit/lower.rs](https://github.com/Marvisak/VIctory/blob/d0261f1174368e2c203b42942e19b24f8f8d7787/crates/victory-shader/src/emit/lower.rs), [crates/victory-shader/src/emit/wave_tests.rs](https://github.com/Marvisak/VIctory/blob/d0261f1174368e2c203b42942e19b24f8f8d7787/crates/victory-shader/src/emit/wave_tests.rs), [crates/victory-gpu/src/host.rs](https://github.com/Marvisak/VIctory/blob/d0261f1174368e2c203b42942e19b24f8f8d7787/crates/victory-gpu/src/host.rs)
GamingRipperDoc commented 2026-11-24 06:56:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by GamingRipperDoc on 2026-11-24T05:26:19Z.


A combination finding, from victory translate <dump> --validate (offline, dxil.dll validator) on Windows 10 + RX 9070 XT, base d2a4bae + #175 + #336. Counts are compute programs, out of 2,581.

on the base emitted validated Entry function performs some operation that is incompatible with the shader stage or other entry properties
base 1,693 1,670 23
+ this PR (with #54) 1,731 1,698 33
+ #136 1,796 1,697 99
+ #136 + this PR 2,332 1,725 607
+ #193 + #437 + this PR 2,442 1,795 647
+ #193 + this PR 1,822 1,768 54

On its own this PR is clean (+38 emitted, +10 of these errors). But together with #136, or with #437 (both let more scalar buffer loads through), ~540 more compute programs get through this PR's path and come out failing validation with the error above. So it looks like a shape #136/#437 expose that this PR's lowering doesn't handle validly in compute. The validator only prints the summary line here ("See other errors for details" without others).

Why it matters: VIctory doesn't validate at run time, so in game these programs go to the driver. In a play run with this PR + #136 + #305 + #385 + #302 + #193 + #437 + #54 on the stack, AMD's shader compiler crashed (amdxc64.dll+0x85fd0f, access violation reading 0x8) after ~1 min in the world, with 250–1,000 pipelines still compiling. I can't say which program it was compiling, but this stack sends ~1,200 non-validating programs to it (these, plus #305's).

I can share the per-program --list output for the combination privately if it helps (it names the title's shaders, so not here).

No game data in this comment.

AI-assisted (Claude Code); I ran the measurements on my machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7122947334 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/298#issuecomment-7122947334). Originally posted by [GamingRipperDoc](https://github.com/GamingRipperDoc) on 2026-11-24T05:26:19Z. --- A combination finding, from `victory translate <dump> --validate` (offline, dxil.dll validator) on Windows 10 + RX 9070 XT, base `d2a4bae` + #175 + #336. Counts are compute programs, out of 2,581. | on the base | emitted | validated | `Entry function performs some operation that is incompatible with the shader stage or other entry properties` | |---|---|---|---| | base | 1,693 | 1,670 | 23 | | + this PR (with #54) | 1,731 | 1,698 | 33 | | + #136 | 1,796 | 1,697 | 99 | | **+ #136 + this PR** | **2,332** | **1,725** | **607** | | + #193 + #437 + this PR | 2,442 | 1,795 | 647 | | + #193 + this PR | 1,822 | 1,768 | 54 | On its own this PR is clean (+38 emitted, +10 of these errors). But together with #136, or with #437 (both let more scalar buffer loads through), ~540 more compute programs get through this PR's path and come out failing validation with the error above. So it looks like a shape #136/#437 expose that this PR's lowering doesn't handle validly in compute. The validator only prints the summary line here ("See other errors for details" without others). Why it matters: VIctory doesn't validate at run time, so in game these programs go to the driver. In a play run with this PR + #136 + #305 + #385 + #302 + #193 + #437 + #54 on the stack, AMD's shader compiler crashed (`amdxc64.dll+0x85fd0f`, access violation reading 0x8) after ~1 min in the world, with 250–1,000 pipelines still compiling. I can't say which program it was compiling, but this stack sends ~1,200 non-validating programs to it (these, plus #305's). I can share the per-program `--list` output for the combination privately if it helps (it names the title's shaders, so not here). No game data in this comment. AI-assisted (Claude Code); I ran the measurements on my machine.
Nixitov commented 2026-11-24 06:56:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Nixitov on 2026-11-24T06:49:17Z.


Big effect on the RTX 5070 world run — this is the single most valuable shader PR I have tested.

Setup: Windows 11 Pro 26200.9974, RTX 5070, driver 617.14, d2a4bae + the GPU stack #493 + #483 + #581 + #595, release build. Same scene (first mission intro), same run length.

build shaders that do not translate a lane mask holding lanes elsewhere read as data draws dropped without a host pipeline
without this PR 399 85 1408
with this PR (#298) 370 10 —
with this PR + #585 + #259 + #302 + #307 + #539 361-362 10-11 952

(399 → 952 dropped draws is not a like-for-like ratio; the two dropped-draw numbers are the last frame line of runs at the same scene, with and without the stack.)

The count of the reason this PR targets drops from 85 to 10; the 97 a select on an untracked mask entries disappear with #585 on top. Nothing regressed in the run: still 2 fps, no device removals, and the frame log reaches the same intro scene.

One integration note: merging #298 with #54-era code needed only two additive hunks in lower.rs (guard_slots next to resolved_reads / pure_spill_writes, and both in the constructor), plus deriving guard_slot from count + dynamic when stacked on #483.

No game files; only counts and log lines.

AI-assisted (DeepSeek V4.1 Flash coding agent).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7124324998 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/298#issuecomment-7124324998). Originally posted by [Nixitov](https://github.com/Nixitov) on 2026-11-24T06:49:17Z. --- Big effect on the RTX 5070 world run — this is the single most valuable shader PR I have tested. **Setup:** Windows 11 Pro 26200.9974, RTX 5070, driver 617.14, `d2a4bae` + the GPU stack #493 + #483 + #581 + #595, release build. Same scene (first mission intro), same run length. | build | shaders that do not translate | `a lane mask holding lanes elsewhere read as data` | draws dropped without a host pipeline | |---|---|---|---| | without this PR | 399 | 85 | 1408 | | **with this PR (#298)** | **370** | **10** | — | | with this PR + #585 + #259 + #302 + #307 + #539 | 361-362 | 10-11 | **952** | (399 → 952 dropped draws is not a like-for-like ratio; the two dropped-draw numbers are the last frame line of runs at the same scene, with and without the stack.) The count of the reason this PR targets drops from 85 to 10; the 97 `a select on an untracked mask` entries disappear with #585 on top. Nothing regressed in the run: still 2 fps, no device removals, and the frame log reaches the same intro scene. One integration note: merging #298 with #54-era code needed only two additive hunks in `lower.rs` (`guard_slots` next to `resolved_reads` / `pure_spill_writes`, and both in the constructor), plus deriving `guard_slot` from `count + dynamic` when stacked on #483. No game files; only counts and log lines. AI-assisted (DeepSeek V4.1 Flash coding agent).
upstream-sync changed title from [PR #298] Shaders: lane masks spilled to VGPR lanes and read back (stacked on #54) to [PR #298] Shaders: lane masks spilled to VGPR lanes and read back 2026-11-24 12:03:37 +00:00
qntic commented 2026-11-24 12:04:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by qntic on 2026-11-24T11:12:55Z.


tested on rx 6600 xt with my compute regression harness. the vgpr lane mask spill test gives 24 incorrect lanes out of 64 on main. with this pr all 64 lanes produce the expected values.
hardware tests:
https://github.com/qntic/VIctory/tree/hwtest/compute-lanes

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129807173 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/298#issuecomment-7129807173). Originally posted by [qntic](https://github.com/qntic) on 2026-11-24T11:12:55Z. --- tested on rx 6600 xt with my compute regression harness. the vgpr lane mask spill test gives 24 incorrect lanes out of 64 on main. with this pr all 64 lanes produce the expected values. hardware tests: https://github.com/qntic/VIctory/tree/hwtest/compute-lanes
permadiego commented 2026-11-24 12:04:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by permadiego on 2026-11-24T11:42:51Z.


Rebased onto main ffe310e as 54f97db, now standalone: #54 was closed, so the spill handling this needs for masks is in this PR (mask_spills in lower.rs). Over shaders.rpf against main: +34 validated, 0 lost, "a lane mask holding lanes elsewhere read as data" 273 → 13. Tests done on d0261f1 (thanks @qntic, @Nixitov, @jeremygold02) were on the #54-based head.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7130451462 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/298#issuecomment-7130451462). Originally posted by [permadiego](https://github.com/permadiego) on 2026-11-24T11:42:51Z. --- Rebased onto `main` ffe310e as 54f97db, now standalone: #54 was closed, so the spill handling this needs for masks is in this PR (`mask_spills` in `lower.rs`). Over `shaders.rpf` against `main`: +34 validated, 0 lost, "a lane mask holding lanes elsewhere read as data" 273 → 13. Tests done on d0261f1 (thanks @qntic, @Nixitov, @jeremygold02) were on the #54-based head. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
mercuryVM commented 2026-11-24 13:39:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T13:39:26Z.

Review: APPROVED


Tested 54f97db on Windows 11, RTX 5070, MSVC: cargo test -p victory-shader -- --test-threads=1 120 passed, and cargo clippy -p victory-shader --all-targets is clean.

Measured on the title's shaders.rpf with victory translate --list, counts only, against upstream main ffe310e (this PR's base):

  • "a select on an untracked mask": 289 → 0.
  • Emitted: vertex/pixel 12,231 → 12,258, compute 1,441 → 1,458, mesh unchanged (8,214).
  • Most of the programs it unblocks now stop at the next refusal, "a descriptor read only as data", which #180 addresses (combined numbers on #180).

Code:

  • Taking a v_readlane_b32 of a constant lane as the mask itself only when it reads back a v_writelane_b32 of that same mask matches the console compiler's spill pattern. The lookup follows writes of other lanes, and joins only when all arguments agree.
  • Accepting the spill write of a mask whose lanes are elsewhere, instead of reading it as data, fixes the complement case.
  • Overlap: #309 (approved) forwards spilled SGPRs from VGPR lanes generally, in a pre-pass (sgpr_spill::forward). It covers the same pattern by another route, so whichever lands second should be checked against the other. If #309 lands, this PR's structure.rs lookup may become redundant for masks.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6040195822 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/298#pullrequestreview-6040195822). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T13:39:26Z. **Review:** APPROVED --- Tested 54f97db on Windows 11, RTX 5070, MSVC: `cargo test -p victory-shader -- --test-threads=1` 120 passed, and `cargo clippy -p victory-shader --all-targets` is clean. Measured on the title's `shaders.rpf` with `victory translate --list`, counts only, against upstream main ffe310e (this PR's base): - "a select on an untracked mask": 289 → 0. - Emitted: vertex/pixel 12,231 → 12,258, compute 1,441 → 1,458, mesh unchanged (8,214). - Most of the programs it unblocks now stop at the next refusal, "a descriptor read only as data", which #180 addresses (combined numbers on #180). Code: - Taking a `v_readlane_b32` of a constant lane as the mask itself only when it reads back a `v_writelane_b32` of that same mask matches the console compiler's spill pattern. The lookup follows writes of other lanes, and joins only when all arguments agree. - Accepting the spill write of a mask whose lanes are elsewhere, instead of reading it as data, fixes the complement case. - Overlap: #309 (approved) forwards spilled SGPRs from VGPR lanes generally, in a pre-pass (`sgpr_spill::forward`). It covers the same pattern by another route, so whichever lands second should be checked against the other. If #309 lands, this PR's `structure.rs` lookup may become redundant for masks. AI-assisted (Claude Code).
qntic commented 2026-11-24 14:04:44 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by qntic on 2026-11-24T13:25:58Z.


re-tested on the rebased head 54f97db on my rx 6600 xt.

the mask spill test still produces correct values, but the select pattern after vcc_hi = 0 still silently produces incorrect values in 16 of 64 lanes.

#660 is still needed to safely reject that pattern.

harness:
https://github.com/qntic/VIctory/tree/hwtest/compute-lanes

<!-- greyfinch-sync:Marvisak/VIctory:comment:7132821122 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/298#issuecomment-7132821122). Originally posted by [qntic](https://github.com/qntic) on 2026-11-24T13:25:58Z. --- re-tested on the rebased head 54f97db on my rx 6600 xt. the mask spill test still produces correct values, but the select pattern after vcc_hi = 0 still silently produces incorrect values in 16 of 64 lanes. #660 is still needed to safely reject that pattern. harness: https://github.com/qntic/VIctory/tree/hwtest/compute-lanes
rafaconvaitis commented 2026-11-24 19:04:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by rafaconvaitis on 2026-11-24T18:36:07Z.


I tested 54f97db independently on the 45 mesh programs that reached a lane-mask join of an untracked mask only after the narrow descriptor-field experiments in #798. The common base was #1269 8c3092f plus #953 c42cbb0, with the same experimental descriptor-bit and offline stride settings in both runs. The candidate applied only the official #298 patch. I matched the same program records across both conditions.

  • Control: the same lane-mask join refusal on all 45 mesh programs.
  • With 54f97db: all 45 passed Microsoft DXIL validation with the 1.8.2502.8 validator.

In one representative the two restored halves both trace to a single dominating conditional EXEC mask, saved in two constant lanes of the same VGPR. That matches the spill recovery this PR implements. I only tested these 45 offline. In-title binding, draws, and the separate high-half correctness case in the RX 6600 XT report remain unverified by this test.

AI-assisted testing. No title files, shader containers or disassembly are attached.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140873778 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/298#issuecomment-7140873778). Originally posted by [rafaconvaitis](https://github.com/rafaconvaitis) on 2026-11-24T18:36:07Z. --- I tested `54f97db` independently on the 45 mesh programs that reached `a lane-mask join of an untracked mask` only after the narrow descriptor-field experiments in #798. The common base was #1269 `8c3092f` plus #953 `c42cbb0`, with the same experimental descriptor-bit and offline stride settings in both runs. The candidate applied only the official #298 patch. I matched the same program records across both conditions. - Control: the same lane-mask join refusal on all 45 mesh programs. - With `54f97db`: all 45 passed Microsoft DXIL validation with the 1.8.2502.8 validator. In one representative the two restored halves both trace to a single dominating conditional EXEC mask, saved in two constant lanes of the same VGPR. That matches the spill recovery this PR implements. I only tested these 45 offline. In-title binding, draws, and the separate high-half correctness case in the RX 6600 XT report remain unverified by this test. AI-assisted testing. No title files, shader containers or disassembly are attached.
Sil3ntGam3r commented 2026-11-24 21:28:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Sil3ntGam3r on 2026-11-24T21:07:31Z.


@permadiego results for 54f97db on top of the #439 stack. It gains programs there too and loses none.

Tree: main + #180 aa69258 + #439 bf0f951 (with #223/#233/#320) + #431 + #876 + #334, then this PR, then #660 19b02ec. The merge conflicts were all additive: both sides' fields in lower.rs, and one duplicate paired_masks initialiser in structure.rs. All 433 tests pass. RTX 3070, driver 621.14, Windows 11, diag build.

Offline, victory translate --validate --host-lanes 32-32 over shaders.rpf, the stack without and with this PR:

without with this PR
vertex and pixel validated 12,288 12,315
compute validated 2,363 2,371
mesh validated 8,236 8,283

82 programs gain and 0 lose. Before this PR they stopped at:

reason before programs
a lane-mask join of an untracked mask 47 mesh, 15 pixel
an opaque lane mask 12 pixel
a program the console structure cannot hold 7 compute
a descriptor's address or format read as data 1 compute

On this stack, "a lane-mask join of an untracked mask" goes from 62 programs to 0. Your PR's own reason, "a lane mask holding lanes elsewhere read as data", stays at 4 both ways, so the stack already took most of those. The 47 mesh programs fit @rafaconvaitis's 45 above. Adding #660 on top changes no program's outcome, as @rpmaster2 found on main in #660.

The CS_RaytracingResolve variants on this stack: 27 move from "a lane mask read as data" to "a program the console structure cannot hold" (at 0x0). That refusal comes from #439's console flow, not from main. They are refused either way. With #180 on the stack, they don't reach "a descriptor read only as data" as they do on main.

In the title, Series X, cold cache, into the world until translation caught up:

  • 5 programs that were refused in the run before this merge now run: 3 pixel (b37565055f2f7d3b, cc6def9058a4bc0a, d642969b6ff7579e) and 2 compute (015832d72477fb26, e81277c8be37103b).
  • No program that translated in that run is refused now. The earlier run ended before translation caught up, so this covers only programs that have a result in both runs. The offline table covers everything.
  • What reaches the screen is unchanged: scenery in the G-buffer, no ground, roads or buildings. No device removal.

Not tested: AMD, a release build, this PR on plain main.

(AI-assisted: Claude Code ran the builds and compared both runs program by program.)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7144508298 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/298#issuecomment-7144508298). Originally posted by [Sil3ntGam3r](https://github.com/Sil3ntGam3r) on 2026-11-24T21:07:31Z. --- @permadiego results for `54f97db` on top of the #439 stack. It gains programs there too and loses none. Tree: `main` + #180 `aa69258` + #439 `bf0f951` (with #223/#233/#320) + #431 + #876 + #334, then this PR, then #660 `19b02ec`. The merge conflicts were all additive: both sides' fields in `lower.rs`, and one duplicate `paired_masks` initialiser in `structure.rs`. All 433 tests pass. RTX 3070, driver 621.14, Windows 11, diag build. **Offline**, `victory translate --validate --host-lanes 32-32` over `shaders.rpf`, the stack without and with this PR: | | without | with this PR | |---|---|---| | vertex and pixel validated | 12,288 | 12,315 | | compute validated | 2,363 | 2,371 | | mesh validated | 8,236 | 8,283 | 82 programs gain and 0 lose. Before this PR they stopped at: | reason before | programs | |---|---| | a lane-mask join of an untracked mask | 47 mesh, 15 pixel | | an opaque lane mask | 12 pixel | | a program the console structure cannot hold | 7 compute | | a descriptor's address or format read as data | 1 compute | On this stack, "a lane-mask join of an untracked mask" goes from 62 programs to 0. Your PR's own reason, "a lane mask holding lanes elsewhere read as data", stays at 4 both ways, so the stack already took most of those. The 47 mesh programs fit @rafaconvaitis's 45 above. Adding #660 on top changes no program's outcome, as @rpmaster2 found on `main` in #660. **The `CS_RaytracingResolve` variants on this stack:** 27 move from "a lane mask read as data" to "a program the console structure cannot hold" (at `0x0`). That refusal comes from #439's console flow, not from `main`. They are refused either way. With #180 on the stack, they don't reach "a descriptor read only as data" as they do on `main`. **In the title**, Series X, cold cache, into the world until translation caught up: - 5 programs that were refused in the run before this merge now run: 3 pixel (`b37565055f2f7d3b`, `cc6def9058a4bc0a`, `d642969b6ff7579e`) and 2 compute (`015832d72477fb26`, `e81277c8be37103b`). - No program that translated in that run is refused now. The earlier run ended before translation caught up, so this covers only programs that have a result in both runs. The offline table covers everything. - What reaches the screen is unchanged: scenery in the G-buffer, no ground, roads or buildings. No device removal. Not tested: AMD, a release build, this PR on plain `main`. (AI-assisted: Claude Code ran the builds and compared both runs program by program.)
upstream-sync closed this pull request 2026-11-24 23:04:02 +00:00

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