Shaders: texel offsets, comparison and gather forms of image samples #160

Closed
github-bot wants to merge 6 commits from gh-pr/160/head into gh-pr/160/base
Owner

@⁠r4tedx on GitHub · 2026-11-24 01:01 UTC · original
r4tedx:shader/image-sampling-family → main · +1765 −117 · 7 files · 6 commits · closed without merging

Rebased onto main 58fed37 (head 3ef252e, 2026-11-24). #634 (image_sample_o with constant offsets) merged and conflicted with this branch in emit/lower.rs. This branch already lowers that form: constant offsets in -8..7 become the same immediates #634 emits, and it also takes offsets past that range or per lane at a known level, which #634 refuses. So the rebase keeps this branch's offset code and uses #634's Module::int_value to read the constant. Its offset test (texel_offsets_and_levels_sample_the_texels_they_name) passes on the RTX 5070. cargo test -p victory-shader at 3ef252e: 97 passed, 1 ignored. The measurements below were taken at 25e917b, before the rebase.

The last commit (3ef252e) is not part of this change: on main the test target of victory-shader does not compile (issue #719; #117's test calls #612's changed helper with one argument). It passes the missing argument so this branch's tests can run, and goes away when main has the fix.

What

fn image accepted a fixed list of sample and gather opcodes; every other MIMG form failed the whole shader. Samples and gathers now lower by their form (comparison, derivatives, coarse or 16-bit derivatives, level, level 0, bias, level clamp, texel offset). The address dwords follow LLVM's ImageDimIntrinsics / SITargetLowering::lowerImage and Mesa's ac_build_image_opcode: offset, bias, reference, derivatives, coordinates, level or clamp.

Newly lowered:

  • Texel offsets (_o) on image_sample, _lz, _l, _b, _d, _c, _c_lz: DXIL immediates when the offset word is a constant in -8..7; otherwise the coordinates move by offset / size, only at a level known at translation.
  • _cl (the DXIL clamp argument), _cd (as _d, marked as a shortcut), _g16.
  • Gradient samples of cubes (image_sample_d, _d_cl, _cd, _g16 forms): two derivatives per direction, those of the face coordinates, turned into the direction's derivatives for SampleGrad.
  • Comparisons: image_sample_c, _c_cl (and _o) in compute as well as pixel shaders; image_sample_c_l(_o) at a level known to be 0; image_sample_c_b(_cl)(_o) with a bias known to be 0.
  • Gathers: image_gather4_l(_o) at any level. A level known to be 0 is a real gather; a run-time level is four samples at the footprint's texel centres at that level, so the sampler's own address mode and level range apply. image_gather4_c_lz(_o) and image_gather4_c_l(_o) at level 0 through textureGatherCmp.
  • a16: the bias as an f16 in the low half of its dword, and comparisons. a16 packs the coordinates and the level, not the derivatives (only _g16 opcodes have 16-bit derivatives); the decoder on main counted them packed, fixed here.
  • image_store of some channels: the data VGPRs are the dmask's channels in order; the others are written as 0.

Still refused, each with its own reason: gathers at an implicit level or with a bias; comparison gathers and cube gathers at a level not known to be 0; comparisons with derivatives, or at a level or with a bias not known to be 0 (SampleCmpLevel is SM 6.7, SampleCmpBias/Grad 6.8); offsets past -8..7 or per lane at a level not known here; offsets, texel coordinates and level queries on cubes.

Measured on the title's shaders

By @⁠EduAzevedo (comments below), victory translate --jobs 8 --list over the retail 1.0.2.1 shaders, main d2a4bae against this PR at 25e917b:

main this PR
Vertex and pixel programs emitted 12,284 12,357
Refused for image_sample_d_cl (all on cubes) 27 4 (they stop at a cross-lane operation outside compute)
Refused for image_gather4_l (compute) 12 0
a biased image sample with 16-bit coordinates 108 0
image_sample_o 4 0
Programs that translated on main and no longer do 0

Validated, by TrashTalker3460 (comment): victory translate --validate --list over the 1.0.2.1 shaders.rpf alone (26,084 programs, so the baselines are 12 lower than above), with DXC 1.9.2609's validator, main d2a4bae against 25e917b:

Emitted / validated main this PR
Vertex and pixel 12,272 / 12,172 12,345 / 12,237
Compute 1,693 / 1,670 1,705 / 1,682
Mesh 8,191 / 8,129 8,191 / 8,129
Programs that validated on main and no longer do 0

All 12 image_gather4_l programs and the 23 image_sample_d_cl programs that emit also validate. Of the 108 programs freed from a biased image sample with 16-bit coordinates, 36 validate, 48 stop next at a scalar memory read as data, 16 at a lane mask read as data, and 8 emit but fail validation with Container part 'Program Input Signature' does not match expected for module. Those 8 are pixel shaders of one family (three distinct programs). #201 counts 21 input-signature mismatches of that kind on main, so they may be that existing problem reached for the first time; whether this PR's sampling path plays a part is not established.

With host pipelines, by adnanoos (comment): victory translate --list --pipelines over shaders.rpf on an RTX 5060 Laptop, main ffe310e against 5ce85c5. That run counts 16 image_gather4_l programs where the table above has 12: 10 meshlet-culling compute programs, which all translate and get host pipelines, and 6 water_micro_geom_renderer ones, which translate and whose pipelines the NVIDIA driver refuses with E_INVALIDARG, as it refuses about 320 compute pipelines on main. Vertex and pixel modules with pipelines: 12,231 to 12,300. One title run each: the world is black with audio on both; main ended in a device removal and this PR did not, with a warm pipeline library, so that difference is not established.

In the title, by nullmarsh (details): on an RX 9060 XT, d2a4bae + #135 + #365 + #500 with and without this PR at 25e917b, 12 traced world frames per run, 2 runs each. Without it, #293's top G-buffer pixel shader 7bdefdfde461f6e3 is refused for image_sample_d_cl and every ExecuteIndirect on its pipelines is dropped (692 and 1,017 in the two runs). With it the shader translates and all of them run, none dropped; the run-time image_sample_d_cl refusals go from 3 programs to 0. There was no visible change (the frames are still black apart from the title card) and no device loss in those four runs.

What those draws write, same tester (target dumps, one run per arm): the pipelines of 7bdefdfde461f6e3 (mesh 792314eae4f7da77) write six 2560x1440 colour targets and the depth target. Without this PR, and with it but that shader skipped, 5 to 6% of depth is non-background. With this PR, depth is 94% covered with only 6 distinct levels and the colour targets 100% with 1 to 4 levels: the draws now run and cover the screen with near-constant values, not a scene. With #587 on top the targets look like the run without this PR. So a build that takes this PR without a fix for what that mesh program emits (#586 / #587 work on that) gets screen-covering output from these draws. Whether the near-constant colour comes from the geometry alone or also from this PR's sampling is not established.

These are two rows of #293's ranking (image_sample_d_cl, image_gather4_l). The cube gradient and run-time-level gather support were added because of the first run: every image_sample_d_cl in the title is on a cube, and no image_gather4_l has a provably zero level. Not measured: whether the translated programs compute the right result in the title, and whether these cubes are cube arrays (the lowering treats the view as a cube; for an array the face operand adds 8 x the slice, a shortcut: already on main).

Checked against the references

  • a16 bias: lowerImage, "Bias is of type half but occupies full 32-bit". #73, #136, #306 read it as an f32; noted there.
  • a16 and derivatives: LLVM's gfx10_asm_mimg.s has image_sample_d ... 2D a16 with five address dwords, image_sample_d_cl ... 2D a16 six.
  • Partial stores: RDNA 2 ISA, MIMG DMASK: "Writes: defines which components are written with data from VGPRs (missing components get 0). Enabled components come from consecutive VGPRs."

Known limits

  • Non-immediate texel offsets and run-time-level gathers work on the level the instruction asks for. If the sampler's own LOD bias or range moves the sampled level, they read another level's grid; a probe with requested level 0 and sampler MinLOD 1 shows it. Marked as shortcut: in the code.
  • Implicit-derivative samples in compute fail the 1.6 validator we declare, as the plain image_sample in compute on main already does; the tests accept that one error for those forms.
  • Whether the texel offset applies before the address mode is not confirmed.

Overlap

  • #73 and #318 cover _cl / image_sample_d_cl, #136 and #360 image_gather4_l, #138 cube gradients, #332 partial stores. Where they differ from this PR I have left notes on each with the reference that settles it. Whichever lands first, I will rebase.
  • #48 (atomics) and #25 (buffer formats) are untouched.

Tested

Windows 11, NVIDIA RTX 5070, hand-assembled programs:

  • GPU, every lane against values worked out on the CPU: offsets (known, past -8..7, per lane), levels, gradients, g16, a16 with 32-bit gradients, bias and clamp through compute quads; cube gradients on every face along s and along t, with and without a clamp; gathers at levels 0-2 passed per lane, with per-lane offsets, through a clamp and a wrap sampler; comparisons and comparison gathers per texel; partial stores.
  • Every newly accepted form translates and passes dxil.dll; refusal reasons are checked; the decoder's address counts are checked against LLVM's.
  • Each new test fails without its change (and the cube and gather tests fail with a wrong scale or a permuted order).
  • cargo test -p victory-shader: 77 passed. clippy: nothing new. cargo xtask policy: ok.

The title was not used in my tests; the title measurements above are the named testers'. AI-assisted.

🤖 Generated with Claude Code

**@⁠r4tedx** on GitHub · 2026-11-24 01:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/160) `r4tedx:shader/image-sampling-family` → `main` · +1765 −117 · 7 files · 6 commits · closed without merging **Rebased onto `main` `58fed37` (head `3ef252e`, 2026-11-24).** #634 (`image_sample_o` with constant offsets) merged and conflicted with this branch in `emit/lower.rs`. This branch already lowers that form: constant offsets in -8..7 become the same immediates #634 emits, and it also takes offsets past that range or per lane at a known level, which #634 refuses. So the rebase keeps this branch's offset code and uses #634's `Module::int_value` to read the constant. Its offset test (`texel_offsets_and_levels_sample_the_texels_they_name`) passes on the RTX 5070. `cargo test -p victory-shader` at `3ef252e`: 97 passed, 1 ignored. The measurements below were taken at `25e917b`, before the rebase. The last commit (`3ef252e`) is not part of this change: on `main` the test target of `victory-shader` does not compile (issue #719; #117's test calls #612's changed helper with one argument). It passes the missing argument so this branch's tests can run, and goes away when `main` has the fix. ## What `fn image` accepted a fixed list of sample and gather opcodes; every other MIMG form failed the whole shader. Samples and gathers now lower by their form (comparison, derivatives, coarse or 16-bit derivatives, level, level 0, bias, level clamp, texel offset). The address dwords follow LLVM's `ImageDimIntrinsics` / `SITargetLowering::lowerImage` and Mesa's `ac_build_image_opcode`: offset, bias, reference, derivatives, coordinates, level or clamp. Newly lowered: - **Texel offsets (`_o`)** on `image_sample`, `_lz`, `_l`, `_b`, `_d`, `_c`, `_c_lz`: DXIL immediates when the offset word is a constant in -8..7; otherwise the coordinates move by offset / size, only at a level known at translation. - **`_cl`** (the DXIL clamp argument), **`_cd`** (as `_d`, marked as a shortcut), **`_g16`**. - **Gradient samples of cubes** (`image_sample_d`, `_d_cl`, `_cd`, `_g16` forms): two derivatives per direction, those of the face coordinates, turned into the direction's derivatives for `SampleGrad`. - **Comparisons**: `image_sample_c`, `_c_cl` (and `_o`) in compute as well as pixel shaders; `image_sample_c_l(_o)` at a level known to be 0; `image_sample_c_b(_cl)(_o)` with a bias known to be 0. - **Gathers**: `image_gather4_l(_o)` at any level. A level known to be 0 is a real gather; a run-time level is four samples at the footprint's texel centres at that level, so the sampler's own address mode and level range apply. `image_gather4_c_lz(_o)` and `image_gather4_c_l(_o)` at level 0 through `textureGatherCmp`. - **a16**: the bias as an f16 in the low half of its dword, and comparisons. a16 packs the coordinates and the level, not the derivatives (only `_g16` opcodes have 16-bit derivatives); the decoder on `main` counted them packed, fixed here. - **`image_store` of some channels**: the data VGPRs are the dmask's channels in order; the others are written as 0. Still refused, each with its own reason: gathers at an implicit level or with a bias; comparison gathers and cube gathers at a level not known to be 0; comparisons with derivatives, or at a level or with a bias not known to be 0 (SampleCmpLevel is SM 6.7, SampleCmpBias/Grad 6.8); offsets past -8..7 or per lane at a level not known here; offsets, texel coordinates and level queries on cubes. ## Measured on the title's shaders By @⁠EduAzevedo (comments below), `victory translate --jobs 8 --list` over the retail 1.0.2.1 shaders, `main` `d2a4bae` against this PR at `25e917b`: | | `main` | this PR | |---|---|---| | Vertex and pixel programs emitted | 12,284 | 12,357 | | Refused for `image_sample_d_cl` (all on cubes) | 27 | 4 (they stop at `a cross-lane operation outside compute`) | | Refused for `image_gather4_l` (compute) | 12 | 0 | | `a biased image sample with 16-bit coordinates` | 108 | 0 | | `image_sample_o` | 4 | 0 | | Programs that translated on `main` and no longer do | | 0 | **Validated**, by TrashTalker3460 ([comment](https://git.gtahub.st/github/Marvisak--VIctory/pulls/160)): `victory translate --validate --list` over the 1.0.2.1 `shaders.rpf` alone (26,084 programs, so the baselines are 12 lower than above), with DXC 1.9.2609's validator, `main` `d2a4bae` against `25e917b`: | Emitted / validated | `main` | this PR | |---|---|---| | Vertex and pixel | 12,272 / 12,172 | 12,345 / 12,237 | | Compute | 1,693 / 1,670 | 1,705 / 1,682 | | Mesh | 8,191 / 8,129 | 8,191 / 8,129 | | Programs that validated on `main` and no longer do | | 0 | All 12 `image_gather4_l` programs and the 23 `image_sample_d_cl` programs that emit also validate. Of the 108 programs freed from `a biased image sample with 16-bit coordinates`, 36 validate, 48 stop next at `a scalar memory read as data`, 16 at `a lane mask read as data`, and **8 emit but fail validation** with `Container part 'Program Input Signature' does not match expected for module`. Those 8 are pixel shaders of one family (three distinct programs). #201 counts 21 input-signature mismatches of that kind on `main`, so they may be that existing problem reached for the first time; whether this PR's sampling path plays a part is not established. **With host pipelines**, by adnanoos ([comment](https://git.gtahub.st/github/Marvisak--VIctory/pulls/160)): `victory translate --list --pipelines` over `shaders.rpf` on an RTX 5060 Laptop, `main` `ffe310e` against `5ce85c5`. That run counts 16 `image_gather4_l` programs where the table above has 12: 10 meshlet-culling compute programs, which all translate and get host pipelines, and 6 `water_micro_geom_renderer` ones, which translate and whose pipelines the NVIDIA driver refuses with `E_INVALIDARG`, as it refuses about 320 compute pipelines on `main`. Vertex and pixel modules with pipelines: 12,231 to 12,300. One title run each: the world is black with audio on both; `main` ended in a device removal and this PR did not, with a warm pipeline library, so that difference is not established. **In the title**, by nullmarsh ([details](https://git.gtahub.st/github/Marvisak--VIctory/pulls/318)): on an RX 9060 XT, `d2a4bae` + #135 + #365 + #500 with and without this PR at `25e917b`, 12 traced world frames per run, 2 runs each. Without it, #293's top G-buffer pixel shader `7bdefdfde461f6e3` is refused for `image_sample_d_cl` and every `ExecuteIndirect` on its pipelines is dropped (692 and 1,017 in the two runs). With it the shader translates and all of them run, none dropped; the run-time `image_sample_d_cl` refusals go from 3 programs to 0. There was no visible change (the frames are still black apart from the title card) and no device loss in those four runs. **What those draws write**, same tester ([target dumps](https://git.gtahub.st/github/Marvisak--VIctory/pulls/160), one run per arm): the pipelines of `7bdefdfde461f6e3` (mesh `792314eae4f7da77`) write six 2560x1440 colour targets and the depth target. Without this PR, and with it but that shader skipped, 5 to 6% of depth is non-background. With this PR, depth is 94% covered with only 6 distinct levels and the colour targets 100% with 1 to 4 levels: the draws now run and cover the screen with near-constant values, not a scene. With #587 on top the targets look like the run without this PR. So a build that takes this PR without a fix for what that mesh program emits (#586 / #587 work on that) gets screen-covering output from these draws. Whether the near-constant colour comes from the geometry alone or also from this PR's sampling is not established. These are two rows of #293's ranking (`image_sample_d_cl`, `image_gather4_l`). The cube gradient and run-time-level gather support were added because of the first run: every `image_sample_d_cl` in the title is on a cube, and no `image_gather4_l` has a provably zero level. Not measured: whether the translated programs compute the right result in the title, and whether these cubes are cube arrays (the lowering treats the view as a cube; for an array the face operand adds 8 x the slice, a `shortcut:` already on `main`). ## Checked against the references - a16 bias: `lowerImage`, "Bias is of type half but occupies full 32-bit". #73, #136, #306 read it as an f32; noted there. - a16 and derivatives: LLVM's `gfx10_asm_mimg.s` has `image_sample_d ... 2D a16` with five address dwords, `image_sample_d_cl ... 2D a16` six. - Partial stores: RDNA 2 ISA, MIMG `DMASK`: "Writes: defines which components are written with data from VGPRs (missing components get 0). Enabled components come from consecutive VGPRs." ## Known limits - Non-immediate texel offsets and run-time-level gathers work on the level the instruction asks for. If the sampler's own LOD bias or range moves the sampled level, they read another level's grid; a probe with requested level 0 and sampler MinLOD 1 shows it. Marked as `shortcut:` in the code. - Implicit-derivative samples in compute fail the 1.6 validator we declare, as the plain `image_sample` in compute on `main` already does; the tests accept that one error for those forms. - Whether the texel offset applies before the address mode is not confirmed. ## Overlap - #73 and #318 cover `_cl` / `image_sample_d_cl`, #136 and #360 `image_gather4_l`, #138 cube gradients, #332 partial stores. Where they differ from this PR I have left notes on each with the reference that settles it. Whichever lands first, I will rebase. - #48 (atomics) and #25 (buffer formats) are untouched. ## Tested Windows 11, NVIDIA RTX 5070, hand-assembled programs: - GPU, every lane against values worked out on the CPU: offsets (known, past -8..7, per lane), levels, gradients, g16, a16 with 32-bit gradients, bias and clamp through compute quads; cube gradients on every face along s and along t, with and without a clamp; gathers at levels 0-2 passed per lane, with per-lane offsets, through a clamp and a wrap sampler; comparisons and comparison gathers per texel; partial stores. - Every newly accepted form translates and passes `dxil.dll`; refusal reasons are checked; the decoder's address counts are checked against LLVM's. - Each new test fails without its change (and the cube and gather tests fail with a wrong scale or a permuted order). - `cargo test -p victory-shader`: 77 passed. clippy: nothing new. `cargo xtask policy`: ok. The title was not used in my tests; the title measurements above are the named testers'. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Image samples and gathers now lower by their form (comparison,
derivatives, coarse or 16-bit derivatives, level, level 0, bias, level
clamp, texel offset) instead of a fixed list of opcodes. The address
dwords follow LLVM's ImageDimIntrinsics and Mesa's ac_build_image_opcode:
offset, bias and reference a dword each, then the derivatives (16-bit
ones two per dword, each direction its own), the coordinates and the
level or clamp. The decoder counted 32-bit derivatives for the _g16
forms; it now counts them packed.

Newly lowered:
- every texel-offset form of the samples above; DXIL immediates when the
  offset word is a constant in -8..7, else (past -8..7, or per lane) the
  coordinates move by offset / size at a level known at translation;
- _cl (the DXIL clamp argument), _cd (as _d), _g16;
- image_sample_c, _c_cl and their _o forms in compute as well as pixel
  shaders; image_sample_c_l(_o) with a level, image_sample_c_b(_cl)(_o)
  with a bias known to be 0;
- image_gather4_l(_o) with a level known to be 0, image_gather4_c_lz(_o),
  image_gather4_c_l(_o) at level 0 (textureGatherCmp);
- a16 biased samples (the bias an f16 in its dword's low half) and a16
  comparisons;
- image_store of some channels: the data VGPRs are the dmask's channels,
  the others are written as 0.
Still refused, each with its reason: gathers at an implicit level or with
a bias, comparisons with derivatives, at a level or with a bias not known
to be 0 (SM 6.7/6.8 operations), and offsets past -8..7 or per lane at a
level not known at translation.

Tests: hand-assembled compute programs on the RTX 5070 against texels
worked out on the CPU (offsets known, past -8..7 and per lane; levels,
gradients, g16, bias and clamp through compute quads; comparisons and
comparison gathers per texel; partial stores, d16 too), every newly
accepted form through the validator, and the refusal reasons. On
upstream/main all of them fail ("... is not supported").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GFX10.3 sizes the derivatives of an image sample by its opcode (the _g16
forms hold them two per dword, each direction starting a dword) and the
coordinates and the level by a16, independently. The decoder and the
lowering took a16 to make the derivatives 16-bit too, so an a16 sample
with 32-bit derivatives had too few address dwords and read its
derivatives and coordinates from the wrong halves.

After LLVM's SITargetLowering::lowerImage where hasG16 (the opcode's
gradients are packed only for G16; "Don't compress addresses for G16"),
and its MC test gfx10_asm_mimg.s: image_sample_d ... 2D a16 has five
address dwords (four derivatives and the packed coordinates),
image_sample_d_cl ... 2D a16 six.

Tests: the decoder's address counts for image_sample_d, _d_cl, _d_g16
and _d_cl_o with a16 (5, 6, 3, 7); on the RTX 5070, image_sample_d with
a16 and 32-bit derivatives samples the level its derivatives pick at the
packed f16 coordinates. With the old sizing that case reads level 3 at
texel 0 for a lane that should read level 0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A cube's derivatives are those of its two face coordinates: two per
direction, then s, t and the face (and the clamp), eight address dwords
for image_sample_d_cl. The lowering took three per direction as for a 3-D
image, ran past the instruction's addresses and refused the program with
"an image address" (and refused cube gradients by name after that).

The face coordinates' derivatives become the direction's for DXIL's
SampleGrad: cube_direction is linear in s and t on a face (u = 2s - 3,
v = 2t - 3), so the direction's derivative is the same per-face table with
2 ds for u, 2 dt for v and 0 for the constant axis. image_sample_d, _d_cl,
_cd and their _g16 forms now lower on cubes; texel coordinates, level
queries and texel offsets on cubes stay refused.

Reported from the title by a tester on PR #160: every image_sample_d_cl
in the 25 programs that stopped at "an image address" is on a cube, with
eight address dwords and no a16.

Test (RTX 5070): a cube whose every face and level holds its own value,
sampled at each face's centre with derivatives of 1, 2 and 4 texels along
s or along t, with and without a clamp: the texel read names the face and
the level. Without the change the programs stop at "an image address";
with the direction's derivative scaled by 1 instead of 2 they read one
level too fine. The test host gains a cube view with mip levels.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
image_gather4_l and _l_o lowered only when the level was a known 0,
since DXIL's gathers read level 0. A tester's run over the title's
shaders (PR #160) found all 12 programs with image_gather4_l stop there:
none has a level the translator can prove is 0.

Such a gather is now four samples: the footprint's four texels, in the
gather's order, each sampled at its centre at that level. At a texel's
centre every filter returns that texel, and the sampler applies its own
address mode and level range, as it does for the console's gather. The
footprint is floor(u * size - 0.5) and the next texel in each direction,
moved by the texel offsets (any offsets, per lane too), on the level
rounded to the nearest whole one and clamped to the view's levels.
Marked as a shortcut: a sampler whose LOD bias or range moves the
sampled level off that one reads another grid. A gather at a level
known to be 0 stays a real gather. Comparison gathers (the function is
in the sampler) and cube gathers at an unknown level stay refused.

Test (RTX 5070): on a mipmapped texture whose texels name themselves,
lanes gather at levels 0, 1 and 2 passed per lane, with and without
per-lane offsets past -8..7, through a clamp sampler and a wrap sampler;
each lane's four values are the footprint's, clamped or wrapped. With the
gather order permuted the test fails.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
On a machine whose default adapter is WARP (a CI runner), the test process
died of an access violation as soon as these tests started: 4 of 4 runs
here with VICTORY_WARP=1, and the first CI run of this branch. One after
the other they pass on WARP. A lock of their own was not enough (1 of 5
runs still died, with an image test beside a VALU test), so they take the
VALU tests' lock, which moves out of `run_cases` to be shared. With it, 8
of 8 runs pass on WARP and the tests still pass on the RTX 5070.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
main merged #566, which gives `resource::track` a fourth argument (the
structured program, for per-lane descriptor tracking). No textual
conflict, but this branch's image test helper called it with three and
the test target no longer built on main (reported by DeerSilver on the
PR). The helper now structures the program first and passes it, as
main's own tests do.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:52:42 +00:00
github-bot closed this pull request 2026-11-26 03:52:42 +00:00
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 01:18 UTC · original

Tested be7369a on Arch Linux x86_64, rustc 1.98.1: pass.

  • cargo test -p victory-shader: 57 passed, 0 failed (2 test binaries), including the 6 tests this PR adds.
  • The full workspace still needs #112 for the victory-gpu E0425.

No game data used.

**@⁠DaviTostes** on GitHub · 2026-11-24 01:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7118975018) Tested `be7369a` on **Arch Linux x86_64, rustc 1.98.1**: **pass**. - `cargo test -p victory-shader`: **57 passed, 0 failed** (2 test binaries), including the 6 tests this PR adds. - The full workspace still needs #112 for the `victory-gpu` E0425. No game data used.
Author
Owner

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

Pushed one more commit (7265593) after checking the open points in the description against AMD's ISA reference and LLVM. One was a mistake of mine, two are now settled:

Fixed: a16 does not make derivatives 16-bit. The decoder (already on main) and my lowering took a16 to pack the derivatives too. On GFX10.3 the two are independent: derivatives are 16-bit only in the _g16 opcodes, a16 packs the coordinates and the level. LLVM's SITargetLowering::lowerImage does it that way where hasG16, and its MC test gfx10_asm_mimg.s has

image_sample_d    v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16    ; 5 address dwords
image_sample_d_cl v[0:3], [v0, v1, v2, v3, v4, v6], ... dim:SQ_RSRC_IMG_2D a16        ; 6

i.e. four 32-bit derivatives plus the packed coordinates (and clamp). The decoder test now checks 5, 6, 3 and 7 address dwords for image_sample_d, _d_cl, _d_g16 and _d_cl_o with a16, and a GPU case samples with a16 and 32-bit derivatives; with the old sizing that case reads level 3 at texel 0 where it should read level 0.

Settled: the a16 bias. lowerImage has "Special handling of bias when A16 is on. Bias is of type half but occupies full 32-bit" and builds {bias, poison} as a v2f16, so the bias is an f16 in the low half of its own dword, as this PR reads it. #73 and #136 read that dword as an f32; I left a note on both.

Settled: partial stores. RDNA 2 ISA, MIMG DMASK: "Writes: defines which components are written with data from VGPRs (missing components get 0). Enabled components come from consecutive VGPRs." That is what this PR does, alpha included.

Still open: whether the texel offset applies before the address mode. cargo test -p victory-shader: 75 passed on the RTX 5070. No game data used.

**@⁠r4tedx** on GitHub · 2026-11-24 01:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7119381282) Pushed one more commit (`7265593`) after checking the open points in the description against AMD's ISA reference and LLVM. One was a mistake of mine, two are now settled: **Fixed: a16 does not make derivatives 16-bit.** The decoder (already on `main`) and my lowering took a16 to pack the derivatives too. On GFX10.3 the two are independent: derivatives are 16-bit only in the `_g16` opcodes, a16 packs the coordinates and the level. LLVM's `SITargetLowering::lowerImage` does it that way where `hasG16`, and its MC test `gfx10_asm_mimg.s` has ``` image_sample_d v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16 ; 5 address dwords image_sample_d_cl v[0:3], [v0, v1, v2, v3, v4, v6], ... dim:SQ_RSRC_IMG_2D a16 ; 6 ``` i.e. four 32-bit derivatives plus the packed coordinates (and clamp). The decoder test now checks 5, 6, 3 and 7 address dwords for `image_sample_d`, `_d_cl`, `_d_g16` and `_d_cl_o` with a16, and a GPU case samples with a16 and 32-bit derivatives; with the old sizing that case reads level 3 at texel 0 where it should read level 0. **Settled: the a16 bias.** `lowerImage` has "Special handling of bias when A16 is on. Bias is of type half but occupies full 32-bit" and builds `{bias, poison}` as a `v2f16`, so the bias is an f16 in the low half of its own dword, as this PR reads it. #73 and #136 read that dword as an f32; I left a note on both. **Settled: partial stores.** RDNA 2 ISA, MIMG `DMASK`: "Writes: defines which components are written with data from VGPRs (missing components get 0). Enabled components come from consecutive VGPRs." That is what this PR does, alpha included. Still open: whether the texel offset applies before the address mode. `cargo test -p victory-shader`: 75 passed on the RTX 5070. No game data used.
Author
Owner

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

A limit of this PR, confirmed by a probe while reviewing the other image PRs with the same scrutiny (RTX 5070): the fallback for texel offsets that are not immediates (past -8..7, or per lane) shifts the coordinates by offset / size of the level the instruction asks for. If the sampler's own LOD range moves the sampled level (probe: requested level 0, sampler MinLOD 1, x offset +1), the immediate form reads x = 1 at level 1 and the shifted form reads x = 0. The code comment already says this case differs; it is silent, not refused, so it belongs here too. An exact form would need the level the sampler actually uses, which the shader cannot know; refusing non-immediate offsets unless the sampler is known not to clamp the level is the conservative alternative if anyone sees it matter in the title.

From synthetic probes only; I have no copy of the title.

**@⁠r4tedx** on GitHub · 2026-11-24 03:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7120913614) A limit of this PR, confirmed by a probe while reviewing the other image PRs with the same scrutiny (RTX 5070): the fallback for texel offsets that are not immediates (past -8..7, or per lane) shifts the coordinates by offset / size of the level the instruction asks for. If the sampler's own LOD range moves the sampled level (probe: requested level 0, sampler MinLOD 1, x offset +1), the immediate form reads x = 1 at level 1 and the shifted form reads x = 0. The code comment already says this case differs; it is silent, not refused, so it belongs here too. An exact form would need the level the sampler actually uses, which the shader cannot know; refusing non-immediate offsets unless the sampler is known not to clamp the level is the conservative alternative if anyone sees it matter in the title. From synthetic probes only; I have no copy of the title.
Author
Owner

@⁠EduAzevedo on GitHub · 2026-11-24 03:19 UTC · original

Follow-up on the 25 image_sample_d_cl programs that stop at an image address with this PR: every image_sample_d_cl in those programs is on a cube (dim:SQ_RSRC_IMG_CUBE), NSA with 8 address VGPRs, no a16. That is two gradients per direction + three coordinates + the clamp; the translator expects three gradients per direction on a cube (10 dwords), runs past the operand list and refuses.

#138 handles exactly this (a cube's gradients are its two face coordinates'). #318 (1d7bf9b) gives the same result as this PR here: the same 25 stop at an image address, 12,328 vertex and pixel programs emitted. So those draws need #138's cube rule on top of whichever _d_cl lowering is merged.

AI-assisted.

**@⁠EduAzevedo** on GitHub · 2026-11-24 03:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7120988076) Follow-up on the 25 `image_sample_d_cl` programs that stop at `an image address` with this PR: every `image_sample_d_cl` in those programs is on a **cube** (`dim:SQ_RSRC_IMG_CUBE`), NSA with **8** address VGPRs, no `a16`. That is two gradients per direction + three coordinates + the clamp; the translator expects three gradients per direction on a cube (10 dwords), runs past the operand list and refuses. #138 handles exactly this (a cube's gradients are its two face coordinates'). #318 (`1d7bf9b`) gives the same result as this PR here: the same 25 stop at `an image address`, 12,328 vertex and pixel programs emitted. So those draws need #138's cube rule on top of whichever `_d_cl` lowering is merged. AI-assisted.
Author
Owner

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

@⁠EduAzevedo thank you, that is exactly the information this PR was missing, and it reproduces here: a hand-assembled image_sample_d_cl on a cube with eight address dwords stopped at an image address on this branch.

Fixed in b540f51 (pushed). A cube's derivatives are those of its two face coordinates, two per direction, then s, t, the face and the clamp. They become the direction's derivatives for SampleGrad: cube_direction is linear in s and t on a face (u = 2s - 3, v = 2t - 3), so the derivative is the same per-face table with 2 ds for u, 2 dt for v and 0 for the constant axis. image_sample_d, _d_cl, _cd and the _g16 forms now lower on cubes.

Test on an RTX 5070: a cube whose every face and level holds its own value, sampled at each face's centre with derivatives of 1, 2 and 4 texels along s or along t, with and without a clamp; the texel read names the face and the level. With the scale wrong (1 instead of 2) it reads one level too fine, so the test does check the mapping, at face centres. cargo test -p victory-shader: 76 passed.

If you can rerun on b540f51, three things would tell me whether it is right for the title:

  1. Do the 25 programs translate now, and if not, what reason do they stop at next (counts per reason)?
  2. Are those cubes plain cubes or cube arrays? The lowering treats the view as a cube; for a cube array the face operand adds 8 x the slice, which is a shortcut: already on main and would read the wrong slice. Yes/no is enough.
  3. For the image_gather4_l shaders of #293: do they translate here (level known to be 0), or stop at a gather at a level not known to be 0?

On #138: its cube rule is the same idea. The difference between the two PRs is the a16 layout (#138 packs derivatives under a16, which LLVM's gfx10_asm_mimg.s does not; noted there). Since your programs have no a16, that part does not matter for these 25.

No game data used on my side.

**@⁠r4tedx** on GitHub · 2026-11-24 03:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7121069162) @⁠EduAzevedo thank you, that is exactly the information this PR was missing, and it reproduces here: a hand-assembled `image_sample_d_cl` on a cube with eight address dwords stopped at `an image address` on this branch. Fixed in `b540f51` (pushed). A cube's derivatives are those of its two face coordinates, two per direction, then s, t, the face and the clamp. They become the direction's derivatives for `SampleGrad`: `cube_direction` is linear in s and t on a face (u = 2s - 3, v = 2t - 3), so the derivative is the same per-face table with 2 ds for u, 2 dt for v and 0 for the constant axis. `image_sample_d`, `_d_cl`, `_cd` and the `_g16` forms now lower on cubes. Test on an RTX 5070: a cube whose every face and level holds its own value, sampled at each face's centre with derivatives of 1, 2 and 4 texels along s or along t, with and without a clamp; the texel read names the face and the level. With the scale wrong (1 instead of 2) it reads one level too fine, so the test does check the mapping, at face centres. `cargo test -p victory-shader`: 76 passed. If you can rerun on `b540f51`, three things would tell me whether it is right for the title: 1. Do the 25 programs translate now, and if not, what reason do they stop at next (counts per reason)? 2. Are those cubes plain cubes or cube arrays? The lowering treats the view as a cube; for a cube array the face operand adds 8 x the slice, which is a `shortcut:` already on `main` and would read the wrong slice. Yes/no is enough. 3. For the `image_gather4_l` shaders of #293: do they translate here (level known to be 0), or stop at `a gather at a level not known to be 0`? On #138: its cube rule is the same idea. The difference between the two PRs is the a16 layout (#138 packs derivatives under a16, which LLVM's `gfx10_asm_mimg.s` does not; noted there). Since your programs have no a16, that part does not matter for these 25. No game data used on my side.
Author
Owner

@⁠EduAzevedo on GitHub · 2026-11-24 03:32 UTC · original

@⁠EduAzevedo thank you, that is exactly the information this PR was missing, and it reproduces here: a hand-assembled image_sample_d_cl on a cube with eight address dwords stopped at an image address on this branch.

Fixed in b540f51 (pushed). A cube's derivatives are those of its two face coordinates, two per direction, then s, t, the face and the clamp. They become the direction's derivatives for SampleGrad: cube_direction is linear in s and t on a face (u = 2s - 3, v = 2t - 3), so the derivative is the same per-face table with 2 ds for u, 2 dt for v and 0 for the constant axis. image_sample_d, _d_cl, _cd and the _g16 forms now lower on cubes.

Test on an RTX 5070: a cube whose every face and level holds its own value, sampled at each face's centre with derivatives of 1, 2 and 4 texels along s or along t, with and without a clamp; the texel read names the face and the level. With the scale wrong (1 instead of 2) it reads one level too fine, so the test does check the mapping, at face centres. cargo test -p victory-shader: 76 passed.

If you can rerun on b540f51, three things would tell me whether it is right for the title:

  1. Do the 25 programs translate now, and if not, what reason do they stop at next (counts per reason)?
  2. Are those cubes plain cubes or cube arrays? The lowering treats the view as a cube; for a cube array the face operand adds 8 x the slice, which is a shortcut: already on main and would read the wrong slice. Yes/no is enough.
  3. For the image_gather4_l shaders of World: which untranslated shaders cost the most draws (ranked from two runs) #293: do they translate here (level known to be 0), or stop at a gather at a level not known to be 0?

On #138: its cube rule is the same idea. The difference between the two PRs is the a16 layout (#138 packs derivatives under a16, which LLVM's gfx10_asm_mimg.s does not; noted there). Since your programs have no a16, that part does not matter for these 25.

No game data used on my side.

Reran on b540f51, same setup (retail v1.0.2.1 shaders, victory translate --jobs 8 --list against main d2a4bae):

Vertex and pixel programs emitted: 12,284 → 12,357 (12,332 on 7265593).

  1. The cube image_sample_d_cl programs: of the 27 refused for image_sample_d_cl on main, 23 translate; the other 4 stop at a cross-lane operation outside compute (2 of them already did on 7265593). The two programs that hit an image address on main itself translate too: that reason goes 2 → 0.
  2. Cube or cube array: I can't tell offline. The instruction is dim:SQ_RSRC_IMG_CUBE in all of them, which GFX10 also uses for cube arrays; the array size is in the descriptor, which only exists at run time. If it matters I can log the bound views' dimensions in a game run.
  3. image_gather4_l: all 12 stop at a gather at a level not known to be 0; none have a level the translator can prove is 0.

Everything else versus main: a biased image sample with 16-bit coordinates 108 → 0, image_sample_o 4 → 0, v_swap_b32 11 → 0 and v_xnor_b32 1 → 0; the programs that get further now stop at a scalar memory read as data (573 → 621), a lane mask read as data (206 → 222), a descriptor read only as data (179 → 183) and a cross-lane operation outside compute (46 → 50). Nothing that translated on main stopped translating.

**@⁠EduAzevedo** on GitHub · 2026-11-24 03:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7121193999) > @⁠EduAzevedo thank you, that is exactly the information this PR was missing, and it reproduces here: a hand-assembled `image_sample_d_cl` on a cube with eight address dwords stopped at `an image address` on this branch. > > Fixed in `b540f51` (pushed). A cube's derivatives are those of its two face coordinates, two per direction, then s, t, the face and the clamp. They become the direction's derivatives for `SampleGrad`: `cube_direction` is linear in s and t on a face (u = 2s - 3, v = 2t - 3), so the derivative is the same per-face table with 2 ds for u, 2 dt for v and 0 for the constant axis. `image_sample_d`, `_d_cl`, `_cd` and the `_g16` forms now lower on cubes. > > Test on an RTX 5070: a cube whose every face and level holds its own value, sampled at each face's centre with derivatives of 1, 2 and 4 texels along s or along t, with and without a clamp; the texel read names the face and the level. With the scale wrong (1 instead of 2) it reads one level too fine, so the test does check the mapping, at face centres. `cargo test -p victory-shader`: 76 passed. > > If you can rerun on `b540f51`, three things would tell me whether it is right for the title: > > 1. Do the 25 programs translate now, and if not, what reason do they stop at next (counts per reason)? > 2. Are those cubes plain cubes or cube arrays? The lowering treats the view as a cube; for a cube array the face operand adds 8 x the slice, which is a `shortcut:` already on `main` and would read the wrong slice. Yes/no is enough. > 3. For the `image_gather4_l` shaders of [World: which untranslated shaders cost the most draws (ranked from two runs) #293](https://git.gtahub.st/github/Marvisak--VIctory/issues/293): do they translate here (level known to be 0), or stop at `a gather at a level not known to be 0`? > > On #138: its cube rule is the same idea. The difference between the two PRs is the a16 layout (#138 packs derivatives under a16, which LLVM's `gfx10_asm_mimg.s` does not; noted there). Since your programs have no a16, that part does not matter for these 25. > > No game data used on my side. Reran on `b540f51`, same setup (retail v1.0.2.1 shaders, `victory translate --jobs 8 --list` against `main` `d2a4bae`): **Vertex and pixel programs emitted: 12,284 → 12,357** (12,332 on `7265593`). 1. **The cube `image_sample_d_cl` programs:** of the 27 refused for `image_sample_d_cl` on `main`, **23 translate**; the other 4 stop at `a cross-lane operation outside compute` (2 of them already did on `7265593`). The two programs that hit `an image address` on `main` itself translate too: that reason goes 2 → 0. 2. **Cube or cube array:** I can't tell offline. The instruction is `dim:SQ_RSRC_IMG_CUBE` in all of them, which GFX10 also uses for cube arrays; the array size is in the descriptor, which only exists at run time. If it matters I can log the bound views' dimensions in a game run. 3. **`image_gather4_l`:** all 12 stop at `a gather at a level not known to be 0`; none have a level the translator can prove is 0. Everything else versus `main`: `a biased image sample with 16-bit coordinates` 108 → 0, `image_sample_o` 4 → 0, `v_swap_b32` 11 → 0 and `v_xnor_b32` 1 → 0; the programs that get further now stop at `a scalar memory read as data` (573 → 621), `a lane mask read as data` (206 → 222), `a descriptor read only as data` (179 → 183) and `a cross-lane operation outside compute` (46 → 50). Nothing that translated on `main` stopped translating.
Author
Owner

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

@⁠EduAzevedo thank you, this is the first measurement of this PR on the title's shaders, and "nothing that translated on main stopped translating" is the line I most wanted to see.

The 12 image_gather4_l programs. Since none has a level the translator can prove is 0, I have added the general case in 25e917b (pushed): a gather at a run-time level becomes four samples, the footprint's four texels in the gather's order, each sampled at its centre at that level. At a texel's centre every filter returns that texel, and the sampler applies its own address mode and level range, as it does for the console's gather (this is why I did not use textureLoads, which would ignore a wrap or border sampler). A level known to be 0 stays a real gather. Still refused: comparison gathers and cube gathers at an unknown level.

Test on an RTX 5070: a mipmapped texture whose texels name themselves; lanes gather at levels 0, 1 and 2 passed per lane, with and without per-lane offsets, through a clamp and a wrap sampler; each lane's four values are that level's footprint. cargo test -p victory-shader: 77 passed.

One shortcut: to know about: the footprint is that of the level rounded to the nearest whole one. A sampler whose LOD bias or range moves the sampled level off that one would read another grid.

The rest of your numbers, as I read them:

  • the 4 image_sample_d_cl programs left stop at a cross-lane operation outside compute, which is the SGPR-spill work (#54, #309), not this PR;
  • cube vs. cube array: thank you, a log of the bound views' dimensions from a run would settle it, but only if it is cheap; it matters only if the 23 read the wrong slice;
  • the programs that get further now pile up at a scalar memory read as data (621). That is the largest reason in your list by far, and from what I can see the part of #136 that reads s_buffer descriptors is what addresses it. I have asked there whether it can be split out.

If you rerun on 25e917b: do the 12 gather programs translate, and what do they stop at next?

No game data used on my side.

**@⁠r4tedx** on GitHub · 2026-11-24 03:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7121260669) @⁠EduAzevedo thank you, this is the first measurement of this PR on the title's shaders, and "nothing that translated on `main` stopped translating" is the line I most wanted to see. **The 12 `image_gather4_l` programs.** Since none has a level the translator can prove is 0, I have added the general case in `25e917b` (pushed): a gather at a run-time level becomes four samples, the footprint's four texels in the gather's order, each sampled at its centre at that level. At a texel's centre every filter returns that texel, and the sampler applies its own address mode and level range, as it does for the console's gather (this is why I did not use `textureLoad`s, which would ignore a wrap or border sampler). A level known to be 0 stays a real gather. Still refused: comparison gathers and cube gathers at an unknown level. Test on an RTX 5070: a mipmapped texture whose texels name themselves; lanes gather at levels 0, 1 and 2 passed per lane, with and without per-lane offsets, through a clamp and a wrap sampler; each lane's four values are that level's footprint. `cargo test -p victory-shader`: 77 passed. One `shortcut:` to know about: the footprint is that of the level rounded to the nearest whole one. A sampler whose LOD bias or range moves the sampled level off that one would read another grid. **The rest of your numbers**, as I read them: - the 4 `image_sample_d_cl` programs left stop at `a cross-lane operation outside compute`, which is the SGPR-spill work (#54, #309), not this PR; - cube vs. cube array: thank you, a log of the bound views' dimensions from a run would settle it, but only if it is cheap; it matters only if the 23 read the wrong slice; - the programs that get further now pile up at `a scalar memory read as data` (621). That is the largest reason in your list by far, and from what I can see the part of #136 that reads `s_buffer` descriptors is what addresses it. I have asked there whether it can be split out. If you rerun on `25e917b`: do the 12 gather programs translate, and what do they stop at next? No game data used on my side.
Author
Owner

@⁠EduAzevedo on GitHub · 2026-11-24 03:53 UTC · original

@⁠EduAzevedo thank you, this is the first measurement of this PR on the title's shaders, and "nothing that translated on main stopped translating" is the line I most wanted to see.

The 12 image_gather4_l programs. Since none has a level the translator can prove is 0, I have added the general case in 25e917b (pushed): a gather at a run-time level becomes four samples, the footprint's four texels in the gather's order, each sampled at its centre at that level. At a texel's centre every filter returns that texel, and the sampler applies its own address mode and level range, as it does for the console's gather (this is why I did not use textureLoads, which would ignore a wrap or border sampler). A level known to be 0 stays a real gather. Still refused: comparison gathers and cube gathers at an unknown level.

Test on an RTX 5070: a mipmapped texture whose texels name themselves; lanes gather at levels 0, 1 and 2 passed per lane, with and without per-lane offsets, through a clamp and a wrap sampler; each lane's four values are that level's footprint. cargo test -p victory-shader: 77 passed.

One shortcut: to know about: the footprint is that of the level rounded to the nearest whole one. A sampler whose LOD bias or range moves the sampled level off that one would read another grid.

The rest of your numbers, as I read them:

If you rerun on 25e917b: do the 12 gather programs translate, and what do they stop at next?

No game data used on my side.

Reran on 25e917b, same setup:

  • The 12 image_gather4_l programs (all compute) translate now; none stops at anything next.
  • The 27 cube image_sample_d_cl programs are as before: 23 translate, 4 stop at a cross-lane operation outside compute.
  • Vertex and pixel programs emitted: 12,357 (gathers are compute, so that count does not move). No program that translated on main stops translating.

A correction to my two earlier comments: my main binary had been built before I updated to d2a4bae. Rebuilt and rerun, main itself already has v_swap_b32 0, v_xnor_b32 0 and a descriptor read only as data at 183, so those three lines are not effects of this PR. The 12,284 for main, and everything else I reported for this PR, hold against the rebuilt main. Sorry for the noise.

Cube vs. cube array: not done yet; it needs a game run with a small local logging change, so I'll only do it if you think it is worth it.

**@⁠EduAzevedo** on GitHub · 2026-11-24 03:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7121513786) > @⁠EduAzevedo thank you, this is the first measurement of this PR on the title's shaders, and "nothing that translated on `main` stopped translating" is the line I most wanted to see. > > **The 12 `image_gather4_l` programs.** Since none has a level the translator can prove is 0, I have added the general case in `25e917b` (pushed): a gather at a run-time level becomes four samples, the footprint's four texels in the gather's order, each sampled at its centre at that level. At a texel's centre every filter returns that texel, and the sampler applies its own address mode and level range, as it does for the console's gather (this is why I did not use `textureLoad`s, which would ignore a wrap or border sampler). A level known to be 0 stays a real gather. Still refused: comparison gathers and cube gathers at an unknown level. > > Test on an RTX 5070: a mipmapped texture whose texels name themselves; lanes gather at levels 0, 1 and 2 passed per lane, with and without per-lane offsets, through a clamp and a wrap sampler; each lane's four values are that level's footprint. `cargo test -p victory-shader`: 77 passed. > > One `shortcut:` to know about: the footprint is that of the level rounded to the nearest whole one. A sampler whose LOD bias or range moves the sampled level off that one would read another grid. > > **The rest of your numbers**, as I read them: > > * the 4 `image_sample_d_cl` programs left stop at `a cross-lane operation outside compute`, which is the SGPR-spill work ([shader: emit WaveSize(32) for small Wave64 groups and elide SGPR spills in SSA #54](https://git.gtahub.st/github/Marvisak--VIctory/pulls/54), [Shaders: forward SGPRs reloaded from VGPR lanes as the spilled value #309](https://git.gtahub.st/github/Marvisak--VIctory/pulls/309)), not this PR; > * cube vs. cube array: thank you, a log of the bound views' dimensions from a run would settle it, but only if it is cheap; it matters only if the 23 read the wrong slice; > * the programs that get further now pile up at `a scalar memory read as data` (621). That is the largest reason in your list by far, and from what I can see the part of [Shaders: s_buffer descriptor reads, signature/PSV0 fixes, gather4_l, a16 samples (+479 VS/PS, +200 mesh validated) #136](https://git.gtahub.st/github/Marvisak--VIctory/pulls/136) that reads `s_buffer` descriptors is what addresses it. I have asked there whether it can be split out. > > If you rerun on `25e917b`: do the 12 gather programs translate, and what do they stop at next? > > No game data used on my side. Reran on `25e917b`, same setup: - **The 12 `image_gather4_l` programs (all compute) translate now**; none stops at anything next. - The 27 cube `image_sample_d_cl` programs are as before: 23 translate, 4 stop at `a cross-lane operation outside compute`. - Vertex and pixel programs emitted: 12,357 (gathers are compute, so that count does not move). No program that translated on `main` stops translating. **A correction to my two earlier comments:** my `main` binary had been built before I updated to `d2a4bae`. Rebuilt and rerun, `main` itself already has `v_swap_b32` 0, `v_xnor_b32` 0 and `a descriptor read only as data` at 183, so those three lines are not effects of this PR. The 12,284 for `main`, and everything else I reported for this PR, hold against the rebuilt `main`. Sorry for the noise. Cube vs. cube array: not done yet; it needs a game run with a small local logging change, so I'll only do it if you think it is worth it.
Author
Owner

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

@⁠EduAzevedo thank you for the rerun and for the correction; I have put your numbers, with the correction applied, into the PR description under "Measured on the title's shaders" and credited them to you. Tell me if I have misread anything: 12,284 to 12,357 vertex and pixel programs, the 12 gather programs translating, 23 of 27 cube image_sample_d_cl, 108 to 0 biased a16 samples, and nothing lost.

Cube vs. cube array: not worth a run on its own. If you (or anyone) are logging bound views in a world run for another reason, the dimension of the views these 23 programs sample would settle it; until then the description says it is unmeasured.

The 4 left at a cross-lane operation outside compute belong to the SGPR-spill PRs (#54 / #309). If you ever run this PR together with one of those, whether those 4 then translate would be a useful line for that PR's thread.

**@⁠r4tedx** on GitHub · 2026-11-24 03:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7121531617) @⁠EduAzevedo thank you for the rerun and for the correction; I have put your numbers, with the correction applied, into the PR description under "Measured on the title's shaders" and credited them to you. Tell me if I have misread anything: 12,284 to 12,357 vertex and pixel programs, the 12 gather programs translating, 23 of 27 cube `image_sample_d_cl`, 108 to 0 biased a16 samples, and nothing lost. Cube vs. cube array: not worth a run on its own. If you (or anyone) are logging bound views in a world run for another reason, the dimension of the views these 23 programs sample would settle it; until then the description says it is unmeasured. The 4 left at `a cross-lane operation outside compute` belong to the SGPR-spill PRs (#54 / #309). If you ever run this PR together with one of those, whether those 4 then translate would be a useful line for that PR's thread.
Author
Owner

@⁠EduAzevedo on GitHub · 2026-11-24 04:00 UTC · original

@⁠EduAzevedo thank you for the rerun and for the correction; I have put your numbers, with the correction applied, into the PR description under "Measured on the title's shaders" and credited them to you. Tell me if I have misread anything: 12,284 to 12,357 vertex and pixel programs, the 12 gather programs translating, 23 of 27 cube image_sample_d_cl, 108 to 0 biased a16 samples, and nothing lost.

Cube vs. cube array: not worth a run on its own. If you (or anyone) are logging bound views in a world run for another reason, the dimension of the views these 23 programs sample would settle it; until then the description says it is unmeasured.

The 4 left at a cross-lane operation outside compute belong to the SGPR-spill PRs (#54 / #309). If you ever run this PR together with one of those, whether those 4 then translate would be a useful line for that PR's thread.

Yes, that's all correct against the rebuilt main

**@⁠EduAzevedo** on GitHub · 2026-11-24 04:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7121615299) > @⁠EduAzevedo thank you for the rerun and for the correction; I have put your numbers, with the correction applied, into the PR description under "Measured on the title's shaders" and credited them to you. Tell me if I have misread anything: 12,284 to 12,357 vertex and pixel programs, the 12 gather programs translating, 23 of 27 cube `image_sample_d_cl`, 108 to 0 biased a16 samples, and nothing lost. > > Cube vs. cube array: not worth a run on its own. If you (or anyone) are logging bound views in a world run for another reason, the dimension of the views these 23 programs sample would settle it; until then the description says it is unmeasured. > > The 4 left at `a cross-lane operation outside compute` belong to the SGPR-spill PRs (#54 / #309). If you ever run this PR together with one of those, whether those 4 then translate would be a useful line for that PR's thread. Yes, that's all correct against the rebuilt main
Author
Owner

@⁠marquezinii on GitHub · 2026-11-24 05:17 UTC · original

Reviewed 25e917b and ran it on an NVIDIA RTX 5070 (driver 621.24), Windows 11, with the SDK's dxil.dll validating: cargo test -p victory-shader 77 passed. I found no defect.

On the a16 bias question raised across the competing PRs: LLVM (SITargetLowering::lowerImage, {bias, poison}) and Mesa ACO ("pack it into its own dword anyway") both keep an a16 bias as an f16 in the low half of its own dword, which is what this PR reads. A GPU probe with 0x7BFF in the high half of the bias dword samples the expected level here, so a reading that takes the whole dword as an f32 would not match. The decoder's address dword counts also agree with LLVM's gfx10_asm_mimg.s for the a16 _d/_d_cl/_c_d_o forms (derivatives stay 32-bit under a16 unless _g16), and the operand order (offset, bias, z-compare, derivatives, coordinates, level/clamp) matches LLVM and ACO.

Four extra GPU probes for cases the PR's tests skip, all passing (81 with them):

  • a16 b (garbage in the high half), b_o, l at a run-time f16 level, d_cl with packed clamp, gather4_l at a run-time level, c_lz with a 32-bit reference;
  • cube d, d_g16 and a16 d_cl away from the face centre;
  • emulated (non-immediate) offsets against the same offsets as immediates, lz_o and l_o at level 1 with linear filtering: 0 of 32 lanes differ;
  • the compute derivative exemption: over 16 forms it hides only the implicit-derivative error and its summary line.

Questions, not defects:

  • Gathers at a run-time level pick the mip with Round_ne; D3D's nearest-mip rule rounds half up, so a level of exactly n + 0.5 can differ. What the console does there is unknown, and the shortcut: already covers it.
  • image_sample_c in compute is newly accepted and, like plain image_sample on main, gives DXIL validator 1.6 rejects for implicit derivatives; harmless while the runtime does not validate, but worth knowing.
  • Not exercised on the GPU here: 3D offsets (the z field) and run-time-level gathers on arrays (the harness has no 3D or array views).

Not covered: the title (no game data here).

**@⁠marquezinii** on GitHub · 2026-11-24 05:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7122807037) Reviewed `25e917b` and ran it on an NVIDIA RTX 5070 (driver 621.24), Windows 11, with the SDK's `dxil.dll` validating: `cargo test -p victory-shader` 77 passed. I found no defect. On the a16 bias question raised across the competing PRs: LLVM (`SITargetLowering::lowerImage`, `{bias, poison}`) and Mesa ACO ("pack it into its own dword anyway") both keep an a16 bias as an f16 in the low half of its own dword, which is what this PR reads. A GPU probe with `0x7BFF` in the high half of the bias dword samples the expected level here, so a reading that takes the whole dword as an f32 would not match. The decoder's address dword counts also agree with LLVM's `gfx10_asm_mimg.s` for the a16 `_d`/`_d_cl`/`_c_d_o` forms (derivatives stay 32-bit under a16 unless `_g16`), and the operand order (offset, bias, z-compare, derivatives, coordinates, level/clamp) matches LLVM and ACO. Four extra GPU probes for cases the PR's tests skip, all passing (81 with them): - a16 `b` (garbage in the high half), `b_o`, `l` at a run-time f16 level, `d_cl` with packed clamp, `gather4_l` at a run-time level, `c_lz` with a 32-bit reference; - cube `d`, `d_g16` and a16 `d_cl` away from the face centre; - emulated (non-immediate) offsets against the same offsets as immediates, `lz_o` and `l_o` at level 1 with linear filtering: 0 of 32 lanes differ; - the compute derivative exemption: over 16 forms it hides only the implicit-derivative error and its summary line. Questions, not defects: - Gathers at a run-time level pick the mip with `Round_ne`; D3D's nearest-mip rule rounds half up, so a level of exactly n + 0.5 can differ. What the console does there is unknown, and the `shortcut:` already covers it. - `image_sample_c` in compute is newly accepted and, like plain `image_sample` on `main`, gives DXIL validator 1.6 rejects for implicit derivatives; harmless while the runtime does not validate, but worth knowing. - Not exercised on the GPU here: 3D offsets (the z field) and run-time-level gathers on arrays (the harness has no 3D or array views). Not covered: the title (no game data here).
Author
Owner

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

@⁠marquezinii thank you for the review and the extra probes, in particular the one with 0x7BFF in the high half of the bias dword: that is direct evidence for the a16 bias layout the competing PRs disagree on.

On the three questions:

  • Run-time-level gathers. Agreed. What the console does at exactly n + 0.5 is unmeasured, so the shortcut: stays until something decides it.
  • image_sample_c in compute. Right, and it is the same class as plain compute image_sample on main (#201). #180 replaces implicit-derivative compute samples with sampleGrad, but SM 6.6 has no comparison sample with gradients, so comparison samples are the part that stays. In the tester tree (integration/testers on my fork) those modules declare validator 1.8, taken from #306, which accepts derivatives in compute; that is a resolution made when merging there, not part of this PR.
  • 3D offsets and gathers on arrays on the GPU. Not covered here either.

If you are willing to share the four probes, a PR against shader/image-sampling-family on r4tedx/VIctory would let me add them under your authorship.

No game data used. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 05:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7123244607) @⁠marquezinii thank you for the review and the extra probes, in particular the one with `0x7BFF` in the high half of the bias dword: that is direct evidence for the a16 bias layout the competing PRs disagree on. On the three questions: - **Run-time-level gathers.** Agreed. What the console does at exactly n + 0.5 is unmeasured, so the `shortcut:` stays until something decides it. - **`image_sample_c` in compute.** Right, and it is the same class as plain compute `image_sample` on `main` (#201). #180 replaces implicit-derivative compute samples with `sampleGrad`, but SM 6.6 has no comparison sample with gradients, so comparison samples are the part that stays. In the tester tree (`integration/testers` on my fork) those modules declare validator 1.8, taken from #306, which accepts derivatives in compute; that is a resolution made when merging there, not part of this PR. - **3D offsets and gathers on arrays on the GPU.** Not covered here either. If you are willing to share the four probes, a PR against `shader/image-sampling-family` on r4tedx/VIctory would let me add them under your authorship. No game data used. AI-assisted.
Author
Owner

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

Validation for 25e917b on the title's shaders, to go with @⁠EduAzevedo's translation counts in the description. Same comparison, plus the DXIL validator.

Setup: victory translate --validate --list over a local 1.0.2.1 shaders.rpf only (no executable, so 26,084 programs; the baselines are 12 lower than the description's). main d2a4bae against this PR at 25e917b. The validator is DXC 1.9.2609's (dxv). Its main counts are the same as @⁠Halfect's with the SDK's dxil.dll on #293 (12,172 / 1,670 / 8,129). Counts and refusal reasons only.

main 25e917b
Vertex and pixel: emitted / validated 12,272 / 12,172 12,345 / 12,237 (+65)
Compute: emitted / validated 1,693 / 1,670 1,705 / 1,682 (+12)
Mesh: emitted / validated 8,191 / 8,129 8,191 / 8,129
Programs that validated on main and no longer do 0

By the rows of the description:

  • image_gather4_l: all 12 emit and validate.
  • image_sample_d_cl: the 23 that emit all validate; the other 4 stop at a cross-lane operation outside compute, as in the description.
  • a biased image sample with 16-bit coordinates (108): 36 validate, 48 now stop at a scalar memory read as data, 16 at a lane mask read as data, and 8 emit but fail validation with Container part 'Program Input Signature' does not match expected for module.

The 8 are pixel shaders of one family (three distinct programs, each in several containers). #201 counts 21 input-signature mismatches of this kind on main already, so these may be that existing signature issue now reached, rather than something in the sampling path. I haven't checked which. Their container offsets and hashes are available if you want to look.

Not measured: host pipelines (no D3D12 here) and results in the title.

AI-assisted (Claude Code); counts were cross-checked against the per-program listings of both runs.

**@⁠ghost** on GitHub · 2026-11-24 06:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7124162958) Validation for `25e917b` on the title's shaders, to go with @⁠EduAzevedo's translation counts in the description. Same comparison, plus the DXIL validator. **Setup:** `victory translate --validate --list` over a local 1.0.2.1 `shaders.rpf` only (no executable, so 26,084 programs; the baselines are 12 lower than the description's). `main` `d2a4bae` against this PR at `25e917b`. The validator is DXC 1.9.2609's (`dxv`). Its `main` counts are the same as @⁠Halfect's with the SDK's `dxil.dll` on #293 (12,172 / 1,670 / 8,129). Counts and refusal reasons only. | | `main` | `25e917b` | |---|---:|---:| | Vertex and pixel: emitted / **validated** | 12,272 / 12,172 | 12,345 / **12,237** (+65) | | Compute: emitted / **validated** | 1,693 / 1,670 | 1,705 / **1,682** (+12) | | Mesh: emitted / validated | 8,191 / 8,129 | 8,191 / 8,129 | | Programs that validated on `main` and no longer do | | **0** | By the rows of the description: - **`image_gather4_l`:** all 12 emit and validate. - **`image_sample_d_cl`:** the 23 that emit all validate; the other 4 stop at `a cross-lane operation outside compute`, as in the description. - **`a biased image sample with 16-bit coordinates` (108):** 36 validate, 48 now stop at `a scalar memory read as data`, 16 at `a lane mask read as data`, and **8 emit but fail validation** with `Container part 'Program Input Signature' does not match expected for module`. The 8 are pixel shaders of one family (three distinct programs, each in several containers). #201 counts 21 input-signature mismatches of this kind on `main` already, so these may be that existing signature issue now reached, rather than something in the sampling path. I haven't checked which. Their container offsets and hashes are available if you want to look. Not measured: host pipelines (no D3D12 here) and results in the title. _AI-assisted (Claude Code); counts were cross-checked against the per-program listings of both runs._
Author
Owner

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

@⁠TrashTalker3460 thank you. Validation was the missing half of the counts in the description, and "0 programs that validated on main and no longer do" is the line that matters most for anyone merging this. I have added your table to the description, with the eight failures stated as open.

On those eight (Container part 'Program Input Signature' does not match expected for module): I agree with your reading that it is probably the existing signature problem reached for the first time, but I cannot show it from here. This PR does not write the input signature; it changes how image addresses are read and what the samples lower to. A pixel input that is only used by a newly translated sample could still change which signature rows the emitter lists, so it is not ruled out either.

One run would separate the two, if you have the time. The tester tree (integration/testers on my fork, head 46ca402) carries this PR together with the signature fixes #176 (packed fp16 pixel inputs paired with unlisted signature rows), #306 and #286:

  • if the eight validate there, they are the known signature issue and one of those PRs fixes it;
  • if they still fail there, the three distinct programs' hashes and the validator's full message for one of them would tell me where to look in this PR.

Nothing was run for this note. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 06:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7124226608) @⁠TrashTalker3460 thank you. Validation was the missing half of the counts in the description, and "0 programs that validated on `main` and no longer do" is the line that matters most for anyone merging this. I have added your table to the description, with the eight failures stated as open. On those eight (`Container part 'Program Input Signature' does not match expected for module`): I agree with your reading that it is probably the existing signature problem reached for the first time, but I cannot show it from here. This PR does not write the input signature; it changes how image addresses are read and what the samples lower to. A pixel input that is only used by a newly translated sample could still change which signature rows the emitter lists, so it is not ruled out either. One run would separate the two, if you have the time. The tester tree (`integration/testers` on my fork, head `46ca402`) carries this PR together with the signature fixes #176 (packed fp16 pixel inputs paired with unlisted signature rows), #306 and #286: - if the eight validate there, they are the known signature issue and one of those PRs fixes it; - if they still fail there, the three distinct programs' hashes and the validator's full message for one of them would tell me where to look in this PR. Nothing was run for this note. AI-assisted.
Author
Owner

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

@⁠catminou4 thank you, a macOS build is one this PR had not had.

On the scope note, so it does not read as an open blocker: the Windows-only GPU tests (image_tests, valu_tests) have been run at this head on two machines. Mine is in the description under "Tested" (RTX 5070 and WARP), and an independent one is marquezinii's review on another RTX 5070, with dxil.dll validating: cargo test -p victory-shader 77 passed, plus four extra GPU probes of theirs. Not covered by anyone yet: an AMD adapter for the new image tests.

Nothing was run for this note. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 06:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7124300228) @⁠catminou4 thank you, a macOS build is one this PR had not had. On the scope note, so it does not read as an open blocker: the Windows-only GPU tests (`image_tests`, `valu_tests`) have been run at this head on two machines. Mine is in the description under "Tested" (RTX 5070 and WARP), and an independent one is [marquezinii's review](https://git.gtahub.st/github/Marvisak--VIctory/pulls/160) on another RTX 5070, with `dxil.dll` validating: `cargo test -p victory-shader` 77 passed, plus four extra GPU probes of theirs. Not covered by anyone yet: an AMD adapter for the new image tests. Nothing was run for this note. AI-assisted.
Author
Owner

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

In-game result for 25e917b on AMD RDNA4 (RX 9060 XT): #293's top G-buffer pixel shader 7bdefdfde461f6e3 translates with this PR and all of its ExecuteIndirect calls run (692 and 1,017 in two traced runs; all dropped without it). Details: #318

AI-assisted (Claude Code, Claude Opus 5.5); no game data.

**@⁠ghost** on GitHub · 2026-11-24 06:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7124411700) In-game result for `25e917b` on AMD RDNA4 (RX 9060 XT): #293's top G-buffer pixel shader `7bdefdfde461f6e3` translates with this PR and all of its `ExecuteIndirect` calls run (692 and 1,017 in two traced runs; all dropped without it). Details: https://git.gtahub.st/github/Marvisak--VIctory/pulls/318 AI-assisted (Claude Code, Claude Opus 5.5); no game data.
Author
Owner

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

@⁠nullmarsh thank you, that is the number I asked for on #318 and the first result for this PR from inside the title: 7bdefdfde461f6e3 translates, and every ExecuteIndirect on its pipelines runs (1,017 and 692) where all were dropped before.

I have added it to the description, with your two caveats kept: no visible change, and four short runs.

That the picture does not change is consistent with what others are finding on #71 today: on builds that survive in the world, the scene reaches a full-resolution f62 target while depth and the G-buffer stay nearly empty, so this shader running is necessary for the G-buffer, not sufficient. If your per-draw trace can say what this shader's draws now write (which targets, and whether anything non-background lands in them), that would show how far down the frame the next gap is.

Nothing was run for this note. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 06:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7124450346) @⁠nullmarsh thank you, that is the number I asked for on #318 and the first result for this PR from inside the title: `7bdefdfde461f6e3` translates, and every `ExecuteIndirect` on its pipelines runs (1,017 and 692) where all were dropped before. I have added it to the description, with your two caveats kept: no visible change, and four short runs. That the picture does not change is consistent with what others are finding on #71 today: on builds that survive in the world, the scene reaches a full-resolution `f62` target while depth and the G-buffer stay nearly empty, so this shader running is necessary for the G-buffer, not sufficient. If your per-draw trace can say what this shader's draws now write (which targets, and whether anything non-background lands in them), that would show how far down the frame the next gap is. Nothing was run for this note. AI-assisted.
Author
Owner

@⁠ghost on GitHub · 2026-11-24 07:25 UTC · original

@⁠r4tedx Target dumps (VICTORY_DUMP_TARGETS) on the same stack, one run per arm, the two frames after a 1,000-draw trigger. 7bdefdfde461f6e3's pipelines (mesh 792314eae4f7da77) write six 2560x1440 colour targets (f27, four f28, f34) and the f19 depth target. Share of non-background pixels, both frames alike:

depth f19 written f28 / f34
without #160 5–6% 5–6% / 0%
#160 25e917b 94% (6 levels) 100% (1–4 levels) / 100%
#160, 7bde skipped 5–6% 5–6% / 0%
#160 + #587 1052a90 5% 5% / 0%

So with #160 alone, this shader's draws cover the screen with near-constant values, consistent with #586's culled-group case. With #587 the targets look like the control: whatever these draws write is not visible here, and I can't tell whether they are culled, off-screen or suppressed by #587. #586's count fix needs its stack, so I didn't test it.

AI-assisted (Claude Code, Claude Opus 5.5); no game data.

**@⁠ghost** on GitHub · 2026-11-24 07:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7124984083) @⁠r4tedx Target dumps (`VICTORY_DUMP_TARGETS`) on the same stack, one run per arm, the two frames after a 1,000-draw trigger. `7bdefdfde461f6e3`'s pipelines (mesh `792314eae4f7da77`) write six 2560x1440 colour targets (f27, four f28, f34) and the f19 depth target. Share of non-background pixels, both frames alike: | | depth f19 | written f28 / f34 | |---|---|---| | without #160 | 5–6% | 5–6% / 0% | | #160 `25e917b` | 94% (6 levels) | 100% (1–4 levels) / 100% | | #160, `7bde` skipped | 5–6% | 5–6% / 0% | | #160 + #587 `1052a90` | 5% | 5% / 0% | So with #160 alone, this shader's draws cover the screen with near-constant values, consistent with #586's culled-group case. With #587 the targets look like the control: whatever these draws write is not visible here, and I can't tell whether they are culled, off-screen or suppressed by #587. #586's count fix needs its stack, so I didn't test it. AI-assisted (Claude Code, Claude Opus 5.5); no game data.
Author
Owner

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

@⁠nullmarsh thank you, that is exactly the measurement I asked for, and it is a caveat on this PR that belongs in the description; I have put it there.

How I read your table, with what I cannot tell from here:

  • The draws run, and what reaches the targets is not a scene. Depth at 94% with 6 distinct levels is screen-covering geometry at a handful of depths. The pixel shader does not decide where triangles land or, unless it writes depth, how deep they are, so that part points at what mesh 792314eae4f7da77 emits, not at the sampling this PR adds. That #587 (mesh output bounds, every primitive initialised) takes the targets back to the control fits that.
  • The colour values are a separate question. 1 to 4 levels in f28 and f34 could be a correct pixel shader on garbage triangles, or a wrong sample result. This PR's GPU tests cover cube gradients on every face with and without a clamp, but nothing here can say what this shader's cube holds in the title.
  • So the practical consequence: a build with this PR and without a fix on the mesh side paints these targets over with near-constant values, which can hide the 5 to 6% that was right before. The tester tree on my fork carries this PR and neither #586 nor #587; I will have #587 and #586 reviewed for it.

If you run it once more, the arm that would separate the two questions is this PR with #587 and with the mesh program's draws counted: do 792314eae4f7da77's dispatches still run and emit primitives there (then they are culled or off-screen and the pixel shader never executes), or are they dropped?

Nothing was run for this note. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 07:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7125094200) @⁠nullmarsh thank you, that is exactly the measurement I asked for, and it is a caveat on this PR that belongs in the description; I have put it there. How I read your table, with what I cannot tell from here: - **The draws run, and what reaches the targets is not a scene.** Depth at 94% with 6 distinct levels is screen-covering geometry at a handful of depths. The pixel shader does not decide where triangles land or, unless it writes depth, how deep they are, so that part points at what mesh `792314eae4f7da77` emits, not at the sampling this PR adds. That #587 (mesh output bounds, every primitive initialised) takes the targets back to the control fits that. - **The colour values are a separate question.** 1 to 4 levels in f28 and f34 could be a correct pixel shader on garbage triangles, or a wrong sample result. This PR's GPU tests cover cube gradients on every face with and without a clamp, but nothing here can say what this shader's cube holds in the title. - **So the practical consequence:** a build with this PR and without a fix on the mesh side paints these targets over with near-constant values, which can hide the 5 to 6% that was right before. The tester tree on my fork carries this PR and neither #586 nor #587; I will have #587 and #586 reviewed for it. If you run it once more, the arm that would separate the two questions is this PR with #587 and with the mesh program's draws counted: do `792314eae4f7da77`'s dispatches still run and emit primitives there (then they are culled or off-screen and the pixel shader never executes), or are they dropped? Nothing was run for this note. AI-assisted.
Author
Owner

@⁠slint6614-dev on GitHub · 2026-11-24 07:32 UTC · original

Measured on the full retail shader pack (26,503 containers) with victory translate --validate, against main d2a4bae (emitted / validated):

VS/PS CS MS cargo test -p victory-shader
main 12272 / 12172 1693 / 1670 8191 / 8129 ok
#694 12272 / 12172 1705 / 1682 8191 / 8129 ok
#563 12297 / 12197 1693 / 1670 8191 / 8129 ok
#160 12345 / 12237 1705 / 1682 8191 / 8129 ok
#136 12619 / 12619 1796 / 1697 8355 / 8302 ok
  • image_gather4_l (12 refusals, all compute): cleared by #694, #160 and #136; the 12 programs then validate.
  • image_sample_d_cl (27 refusals): cleared by #694, #563 and #160, but only #563 (cube gradients) turns 25 of them into validated pixel programs; with #694 they stop on another reason.
  • #160 also clears the 108 biased 16-bit samples, but adds 8 "Program Input Signature does not match" validator failures (21 → 29).
  • #136 gains the most (+447 VS/PS, +27 CS, +173 MS validated), but the compute "operation incompatible with the shader stage" validator failure goes from 23 to 99: of its 103 newly emitted compute programs, 76 fail validation.

Windows 11, dxil.dll from SDK 10.0.26100.

**@⁠slint6614-dev** on GitHub · 2026-11-24 07:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7125099575) Measured on the full retail shader pack (26,503 containers) with `victory translate --validate`, against main d2a4bae (emitted / validated): | | VS/PS | CS | MS | `cargo test -p victory-shader` | |---|---|---|---|---| | main | 12272 / 12172 | 1693 / 1670 | 8191 / 8129 | ok | | #694 | 12272 / 12172 | 1705 / 1682 | 8191 / 8129 | ok | | #563 | 12297 / 12197 | 1693 / 1670 | 8191 / 8129 | ok | | #160 | 12345 / 12237 | 1705 / 1682 | 8191 / 8129 | ok | | #136 | 12619 / 12619 | 1796 / 1697 | 8355 / 8302 | ok | - `image_gather4_l` (12 refusals, all compute): cleared by #694, #160 and #136; the 12 programs then validate. - `image_sample_d_cl` (27 refusals): cleared by #694, #563 and #160, but only #563 (cube gradients) turns 25 of them into validated pixel programs; with #694 they stop on another reason. - #160 also clears the 108 biased 16-bit samples, but adds 8 "Program Input Signature does not match" validator failures (21 → 29). - #136 gains the most (+447 VS/PS, +27 CS, +173 MS validated), but the compute "operation incompatible with the shader stage" validator failure goes from 23 to 99: of its 103 newly emitted compute programs, 76 fail validation. Windows 11, dxil.dll from SDK 10.0.26100.
Author
Owner

@⁠ghost on GitHub · 2026-11-24 07:44 UTC · original

@⁠r4tedx From the #160 + #587 run's trace: in both matched frames all 332 operations on this shader's pipelines ran (ExecuteIndirect, none dropped), and mesh 792314eae4f7da77 translates. Whether its groups emit primitives isn't something the trace can see: it records that the call was issued, not what the GPU produced. That would take a pipeline-statistics query around these calls; I have no counter for that here.

AI-assisted (Claude Code, Claude Opus 5.5); no game data.

**@⁠ghost** on GitHub · 2026-11-24 07:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7125312896) @⁠r4tedx From the #160 + #587 run's trace: in both matched frames all 332 operations on this shader's pipelines ran (`ExecuteIndirect`, none dropped), and mesh `792314eae4f7da77` translates. Whether its groups emit primitives isn't something the trace can see: it records that the call was issued, not what the GPU produced. That would take a pipeline-statistics query around these calls; I have no counter for that here. AI-assisted (Claude Code, Claude Opus 5.5); no game data.
Author
Owner

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

@⁠slint6614-dev thank you for putting the four PRs side by side on one corpus; the #160 row matches the two earlier counts (12,345 / 12,237 and 1,705 / 1,682).

One correction to the second bullet, from your own table: this PR does turn the image_sample_d_cl programs into validated pixel programs. Its +65 validated vertex and pixel programs over main are more than #563's +25 because they include them: 23 of the 27 image_sample_d_cl programs emit and all 23 validate (TrashTalker3460's breakdown); the other 4 stop at a cross-lane operation outside compute. The cube gradient rule those need has been in this PR since b540f51. It is #694 where they stop on another reason, as you say.

The 8 input-signature failures are right and are in the description as open; whether they are the signature problem #201 already counts on main, reached for the first time, is not settled.

Nothing was run for this note. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 07:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7125380097) @⁠slint6614-dev thank you for putting the four PRs side by side on one corpus; the #160 row matches the two earlier counts (12,345 / 12,237 and 1,705 / 1,682). One correction to the second bullet, from your own table: this PR does turn the `image_sample_d_cl` programs into validated pixel programs. Its +65 validated vertex and pixel programs over `main` are more than #563's +25 because they include them: 23 of the 27 `image_sample_d_cl` programs emit and all 23 validate ([TrashTalker3460's breakdown](https://git.gtahub.st/github/Marvisak--VIctory/pulls/160)); the other 4 stop at `a cross-lane operation outside compute`. The cube gradient rule those need has been in this PR since `b540f51`. It is #694 where they stop on another reason, as you say. The 8 input-signature failures are right and are in the description as open; whether they are the signature problem #201 already counts on `main`, reached for the first time, is not settled. Nothing was run for this note. AI-assisted.
Author
Owner

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

@⁠nullmarsh thank you, that closes what a trace can close. With #160 and #587 together the shader translates, mesh 792314eae4f7da77 translates, and all 332 calls on their pipelines are issued, none dropped; yet the targets look like the run without #160. So the calls reach the GPU and what they produce is the unknown: primitives culled or emitted off-screen by the mesh program, or pixels that are drawn and rejected.

As you say, that needs a count from the GPU, not from the trace: pipeline statistics around those calls (mesh primitives out, pixel shader invocations). Nothing in the tree records that today; I will note it as the missing diagnostic rather than ask you for another run.

For readers deciding about this PR: its part is that the shader translates and its draws run. What those draws put in the targets depends on the mesh program's output, with or without #587, and that is not settled by anything here.

Nothing was run for this note. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 07:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7125438873) @⁠nullmarsh thank you, that closes what a trace can close. With #160 and #587 together the shader translates, mesh `792314eae4f7da77` translates, and all 332 calls on their pipelines are issued, none dropped; yet the targets look like the run without #160. So the calls reach the GPU and what they produce is the unknown: primitives culled or emitted off-screen by the mesh program, or pixels that are drawn and rejected. As you say, that needs a count from the GPU, not from the trace: pipeline statistics around those calls (mesh primitives out, pixel shader invocations). Nothing in the tree records that today; I will note it as the missing diagnostic rather than ask you for another run. For readers deciding about this PR: its part is that the shader translates and its draws run. What those draws put in the targets depends on the mesh program's output, with or without #587, and that is not settled by anything here. Nothing was run for this note. AI-assisted.
Author
Owner

@⁠ghost on GitHub · 2026-11-24 10:35 UTC · original

@⁠r4tedx I tried that counter on 25e917b without #587 (d2a4bae + #135 + #365 + #500 + this PR, local patch, not a PR: a PIPELINE_STATISTICS1 query around every draw, mesh dispatch and ExecuteIndirect of the listed frames; RX 9060 XT, driver 32.0.32029.2010). On AMD it changes the case it was meant to measure:

  • Queries on, 2 runs: in the frames with the 332 7bdefdfde461f6e3 calls, depth and G-buffer are about 5% covered, as without this PR, and about 100 of ~240 dumped targets are non-empty (93–99 without this PR).
  • Same binary, queries off, 1 run: the full-screen pattern is back (depth 94%, G-buffer 100%) and only 67 targets are non-empty, as in my earlier run of the plain build.

So what these draws emit without #587 depends on whether queries wrap the frame's work, which fits undefined mesh output. The counts themselves don't settle it: most ExecuteIndirect calls read 0 under the queries, including ones writing the G-buffer, and I can't yet tell whether the counter misses indirect work on this driver.

AI-assisted (Claude Code, Claude Opus 5.5); no game data.

**@⁠ghost** on GitHub · 2026-11-24 10:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7128973706) @⁠r4tedx I tried that counter on `25e917b` without #587 (`d2a4bae` + #135 + #365 + #500 + this PR, local patch, not a PR: a `PIPELINE_STATISTICS1` query around every draw, mesh dispatch and `ExecuteIndirect` of the listed frames; RX 9060 XT, driver 32.0.32029.2010). On AMD it changes the case it was meant to measure: - **Queries on, 2 runs:** in the frames with the 332 `7bdefdfde461f6e3` calls, depth and G-buffer are about 5% covered, as without this PR, and about 100 of ~240 dumped targets are non-empty (93–99 without this PR). - **Same binary, queries off, 1 run:** the full-screen pattern is back (depth 94%, G-buffer 100%) and only 67 targets are non-empty, as in my earlier run of the plain build. So what these draws emit without #587 depends on whether queries wrap the frame's work, which fits undefined mesh output. The counts themselves don't settle it: most `ExecuteIndirect` calls read 0 under the queries, including ones writing the G-buffer, and I can't yet tell whether the counter misses indirect work on this driver. AI-assisted (Claude Code, Claude Opus 5.5); no game data.
Author
Owner

@⁠MrCloudy2 on GitHub · 2026-11-24 10:59 UTC · original

Tester result: +11 of 339 previously failing world programs now emit (vertex/pixel 0 → 4 of 25, compute 32 → 39 of 272). That includes all seven meshlet-culling compute programs in this set that stopped on image_gather4_l is not supported; their level is computed per lane, which this PR's run-time-level path covers. Merged together with #539 and #571 the gains add up exactly: vertex/pixel 11, compute 41.

How measured: 339 shader containers from my own 1.0.2.1 copy, the distinct programs that logged shader does not translate in two world runs, each matched to its container by the BLAKE3 VIctory logs. Each PR was merged on its own onto one base: main 8e79c80 + #151 #190 #454 #493 #579 + #177's key fix + the wave64 stack via #439. I then ran victory translate <folder> (diag build, CPU only) and compared DXIL emitted per stage against the base (vertex/pixel 0 of 25, compute 32 of 272, mesh 0 of 13). Linux, Proton-CachyOS wine, cross-built with xwin, RTX 3060 host (only matters for the wave64 part of the base). Translation counts only, not image correctness. AI-assisted (Claude Code).

**@⁠MrCloudy2** on GitHub · 2026-11-24 10:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7129519603) Tester result: **+11 of 339** previously failing world programs now emit (vertex/pixel 0 → 4 of 25, compute 32 → 39 of 272). That includes all seven meshlet-culling compute programs in this set that stopped on `image_gather4_l is not supported`; their level is computed per lane, which this PR's run-time-level path covers. Merged together with #539 and #571 the gains add up exactly: vertex/pixel 11, compute 41. **How measured:** 339 shader containers from my own 1.0.2.1 copy, the distinct programs that logged `shader does not translate` in two world runs, each matched to its container by the BLAKE3 VIctory logs. Each PR was merged on its own onto one base: `main` `8e79c80` + #151 #190 #454 #493 #579 + #177's key fix + the wave64 stack via #439. I then ran `victory translate <folder>` (diag build, CPU only) and compared DXIL emitted per stage against the base (vertex/pixel 0 of 25, compute 32 of 272, mesh 0 of 13). Linux, Proton-CachyOS wine, cross-built with xwin, RTX 3060 host (only matters for the wave64 part of the base). Translation counts only, not image correctness. AI-assisted (Claude Code).
Author
Owner

@⁠DeerSilver on GitHub · 2026-11-24 11:01 UTC · original

Tested head 6ad7e15 merged onto main ffe310e on NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell), driver 621.24, Windows 11 26300, Rust 1.98.1. No game files: the test suite only.

Merged onto current main, the test build fails. 6638098 ("per-lane descriptors chosen by control flow", merged with #566 at 09:53) added a fourth argument to resource::track:

error[E0061]: this function takes 4 arguments but 3 arguments were supplied
  --> crates/victory-shader/src/emit/image_tests.rs (new in this PR)
   |     resource::track(&p, &native.layout, native.stage)
   |     argument #4 of type `Option<&structure::Structured>` is missing

There's no text conflict, so GitHub still shows the PR as mergeable, but merging it as it is would break cargo test on main. The call this PR adds needs the fourth argument. main's own tests pass Some(&st); None keeps the old three-argument behaviour.

With , None added locally to that call, everything passes:

  • The PR's new tests pass. The ones that use the host GPU ran on the RTX 5060 (DXGI adapter 0 on this laptop, so the host-device helpers return a device and the tests don't take their early return), and the log has no no SM 6.6 device skip:
    • texel_offsets_and_levels_sample_the_texels_they_name
    • gathers_at_a_run_time_level_read_that_levels_footprint
    • comparisons_and_comparison_gathers_match_per_texel_comparisons
    • cube_gradients_are_the_face_coordinates
    • stores_of_some_channels_write_zero_to_the_others
    • sample_and_gather_forms_lower_to_valid_dxil
    • forms_without_an_sm_6_6_equivalent_name_why
    • image_address_dwords_by_form
  • cargo test --workspace --locked: 350 passed, 0 failed, 6 ignored, against 342 passed / 6 ignored on main.
  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean.

AI-assisted (Claude Code).

**@⁠DeerSilver** on GitHub · 2026-11-24 11:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7129559758) Tested head `6ad7e15` merged onto `main` `ffe310e` on **NVIDIA GeForce RTX 5060 Laptop GPU** (Blackwell), driver 621.24, Windows 11 26300, Rust 1.98.1. No game files: the test suite only. **Merged onto current `main`, the test build fails.** `6638098` ("per-lane descriptors chosen by control flow", merged with #566 at 09:53) added a fourth argument to `resource::track`: ``` error[E0061]: this function takes 4 arguments but 3 arguments were supplied --> crates/victory-shader/src/emit/image_tests.rs (new in this PR) | resource::track(&p, &native.layout, native.stage) | argument #4 of type `Option<&structure::Structured>` is missing ``` There's no text conflict, so GitHub still shows the PR as mergeable, but merging it as it is would break `cargo test` on `main`. The call this PR adds needs the fourth argument. `main`'s own tests pass `Some(&st)`; `None` keeps the old three-argument behaviour. **With `, None` added locally to that call**, everything passes: - The PR's new tests pass. The ones that use the host GPU ran on the RTX 5060 (DXGI adapter 0 on this laptop, so the host-device helpers return a device and the tests don't take their early return), and the log has no `no SM 6.6 device` skip: - `texel_offsets_and_levels_sample_the_texels_they_name` - `gathers_at_a_run_time_level_read_that_levels_footprint` - `comparisons_and_comparison_gathers_match_per_texel_comparisons` - `cube_gradients_are_the_face_coordinates` - `stores_of_some_channels_write_zero_to_the_others` - `sample_and_gather_forms_lower_to_valid_dxil` - `forms_without_an_sm_6_6_equivalent_name_why` - `image_address_dwords_by_form` - `cargo test --workspace --locked`: **350 passed, 0 failed, 6 ignored**, against 342 passed / 6 ignored on `main`. - `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean. AI-assisted (Claude Code).
Author
Owner

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

@⁠nullmarsh, thanks for tracing 7bdefdfde461f6e3 back to the G-buffer pass. The two RX 9060 XT runs answer the question on #318: this shader reaches ExecuteIndirect with #160, and the baseline drops those calls. That gives this PR an AMD in-game result alongside the Windows synthetic image tests. The trace measures draw execution; the final pixel values are a separate measurement.

AI-assisted (Codex).

**@⁠r4tedx** on GitHub · 2026-11-24 11:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7129689849) @⁠nullmarsh, thanks for tracing `7bdefdfde461f6e3` back to the G-buffer pass. The two RX 9060 XT runs answer the question on #318: this shader reaches `ExecuteIndirect` with #160, and the baseline drops those calls. That gives this PR an AMD in-game result alongside the Windows synthetic image tests. The trace measures draw execution; the final pixel values are a separate measurement. AI-assisted (Codex).
Author
Owner

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

@⁠DeerSilver you are right, and thank you for testing the merge and not just the head. Reproduced here: 6ad7e15 merged with main ffe310e fails to build its tests at emit/image_tests.rs:230, with the error you quote. GitHub showed the PR mergeable and its check green because that run was before #566 landed.

Fixed in 5ce85c5: main is merged in, and the helper structures the program first and passes it (Some(&st)), as main's own tests do, not None. Nothing else changes.

On the result, on an RTX 5070 here: both CI clippy commands are clean, and cargo test --workspace --locked gives 350 passed, 0 failed, 6 ignored, the count you got with your local fix. The same run with VICTORY_WARP=1, which is what the CI runner has, also gives 350.

The title was not used in these tests. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 13:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7133379190) @⁠DeerSilver you are right, and thank you for testing the merge and not just the head. Reproduced here: `6ad7e15` merged with `main` `ffe310e` fails to build its tests at `emit/image_tests.rs:230`, with the error you quote. GitHub showed the PR mergeable and its check green because that run was before #566 landed. Fixed in `5ce85c5`: `main` is merged in, and the helper structures the program first and passes it (`Some(&st)`), as `main`'s own tests do, not `None`. Nothing else changes. On the result, on an RTX 5070 here: both CI clippy commands are clean, and `cargo test --workspace --locked` gives 350 passed, 0 failed, 6 ignored, the count you got with your local fix. The same run with `VICTORY_WARP=1`, which is what the CI runner has, also gives 350. The title was not used in these tests. AI-assisted.
Author
Owner

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

A note for anyone stacking this PR with #180 (@⁠permadiego, @⁠h0useadv): the two merge without a text conflict, but the result samples wrong texels for three compute sample forms, and validation does not see it.

What fails. With 5ce85c5 and #180 at aa69258 merged, this PR's texel_offsets_and_levels_sample_the_texels_they_name fails on an RTX 5070 for bias with offset (b_o), level clamp (cl) and bias with clamp and offset (b_cl_o), and only those. Each PR alone passes. (Found in a stack built like the one reported on #293; I did not run that stack myself.)

Why. #180 emits compute image_sample and image_sample_b as sampleGrad with the console quad's differences. Its arm reads the bias at address 0 and passes no level clamp:

let bias = addr_val(self, 0)?;      // #180
...
args.push(fu);                      // #180: no clamp

This PR adds the forms where that no longer holds: with a texel offset the bias comes after the offset word (and is an f16 with a16), and _cl forms carry a clamp. Git keeps #180's arm as it is, so those forms read the offset word as the bias and drop the clamp.

The change the combination needs, in that arm, using what this PR already computes:

let bias = float(self, bias_at)?;   // the bias where this PR's form puts it
...
args.push(clamp);                   // this PR's level clamp

The tester tree has carried both PRs with exactly this since its #180 merge, and the test above passes there (one run today on an RTX 5070, 487 workspace tests). Neither PR can hold the change alone while the other is open, so it belongs in whichever lands second. If #180 lands first I will put it in this branch's merge with main; if this one lands first, the two lines above are what #180 needs.

The title was not used in these tests. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 14:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7133899424) A note for anyone stacking this PR with #180 (@⁠permadiego, @⁠h0useadv): the two merge without a text conflict, but the result samples wrong texels for three compute sample forms, and validation does not see it. **What fails.** With `5ce85c5` and #180 at `aa69258` merged, this PR's `texel_offsets_and_levels_sample_the_texels_they_name` fails on an RTX 5070 for bias with offset (`b_o`), level clamp (`cl`) and bias with clamp and offset (`b_cl_o`), and only those. Each PR alone passes. (Found in a stack built like the one reported on #293; I did not run that stack myself.) **Why.** #180 emits compute `image_sample` and `image_sample_b` as `sampleGrad` with the console quad's differences. Its arm reads the bias at address 0 and passes no level clamp: ```rust let bias = addr_val(self, 0)?; // #180 ... args.push(fu); // #180: no clamp ``` This PR adds the forms where that no longer holds: with a texel offset the bias comes after the offset word (and is an f16 with `a16`), and `_cl` forms carry a clamp. Git keeps #180's arm as it is, so those forms read the offset word as the bias and drop the clamp. **The change the combination needs**, in that arm, using what this PR already computes: ```rust let bias = float(self, bias_at)?; // the bias where this PR's form puts it ... args.push(clamp); // this PR's level clamp ``` The tester tree has carried both PRs with exactly this since its #180 merge, and the test above passes there (one run today on an RTX 5070, 487 workspace tests). Neither PR can hold the change alone while the other is open, so it belongs in whichever lands second. If #180 lands first I will put it in this branch's merge with `main`; if this one lands first, the two lines above are what #180 needs. The title was not used in these tests. AI-assisted.
Author
Owner

@⁠pablogonz12 on GitHub · 2026-11-24 16:20 UTC · original

Measured on Linux (RX 9070 XT, RADV/Mesa 26.3.1, GE-Proton11-14, vkd3d-proton master), head 5ce85c5, which already merges ffe310e:

  • full archive under Wine (26,503 containers, --host-lanes 32-64), before -> after: vertex+pixel 13146 -> 13171 (+25), compute 2404 -> 2420 (+16), mesh 8396 unchanged; total 23946 -> 23987 (+41), 0 regressions.
  • offline world set (751) unchanged at 692; every emitted program's SPIR-V passes dxil-spirv and spirv-val.
  • cargo test -p victory-shader --lib: 118 pass, only the known indexed_move_initializes_an_input_before_its_first_use failure; xwin clippy --workspace --all-targets clean.
    Not tested: in-game on this branch; native Windows.
**@⁠pablogonz12** on GitHub · 2026-11-24 16:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7137515573) Measured on Linux (RX 9070 XT, RADV/Mesa 26.3.1, GE-Proton11-14, vkd3d-proton master), head 5ce85c5, which already merges ffe310e: - full archive under Wine (26,503 containers, `--host-lanes 32-64`), before -> after: vertex+pixel 13146 -> 13171 (+25), compute 2404 -> 2420 (+16), mesh 8396 unchanged; total 23946 -> 23987 (+41), 0 regressions. - offline world set (751) unchanged at 692; every emitted program's SPIR-V passes dxil-spirv and spirv-val. - `cargo test -p victory-shader --lib`: 118 pass, only the known `indexed_move_initializes_an_input_before_its_first_use` failure; xwin clippy `--workspace --all-targets` clean. Not tested: in-game on this branch; native Windows.
Author
Owner

@⁠Yaekai on GitHub · 2026-11-24 16:36 UTC · original

Independent verification on Windows 11 + NVIDIA RTX 3070 (Rust 1.98.1) at head 5ce85c5:

  • cargo test -p victory-shader --lib -- --skip valu_tests --skip waterfall_tests: 110 passed, 0 failed.
  • cargo clippy -p victory-shader -- -D warnings: 0 warnings.
  • Live GTA VI (1.0.2.1, --console series-s, 19-min world run): no regressions. Ready to merge!
**@⁠Yaekai** on GitHub · 2026-11-24 16:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7137919820) Independent verification on Windows 11 + NVIDIA RTX 3070 (Rust 1.98.1) at head `5ce85c5`: - `cargo test -p victory-shader --lib -- --skip valu_tests --skip waterfall_tests`: 110 passed, 0 failed. - `cargo clippy -p victory-shader -- -D warnings`: 0 warnings. - Live GTA VI (`1.0.2.1`, `--console series-s`, 19-min world run): no regressions. Ready to merge!
Author
Owner

@⁠adnanoos on GitHub · 2026-11-24 18:01 UTC · original

Tested this PR (5ce85c5, merged with main ffe310e) on an NVIDIA GeForce RTX 5060 Laptop GPU (driver 32.0.16.2124, Intel Core 7 240H, Windows 11 Pro 26200), title files version 1.0.2.1 (title exe BLAKE3 b99f876b…239e93).

cargo test --release -p victory-shader: 128 passed, 0 failed, 1 ignored (GPU tests on the RTX 5060).

victory translate --list --pipelines on shaders.rpf (26,084 programs), main vs this PR:

main this PR
VS/PS DXIL emitted (and host pipelines created) 12231 12300
image_gather4_l 16 0
a biased image sample with 16-bit coordinates 108 0
image_sample_d_cl 29 0
a scalar memory read as data 771 819
a lane mask read as data 250 266
a cross-lane operation outside compute 46 50
pipeline: The parameter is incorrect. 320 326

Nothing else changed. On this build there are 16 image_gather4_l programs (the description counts 12):

  • All 10 meshlet_culling programs (CS_BatchCullMeshlets*, CS_BatchCullPreSkinnedMeshlets*, CS_BatchCullBatchCSMeshlets*, incl. _Prev / _ParaboloidShadows) now translate and create host pipelines.
  • The 6 water_micro_geom_renderer ones (CS_GenerateWaterPatches*, CS_GenerateWaterPatchWritingJobs*, CS_CullWaterPatches*) translate, but the NVIDIA driver refuses all 6 pipelines with E_INVALIDARG. These are the +6 in the last row, the same refusal as the ~320 compute pipelines on main (looks like #71's class, not this PR).

In the title (one run each, Series X mode, GpuPreference=2 so the dGPU is used):

  • main: world black with audio; world frames 265–3380 ms per submission (avg ~794); ended in DXGI_ERROR_DEVICE_REMOVED / 0x887A0006 (device removed after a submission of 11 lists; no breadcrumbs).
  • this PR: world still black with audio; slow submissions avg ~436 ms, max 548; no device removal, exited cleanly when the window was closed.

Caveat: one run each, and the PR run had a warm pipeline library, so the timing and the missing hang are not conclusive. Happy to run more passes or a diag build with VICTORY_D3D12_DEBUG=1 if that helps.

**@⁠adnanoos** on GitHub · 2026-11-24 18:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7140035440) Tested this PR (`5ce85c5`, merged with main `ffe310e`) on an **NVIDIA GeForce RTX 5060 Laptop GPU** (driver 32.0.16.2124, Intel Core 7 240H, Windows 11 Pro 26200), title files version 1.0.2.1 (title exe BLAKE3 `b99f876b…239e93`). **`cargo test --release -p victory-shader`**: 128 passed, 0 failed, 1 ignored (GPU tests on the RTX 5060). **`victory translate --list --pipelines` on `shaders.rpf`** (26,084 programs), main vs this PR: | | main | this PR | |---|---:|---:| | VS/PS DXIL emitted (and host pipelines created) | 12231 | 12300 | | `image_gather4_l` | 16 | 0 | | `a biased image sample with 16-bit coordinates` | 108 | 0 | | `image_sample_d_cl` | 29 | 0 | | `a scalar memory read as data` | 771 | 819 | | `a lane mask read as data` | 250 | 266 | | `a cross-lane operation outside compute` | 46 | 50 | | `pipeline: The parameter is incorrect.` | 320 | 326 | Nothing else changed. On this build there are **16** `image_gather4_l` programs (the description counts 12): - All 10 `meshlet_culling` programs (`CS_BatchCullMeshlets*`, `CS_BatchCullPreSkinnedMeshlets*`, `CS_BatchCullBatchCSMeshlets*`, incl. `_Prev` / `_ParaboloidShadows`) now translate **and create host pipelines**. - The 6 `water_micro_geom_renderer` ones (`CS_GenerateWaterPatches*`, `CS_GenerateWaterPatchWritingJobs*`, `CS_CullWaterPatches*`) translate, but the NVIDIA driver refuses all 6 pipelines with `E_INVALIDARG`. These are the +6 in the last row, the same refusal as the ~320 compute pipelines on main (looks like #71's class, not this PR). **In the title** (one run each, Series X mode, `GpuPreference=2` so the dGPU is used): - main: world black with audio; world frames 265–3380 ms per submission (avg ~794); ended in `DXGI_ERROR_DEVICE_REMOVED` / `0x887A0006` (`device removed after a submission of 11 lists; no breadcrumbs`). - this PR: world still **black with audio**; slow submissions avg ~436 ms, max 548; **no device removal**, exited cleanly when the window was closed. Caveat: one run each, and the PR run had a warm pipeline library, so the timing and the missing hang are not conclusive. Happy to run more passes or a diag build with `VICTORY_D3D12_DEBUG=1` if that helps.
Author
Owner

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

@⁠adnanoos thank you. This adds the one thing the earlier counts did not have, host pipelines, and it corrects a number: your run finds 16 image_gather4_l programs where the description's table had 12. I have put your result in the description next to that table, with the split you give (the 10 meshlet-culling programs translate and get pipelines; the 6 water ones translate and the driver refuses their pipelines with E_INVALIDARG).

On those 6: I read them as you do. The translation is accepted by the validator and refused at pipeline creation, like the roughly 320 compute pipelines main already loses on NVIDIA, so they belong with that class and not with this PR's lowering. If your --list output names the same refusal text for them as for the 320, that settles it; if theirs differs, I would like to know.

On the title runs: agreed that one run each with a warm pipeline library does not establish the missing hang, and you say so yourself. No need for more passes on this PR's account. If you do run again, the comparison worth having is both builds on a cold cache.

@⁠Yaekai thank you as well for the run on the RTX 3070, here and on #265.

The title was not used in my tests. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 18:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7140807798) @⁠adnanoos thank you. This adds the one thing the earlier counts did not have, host pipelines, and it corrects a number: your run finds 16 `image_gather4_l` programs where the description's table had 12. I have put your result in the description next to that table, with the split you give (the 10 meshlet-culling programs translate and get pipelines; the 6 water ones translate and the driver refuses their pipelines with `E_INVALIDARG`). On those 6: I read them as you do. The translation is accepted by the validator and refused at pipeline creation, like the roughly 320 compute pipelines `main` already loses on NVIDIA, so they belong with that class and not with this PR's lowering. If your `--list` output names the same refusal text for them as for the 320, that settles it; if theirs differs, I would like to know. On the title runs: agreed that one run each with a warm pipeline library does not establish the missing hang, and you say so yourself. No need for more passes on this PR's account. If you do run again, the comparison worth having is both builds on a cold cache. @⁠Yaekai thank you as well for the run on the RTX 3070, here and on #265. The title was not used in my tests. AI-assisted.
Author
Owner

@⁠adnanoos on GitHub · 2026-11-24 18:38 UTC · original

Checked the saved --list output. The 6 water_micro_geom_renderer programs (CS_GenerateWaterPatches, CS_GenerateWaterPatches_WithLODStitching, CS_GenerateWaterPatchWritingJobs, CS_GenerateWaterPatchWritingJobs_WithLODStitching, CS_CullWaterPatches, CS_CullWaterPatchesUsingCalmingInfo) report exactly pipeline: The parameter is incorrect., the same text as all 320 on main (all Cs). A set diff of the refused programs: this PR adds exactly those 6 and removes none, so 320 becomes 326 with no other change.

One limit: the listing records only the HRESULT text, not the driver's reason, so this shows the same error code rather than the same cause. If it would help, I can rerun those 6 with the debug layer on and post the messages next to a few of the 320.

On the title: noted. If I run it again, it will be both builds on a cold cache.

**@⁠adnanoos** on GitHub · 2026-11-24 18:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7140927084) Checked the saved `--list` output. The 6 `water_micro_geom_renderer` programs (`CS_GenerateWaterPatches`, `CS_GenerateWaterPatches_WithLODStitching`, `CS_GenerateWaterPatchWritingJobs`, `CS_GenerateWaterPatchWritingJobs_WithLODStitching`, `CS_CullWaterPatches`, `CS_CullWaterPatchesUsingCalmingInfo`) report exactly `pipeline: The parameter is incorrect.`, the same text as all 320 on main (all `Cs`). A set diff of the refused programs: this PR adds exactly those 6 and removes none, so 320 becomes 326 with no other change. One limit: the listing records only the HRESULT text, not the driver's reason, so this shows the same error code rather than the same cause. If it would help, I can rerun those 6 with the debug layer on and post the messages next to a few of the 320. On the title: noted. If I run it again, it will be both builds on a cold cache.
Author
Owner

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

@⁠adnanoos thank you, that settles it as far as a listing can: the same text for the 6 as for the 320, and a set difference of exactly those 6. The description already says they are refused the way main's are, so nothing to change there.

On your offer: the debug-layer messages for those 6 next to a few of the 320 would be useful, but for the issue that tracks those refusals (#71's class) rather than for this PR, which only moves the 6 from "refused by the translator" to "refused by the driver". If you do run it, that is where I would post it.

AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 18:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7141080199) @⁠adnanoos thank you, that settles it as far as a listing can: the same text for the 6 as for the 320, and a set difference of exactly those 6. The description already says they are refused the way `main`'s are, so nothing to change there. On your offer: the debug-layer messages for those 6 next to a few of the 320 would be useful, but for the issue that tracks those refusals (#71's class) rather than for this PR, which only moves the 6 from "refused by the translator" to "refused by the driver". If you do run it, that is where I would post it. AI-assisted.
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 20:58 UTC · original

In-world evidence for the explicit-level gathers here, from a fork that runs main + its own changes into the world: fxceless/victory-gta6 (README, "Gathers at a named mip level read level 0"; the comment at its image_gather4_l lowering).

The fork found that a host gather (DXIL op 73, no level) reading level 0 where the title names one broke the title's meshlet occlusion culling. The culling gathers a 4×4 block of the depth pyramid at a named level: one image_gather4_l and three image_gather4_l_o with offsets (2,0), (0,2) and (2,2). Read at level 0, "most of the world was culled against the wrong depths". The fork reads the four texels at the named level instead, with the offset in texels of that level.

That is what gathers_at_a_run_time_level_read_that_levels_footprint checks here (gather4_l_o at a per-lane level included). It also means #694, which maps image_gather4_l to op 73 and so reads level 0, would translate those programs but cull most of the world.

AI-assisted (Claude Code).

**@⁠upipibi** on GitHub · 2026-11-24 20:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7144314297) In-world evidence for the explicit-level gathers here, from a fork that runs `main` + its own changes into the world: [fxceless/victory-gta6](https://github.com/fxceless/victory-gta6) (README, "Gathers at a named mip level read level 0"; the comment at its `image_gather4_l` lowering). The fork found that a host gather (DXIL op 73, no level) reading level 0 where the title names one broke the title's meshlet occlusion culling. The culling gathers a 4×4 block of the depth pyramid at a named level: one `image_gather4_l` and three `image_gather4_l_o` with offsets (2,0), (0,2) and (2,2). Read at level 0, "most of the world was culled against the wrong depths". The fork reads the four texels at the named level instead, with the offset in texels of that level. That is what `gathers_at_a_run_time_level_read_that_levels_footprint` checks here (`gather4_l_o` at a per-lane level included). It also means #694, which maps `image_gather4_l` to op 73 and so reads level 0, would translate those programs but cull most of the world. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:19 UTC · original

Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-shader/src/emit/host.rs, crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/emit/mod.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7148383005) <!-- victory-triage v1 head=5ce85c5e70878e9208a1cc02c2b65966a1316653 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-shader/src/emit/host.rs`, `crates/victory-shader/src/emit/lower.rs`, `crates/victory-shader/src/emit/mod.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

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

Closing this rather than rebasing it. main moved 319 commits on and got its own lowering of the image forms this title uses from other PRs; what is left of this one is unused by the title. The change is not wrong.

By count. Local title data (v1.0.2.1, the main shader archive), offline, CPU only; counts and reasons only.

  • Offline count on main 940d32f (translate --validate --list, 25,889 programs counted): 23,918 validate; the translator refuses 298, under 10 reasons. None names an image instruction.
  • Disassembly passes by main's own binary over the archive's 26,503 containers (all 26,084 programs decode): every image sample, gather, load and store instruction the title uses occurs in programs that validate on main, the 16 containers with image_gather4_l and the 16 with image_gather4_l_o included. The forms this PR adds beyond that do not occur: no offset form other than image_sample_o (4 containers), image_gather4_lz_o (6) and image_gather4_l_o, no comparison form other than image_sample_c_lz, no _cd, no _g16, no level clamp without derivatives, and every image_store writes all four channels.

By what is read. A count cannot show whether main reads the right texels, so this PR's GPU tests were ported onto main 940d32f without its lowering and run on WARP (one test thread; no hardware GPU):

  • The forms the title uses read the texels this PR's tests expect: image_sample_b, _l at per-lane levels, _lz, _d, _d_cl, _c_lz, image_gather4_lz and image_gather4_lz_o (offset known and per lane), 9 of 9 cases; and gathers at a level in the form main takes (immediate border sampler, whole level), gather4_l_o per lane and gather4_l at levels past the last, 2 of 2.
  • 80 cases are refused by main, each with a reason (<mnemonic> is not supported, a gather at a level through a sampler from memory, an image store of some channels). Refused, not mis-read; and per the count the title has none of them.
  • One form reads wrong on main: image_sample_d with 16-bit addresses (a16). main packs the derivatives two per register along with the coordinates; this PR keeps derivatives as 32-bit floats and packs only coordinates and level, which is what LLVM's assembler tests have for GFX10 (image_sample_d … dim:SQ_RSRC_IMG_2D a16 takes five address registers, and the _g16 opcodes exist for 16-bit derivatives). On main the test reads level 3's texel (0,0) in 32 of 32 lanes where the footprint's texel is expected, and the decoder counts 3 address dwords for 5. The title does not use it: none of its 2,901 containers with image_sample_d and none of the 29 with image_sample_d_cl has a16. So I am not opening a PR for it. The ported tests and a 35-line fix are on the fork, branch check/image-tests-on-main (4467705 tests on main as it is, f85e0ab the fix, 63c2d06 the gather test); with the fix the case passes. If a maintainer wants that as a PR, say so here and I will send it. Not checked against the console's own compiler or hardware.

@⁠upipibi thank you for the in-world evidence. The case you describe, the culling's 4×4 block of the depth pyramid read with one image_gather4_l and three image_gather4_l_o at a named level, is what main's own gather at a level now covers: the 16 containers with those instructions validate on main, and this PR's footprint test, adapted to main's form, passes there. So that fix no longer needs this PR. What main still refuses is a gather at a level through a sampler read from memory, which the title does not have.

Limits. The count and the passes cover one archive, not shaders elsewhere in the title. A refused program reports only its first reason, so a refused image form could still sit behind another reason in the programs main refuses at emit; by instruction name there is none. All test results are from WARP.

The branch shader/image-sampling-family stays on the fork at 5ce85c5; if a program turns up that needs one of its forms, I will reopen this on current main.

Thank you to everyone who tested and measured this head.

AI-assisted

**@⁠r4tedx** on GitHub · 2026-11-25 05:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/160#issuecomment-7153581267) Closing this rather than rebasing it. `main` moved 319 commits on and got its own lowering of the image forms this title uses from other PRs; what is left of this one is unused by the title. The change is not wrong. **By count.** Local title data (v1.0.2.1, the main shader archive), offline, CPU only; counts and reasons only. - Offline count on `main` `940d32f` (`translate --validate --list`, 25,889 programs counted): 23,918 validate; the translator refuses 298, under 10 reasons. None names an image instruction. - Disassembly passes by `main`'s own binary over the archive's 26,503 containers (all 26,084 programs decode): every image sample, gather, load and store instruction the title uses occurs in programs that validate on `main`, the 16 containers with `image_gather4_l` and the 16 with `image_gather4_l_o` included. The forms this PR adds beyond that do not occur: no offset form other than `image_sample_o` (4 containers), `image_gather4_lz_o` (6) and `image_gather4_l_o`, no comparison form other than `image_sample_c_lz`, no `_cd`, no `_g16`, no level clamp without derivatives, and every `image_store` writes all four channels. **By what is read.** A count cannot show whether `main` reads the right texels, so this PR's GPU tests were ported onto `main` `940d32f` without its lowering and run on WARP (one test thread; no hardware GPU): - The forms the title uses read the texels this PR's tests expect: `image_sample_b`, `_l` at per-lane levels, `_lz`, `_d`, `_d_cl`, `_c_lz`, `image_gather4_lz` and `image_gather4_lz_o` (offset known and per lane), 9 of 9 cases; and gathers at a level in the form `main` takes (immediate border sampler, whole level), `gather4_l_o` per lane and `gather4_l` at levels past the last, 2 of 2. - 80 cases are refused by `main`, each with a reason (`<mnemonic> is not supported`, `a gather at a level through a sampler from memory`, `an image store of some channels`). Refused, not mis-read; and per the count the title has none of them. - **One form reads wrong on `main`: `image_sample_d` with 16-bit addresses (`a16`).** `main` packs the derivatives two per register along with the coordinates; this PR keeps derivatives as 32-bit floats and packs only coordinates and level, which is what LLVM's assembler tests have for GFX10 (`image_sample_d … dim:SQ_RSRC_IMG_2D a16` takes five address registers, and the `_g16` opcodes exist for 16-bit derivatives). On `main` the test reads level 3's texel (0,0) in 32 of 32 lanes where the footprint's texel is expected, and the decoder counts 3 address dwords for 5. **The title does not use it:** none of its 2,901 containers with `image_sample_d` and none of the 29 with `image_sample_d_cl` has `a16`. So I am not opening a PR for it. The ported tests and a 35-line fix are on the fork, branch [`check/image-tests-on-main`](https://github.com/r4tedx/VIctory/tree/check/image-tests-on-main) (`4467705` tests on `main` as it is, `f85e0ab` the fix, `63c2d06` the gather test); with the fix the case passes. If a maintainer wants that as a PR, say so here and I will send it. Not checked against the console's own compiler or hardware. @⁠upipibi thank you for the in-world evidence. The case you describe, the culling's 4×4 block of the depth pyramid read with one `image_gather4_l` and three `image_gather4_l_o` at a named level, is what `main`'s own gather at a level now covers: the 16 containers with those instructions validate on `main`, and this PR's footprint test, adapted to `main`'s form, passes there. So that fix no longer needs this PR. What `main` still refuses is a gather at a level through a sampler read from memory, which the title does not have. **Limits.** The count and the passes cover one archive, not shaders elsewhere in the title. A refused program reports only its first reason, so a refused image form could still sit behind another reason in the programs `main` refuses at emit; by instruction name there is none. All test results are from WARP. The branch `shader/image-sampling-family` stays on the fork at `5ce85c5`; if a program turns up that needs one of its forms, I will reopen this on current `main`. Thank you to everyone who tested and measured this head. AI-assisted

Pull request closed

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