[BUNDLE] Lane-mask, scalar descriptor read and cube-sample shader fixes: #1057 #1073 #1074 #1084 #953 #1056 #1015 #1055 #563 #1004 #1319

Closed
MamaLeVrai wants to merge 20 commits from upstream-pr/1319 into main
MamaLeVrai commented 2026-11-24 17:23:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MamaLeVrai on 2026-11-24T17:23:35Z.


One PR in place of ten. It merges ten open shader PRs onto main (ffe310e) with every head unchanged, and reports that the result builds and passes together. Two of the merges needed a hand resolution, described below. Nothing else is changed.

For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is the [BUNDLE] PR. The re-verification commands are below, so one run covers all ten.

What is inside

PR Author Head Topic
#1057 bartikele a793ad86a lower all-zero and all-one constant lane masks
#1073 undeadhuman37 986fa6db9 a scalar joining a lane mask and a number (pixel, vertex)
#1074 undeadhuman37 ec337a025 a lane mask spilled to a VGPR lane is still that mask
#1084 undeadhuman37 48a41fb85 select or carry-in on an untracked mask tests this lane's bit
#953 MartinIndra02 c42cbb073 s_buffer_load uses in descriptor_data (#798)
#1056 adamdotpy 417f4e30d scalar loads from a root view's address read its memory
#1015 justrealyme b8cfe8ce7 scalar loads through a heap buffer that vector accesses use
#1055 adamdotpy 21d1b4682 scalar buffer loads from a UAV read it raw
#563 SAitken91 10ac6ceac cube samples with gradients, image_sample_d_cl
#1004 tarcisioads cbc8c33dc image_get_lod on cube textures

The first four target "a lane mask read as data", named in the in-game refusal tables on #293 (the latest one there puts "a lane mask read as data" first, at 408 per frame). The next four target "a scalar memory read as data". The last two are the image-sample refusals.

All ten are MERGEABLE against main on their own. Merged in the order above they conflict in two places, which this PR resolves:

  1. #1015 + #1055, emit/lower.rs, the raw view chosen for a scalar buffer load of a descriptor. Resolution: an SRV range reads a raw SRV view, a UAV range a raw UAV view (#1055), a descriptor of no listed kind the heap buffer view (#1015). Both PRs' tests in emit/valu_tests.rs are kept.
  2. #563 + #1004, emit/lower.rs, the cube-sample refusal. #563 lowers gradients, #1004 the level query, so only texel coordinates are still refused.

Left out, and why

  • #1083: another design for the same scalar-buffer-load case as #953 (it marks the dwords missing with a reason instead of reading a raw view). The two do not merge into one behaviour, so this is a choice for the maintainer.
  • #1103: closed as a duplicate of #953.
  • #667, #645: conflict with main.
  • #694: does not build on main (resource::track takes four arguments, see #801).

Verification

Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):

Check Result
cargo clippy --workspace --all-targets --locked -- -D warnings clean
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings clean
cargo test --workspace --locked 350 passed, 0 failed, 6 ignored (main: 342 passed, 6 ignored)

Each of the ten also passes the same three checks alone on main (matrix on #801). The tests that exercise the lowering run on the GPU and on WARP. The title was not run, so this says nothing about in-game effect: a testing run with this branch is the next useful step.

Re-verify in one go

git fetch https://github.com/MamaLeVrai/VIctory.git bundle/lane-masks-scalar-reads
git checkout FETCH_HEAD
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --locked

To confirm that no component PR moved since this was built, compare each Head above with gh pr view <n> --repo Marvisak/VIctory --json headRefOid. If one differs, this branch needs a rebuild: merge the new head in the same order.

If this lands

The ten heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. If you prefer to merge them one by one instead, the order above has no conflicts except the two noted.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6587525140 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1319). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-24T17:23:35Z. --- **One PR in place of ten.** It merges ten open shader PRs onto `main` (`ffe310e`) with every head unchanged, and reports that the result builds and passes together. Two of the merges needed a hand resolution, described below. Nothing else is changed. > For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is the `[BUNDLE]` PR. The re-verification commands are below, so one run covers all ten. ## What is inside | PR | Author | Head | Topic | |---|---|---|---| | #1057 | bartikele | `a793ad86a` | lower all-zero and all-one constant lane masks | | #1073 | undeadhuman37 | `986fa6db9` | a scalar joining a lane mask and a number (pixel, vertex) | | #1074 | undeadhuman37 | `ec337a025` | a lane mask spilled to a VGPR lane is still that mask | | #1084 | undeadhuman37 | `48a41fb85` | select or carry-in on an untracked mask tests this lane's bit | | #953 | MartinIndra02 | `c42cbb073` | `s_buffer_load` uses in `descriptor_data` (#798) | | #1056 | adamdotpy | `417f4e30d` | scalar loads from a root view's address read its memory | | #1015 | justrealyme | `b8cfe8ce7` | scalar loads through a heap buffer that vector accesses use | | #1055 | adamdotpy | `21d1b4682` | scalar buffer loads from a UAV read it raw | | #563 | SAitken91 | `10ac6ceac` | cube samples with gradients, `image_sample_d_cl` | | #1004 | tarcisioads | `cbc8c33dc` | `image_get_lod` on cube textures | The first four target "a lane mask read as data", named in the in-game refusal tables on #293 (the latest one there puts "a lane mask read as data" first, at 408 per frame). The next four target "a scalar memory read as data". The last two are the image-sample refusals. All ten are `MERGEABLE` against `main` on their own. Merged in the order above they conflict in two places, which this PR resolves: 1. **#1015 + #1055**, `emit/lower.rs`, the raw view chosen for a scalar buffer load of a descriptor. Resolution: an SRV range reads a raw SRV view, a UAV range a raw UAV view (#1055), a descriptor of no listed kind the heap buffer view (#1015). Both PRs' tests in `emit/valu_tests.rs` are kept. 2. **#563 + #1004**, `emit/lower.rs`, the cube-sample refusal. #563 lowers gradients, #1004 the level query, so only texel coordinates are still refused. ## Left out, and why - **#1083**: another design for the same scalar-buffer-load case as #953 (it marks the dwords missing with a reason instead of reading a raw view). The two do not merge into one behaviour, so this is a choice for the maintainer. - **#1103**: closed as a duplicate of #953. - **#667, #645**: conflict with `main`. - **#694**: does not build on `main` (`resource::track` takes four arguments, see #801). ## Verification Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain): | Check | Result | |---|---| | `cargo clippy --workspace --all-targets --locked -- -D warnings` | clean | | `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` | clean | | `cargo test --workspace --locked` | 350 passed, 0 failed, 6 ignored (`main`: 342 passed, 6 ignored) | Each of the ten also passes the same three checks alone on `main` (matrix on #801). The tests that exercise the lowering run on the GPU and on WARP. **The title was not run**, so this says nothing about in-game effect: a testing run with this branch is the next useful step. ## Re-verify in one go ```powershell git fetch https://github.com/MamaLeVrai/VIctory.git bundle/lane-masks-scalar-reads git checkout FETCH_HEAD cargo clippy --workspace --all-targets --locked -- -D warnings cargo clippy --workspace --all-targets --all-features --locked -- -D warnings cargo test --workspace --locked ``` To confirm that no component PR moved since this was built, compare each `Head` above with `gh pr view <n> --repo Marvisak/VIctory --json headRefOid`. If one differs, this branch needs a rebuild: merge the new head in the same order. ## If this lands The ten heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. If you prefer to merge them one by one instead, the order above has no conflicts except the two noted. AI-assisted (Claude Code); no game data. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
copilot-pull-request-reviewer[bot commented 2026-11-24 18:04:44 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T17:23:47Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

<!-- greyfinch-sync:Marvisak/VIctory:review:6044115351 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1319#pullrequestreview-6044115351). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/copilot-pull-request-reviewer%5Bbot%5D) on 2026-11-24T17:23:47Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
DeerSilver commented 2026-11-24 18:06:02 +00:00 (Migrated from github.com)

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


The NVIDIA side of the AMD run above. Tested head 643aef6 merged onto main ffe310e (clean merge) on NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell), driver 621.24, Windows 11 26300, Rust 1.98.1. Pass. No game files: the test suite only.

Check Result
cargo clippy --workspace --all-targets --locked -- -D warnings clean
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings clean
cargo test --workspace --locked 350 passed, 0 failed, 6 ignored (main: 342 / 6), the same totals as on the RX 6950 XT
  • The bundle's tests that dispatch ran on both the RTX 5060 (hardware) and WARP, and the log has no no SM 6.6 skip:
    • scalar_loads_read_a_root_srv_and_a_root_cbv (root_view_tests.rs)
    • v_cndmask_on_an_untracked_mask_tests_this_lanes_bit (valu_tests.rs)
    • scalar_buffer_loads_read_a_uav_through_its_table (valu_tests.rs)
  • The lowering tests pass too:
    • scalar_loads_through_a_heap_buffer_that_vector_accesses_use_read_a_buffer_view
    • s_buffer_load_descriptor_size_reads_as_data
    • cube_image_get_lod_lowers
    • a_scalar_joining_a_lane_mask_and_a_number_lowers_in_pixel_programs
    • a_lane_mask_spilled_to_a_vgpr_lane_stays_a_mask

So the ten PRs pass together on both AMD and NVIDIA. Like the AMD run, this says nothing about in-game effect.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139907250 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1319#issuecomment-7139907250). Originally posted by [DeerSilver](https://github.com/DeerSilver) on 2026-11-24T17:55:45Z. --- The NVIDIA side of the AMD run above. Tested head `643aef6` merged onto `main` `ffe310e` (clean merge) on **NVIDIA GeForce RTX 5060 Laptop GPU** (Blackwell), driver 621.24, Windows 11 26300, Rust 1.98.1. **Pass.** No game files: the test suite only. | Check | Result | |---|---| | `cargo clippy --workspace --all-targets --locked -- -D warnings` | clean | | `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` | clean | | `cargo test --workspace --locked` | **350 passed, 0 failed, 6 ignored** (`main`: 342 / 6), the same totals as on the RX 6950 XT | - The bundle's tests that dispatch ran on both the RTX 5060 (hardware) and WARP, and the log has no `no SM 6.6` skip: - `scalar_loads_read_a_root_srv_and_a_root_cbv` (`root_view_tests.rs`) - `v_cndmask_on_an_untracked_mask_tests_this_lanes_bit` (`valu_tests.rs`) - `scalar_buffer_loads_read_a_uav_through_its_table` (`valu_tests.rs`) - The lowering tests pass too: - `scalar_loads_through_a_heap_buffer_that_vector_accesses_use_read_a_buffer_view` - `s_buffer_load_descriptor_size_reads_as_data` - `cube_image_get_lod_lowers` - `a_scalar_joining_a_lane_mask_and_a_number_lowers_in_pixel_programs` - `a_lane_mask_spilled_to_a_vgpr_lane_stays_a_mask` So the ten PRs pass together on both AMD and NVIDIA. Like the AMD run, this says nothing about in-game effect. AI-assisted (Claude Code).
sinan-cmyk commented 2026-11-24 19:04:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-24T18:12:53Z.


Offline measurement on a retail dump

Result: +285 programs over main, 0 programs lost.

Method: the same as #1247. I ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11. I compared head 643aef6 with main ffe310e program by program, 25,889 programs. Validated: 21,724 on main, 22,009 with this PR.

Failure on main Gained
a scalar memory read as data 230
image_sample_d_cl 25
a lane-mask join of an untracked mask 17
a lane mask read as data 6
an opaque lane mask 4
a select on an untracked mask 3

Programs that still fail but now fail later. Many programs get past their old failure and stop at a later step:

  • 497 move from "a scalar memory read as data" to "a descriptor's address or format read as data"
  • 247 move to "a descriptor read only as data", the reason #1067 addresses. 206 of them come from "a select on an untracked mask".

The 247 programs explain why #1402, which stacks #1067 and three more PRs on this one, gains more than those PRs gained one by one. Details are in the measurement on #1402.

These counts show only that programs translate and pass the validator. They do not show that the output is correct. No shader names or data are included, per the asset policy.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140322706 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1319#issuecomment-7140322706). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-24T18:12:53Z. --- ### Offline measurement on a retail dump **Result: +285 programs over `main`, 0 programs lost.** Method: the same as #1247. I ran `victory translate --validate --list` on `shaders.rpf` (1.0.2.1), with dxil.dll 1.8.2502.11. I compared head 643aef6 with `main` ffe310e program by program, 25,889 programs. Validated: 21,724 on `main`, 22,009 with this PR. | Failure on `main` | Gained | |---|---| | a scalar memory read as data | 230 | | image_sample_d_cl | 25 | | a lane-mask join of an untracked mask | 17 | | a lane mask read as data | 6 | | an opaque lane mask | 4 | | a select on an untracked mask | 3 | **Programs that still fail but now fail later.** Many programs get past their old failure and stop at a later step: - 497 move from "a scalar memory read as data" to "a descriptor's address or format read as data" - 247 move to "a descriptor read only as data", the reason #1067 addresses. 206 of them come from "a select on an untracked mask". The 247 programs explain why #1402, which stacks #1067 and three more PRs on this one, gains more than those PRs gained one by one. Details are in [the measurement on #1402](https://github.com/Marvisak/VIctory/pull/1402#issuecomment-7140318094). These counts show only that programs translate and pass the validator. They do not show that the output is correct. No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
MamaLeVrai commented 2026-11-24 20:03:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MamaLeVrai on 2026-11-24T19:51:30Z.


Thanks to DeerSilver for the RTX 5060 run (350 passed, the same totals as on the RX 6950 XT) and to sinan-cmyk for the offline measurement (+285 programs, 0 lost, and the walls the programs now stop at, which drove #1402 and #1504). The head is unchanged since those runs, 643aef6. AI-assisted (Claude Code); no game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7142687340 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1319#issuecomment-7142687340). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-24T19:51:30Z. --- Thanks to DeerSilver for the RTX 5060 run (350 passed, the same totals as on the RX 6950 XT) and to sinan-cmyk for the offline measurement (+285 programs, 0 lost, and the walls the programs now stop at, which drove #1402 and #1504). The head is unchanged since those runs, `643aef6`. AI-assisted (Claude Code); no game data.
Bullet18x commented 2026-11-24 22:02:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Bullet18x on 2026-11-24T21:50:10Z.


NVIDIA RTX 5090 run of this bundle in the title, against main.

Machine: RTX 5090 32 GB, driver 621.40 (32.0.16.2114), Ryzen 9 9950X3D, 64 GB, Windows 11 Pro 10.0.28000.
Builds: main ffe310e and this bundle bundle/lane-masks-scalar-reads 643aef646, both cargo build --profile diag -p victory --features diagnostics, warm shader and pipeline caches.
Run: VICTORY_KEYS=8:Enter,20:Enter,35:Enter, VICTORY_D3D12_DRED=1, VICTORY_CAPTURE=<dir>, VICTORY_CAPTURE_FRAMES = every second frame 900–990, one run each.

main this bundle
shader does not translate warnings in the run 433 398 (−35)
Frames until DXGI_ERROR_DEVICE_HUNG ~966 ~932
World frames, 3D scene black black
  • Captured world frames (mean brightness of every frame from 900 on): only the 2D title cards and subtitles are drawn; the 3D scene behind them is black (mean ~0.3 / 255) on both builds until the hang, so the effect of the newly translated shaders cannot be seen on this card yet.
  • The bundle reached the world earlier (by frame ~900 vs ~960) and hung earlier; one run each, so not conclusive.
  • Offline census of all 26,148 programs (victory translate <dump>), main → this bundle:
    • emitted: vertex/pixel 12,243 → 12,351, compute 1,441 → 1,461, mesh 8,214 → 8,380 (+294 in all)
    • "a scalar memory read as data" 771 → 0; "a select on an untracked mask" 288 → 0; image_sample_d_cl 29 → 0; "a lane-mask join of an untracked mask" 19 → 0
    • "a descriptor read only as data" 394 → 643: programs that stopped earlier now stop here (the #1067 case in #1402).

The NVIDIA world hang itself is tracked in #1586 (what does not stop it on this machine).

No game data, captured frames or screenshots attached (asset policy). AI use: Claude Code (Claude Opus 5.5) built, ran and measured; I checked the results.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7145451784 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1319#issuecomment-7145451784). Originally posted by [Bullet18x](https://github.com/Bullet18x) on 2026-11-24T21:50:10Z. --- NVIDIA RTX 5090 run of this bundle in the title, against `main`. **Machine**: RTX 5090 32 GB, driver 621.40 (32.0.16.2114), Ryzen 9 9950X3D, 64 GB, Windows 11 Pro 10.0.28000. **Builds**: `main` `ffe310e` and this bundle `bundle/lane-masks-scalar-reads` `643aef646`, both `cargo build --profile diag -p victory --features diagnostics`, warm shader and pipeline caches. **Run**: `VICTORY_KEYS=8:Enter,20:Enter,35:Enter`, `VICTORY_D3D12_DRED=1`, `VICTORY_CAPTURE=<dir>`, `VICTORY_CAPTURE_FRAMES` = every second frame 900–990, one run each. | | `main` | this bundle | |---|---|---| | `shader does not translate` warnings in the run | 433 | **398** (−35) | | Frames until `DXGI_ERROR_DEVICE_HUNG` | ~966 | ~932 | | World frames, 3D scene | black | black | - Captured world frames (mean brightness of every frame from 900 on): only the 2D title cards and subtitles are drawn; the 3D scene behind them is black (mean ~0.3 / 255) on both builds until the hang, so the effect of the newly translated shaders cannot be seen on this card yet. - The bundle reached the world earlier (by frame ~900 vs ~960) and hung earlier; one run each, so not conclusive. - Offline census of all 26,148 programs (`victory translate <dump>`), `main` → this bundle: - emitted: vertex/pixel 12,243 → 12,351, compute 1,441 → 1,461, mesh 8,214 → 8,380 (**+294** in all) - "a scalar memory read as data" 771 → **0**; "a select on an untracked mask" 288 → **0**; `image_sample_d_cl` 29 → **0**; "a lane-mask join of an untracked mask" 19 → **0** - "a descriptor read only as data" 394 → 643: programs that stopped earlier now stop here (the #1067 case in #1402). The NVIDIA world hang itself is tracked in #1586 (what does not stop it on this machine). No game data, captured frames or screenshots attached (asset policy). AI use: Claude Code (Claude Opus 5.5) built, ran and measured; I checked the results.
MamaLeVrai commented 2026-11-25 00:06:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MamaLeVrai on 2026-11-24T23:52:37Z.


Bullet18x: thank you for the RTX 5090 run and for the offline census; the census (+294 emitted, 771 to 0 for "a scalar memory read as data") is what the bundle is for. One caution about what it measures: it is against main at ffe310e. main has since moved (28 commits of the maintainer's own, ffe310e..70564ae, among them lane masks, bounded root views and 64-bit image atomics), and on that main only 1 of this bundle's 10 PRs merges as it stands (the others conflict in the shader lowering), so this branch is not rebuilt yet and your numbers are for the earlier base.

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7147892768 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1319#issuecomment-7147892768). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-24T23:52:37Z. --- Bullet18x: thank you for the RTX 5090 run and for the offline census; the census (+294 emitted, 771 to 0 for "a scalar memory read as data") is what the bundle is for. One caution about what it measures: it is against `main` at `ffe310e`. `main` has since moved (28 commits of the maintainer's own, `ffe310e..70564ae`, among them lane masks, bounded root views and 64-bit image atomics), and on that `main` only 1 of this bundle's 10 PRs merges as it stands (the others conflict in the shader lowering), so this branch is not rebuilt yet and your numbers are for the earlier base. AI-assisted (Claude Code); no game data.
upstream-sync closed this pull request 2026-11-25 01:06:13 +00:00
Marvisak commented 2026-11-25 01:08:08 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged.

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148705376 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1319#issuecomment-7148705376). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:37:24Z. --- Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!1319
No description provided.