Shaders: implicit-level samples in compute follow the console's lane quads (#2027, on #1237) #2997

Open
wwwwwwww3333333 wants to merge 6 commits from upstream-pr/2999 into main
wwwwwwww3333333 commented 2026-11-26 03:00:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by wwwwwwww3333333 on 2026-11-26T03:00:03Z.


Builds on #1237 by @felicienradio (its commit is kept as is, rebased onto main 63bcca4) and adds what makes it match the console in groups of more than one row. It is for the 735 compute programs of #2027 ("Function uses features incompatible with the shader stage (cs)"), which #1237 was measured to validate without a newer validator (@wildheathen's census on #1237; my changes here do not touch validation, and I have not rerun the census). Among them are the fog/lighting apply pass (CS_ApplyCombinedDeferred, #2045) and the density shadow blur.

The problem the earlier comparisons did not reach. The console takes an implicit level from quads of lanes, and its compute lanes hold threads in x-major order: in an [8, 8, 1] group a quad is four threads of one row. Hosts place two-dimensional groups their own way. On an RX 6750 XT the host put 2x2 tiles of threads in a quad, so main, #1065 and #1237 all took the "y" derivative across rows. The 1D tests on #1237 could not show this, since a one-row group keeps its order everywhere. @ElSeba0811 saw a 2D case pick a different mip on #1237 and fixed it locally the same way (a one-row host group); the test below says which answer is the console's.

What changes (second commit)

  • A compute program with an implicit-level image instruction (image_sample without _l/_lz/_d/_cd, or image_get_lod) in a group of more than one row, and no other cross-lane code, runs as one host row of as many threads. Thread ids are taken back from the flat id. Programs that already use cross-lane code keep main's relabelling to console lanes, which also makes the quads right. No wave size is forced, so 32-lane hosts run wave64 programs as before.
  • Fixes a bug in #1237: with 16-bit addresses (a16) the bias is the low half's f16, as on main's sampleBias path. #1237 read it as f32, and image_addresses_of_16_bits_and_clamps failed with it.

Test compute_samples_take_derivatives_from_lane_quads: an [8, 8, 1] group, coordinates from the thread ids, chosen so that each derivative pair has one nonzero vector (the result does not depend on how the sampler combines them). Lane quads give level 1; 2x2 tiles give level 3. Each level of the texture holds its own number. RX 6750 XT (driver 32.0.21045.29003) and WARP, wave32 and wave64:

tree level read validator
main 63bcca4 3 refused (the #2027 message)
main + #1065 3 accepted
main + #1237 3 accepted
this PR 1.0 on every lane, hardware and WARP, wave32 and wave64 accepted

(The first three rows are wave32 on the hardware adapter, from a first version of the test whose u also stepped along x, which read 3 on every tree; they are the 2x2-tile answer either way.)

Suites (Windows 11, Rust 1.98.1 MSVC): victory-shader 303 passed (main alone: 302; the difference is the new test). cargo clippy -p victory-shader --all-targets -- -D warnings: clean.

Not measured: how the lit world looks with it. That needs a run in the title.

Unit tests only, no game files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwHmoV6jP696CZH3DVW7V1

<!-- greyfinch-sync:Marvisak/VIctory:issue:5503187238 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999). Originally posted by [wwwwwwww3333333](https://github.com/wwwwwwww3333333) on 2026-11-26T03:00:03Z. --- Builds on #1237 by @felicienradio (its commit is kept as is, rebased onto main 63bcca4) and adds what makes it match the console in groups of more than one row. It is for the 735 compute programs of #2027 ("Function uses features incompatible with the shader stage (cs)"), which #1237 was measured to validate without a newer validator (@wildheathen's census on #1237; my changes here do not touch validation, and I have not rerun the census). Among them are the fog/lighting apply pass (`CS_ApplyCombinedDeferred`, #2045) and the density shadow blur. **The problem the earlier comparisons did not reach.** The console takes an implicit level from quads of lanes, and its compute lanes hold threads in x-major order: in an `[8, 8, 1]` group a quad is four threads of one row. Hosts place two-dimensional groups their own way. On an RX 6750 XT the host put 2x2 tiles of threads in a quad, so main, #1065 and #1237 all took the "y" derivative across rows. The 1D tests on #1237 could not show this, since a one-row group keeps its order everywhere. @ElSeba0811 saw a 2D case pick a different mip on #1237 and fixed it locally the same way (a one-row host group); the test below says which answer is the console's. **What changes** (second commit) - A compute program with an implicit-level image instruction (`image_sample` without `_l`/`_lz`/`_d`/`_cd`, or `image_get_lod`) in a group of more than one row, and no other cross-lane code, runs as one host row of as many threads. Thread ids are taken back from the flat id. Programs that already use cross-lane code keep main's relabelling to console lanes, which also makes the quads right. No wave size is forced, so 32-lane hosts run wave64 programs as before. - Fixes a bug in #1237: with 16-bit addresses (`a16`) the bias is the low half's f16, as on main's `sampleBias` path. #1237 read it as f32, and `image_addresses_of_16_bits_and_clamps` failed with it. **Test** `compute_samples_take_derivatives_from_lane_quads`: an `[8, 8, 1]` group, coordinates from the thread ids, chosen so that each derivative pair has one nonzero vector (the result does not depend on how the sampler combines them). Lane quads give level 1; 2x2 tiles give level 3. Each level of the texture holds its own number. RX 6750 XT (driver 32.0.21045.29003) and WARP, wave32 and wave64: | tree | level read | validator | |---|---|---| | main 63bcca4 | 3 | refused (the #2027 message) | | main + #1065 | 3 | accepted | | main + #1237 | 3 | accepted | | this PR | **1.0 on every lane**, hardware and WARP, wave32 and wave64 | accepted | (The first three rows are wave32 on the hardware adapter, from a first version of the test whose u also stepped along x, which read 3 on every tree; they are the 2x2-tile answer either way.) **Suites** (Windows 11, Rust 1.98.1 MSVC): victory-shader 303 passed (main alone: 302; the difference is the new test). `cargo clippy -p victory-shader --all-targets -- -D warnings`: clean. **Not measured:** how the lit world looks with it. That needs a run in the title. Unit tests only, no game files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01LwHmoV6jP696CZH3DVW7V1
kotekompotek commented 2026-11-26 03:04:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T03:04:37Z.

Review: APPROVED


LGTM — verified the mechanism end to end. implicit_level excludes only _l/_lz/_d/_cd (bias/_cl stay implicit). The row flattening to [xyz,1,1] forces x-major lane quads on every host, with thread_id reconstructing console (x,y,z) from flattenedThreadIdInGroup via URem/UDiv — decomposition is exact. quad_gradients uses lane base|1 and base|2 deltas (hardware coarse-derivative semantics), bias scales by 2^bias through exp2, and the sampleGrad arg order (offsets, ddx3, ddy3, undef clamp) matches DXIL op 63. The test discriminates the two orderings: lane quads give level 1, 2x2 tiles give 3.

<!-- greyfinch-sync:Marvisak/VIctory:review:6067996996 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6067996996). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-26T03:04:37Z. **Review:** APPROVED --- LGTM — verified the mechanism end to end. implicit_level excludes only _l/_lz/_d/_cd (bias/_cl stay implicit). The row flattening to [x*y*z,1,1] forces x-major lane quads on every host, with thread_id reconstructing console (x,y,z) from flattenedThreadIdInGroup via URem/UDiv — decomposition is exact. quad_gradients uses lane base|1 and base|2 deltas (hardware coarse-derivative semantics), bias scales by 2^bias through exp2, and the sampleGrad arg order (offsets, ddx3, ddy3, undef clamp) matches DXIL op 63. The test discriminates the two orderings: lane quads give level 1, 2x2 tiles give 3.
fuzeofficlal commented 2026-11-26 03:22:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T03:22:49Z.

Review: CHANGES_REQUESTED


Code review on 1d7472f7 (static source inspection; no runtime GPU/DXIL validation executed):

  • P2 — Regression on compute shaders with constant sample offsets (crates/victory-shader/src/emit/lower.rs:8880-8920):
    • let quad_grads = matches!(op, 60 | 61) && self.s.threads.is_some() && self.s.mesh.is_none() && kind != 5; intercepts non-cube compute image_sample_o (op == 60) and image_sample_b_o (op == 61) before the existing 60 => offset decoder, and immediately returns Err("a sample offset outside a pixel shader") whenever offset_word is set.
    • Previously, compute image_sample_o with valid immediate offsets (-8..=7) reached the offset decoder in 60 =>. Since DXIL sampleGrad (op 63) already accepts the same os immediate offset arguments right below (args.extend(&os)), decoding and validating offset_word before selecting sampleGrad vs sample fixes the regression cleanly. Adding a compute image_sample_o offset test case would lock this in.
<!-- greyfinch-sync:Marvisak/VIctory:review:6068131101 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6068131101). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T03:22:49Z. **Review:** CHANGES_REQUESTED --- Code review on `1d7472f7` (static source inspection; no runtime GPU/DXIL validation executed): - **P2 — Regression on compute shaders with constant sample offsets (`crates/victory-shader/src/emit/lower.rs:8880-8920`)**: - `let quad_grads = matches!(op, 60 | 61) && self.s.threads.is_some() && self.s.mesh.is_none() && kind != 5;` intercepts non-cube compute `image_sample_o` (`op == 60`) and `image_sample_b_o` (`op == 61`) before the existing `60 =>` offset decoder, and immediately returns `Err("a sample offset outside a pixel shader")` whenever `offset_word` is set. - Previously, compute `image_sample_o` with valid immediate offsets (`-8..=7`) reached the offset decoder in `60 =>`. Since DXIL `sampleGrad` (`op 63`) already accepts the same `os` immediate offset arguments right below (`args.extend(&os)`), decoding and validating `offset_word` before selecting `sampleGrad` vs `sample` fixes the regression cleanly. Adding a compute `image_sample_o` offset test case would lock this in.
steven-seagull27 commented 2026-11-26 04:06:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T03:16:57Z.


The compute LOD change matched all 16,416 expected samples per adapter on an RTX 5080 and Microsoft WARP at 1d7472f. I also found a one-line correction for the PR's test fixture.

The original quad_program reads its UVs with buffer_load_dwordx2 ... offen. DXC disassembly identifies that SRV as a ByteAddressBuffer and shows a two-component rawBufferLoad. The test currently binds it as Stride::Structured(8). Changing the UV view to Stride::Raw makes the descriptor match the shader. With that one change, the original coordinates and sampler returned level 1 for 64/64 lanes in each guest wave mode on both adapters. Test fixture, line 1114

For the wider test I dispatched 2 × 3 × 2 groups and used the guest XYZ local and group IDs to address the UV and output buffers. Each consecutive four guest lanes shared a prescribed footprint of 2, 4, 8 or 16 texels. Each mip had a distinct constant color, with point filtering and clamp-to-edge. I ran plain image_sample, image_sample_b with alternating FP16 biases of +1 and −1, and explicit mip zero. The SDK validator accepted all shader variants.

Selected case, per guest wave mode Wrong samples at 653b119 (#1237 rebased) Wrong at 1d7472f
Plain sample, local size 6 × 4 × 4 910 / 1,152 0 / 1,152
Plain sample, 8 × 2 × 4 644 / 768 0 / 768
FP16 bias, 8 × 1 × 1 96 / 96 0 / 96
Explicit mip zero, all four local sizes 0 / 2,736 0 / 2,736

Both adapters returned the same counts for guest wave32 and wave64. Across all cases, including 3 × 5 × 4, the predecessor missed 7,844 of 16,416 values on each adapter. These are synthetic texture readbacks. I haven't measured a game frame with this change.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7181567865 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7181567865). Originally posted by [steven-seagull27](https://github.com/steven-seagull27) on 2026-11-26T03:16:57Z. --- **The compute LOD change matched all 16,416 expected samples per adapter** on an RTX 5080 and Microsoft WARP at `1d7472f`. I also found a one-line correction for the PR's test fixture. The original `quad_program` reads its UVs with `buffer_load_dwordx2 ... offen`. DXC disassembly identifies that SRV as a `ByteAddressBuffer` and shows a two-component `rawBufferLoad`. The test currently binds it as `Stride::Structured(8)`. Changing the UV view to `Stride::Raw` makes the descriptor match the shader. With that one change, the original coordinates and sampler returned level 1 for **64/64 lanes** in each guest wave mode on both adapters. [Test fixture, line 1114](https://github.com/Marvisak/VIctory/blob/1d7472f783d1bbb924f4a294fbb1bd9fed0a9c43/crates/victory-shader/src/emit/synthetic_tests.rs#L1114) For the wider test I dispatched 2 × 3 × 2 groups and used the guest XYZ local and group IDs to address the UV and output buffers. Each consecutive four guest lanes shared a prescribed footprint of 2, 4, 8 or 16 texels. Each mip had a distinct constant color, with point filtering and clamp-to-edge. I ran plain `image_sample`, `image_sample_b` with alternating FP16 biases of +1 and −1, and explicit mip zero. The SDK validator accepted all shader variants. | Selected case, per guest wave mode | Wrong samples at `653b119` (#1237 rebased) | Wrong at `1d7472f` | |---|---:|---:| | Plain sample, local size 6 × 4 × 4 | 910 / 1,152 | 0 / 1,152 | | Plain sample, 8 × 2 × 4 | 644 / 768 | 0 / 768 | | FP16 bias, 8 × 1 × 1 | 96 / 96 | 0 / 96 | | Explicit mip zero, all four local sizes | 0 / 2,736 | 0 / 2,736 | Both adapters returned the same counts for guest wave32 and wave64. Across all cases, including 3 × 5 × 4, the predecessor missed 7,844 of 16,416 values on each adapter. These are synthetic texture readbacks. I haven't measured a game frame with this change.
zed6000 commented 2026-11-26 04:06:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by zed6000 on 2026-11-26T03:34:04Z.


The census you hadn't rerun. Measured offline on the title's shaders (the method in #1247), head 1d7472f merged onto main 63bcca4 (a clean merge), RX 7900 XTX (RDNA3), dxil.dll 1.8.2502:

  • +748, 0 lost (24,850 → 25,598 validate). The 748 are all compute programs that fail on main with the validator's Entry function performs some operation that is incompatible with the shader stage. Program by program, they're exactly the same 748 programs #1065 (cbd152c) gains on the same base. So on this title the two are interchangeable in count; the difference is the 2D quad order this PR adds.
  • compute_samples_take_derivatives_from_lane_quads passes on RDNA3: Wave32 and Wave64, hardware and built-in WARP, every lane at level 1.0.
  • cargo test -p victory-shader --lib --locked: 303 passed, 0 failed, 3 ignored. cargo clippy -p victory-shader --all-targets --locked -- -D warnings is clean.

Offline counts and unit tests only; no program names or data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7181831861 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7181831861). Originally posted by [zed6000](https://github.com/zed6000) on 2026-11-26T03:34:04Z. --- The census you hadn't rerun. Measured offline on the title's shaders (the method in #1247), head `1d7472f` merged onto `main` `63bcca4` (a clean merge), RX 7900 XTX (RDNA3), dxil.dll 1.8.2502: - **+748, 0 lost** (24,850 → 25,598 validate). The 748 are all compute programs that fail on `main` with the validator's `Entry function performs some operation that is incompatible with the shader stage`. Program by program, they're **exactly the same 748 programs #1065 (`cbd152c`) gains** on the same base. So on this title the two are interchangeable in count; the difference is the 2D quad order this PR adds. - `compute_samples_take_derivatives_from_lane_quads` passes on RDNA3: Wave32 and Wave64, hardware and built-in WARP, every lane at level 1.0. - `cargo test -p victory-shader --lib --locked`: 303 passed, 0 failed, 3 ignored. `cargo clippy -p victory-shader --all-targets --locked -- -D warnings` is clean. Offline counts and unit tests only; no program names or data.
wwwwwwww3333333 commented 2026-11-26 04:06:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by wwwwwwww3333333 on 2026-11-26T03:53:02Z.


Both fixed in 7b5a3fc. @fuzeofficlal: the offset word is now decoded once, before the sample, sampleBias and sampleGrad paths, so image_sample_o in compute takes the quad path with its offset instead of being refused. @steven-seagull27: the test binds the coordinates as Stride::Raw, as the program reads them, and also runs image_sample_o. On an RX 6750 XT and WARP, wave32 and wave64, every lane reads level 1 in all eight cases; victory-shader 303 passed twice, clippy clean. Thanks to both of you, and to @zed6000 for the census.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7182105564 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7182105564). Originally posted by [wwwwwwww3333333](https://github.com/wwwwwwww3333333) on 2026-11-26T03:53:02Z. --- Both fixed in 7b5a3fc. @fuzeofficlal: the offset word is now decoded once, before the sample, sampleBias and sampleGrad paths, so `image_sample_o` in compute takes the quad path with its offset instead of being refused. @steven-seagull27: the test binds the coordinates as `Stride::Raw`, as the program reads them, and also runs `image_sample_o`. On an RX 6750 XT and WARP, wave32 and wave64, every lane reads level 1 in all eight cases; victory-shader 303 passed twice, clippy clean. Thanks to both of you, and to @zed6000 for the census.
steven-seagull27 commented 2026-11-26 05:04:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T04:06:47Z.


@wwwwwwww3333333 I retested 7b5a3fc. On RTX 5080, Windows WARP and WARP 1.0.22, all 640/640 tagged offset samples per adapter returned the expected mip and texel. Each texel identifies its mip, X and Y, so an ignored or incorrectly signed offset changes the readback even if the sampler chooses the correct mip.

At mip 1, lane 0 read (8,6) with offset (0,0), (9,6) with (+1,0), and (6,7) with (-2,+1). The five offsets ran across all 64 threads for both guest wave sizes. On 1d7472f the same offset shaders were refused before dispatch. The updated stock raw-view test and the earlier 16,416-lane multidimensional LOD matrix also passed on each adapter.

AI-assisted with Codex. Synthetic tagged textures.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7182304771 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7182304771). Originally posted by [steven-seagull27](https://github.com/steven-seagull27) on 2026-11-26T04:06:47Z. --- @wwwwwwww3333333 I retested `7b5a3fc`. On RTX 5080, Windows WARP and WARP 1.0.22, all **640/640** tagged offset samples per adapter returned the expected mip **and** texel. Each texel identifies its mip, X and Y, so an ignored or incorrectly signed offset changes the readback even if the sampler chooses the correct mip. At mip 1, lane 0 read `(8,6)` with offset `(0,0)`, `(9,6)` with `(+1,0)`, and `(6,7)` with `(-2,+1)`. The five offsets ran across all 64 threads for both guest wave sizes. On `1d7472f` the same offset shaders were refused before dispatch. The updated stock raw-view test and the earlier 16,416-lane multidimensional LOD matrix also passed on each adapter. AI-assisted with Codex. Synthetic tagged textures.
Marvisak commented 2026-11-26 06:03:43 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Thanks, the size issue is fixed. In 86f801c the lane-quad code (implicit_level, row_thread_id, quad_gradients, sample_offsets) moves to crates/victory-shader/src/emit/lower/quads.rs with no change in logic. lower.rs is back under the 512 KiB limit, and CI is green.

Merge candidate. A compute program that samples with an implicit level runs its multi-row groups as one host row. The thread ids are rebuilt from the flat id, so quads are four lanes of one row, as on the console. The thread backs this with GPU readbacks on RTX 5080, WARP and two AMD cards, covering the texel-offset path, and with a census of +748 validating programs and none lost.

For the maintainers:

  • The branch includes #1237's commit (rebased, 653b119), so landing this supersedes #1237, which is still open.
  • #1065 clears the same 748 programs by declaring validator 1.8 instead. Choosing between the two approaches is the maintainer's call. This one follows the console's quads for multi-row groups.

CI: passing.

Recommending a look, not approving.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7183542420 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7183542420). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T05:30:09Z. --- <!-- victory-triage v1 head=86f801cf0d056e989e0c0c109f0235f5bad80a7c verdict=merge-candidate at=2026-11-26T07:19:47Z --> Automated triage for the maintainers. Thanks, the size issue is fixed. In `86f801c` the lane-quad code (`implicit_level`, `row_thread_id`, `quad_gradients`, `sample_offsets`) moves to `crates/victory-shader/src/emit/lower/quads.rs` with no change in logic. `lower.rs` is back under the 512 KiB limit, and CI is green. **Merge candidate.** A compute program that samples with an implicit level runs its multi-row groups as one host row. The thread ids are rebuilt from the flat id, so quads are four lanes of one row, as on the console. The thread backs this with GPU readbacks on RTX 5080, WARP and two AMD cards, covering the texel-offset path, and with a census of +748 validating programs and none lost. For the maintainers: - The branch includes #1237's commit (rebased, `653b119`), so landing this supersedes #1237, which is still open. - #1065 clears the same 748 programs by declaring validator 1.8 instead. Choosing between the two approaches is the maintainer's call. This one follows the console's quads for multi-row groups. CI: passing. Recommending a look, not approving. --- _Generated by [Claude Code](https://claude.ai/code)_
wwwwwwww3333333 commented 2026-11-26 06:03:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by wwwwwwww3333333 on 2026-11-26T06:03:02Z.


CI fix in 86f801c: the lane-quad code (implicit_level, the one-row thread ids, quad_gradients, the offset-word decoding) moves to emit/lower/quads.rs, as lower/bvh.rs does. lower.rs is now 522,621 bytes. No change in behaviour: victory-shader passed 303 of 303 twice on an RX 6750 XT, Clippy is clean, and the xtask policy tests pass. CI is green.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7184045515 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7184045515). Originally posted by [wwwwwwww3333333](https://github.com/wwwwwwww3333333) on 2026-11-26T06:03:02Z. --- CI fix in 86f801c: the lane-quad code (`implicit_level`, the one-row thread ids, `quad_gradients`, the offset-word decoding) moves to `emit/lower/quads.rs`, as `lower/bvh.rs` does. `lower.rs` is now 522,621 bytes. No change in behaviour: victory-shader passed 303 of 303 twice on an RX 6750 XT, Clippy is clean, and the xtask policy tests pass. CI is green.
Dukestar69 commented 2026-11-26 07:29:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T07:29:00Z.

Review: APPROVED


Tested locally merged onto origin/main (63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP + dxil.dll):

  • cargo test -p victory-shader compute_samples_take_derivatives_from_lane_quads -- --test-threads=1 (RTX 5090 & WARP): 1 passed, 0 failed on both.
  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean.
  • cargo xtask policy: 192 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6070047771 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6070047771). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T07:29:00Z. **Review:** APPROVED --- Tested locally merged onto `origin/main` (`63bcca4`) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP + `dxil.dll`): - `cargo test -p victory-shader compute_samples_take_derivatives_from_lane_quads -- --test-threads=1` (RTX 5090 & WARP): 1 passed, 0 failed on both. - `cargo clippy -p victory-shader --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 192 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
fuzeofficlal commented 2026-11-26 09:48:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T09:48:30Z.

Review: CHANGES_REQUESTED


86f801cf moves the quad helpers cleanly into emit/lower/quads.rs (bringing emit/lower.rs down to 522,621 bytes), fixes the compute image_sample_o regression by decoding offset_word ahead of the 60 | 61 if quad_grads branch, and binds the coordinate SRV as Stride::Raw.

A few issues still need attention:

  1. image_sample_b_o is unreachable despite matching implicit_level: quads::implicit_level matches image_sample_b_o (triggering group reshaping), and lines 8837-8854 already handle offset_word alongside op == 61, yet emit/lower.rs lines 8664-8677 only dispatch image_sample_b (image_sample_b_o hits Err(name)), and lines 8748-8749 only skip the bias address word for exact name == "image_sample_b". Please either wire up and test image_sample_b_o or explicitly scope it out.
  2. Partial / divergent quad edge cases: quad_gradients reads quad lanes base, base | 1, and base | 2 via waveReadLaneAt.i32 without checking source-lane activity. Please add test coverage for a partial tail quad or divergent control flow.
  3. In-tree offset verification & formatting: Because each mip in compute_samples_take_derivatives_from_lane_quads has a uniform color, the in-tree test only checks mip selection rather than texel offset forwarding; a tagged-texel assertion would pin that down in CI. Also rustfmt --edition 2024 --check reports line-wrapping diffs in quads.rs and synthetic_tests.rs.

Verified locally on Windows 11 x64 (RTX 5090 + WARP + dxil.dll, 86f801cf):

  • cargo run --locked -p xtask -- policy: passed (192 files ok)
  • cargo clippy -p victory-shader --all-targets --locked -- -D warnings (default and --all-features): clean
  • emit::lower::tests: 33 passed, 0 failed
  • compute_samples_take_derivatives_from_lane_quads and image_addresses_of_16_bits_and_clamps (RTX 5090 and VICTORY_WARP=1): 1 passed, 0 failed each
<!-- greyfinch-sync:Marvisak/VIctory:review:6071830111 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6071830111). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T09:48:30Z. **Review:** CHANGES_REQUESTED --- `86f801cf` moves the quad helpers cleanly into `emit/lower/quads.rs` (bringing `emit/lower.rs` down to `522,621` bytes), fixes the compute `image_sample_o` regression by decoding `offset_word` ahead of the `60 | 61 if quad_grads` branch, and binds the coordinate SRV as `Stride::Raw`. A few issues still need attention: 1. **`image_sample_b_o` is unreachable despite matching `implicit_level`**: `quads::implicit_level` matches `image_sample_b_o` (triggering group reshaping), and lines 8837-8854 already handle `offset_word` alongside `op == 61`, yet `emit/lower.rs` lines 8664-8677 only dispatch `image_sample_b` (`image_sample_b_o` hits `Err(name)`), and lines 8748-8749 only skip the bias address word for exact `name == "image_sample_b"`. Please either wire up and test `image_sample_b_o` or explicitly scope it out. 2. **Partial / divergent quad edge cases**: `quad_gradients` reads quad lanes `base`, `base | 1`, and `base | 2` via `waveReadLaneAt.i32` without checking source-lane activity. Please add test coverage for a partial tail quad or divergent control flow. 3. **In-tree offset verification & formatting**: Because each mip in `compute_samples_take_derivatives_from_lane_quads` has a uniform color, the in-tree test only checks mip selection rather than texel offset forwarding; a tagged-texel assertion would pin that down in CI. Also `rustfmt --edition 2024 --check` reports line-wrapping diffs in `quads.rs` and `synthetic_tests.rs`. Verified locally on Windows 11 x64 (RTX 5090 + WARP + `dxil.dll`, `86f801cf`): - `cargo run --locked -p xtask -- policy`: passed (`192 files ok`) - `cargo clippy -p victory-shader --all-targets --locked -- -D warnings` (default and `--all-features`): clean - `emit::lower::tests`: 33 passed, 0 failed - `compute_samples_take_derivatives_from_lane_quads` and `image_addresses_of_16_bits_and_clamps` (RTX 5090 and `VICTORY_WARP=1`): 1 passed, 0 failed each
wwwwwwww3333333 commented 2026-11-26 11:04:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by wwwwwwww3333333 on 2026-11-26T10:53:27Z.


Thanks @fuzeofficlal. All three are addressed in 9833d58.

  1. image_sample_b_o is wired up: it takes the image_sample_b path, with the words in the order offset, bias, u, v. The test covers it with a bias of 1.
  2. Groups that are not whole quads: an implicit-level sample in a group whose size is not a multiple of 4 is now refused ("an implicit-level sample in a group of partial quads"), since the last quad would read lanes that are not threads. Lanes of a quad that diverge before the sample are not handled: the derivatives are undefined there on the hardware too, so I documented it in the code and added no test for it.
  3. Each texel of the test texture now carries its x (red = level + x / 10000), so the test checks the texel read as well as the level. Plain reads texel 8, the offset form 9, and the biased form with an offset reads level 2 at coordinate 5.25. rustfmt on quads.rs and synthetic_tests.rs is clean for what this PR touches; the one remaining diff, at synthetic_tests.rs:744, is older code I left alone.

Tests (RX 6750 XT and WARP, Windows 11, Rust 1.98.1 MSVC): the lane-quad test passes in wave32 and wave64 for all three forms, twice in a row. victory-shader 303 passed, 0 failed, 3 ignored. clippy -D warnings clean, cargo xtask policy 192 files ok, lower.rs 523,244 bytes.

Not covered: quads that diverge before a sample, and any title.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7189974818 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7189974818). Originally posted by [wwwwwwww3333333](https://github.com/wwwwwwww3333333) on 2026-11-26T10:53:27Z. --- Thanks @fuzeofficlal. All three are addressed in 9833d58. 1. image_sample_b_o is wired up: it takes the image_sample_b path, with the words in the order offset, bias, u, v. The test covers it with a bias of 1. 2. Groups that are not whole quads: an implicit-level sample in a group whose size is not a multiple of 4 is now refused ("an implicit-level sample in a group of partial quads"), since the last quad would read lanes that are not threads. Lanes of a quad that diverge before the sample are not handled: the derivatives are undefined there on the hardware too, so I documented it in the code and added no test for it. 3. Each texel of the test texture now carries its x (red = level + x / 10000), so the test checks the texel read as well as the level. Plain reads texel 8, the offset form 9, and the biased form with an offset reads level 2 at coordinate 5.25. rustfmt on quads.rs and synthetic_tests.rs is clean for what this PR touches; the one remaining diff, at synthetic_tests.rs:744, is older code I left alone. Tests (RX 6750 XT and WARP, Windows 11, Rust 1.98.1 MSVC): the lane-quad test passes in wave32 and wave64 for all three forms, twice in a row. victory-shader 303 passed, 0 failed, 3 ignored. clippy -D warnings clean, cargo xtask policy 192 files ok, lower.rs 523,244 bytes. Not covered: quads that diverge before a sample, and any title.
steven-seagull27 commented 2026-11-26 11:04:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T11:00:00Z.


@wwwwwwww3333333 Confirmed 9833d58 on an RTX 5080 and Windows inbox WARP. With image_sample_b_o, both returned 1,920/1,920 correct mip and texel tags in each of two fresh runs. That is 960/960 for guest Wave32 and 960/960 for Wave64 on each adapter. I used point sampling, LOD biases −1, 0, +1, and five signed XY offsets across all 64 threads of an 8×8 group.

The tag encodes mip, X and Y independently. Holding lane 0's offset at (-2,+1) gave these exact readbacks on both adapters.

Bias Mip Texel (X,Y) Readback
−1 0 (14,13) 846
0 1 (6,7) 10454
+1 2 (2,4) 20258

At bias +1, changing just the offset to (0,0) read mip 2 at (4,3) (20196). The unchanged PR test also passed all three instruction forms on both guest wave sizes and adapters. For a [3,1,1] group, translation refused all three forms on Wave32 and Wave64 with the expected partial-quad diagnostic, before dispatch.

AI-assisted synthetic test. Divergence within a quad and title behavior remain untested here.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7190123723 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7190123723). Originally posted by [steven-seagull27](https://github.com/steven-seagull27) on 2026-11-26T11:00:00Z. --- @wwwwwwww3333333 Confirmed `9833d58` on an RTX 5080 and Windows inbox WARP. With `image_sample_b_o`, both returned **1,920/1,920 correct mip and texel tags** in each of two fresh runs. That is 960/960 for guest Wave32 and 960/960 for Wave64 on each adapter. I used point sampling, LOD biases −1, 0, +1, and five signed XY offsets across all 64 threads of an 8×8 group. The tag encodes mip, X and Y independently. Holding lane 0's offset at `(-2,+1)` gave these exact readbacks on both adapters. | Bias | Mip | Texel (X,Y) | Readback | |---:|---:|---:|---:| | −1 | 0 | (14,13) | 846 | | 0 | 1 | (6,7) | 10454 | | +1 | 2 | (2,4) | 20258 | At bias +1, changing just the offset to `(0,0)` read mip 2 at `(4,3)` (20196). The unchanged PR test also passed all three instruction forms on both guest wave sizes and adapters. For a `[3,1,1]` group, translation refused all three forms on Wave32 and Wave64 with the expected partial-quad diagnostic, before dispatch. AI-assisted synthetic test. Divergence within a quad and title behavior remain untested here.
fuzeofficlal commented 2026-11-26 11:18:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T11:18:43Z.

Review: CHANGES_REQUESTED


Verified 9833d580 on RTX 5090 and WARP: image_sample_b_o is now wired into the sampleGrad path, partial-quad thread groups are rejected (product % 4 != 0), emit/lower.rs stays under the policy cap at 523,244 bytes, and compute_samples_take_derivatives_from_lane_quads passes all three forms (Plain, Offset, BiasOffset) in Wave32 and Wave64 on both hardware and WARP with tagged texel checks.

One remaining blocker prevents merging:

  • Multi-row groups that also set console_lanes (emit/lower.rs:620-626, 2936-2976): if !console_lanes skips flattening [X, Y, Z] to [X*Y*Z, 1, 1], leaving the 2D/3D group intact and falling back to thread_id's align_down(waveReadLaneFirst(flattenedThreadIdInGroup), wave) + lane_index. On hosts that assign 2D groups in 2×2 tiles rather than x-major order (e.g., [6, 8, 1] at Wave32), two waves can start at flat IDs 0 and 28, both rounding down to 0 and producing duplicate guest thread IDs and corrupted quad gradients.

Two smaller notes:

  • Divergent branches within a quad call waveReadLaneAt.i32 unconditionally on base, base | 1, and base | 2 (quads.rs:45-70), where inactive lanes yield undefined values (potentially propagating into sampleGrad derivatives); keeping that boundary explicit and/or adding divergent-quad coverage is worth considering.
  • quads::implicit_level (quads.rs:8-15) matches image_get_lod, image_sample_c, image_sample_cl, and cube (kind == 5) ops even though compute quad_grads only lowers non-cube op 60/61.

Please make multi-row implicit-level compute groups with console_lanes independent of host tile ordering and add a multi-wave test covering that combination.

Verified locally on Windows 11 x64 (RTX 5090 + WARP + dxil.dll, 9833d580):

  • cargo run --locked -p xtask -- policy (192 files ok) and cargo clippy --workspace --all-targets -- -D warnings (default and --all-features): clean.
  • emit::lower::tests (33 passed), compute_samples_take_derivatives_from_lane_quads (Wave32 & Wave64, all 3 forms), image_addresses_of_16_bits_and_clamps, and emit::tests (17/17): all passed on both RTX 5090 and WARP.
<!-- greyfinch-sync:Marvisak/VIctory:review:6073236828 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6073236828). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T11:18:43Z. **Review:** CHANGES_REQUESTED --- Verified `9833d580` on RTX 5090 and WARP: `image_sample_b_o` is now wired into the `sampleGrad` path, partial-quad thread groups are rejected (`product % 4 != 0`), `emit/lower.rs` stays under the policy cap at `523,244` bytes, and `compute_samples_take_derivatives_from_lane_quads` passes all three forms (`Plain`, `Offset`, `BiasOffset`) in Wave32 and Wave64 on both hardware and WARP with tagged texel checks. One remaining blocker prevents merging: - **Multi-row groups that also set `console_lanes` (`emit/lower.rs:620-626, 2936-2976`)**: `if !console_lanes` skips flattening `[X, Y, Z]` to `[X*Y*Z, 1, 1]`, leaving the 2D/3D group intact and falling back to `thread_id`'s `align_down(waveReadLaneFirst(flattenedThreadIdInGroup), wave) + lane_index`. On hosts that assign 2D groups in 2×2 tiles rather than x-major order (e.g., `[6, 8, 1]` at Wave32), two waves can start at flat IDs `0` and `28`, both rounding down to `0` and producing duplicate guest thread IDs and corrupted quad gradients. Two smaller notes: - Divergent branches within a quad call `waveReadLaneAt.i32` unconditionally on `base`, `base | 1`, and `base | 2` (`quads.rs:45-70`), where inactive lanes yield undefined values (potentially propagating into `sampleGrad` derivatives); keeping that boundary explicit and/or adding divergent-quad coverage is worth considering. - `quads::implicit_level` (`quads.rs:8-15`) matches `image_get_lod`, `image_sample_c`, `image_sample_cl`, and cube (`kind == 5`) ops even though compute `quad_grads` only lowers non-cube `op` 60/61. Please make multi-row implicit-level compute groups with `console_lanes` independent of host tile ordering and add a multi-wave test covering that combination. Verified locally on Windows 11 x64 (RTX 5090 + WARP + `dxil.dll`, `9833d580`): - `cargo run --locked -p xtask -- policy` (`192 files ok`) and `cargo clippy --workspace --all-targets -- -D warnings` (default and `--all-features`): clean. - `emit::lower::tests` (33 passed), `compute_samples_take_derivatives_from_lane_quads` (Wave32 & Wave64, all 3 forms), `image_addresses_of_16_bits_and_clamps`, and `emit::tests` (17/17): all passed on both RTX 5090 and WARP.
steven-seagull27 commented 2026-11-26 12:05:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T11:39:54Z.


@fuzeofficlal I reproduced the multi-row failure from your review on 9833d580, on both the RTX 5080 (621.40) and app-local WARP 1.0.22. The guest shader combines image_sample with v_readlane_b32 and stores a pair at every guest thread ID: the tagged mip/texel it sampled and the flat ID it read from wave lane 0. Review

Guest group Wave32 destinations left unwritten on the PR head, each adapter Correct pairs with the patch, each adapter
6 × 8 × 1 16 / 48 48 / 48
6 × 16 × 1 32 / 96 96 / 96
8 × 8 × 1 control 0 / 64 64 / 64

A native HLSL probe on both adapters read first flat IDs 0 and 28 for the two 6 × 8 waves. Both round down to base 0. Sixteen IDs get assigned twice and IDs 32–47 are missing. The native 48 × 1 control read 0 and 32. An independent CPU model enumerating 2 × 2 tiles gives the same collisions.

The fix uses one host row for implicit-level sampling even when another instruction requires console lanes. It retains the wave lane index and reconstructs x/y/z with the original guest dimensions. Across the three shapes the RTX matched 208/208 Wave32 pairs. WARP 1.0.22 matched 208/208 at each of Wave32 and Wave64. Windows inbox WARP skipped both fixed widths. The regression also checks the emitted group dimensions without a working GPU. These measurements cover the converged sampling path. Commit and regression

git fetch https://github.com/steven-seagull27/VIctory.git codex/pr2999-multirow-guest-ids
git cherry-pick eec90086e8cd9d350addb5d00d12c633c525ea63
cargo test --locked -p victory-shader --lib multirow_samples_and_console_wave_reads_keep_each_guest_thread -- --nocapture

The original quad sampling test, strict all-feature shader Clippy, and asset policy passed. AI-assisted with Codex. Synthetic inputs on native Windows.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7191014090 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7191014090). Originally posted by [steven-seagull27](https://github.com/steven-seagull27) on 2026-11-26T11:39:54Z. --- @fuzeofficlal I reproduced the multi-row failure from your review on `9833d580`, on both the RTX 5080 (621.40) and app-local WARP 1.0.22. The guest shader combines `image_sample` with `v_readlane_b32` and stores a pair at every guest thread ID: the tagged mip/texel it sampled and the flat ID it read from wave lane 0. [Review](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6073236828) | Guest group | Wave32 destinations left unwritten on the PR head, each adapter | Correct pairs with the patch, each adapter | |---|---:|---:| | 6 × 8 × 1 | 16 / 48 | 48 / 48 | | 6 × 16 × 1 | 32 / 96 | 96 / 96 | | 8 × 8 × 1 control | 0 / 64 | 64 / 64 | A native HLSL probe on both adapters read first flat IDs **0 and 28** for the two 6 × 8 waves. Both round down to base 0. Sixteen IDs get assigned twice and IDs 32–47 are missing. The native 48 × 1 control read 0 and 32. An independent CPU model enumerating 2 × 2 tiles gives the same collisions. The fix uses one host row for implicit-level sampling even when another instruction requires console lanes. It retains the wave lane index and reconstructs x/y/z with the original guest dimensions. Across the three shapes the RTX matched **208/208** Wave32 pairs. WARP 1.0.22 matched **208/208 at each of Wave32 and Wave64**. Windows inbox WARP skipped both fixed widths. The regression also checks the emitted group dimensions without a working GPU. These measurements cover the converged sampling path. [Commit and regression](https://github.com/steven-seagull27/VIctory/commit/eec90086e8cd9d350addb5d00d12c633c525ea63) ```sh git fetch https://github.com/steven-seagull27/VIctory.git codex/pr2999-multirow-guest-ids git cherry-pick eec90086e8cd9d350addb5d00d12c633c525ea63 cargo test --locked -p victory-shader --lib multirow_samples_and_console_wave_reads_keep_each_guest_thread -- --nocapture ``` The original quad sampling test, strict all-feature shader Clippy, and asset policy passed. AI-assisted with Codex. Synthetic inputs on native Windows.
fuzeofficlal commented 2026-11-26 12:40:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T12:40:39Z.

Review: APPROVED


Verified 3f6b2052: removing the !console_lanes gate (crates/victory-shader/src/emit/lower.rs:616-624) flattens multi-row implicit-level compute groups even when fixed wave widths are requested, and thread_id (emit/lower.rs:2935-2977) reconstructs guest coordinates using self.rows.or(self.s.threads). The merged emit/lower.rs is 523,400 bytes (888 bytes under the 524,288-byte limit).

Local verification passed: xtask policy (192 files ok), cargo clippy -p victory-shader --all-targets -- -D warnings (default & --all-features), emit::lower::tests (33 passed), multirow_samples_and_console_wave_reads_keep_each_guest_thread (208/208 sample + wave-base pairs matched across 6x8, 6x16, and 8x8 on RTX 5090 Wave32; Wave64 hardware and inbox WARP skipped via OPTIONS1), and both compute_samples_take_derivatives_from_lane_quads (Plain/Offset/BiasOffset, Wave32/Wave64) and image_addresses_of_16_bits_and_clamps passed on RTX 5090 and WARP.

Non-blocking note: quads::implicit_level still matches image_get_lod, image_sample_c*, and cube ops outside compute lowering's quad_grads support, and divergent quads remain outside verified coverage. Approving to clear the earlier request for changes.

<!-- greyfinch-sync:Marvisak/VIctory:review:6074282848 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6074282848). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T12:40:39Z. **Review:** APPROVED --- Verified `3f6b2052`: removing the `!console_lanes` gate (`crates/victory-shader/src/emit/lower.rs:616-624`) flattens multi-row implicit-level compute groups even when fixed wave widths are requested, and `thread_id` (`emit/lower.rs:2935-2977`) reconstructs guest coordinates using `self.rows.or(self.s.threads)`. The merged `emit/lower.rs` is 523,400 bytes (888 bytes under the 524,288-byte limit). Local verification passed: `xtask policy` (`192 files ok`), `cargo clippy -p victory-shader --all-targets -- -D warnings` (default & `--all-features`), `emit::lower::tests` (33 passed), `multirow_samples_and_console_wave_reads_keep_each_guest_thread` (208/208 sample + wave-base pairs matched across `6x8`, `6x16`, and `8x8` on RTX 5090 Wave32; Wave64 hardware and inbox WARP skipped via `OPTIONS1`), and both `compute_samples_take_derivatives_from_lane_quads` (Plain/Offset/BiasOffset, Wave32/Wave64) and `image_addresses_of_16_bits_and_clamps` passed on RTX 5090 and WARP. Non-blocking note: `quads::implicit_level` still matches `image_get_lod`, `image_sample_c*`, and cube ops outside compute lowering's `quad_grads` support, and divergent quads remain outside verified coverage. Approving to clear the earlier request for changes.
wwwwwwww3333333 commented 2026-11-26 13:04:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by wwwwwwww3333333 on 2026-11-26T12:15:22Z.


Thanks @fuzeofficlal for the review and @steven-seagull27 for the reproduction and the fix. I took steven's commit (eec9008, now 3f6b205 on this branch, author kept) as it is: a multi-row group that also needs console lanes is flattened to one host row for implicit-level sampling too, and the thread ids are rebuilt from the guest dimensions.

On an RX 6750 XT (RDNA2, driver 32.0.21045.29003, Windows 11, Rust 1.98.1), with the commit on top of 9833d58:

  • multirow_samples_and_console_wave_reads_keep_each_guest_thread passes on the hardware adapter (the built-in WARP skipped its Wave32 and Wave64 cases as unsupported);
  • compute_samples_take_derivatives_from_lane_quads passes;
  • victory-shader: 304 passed, 0 failed, 3 ignored;
  • clippy -D warnings clean, cargo xtask policy 193 files ok, lower.rs 523,400 bytes.

Not addressed in this push: quads that diverge before a sample (still undefined, as on the hardware), and the cube and image_get_lod cases where implicit_level matches more than compute lowers (I haven't added coverage for them).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7191767182 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7191767182). Originally posted by [wwwwwwww3333333](https://github.com/wwwwwwww3333333) on 2026-11-26T12:15:22Z. --- Thanks @fuzeofficlal for the review and @steven-seagull27 for the reproduction and the fix. I took steven's commit (eec9008, now 3f6b205 on this branch, author kept) as it is: a multi-row group that also needs console lanes is flattened to one host row for implicit-level sampling too, and the thread ids are rebuilt from the guest dimensions. On an RX 6750 XT (RDNA2, driver 32.0.21045.29003, Windows 11, Rust 1.98.1), with the commit on top of 9833d58: - multirow_samples_and_console_wave_reads_keep_each_guest_thread passes on the hardware adapter (the built-in WARP skipped its Wave32 and Wave64 cases as unsupported); - compute_samples_take_derivatives_from_lane_quads passes; - victory-shader: 304 passed, 0 failed, 3 ignored; - clippy -D warnings clean, cargo xtask policy 193 files ok, lower.rs 523,400 bytes. Not addressed in this push: quads that diverge before a sample (still undefined, as on the hardware), and the cube and image_get_lod cases where implicit_level matches more than compute lowers (I haven't added coverage for them).
neonbyte1 commented 2026-11-26 20:18:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-26T20:18:06Z.


In-game result on an RTX 5090 (driver 620.73.04), Linux, GE-Proton11-14 Wine with vkd3d-proton, VICTORY_WAVE32_APPROX=1. GTA VI's opening yard.

Base: main plus the wave64 stack #2176 → #2711 → #2925 reconciled with #439, and a few unmerged PRs this setup needs. On that base, 8 compute/pixel programs are still refused in game.

Added: this PR together with #2363 and #1014's permlane change (manual merges onto that stack; neither is based on #2176/#439).

This PR's program now runs in game: 5b2ce592c3a5dd09 CS_DensityShadowMapMips ("implicit-derivative sample in console flow without 64-lane host waves" before).

  • Refused shaders in game: 8 → 5, in two runs; the other two fixed by the other PRs.
  • Offline census: the same programs translate, 0 newly refused.
  • Frame time, timed runs: 564 ms of GPU commands and 840 ms per frame with the PRs, against 580 ms and 850 ms without. No cost.
  • Stability: no Xid or device removal.
  • Pictures: frames 1500/1700 match the base apart from this scene's usual lit/hazy variation.

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7202512055 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7202512055). Originally posted by [neonbyte1](https://github.com/neonbyte1) on 2026-11-26T20:18:06Z. --- In-game result on an RTX 5090 (driver 620.73.04), Linux, GE-Proton11-14 Wine with vkd3d-proton, `VICTORY_WAVE32_APPROX=1`. GTA VI's opening yard. **Base:** `main` plus the wave64 stack #2176 → #2711 → #2925 reconciled with #439, and a few unmerged PRs this setup needs. On that base, 8 compute/pixel programs are still refused in game. **Added:** this PR together with #2363 and #1014's permlane change (manual merges onto that stack; neither is based on #2176/#439). **This PR's program now runs in game:** `5b2ce592c3a5dd09` `CS_DensityShadowMapMips` ("implicit-derivative sample in console flow without 64-lane host waves" before). - **Refused shaders in game:** 8 → 5, in two runs; the other two fixed by the other PRs. - **Offline census:** the same programs translate, 0 newly refused. - **Frame time, timed runs:** 564 ms of GPU commands and 840 ms per frame with the PRs, against 580 ms and 850 ms without. No cost. - **Stability:** no Xid or device removal. - **Pictures:** frames 1500/1700 match the base apart from this scene's usual lit/hazy variation. _AI-assisted (Claude); measured on my machine, no game data shared._
kilolimaVI commented 2026-11-29 11:37:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kilolimaVI on 2026-11-29T11:37:38Z.


RDNA3 iGPU row, and a combined tree. AMD Radeon 780M (driver 32.0.13022.3006, Windows 11), head 3f6b205:

  • compute_samples_take_derivatives_from_lane_quads: pass. Plain and offset samples read level ~1.00 (1.0008-1.0012) at wave32 and wave64, the same as WARP, so the console's level, not the 3 the RX 6750 XT / 7900 XTX read without the change.
  • multirow_samples_and_console_wave_reads_keep_each_guest_thread: pass, hardware Wave32 6x8 / 6x16 / 8x8 and Wave64 6x8 all pairs matched (WARP skips Wave32).

Merged with the other pending shader PRs, so the maintainers can see they fit: main 63bcca4 + #3097 + this + #3617 + #3717 + #1315 (kilolimaVI/VIctory shader/1315-on-main) + #3716, branch kilolimaVI/VIctory integration/shader-6 (9d6417b). Two trivial conflicts: mod geometry; next to mod quads; in lower.rs, and this PR's and #3716's tests both appended to synthetic_tests.rs (kept both). lower.rs ends at 476,152 bytes. On that tree: victory-shader lib 320 passed / 0 failed / 3 ignored, victory-gpu (diagnostics) 246 passed, rest of the workspace 93 passed, both clippy configurations and the asset policy pass.

Per #201 and #2027 this class is the bulk of the validator failures (748 of the 819 at 32 lanes).

AI-assisted (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7255240172 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7255240172). Originally posted by [kilolimaVI](https://github.com/kilolimaVI) on 2026-11-29T11:37:38Z. --- RDNA3 iGPU row, and a combined tree. AMD Radeon 780M (driver 32.0.13022.3006, Windows 11), head `3f6b205`: - `compute_samples_take_derivatives_from_lane_quads`: pass. Plain and offset samples read level ~1.00 (1.0008-1.0012) at wave32 and wave64, the same as WARP, so the console's level, not the 3 the RX 6750 XT / 7900 XTX read without the change. - `multirow_samples_and_console_wave_reads_keep_each_guest_thread`: pass, hardware Wave32 6x8 / 6x16 / 8x8 and Wave64 6x8 all pairs matched (WARP skips Wave32). Merged with the other pending shader PRs, so the maintainers can see they fit: main `63bcca4` + #3097 + this + #3617 + #3717 + #1315 (`kilolimaVI/VIctory` `shader/1315-on-main`) + #3716, branch `kilolimaVI/VIctory` `integration/shader-6` (`9d6417b`). Two trivial conflicts: `mod geometry;` next to `mod quads;` in `lower.rs`, and this PR's and #3716's tests both appended to `synthetic_tests.rs` (kept both). `lower.rs` ends at 476,152 bytes. On that tree: victory-shader lib 320 passed / 0 failed / 3 ignored, victory-gpu (diagnostics) 246 passed, rest of the workspace 93 passed, both clippy configurations and the asset policy pass. Per #201 and #2027 this class is the bulk of the validator failures (748 of the 819 at 32 lanes). AI-assisted (Claude).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.

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

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

No due date set.

Reference
Marvisak/VIctory!2997
No description provided.