xshader: gate CbDyn and tbuf_uint vector loads on exec_lo #549

Merged
glovepost merged 1 commit from upstream-pr/549 into main 2026-12-01 14:36:36 +00:00
glovepost commented 2026-11-29 21:31:40 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-29T21:31:40Z.


Summary

Split 2 of 3 from #522 per @brcly's review (alongside #547 for CLI --capabilities / --stride-report / --stride-hints, and #522 narrowed to stage-aware loop guards).

Gate vector MUBUF loads (tbuf_uint and CbDyn indexed/unindexed constant buffer loads) on exec_lo in tools/shader-compiler/src/hlsl/emitter/buffer.rs so inactive lanes match the existing exec-mask gating used by raw, structured, and typed buffer loads. Adds structured_typed_and_cbdyn_mubuf_loads_guard_with_exec_mask in tools/shader-compiler/src/tests/hlsl/raw_width.rs.

Verification

  • Host (DXC=<dxc> python3 tuxbox.py check --no-gpu): 9/9 passed:
    • 711 Python tests
    • 631 shader compiler lib tests + 1 bin test + 2 integration tests (including structured_typed_and_cbdyn_mubuf_loads_guard_with_exec_mask)
    • 116 DXBC tests
    • 24 XG layout + 7 XG entry point tests
    • 22 storage codec tests
    • 9 ACP HAL tests
    • D3D12 Windows typecheck
  • GPU: Not re-run after splitting from #522. Prior to splitting, the combined commit previously passed 65/65 check_translator_gpu.py checks (including buffer-loads and dynamic-cbv) and 126/126 tuxbox.py verify checks on both NVIDIA RTX 2070 SUPER (10de:1e84) and AMD RX 9070 XT (1002:13c0).
  • ProjectScarlett: Not run with this split PR yet.

AI-assistance disclosure

Prepared and verified with AI-assisted coding tools (submitting contributor verified builds, diffs, and test runs).

<!-- greyfinch-sync:brcly/TuxBox:issue:5555334979 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/549). Originally posted by [glovepost](https://github.com/glovepost) on 2026-11-29T21:31:40Z. --- ### Summary Split 2 of 3 from #522 per @brcly's review (alongside #547 for CLI `--capabilities` / `--stride-report` / `--stride-hints`, and #522 narrowed to stage-aware loop guards). Gate vector MUBUF loads (`tbuf_uint` and `CbDyn` indexed/unindexed constant buffer loads) on `exec_lo` in [`tools/shader-compiler/src/hlsl/emitter/buffer.rs`](tools/shader-compiler/src/hlsl/emitter/buffer.rs) so inactive lanes match the existing `exec`-mask gating used by raw, structured, and typed buffer loads. Adds `structured_typed_and_cbdyn_mubuf_loads_guard_with_exec_mask` in [`tools/shader-compiler/src/tests/hlsl/raw_width.rs`](tools/shader-compiler/src/tests/hlsl/raw_width.rs). ### Verification - Host (`DXC=<dxc> python3 tuxbox.py check --no-gpu`): **9/9 passed**: - `711` Python tests - `631` shader compiler lib tests + `1` bin test + `2` integration tests (including `structured_typed_and_cbdyn_mubuf_loads_guard_with_exec_mask`) - `116` DXBC tests - `24` XG layout + `7` XG entry point tests - `22` storage codec tests - `9` ACP HAL tests - D3D12 Windows typecheck - GPU: Not re-run after splitting from #522. Prior to splitting, the combined commit previously passed `65/65` `check_translator_gpu.py` checks (including `buffer-loads` and `dynamic-cbv`) and `126/126` `tuxbox.py verify` checks on both NVIDIA RTX 2070 SUPER (`10de:1e84`) and AMD RX 9070 XT (`1002:13c0`). - ProjectScarlett: **Not run** with this split PR yet. ### AI-assistance disclosure Prepared and verified with AI-assisted coding tools (submitting contributor verified builds, diffs, and test runs).
brcly commented 2026-11-29 22:02:59 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T22:02:59Z.


Heads-up: we rewrote main's history tonight (one commit per merged PR, to drop files that came in with intermediate commits), and this branch is still based on the old main (on the old #512 merge, 39463ea5). That's why GitHub now shows it with dozens of commits that aren't yours. Your own commits are the ones after 39463ea5; this replays only those onto the new main:

git fetch origin
git rebase --onto origin/main 39463ea5
git push --force-with-lease

Sorry for the extra step.

<!-- greyfinch-sync:brcly/TuxBox:comment:7263359852 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/549#issuecomment-7263359852). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T22:02:59Z. --- Heads-up: we rewrote `main`'s history tonight (one commit per merged PR, to drop files that came in with intermediate commits), and this branch is still based on the old `main` (on the old #512 merge, `39463ea5`). That's why GitHub now shows it with dozens of commits that aren't yours. Your own commits are the ones after `39463ea5`; this replays only those onto the new `main`: ```sh git fetch origin git rebase --onto origin/main 39463ea5 git push --force-with-lease ``` Sorry for the extra step.
glovepost commented 2026-11-29 22:20:25 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-29T22:20:25Z.


@brcly Rebased #549 cleanly onto rewritten main (6bab5478, single commit f00ddbc2).

DXC=<dxc> python3 tuxbox.py check --no-gpu passed 9/9. ProjectScarlett was not run against this rebased commit.

<!-- greyfinch-sync:brcly/TuxBox:comment:7263595444 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/549#issuecomment-7263595444). Originally posted by [glovepost](https://github.com/glovepost) on 2026-11-29T22:20:25Z. --- @brcly Rebased #549 cleanly onto rewritten `main` (`6bab5478`, single commit `f00ddbc2`). `DXC=<dxc> python3 tuxbox.py check --no-gpu` passed `9/9`. ProjectScarlett was not run against this rebased commit.
glovepost commented 2026-11-30 00:27:38 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-30T00:27:38Z.


Rebased onto main (f482572a, commit 917adada25d2) with no functional changes from f00ddbc2, and ran the changed GPU checks on NVIDIA:

  • Command: TUXBOX_CHECK_JOBS=4 DXC=<dxc> python3 tuxbox.py check --changed --adapter 10de:1e84 --proton <proton> --prefix <prefix> --windows-dxc <windows-dxc>
  • GPU / driver / backend: NVIDIA GeForce RTX 2070 SUPER (10de:1e84), driver 620.73.04, GE-Proton11-14
  • Results: Lanes and fixtures on the GPU (lanes-bindless-compute, lanes-compute-root, lanes-compute-root-recovery, lanes-raster-tables, lanes-shader-cache) and Shader translator on the GPU all passed (13 passed, 0 failed, 0 not run).
  • Still missing: AMD GPU checks. ProjectScarlett was not run on this commit.

Evidence: TuxBox check of 917adada25d2, no uncommitted changes, GPU 10de:1e84: 13 passed, 0 failed, 0 not run

<!-- greyfinch-sync:brcly/TuxBox:comment:7265288206 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/549#issuecomment-7265288206). Originally posted by [glovepost](https://github.com/glovepost) on 2026-11-30T00:27:38Z. --- Rebased onto `main` (`f482572a`, commit `917adada25d2`) with no functional changes from `f00ddbc2`, and ran the changed GPU checks on NVIDIA: - **Command:** `TUXBOX_CHECK_JOBS=4 DXC=<dxc> python3 tuxbox.py check --changed --adapter 10de:1e84 --proton <proton> --prefix <prefix> --windows-dxc <windows-dxc>` - **GPU / driver / backend:** NVIDIA GeForce RTX 2070 SUPER (`10de:1e84`), driver `620.73.04`, `GE-Proton11-14` - **Results:** `Lanes and fixtures on the GPU` (`lanes-bindless-compute`, `lanes-compute-root`, `lanes-compute-root-recovery`, `lanes-raster-tables`, `lanes-shader-cache`) and `Shader translator on the GPU` all passed (**13 passed, 0 failed, 0 not run**). - **Still missing:** AMD GPU checks. ProjectScarlett was not run on this commit. `Evidence: TuxBox check of 917adada25d2, no uncommitted changes, GPU 10de:1e84: 13 passed, 0 failed, 0 not run`
NickStallman commented 2026-11-30 01:13:21 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T01:13:21Z.


The AMD check you were missing, on 917adada: AMD iGPU (1002:13c0, RADV, Mesa 26.0.8, GE-Proton11-14, Linux), full python tuxbox.py check: 199 pass, 0 fail. A game was loading on the other card during part of it. ProjectScarlett wasn't run on this commit.

Evidence: TuxBox check of 917adada25, no uncommitted changes, GPU 1002:13c0: 14 passed, 0 failed, 0 not run

<!-- greyfinch-sync:brcly/TuxBox:comment:7265949671 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/549#issuecomment-7265949671). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T01:13:21Z. --- The AMD check you were missing, on 917adada: AMD iGPU (`1002:13c0`, RADV, Mesa 26.0.8, GE-Proton11-14, Linux), full `python tuxbox.py check`: 199 pass, 0 fail. A game was loading on the other card during part of it. ProjectScarlett wasn't run on this commit. Evidence: TuxBox check of 917adada25d2, no uncommitted changes, GPU 1002:13c0: 14 passed, 0 failed, 0 not run
brcly commented 2026-11-30 04:12:13 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T04:12:13Z.


Heads-up: main just landed a large cleanup (up to e5d2e913), so this PR needs a rebase.

  • Formatting: the whole workspace is now formatted with rustfmt (see the new rustfmt.toml).
  • Lints: every crate denies unwrap(), lossy as casts and undocumented unsafe outside tests.
  • CI: it now also runs cargo fmt --check, rustdoc with warnings denied, and Miri on the providers' unit tests.

The least painful way is to format your branch first, so the rebase only shows real changes:

git fetch origin
git checkout origin/main -- rustfmt.toml
cargo fmt --all && git commit -am "rustfmt"
git rebase origin/main

Then run python tuxbox.py check --no-gpu, which now includes the format step.

If clippy flags something new:

  • A cast: use From for widening, TryFrom for narrowing, and a mask for bit fields.
  • An unwrap(): use ?, or expect with the reason it can't fail.
  • An unsafe block: it needs a // SAFETY: comment.

CONTRIBUTING's "Code checks" section lists the commands. Thanks!

<!-- greyfinch-sync:brcly/TuxBox:comment:7268560693 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/549#issuecomment-7268560693). Originally posted by [brcly](https://github.com/brcly) on 2026-11-30T04:12:13Z. --- Heads-up: main just landed a large cleanup (up to e5d2e913), so this PR needs a rebase. - **Formatting:** the whole workspace is now formatted with rustfmt (see the new `rustfmt.toml`). - **Lints:** every crate denies `unwrap()`, lossy `as` casts and undocumented `unsafe` outside tests. - **CI:** it now also runs `cargo fmt --check`, rustdoc with warnings denied, and Miri on the providers' unit tests. The least painful way is to format your branch first, so the rebase only shows real changes: ```sh git fetch origin git checkout origin/main -- rustfmt.toml cargo fmt --all && git commit -am "rustfmt" git rebase origin/main ``` Then run `python tuxbox.py check --no-gpu`, which now includes the format step. If clippy flags something new: - **A cast:** use `From` for widening, `TryFrom` for narrowing, and a mask for bit fields. - **An `unwrap()`:** use `?`, or `expect` with the reason it can't fail. - **An `unsafe` block:** it needs a `// SAFETY:` comment. CONTRIBUTING's "Code checks" section lists the commands. Thanks!
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
brcly/TuxBox!549
No description provided.