shader: map s_bitset1_b32 on a root address high word to the stride-one V# #3704

Manually merged
github merged 1 commit from github-bot/gh-3702 into main 2026-12-01 08:47:19 +00:00 AGit
Owner

@⁠lukaslw-lab on GitHub · 2026-12-01 05:09 UTC · original
lukaslw-lab:shader/mesh-root-bitset1-stride → main · +82 −2 · 6 files · 1 commits · merged 2026-12-01 08:44 UTC

Change

s_bitset1_b32 <root address high>, 16 sets bit 16 of the high address word, the same bit as the s_or_b32 <high>, 0x10000 that byte_descriptor_field already maps to root_stride_one_high. It now gets the same symbol, so a raw V# built that way reaches the existing stride-one path (word 2 0xffffffff, word 3 0x11014fac). s_bitset1_b32 does not write SCC, so the compute and mesh code generators leave SCC unchanged for it instead of setting it to 1 as for s_or_b32. Any other bit, the low word and s_bitset0_b32 keep unbound numeric SGPR.

This is the first refusal of 24 slot 86 mesh requests on a local capture (#3705); they reach later refusals, listed there. Refs #3643.

Verification

Build release at this branch (Windows 10 19045, MSVC 2022, DXC 1.9.2609):

python -B tests/native_direct_mesh_check.py <compile_dxil.exe> <dxc dir>       -> passed
python -B tests/native_direct_container_check.py <compile_dxil.exe> <dxc dir>  -> passed
python -B tests/docs_links_check.py                                            -> passed
ctest --test-dir out/build/release -R "native_direct|descriptor_scc|native_scalar|mesh|native_.*root|compute_desc"
  -> 217 tests: 106 passed, 86 capability skips (77), 25 failed

The same 25 _hardware tests fail on this host without this change (Windows 10 without the Agility SDK; NVIDIA RTX 3080 Ti, driver 32.0.16.1047, debug layer on).

Controls:

  • Without the source change, both checks fail: unbound numeric SGPR s27 (mesh) and s5 (compute).
  • With the two SCC lines reverted, both SCC assertions fail.

Evidence and follow-up

Source-built words only. The mesh check compiles the s_or_b32 and s_bitset1_b32 forms of the existing root SRV read to byte-identical DXIL and checks that a compare before the stride write reaches an s_cselect_b32 after it. Bit 15, the low word and s_bitset0_b32 are refused. The compute check covers the same on a compute root descriptor. Note: docs/experiments/native-root-stride-bitset1.md.

Follow-ups in #3705: mesh scalar loops (design first), v_mad_f32, idxen offen raw loads.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

🤖 Generated with Claude Code

**@⁠lukaslw-lab** on GitHub · 2026-12-01 05:09 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3702) `lukaslw-lab:shader/mesh-root-bitset1-stride` → `main` · +82 −2 · 6 files · 1 commits · merged 2026-12-01 08:44 UTC ## Change `s_bitset1_b32 <root address high>, 16` sets bit 16 of the high address word, the same bit as the `s_or_b32 <high>, 0x10000` that `byte_descriptor_field` already maps to `root_stride_one_high`. It now gets the same symbol, so a raw V# built that way reaches the existing stride-one path (word 2 `0xffffffff`, word 3 `0x11014fac`). `s_bitset1_b32` does not write SCC, so the compute and mesh code generators leave SCC unchanged for it instead of setting it to 1 as for `s_or_b32`. Any other bit, the low word and `s_bitset0_b32` keep `unbound numeric SGPR`. This is the first refusal of 24 slot 86 mesh requests on a local capture (#3705); they reach later refusals, listed there. Refs #3643. ## Verification Build `release` at this branch (Windows 10 19045, MSVC 2022, DXC 1.9.2609): ``` python -B tests/native_direct_mesh_check.py <compile_dxil.exe> <dxc dir> -> passed python -B tests/native_direct_container_check.py <compile_dxil.exe> <dxc dir> -> passed python -B tests/docs_links_check.py -> passed ctest --test-dir out/build/release -R "native_direct|descriptor_scc|native_scalar|mesh|native_.*root|compute_desc" -> 217 tests: 106 passed, 86 capability skips (77), 25 failed ``` The same 25 `_hardware` tests fail on this host without this change (Windows 10 without the Agility SDK; NVIDIA RTX 3080 Ti, driver 32.0.16.1047, debug layer on). Controls: - Without the source change, both checks fail: `unbound numeric SGPR s27` (mesh) and `s5` (compute). - With the two SCC lines reverted, both SCC assertions fail. ## Evidence and follow-up Source-built words only. The mesh check compiles the `s_or_b32` and `s_bitset1_b32` forms of the existing root SRV read to byte-identical DXIL and checks that a compare before the stride write reaches an `s_cselect_b32` after it. Bit 15, the low word and `s_bitset0_b32` are refused. The compute check covers the same on a compute root descriptor. Note: `docs/experiments/native-root-stride-bitset1.md`. Follow-ups in #3705: mesh scalar loops (design first), `v_mad_f32`, `idxen offen` raw loads. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
s_bitset1_b32 <root address high>, 16 sets the same bit as the
s_or_b32 <high>, 0x10000 that byte_descriptor_field already maps to
root_stride_one_high. Give it the same symbol. s_bitset1_b32 does not
write SCC, so the compute and mesh code generators leave SCC unchanged
for it. Other bits, the low word and s_bitset0_b32 stay refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 05:14:23 +00:00
github manually merged commit 1c7f994a78 into main 2026-12-01 08:47:19 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-01 08:43 UTC · original · approved these changes

Reviewed stride-one root descriptor recognition and SCC preservation. The integrated native_direct_container and native_direct_mesh fixtures passed, including the positive and refusal controls.

**@⁠R0Y00** on GitHub · 2026-12-01 08:43 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3702#pullrequestreview-6127738869) · **approved these changes** Reviewed stride-one root descriptor recognition and SCC preservation. The integrated native_direct_container and native_direct_mesh fixtures passed, including the positive and refusal controls.
This discussion has been locked. Commenting is limited to contributors.
No description provided.