xshader: check a scalar load’s declared stride against the bound view #379

Closed
github-bot wants to merge 1 commit from gh-pr/379/head into gh-pr/379/base
Owner

@⁠morethansilicon on GitHub · 2026-11-25 00:46 UTC · original
test/376-structured-view-stride → main · +30 −0 · 1 files · 1 commits · closed without merging

Adds regression coverage for the CI guard proposed in #376. A synthetic pixel shader reads byte offset 0x24 through UAV slot 1. The test translates that shader and uses the existing declaration parser and comparator to check its output against independently specified view strides. A 16-byte view must match. A 64-byte view must produce the exact 64-versus-16 stride diagnostic.

This checks the declarations before GPU execution. In the hardware experiment, WARP and the RTX 4070 Laptop GPU both returned the expected word even with the mismatched view. The test covers that blind spot. The translator’s fallback stride inference remains a separate part of #376.

Validation

  • All four mixed_table tests passed in an isolated Linux build with the unrelated Windows-only pack_key module excluded. Changing the translator to emit 64 bytes caused the new test to fail on the 16-byte control. Restoring the translator made it pass.
  • cargo check --locked -p tombox-xshader --target x86_64-pc-windows-msvc --test mixed_table and the repository PR gate passed locally.
  • The patch changes one test file and uses synthetic instructions only. No exports or runtime behavior change.
**@⁠morethansilicon** on GitHub · 2026-11-25 00:46 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/379) `test/376-structured-view-stride` → `main` · +30 −0 · 1 files · 1 commits · closed without merging Adds regression coverage for the CI guard proposed in #376. A synthetic pixel shader reads byte offset `0x24` through UAV slot 1. The test translates that shader and uses the existing declaration parser and comparator to check its output against independently specified view strides. A 16-byte view must match. A 64-byte view must produce the exact 64-versus-16 stride diagnostic. This checks the declarations before GPU execution. In the [hardware experiment](https://git.gtahub.st/github/omonkeyz--xbox-emulator/issues/376), WARP and the RTX 4070 Laptop GPU both returned the expected word even with the mismatched view. The test covers that blind spot. The translator’s fallback stride inference remains a separate part of #376. **Validation** - All four `mixed_table` tests passed in an isolated Linux build with the unrelated Windows-only `pack_key` module excluded. Changing the translator to emit 64 bytes caused the new test to fail on the 16-byte control. Restoring the translator made it pass. - `cargo check --locked -p tombox-xshader --target x86_64-pc-windows-msvc --test mixed_table` and the repository PR gate passed locally. - The patch changes one test file and uses synthetic instructions only. No exports or runtime behavior change.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:20:54 +00:00
github-bot closed this pull request 2026-11-26 06:20:54 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.