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

Open
github-bot wants to merge 6 commits from github-bot/gh-2999 into main AGit
Owner

@⁠wwwwwwww3333333 on GitHub · 2026-11-26 03:00 UTC · original
wwwwwwww3333333:fix/compute-lane-quads → main · +541 −24 · 3 files · 6 commits · open

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

**@⁠wwwwwwww3333333** on GitHub · 2026-11-26 03:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999) `wwwwwwww3333333:fix/compute-lane-quads` → `main` · +541 −24 · 3 files · 6 commits · open 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
A console compute program may sample with an implicit level of detail
(image_sample, image_sample_b): the hardware takes the coordinates'
coarse derivatives across each quad of lanes. As DXIL `sample` and
`sampleBias`, these programs failed validation with "Function uses
features incompatible with the shader stage (cs) of the entry function".
The gradients are now read from the quad (lane 1 less lane 0, lane 2
less lane 0, through waveReadLaneAt) and passed to `sampleGrad`; a bias
scales them by 2^bias. Pixel and mesh shaders are unchanged.

`victory translate --validate` over the title's shaders on Windows
(dxil.dll 10.0.26100), on top of #439: compute programs validated go
from 1,658 to 2,193 of 2,193 emitted; no other count changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SDn5GupcrERtCYPyoztdtG
The console takes an image_sample's implicit level from quads of lanes,
and its compute lanes hold threads in x-major order: in a group of more
than one row, a quad is four threads of one row. A host places
two-dimensional groups its own way. On an RX 6750 XT an [8, 8, 1] group
put 2x2 tiles of threads in a quad, so the quad gradients of #1237 (and
the host's own derivatives, and main) took the y step across rows.

A compute program with such a sample in a group of more than one row,
and no other cross-lane code (which already relabels threads to console
lanes), now runs as one host row of as many threads; the thread ids are
taken back from the flat id. Every host keeps the order of a one-row
group, and the console's wave size is not required, so 32-lane hosts
run these too.

The bias of a sample with 16-bit addresses is the low half's f16, as on
the sampleBias path (#1237 read the register as f32:
image_addresses_of_16_bits_and_clamps failed with it).

Test compute_samples_take_derivatives_from_lane_quads: an [8, 8, 1]
group whose lane quads give level 1 and whose 2x2 tiles give level 3.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHmoV6jP696CZH3DVW7V1
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:19:46 +00:00
image_sample_o in compute was refused on the quad path (fuzeofficlal). The offset word is now decoded once, before the sample, sampleBias and sampleGrad paths, and the quad path passes it to sampleGrad. The lane-quad test binds its coordinates as a raw view, as the program reads them (steven-seagull27), and runs image_sample_o in wave32 and wave64.

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

Claude-Session: https://claude.ai/code/session_01LwHmoV6jP696CZH3DVW7V1
lower.rs was 525,457 bytes on this branch, over the repository's 512 KiB
file limit (policy::tests::repository_passes_policy). implicit_level,
the one-row thread ids, quad_gradients (which now takes the bias scale)
and the decoding of a sample's offset word move to a submodule, as
lower/bvh.rs does; lower.rs is 522,621 bytes. No change in behaviour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHmoV6jP696CZH3DVW7V1
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-26 03:16 UTC · original

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.

**@⁠steven-seagull27** on GitHub · 2026-11-26 03:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7181567865) **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.
Author
Owner

@⁠zed6000 on GitHub · 2026-11-26 03:34 UTC · original

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.

**@⁠zed6000** on GitHub · 2026-11-26 03:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7181831861) 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.
Author
Owner

@⁠wwwwwwww3333333 on GitHub · 2026-11-26 03:53 UTC · original

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.

**@⁠wwwwwwww3333333** on GitHub · 2026-11-26 03:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7182105564) 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.
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-26 04:06 UTC · original

@⁠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.

**@⁠steven-seagull27** on GitHub · 2026-11-26 04:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7182304771) @⁠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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 05:30 UTC · original · edited 2026-11-26 07:19 UTC

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

**@⁠Marvisak** on GitHub · 2026-11-26 05:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7183542420) · edited 2026-11-26 07:19 UTC <!-- 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)_
Author
Owner

@⁠wwwwwwww3333333 on GitHub · 2026-11-26 06:03 UTC · original

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.

**@⁠wwwwwwww3333333** on GitHub · 2026-11-26 06:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7184045515) 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.
- image_sample_b_o takes the same path as image_sample_b (offset, bias,
  then coordinates).
- An implicit-level sample in a group whose size is not a multiple of 4
  is refused: the last quad would read lanes that are not threads.
  Quads that diverge before the sample are undefined, as on hardware.
- The lane-quad test tags each texel with its x, so it checks the level
  and the texel read; it covers image_sample_b_o with a bias of 1.
- rustfmt on quads.rs and the test.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHmoV6jP696CZH3DVW7V1
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-26 03:04 UTC · original · approved these changes

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.

**@⁠kotekompotek** on GitHub · 2026-11-26 03:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6067996996) · **approved these changes** 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.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 03:22 UTC · original · requested changes

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.
**@⁠fuzeofficlal** on GitHub · 2026-11-26 03:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6068131101) · **requested changes** 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.
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 07:29 UTC · original · approved these changes

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).

**@⁠Dukestar69** on GitHub · 2026-11-26 07:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6070047771) · **approved these changes** 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).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 09:48 UTC · original · requested changes

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
**@⁠fuzeofficlal** on GitHub · 2026-11-26 09:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6071830111) · **requested changes** `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
Author
Owner

@⁠wwwwwwww3333333 on GitHub · 2026-11-26 10:53 UTC · original

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.

**@⁠wwwwwwww3333333** on GitHub · 2026-11-26 10:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7189974818) 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.
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-26 11:00 UTC · original

@⁠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.

**@⁠steven-seagull27** on GitHub · 2026-11-26 11:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7190123723) @⁠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.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 11:18 UTC · original · requested changes

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.
**@⁠fuzeofficlal** on GitHub · 2026-11-26 11:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6073236828) · **requested changes** 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.
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-26 11:39 UTC · original

@⁠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.

**@⁠steven-seagull27** on GitHub · 2026-11-26 11:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7191014090) @⁠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://git.gtahub.st/github/Marvisak--VIctory/pulls/2999) | 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.
Author
Owner

@⁠wwwwwwww3333333 on GitHub · 2026-11-26 12:15 UTC · original

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).

**@⁠wwwwwwww3333333** on GitHub · 2026-11-26 12:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7191767182) 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).
Author
Owner

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

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.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 12:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#pullrequestreview-6074282848) · **approved these changes** 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.
Author
Owner

@⁠neonbyte1 on GitHub · 2026-11-26 20:18 UTC · original

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.

**@⁠neonbyte1** on GitHub · 2026-11-26 20:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/2999#issuecomment-7202512055) 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._
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2999'
git switch 'github-bot/gh-2999'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2999'
git switch 'github-bot/gh-2999'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2999'
git switch 'main'
git merge --squash 'github-bot/gh-2999'
git switch 'main'
git merge --ff-only 'github-bot/gh-2999'
git switch 'main'
git merge 'github-bot/gh-2999'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

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