Find complete shader layout pointer pair #2658

Open
luckyteagirl wants to merge 1 commit from upstream-pr/2668 into main
luckyteagirl commented 2026-11-26 05:40:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T05:40:26Z.


The BVH layout checker stopped at the first s_and_b32 that masked s1. An unrelated mask could hide a later register pair and cause the checker to skip that shader's loads.

What is in it

  • Choose the first high-register mask with a matching low-register move.
  • Add a synthetic DXBC fixture and mocked disassembly with an unrelated mask before a valid pair, followed by one on-boundary and one off-boundary load.

Tested

  • Main b49be183 reported no table pointer and skipped both loads in the new fixture.
  • python -B -m unittest discover -s scripts -p 'test_*.py': 26 passed, 0 failed, 0 skipped on Windows with Python 3.11. The fixture reaches an existing unclosed-file ResourceWarning in the script.
  • git diff --check passed.

Regression run

  • Not applicable. The change affects only the Python layout checker and its test.

Not tested

  • A live BVH shader pack or native xcl disasm output. The regression uses a synthetic listing.
  • Rust and GPU tests or a retail title run.

AI use

  • Codex (GPT-6.2 Sol) implemented the change and test, verified behavior against main, and drafted this description.
<!-- greyfinch-sync:ivall/xcl:issue:5504676814 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2668). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T05:40:26Z. --- The BVH layout checker stopped at the first `s_and_b32` that masked `s1`. An unrelated mask could hide a later register pair and cause the checker to skip that shader's loads. **What is in it** - Choose the first high-register mask with a matching low-register move. - Add a synthetic DXBC fixture and mocked disassembly with an unrelated mask before a valid pair, followed by one on-boundary and one off-boundary load. **Tested** - Main `b49be183` reported no table pointer and skipped both loads in the new fixture. - `python -B -m unittest discover -s scripts -p 'test_*.py'`: 26 passed, 0 failed, 0 skipped on Windows with Python 3.11. The fixture reaches an existing unclosed-file `ResourceWarning` in the script. - `git diff --check` passed. **Regression run** - Not applicable. The change affects only the Python layout checker and its test. **Not tested** - A live BVH shader pack or native `xcl disasm` output. The regression uses a synthetic listing. - Rust and GPU tests or a retail title run. **AI use** - Codex (GPT-6.2 Sol) implemented the change and test, verified behavior against main, and drafted this description.
oni-swr commented 2026-11-26 07:03:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-26T07:01:52Z.


Independent native Windows CPU verification at e9f200797c1484e03586c1dc01181a18585c2cb5 against exact parent b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.

Windows 11 Pro build 26200, Ryzen 7 5700X3D, Python 3.11.9. py -3.11 -B -m unittest discover -s scripts -p 'test_*.py' passed 26 tests at the head and 25 on the parent, with zero failures or skips. The head emitted a ResourceWarning for an unclosed input file.

With a synthetic unrelated mask followed by two complete pairs, the parent reported no table pointer and counted zero loads. The head picked the first complete pair and counted one on-boundary and one off-boundary load. Both revisions handled the single-pair and missing-pair controls as expected. Cargo, GPU, native disassembly and retail smoke were outside this run.

AI use: Codex (gpt-6.2-sol) wrote and ran the synthetic checks and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7185023445 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2668#issuecomment-7185023445). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-26T07:01:52Z. --- Independent native Windows CPU verification at `e9f200797c1484e03586c1dc01181a18585c2cb5` against exact parent `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. Windows 11 Pro build 26200, Ryzen 7 5700X3D, Python 3.11.9. `py -3.11 -B -m unittest discover -s scripts -p 'test_*.py'` passed 26 tests at the head and 25 on the parent, with zero failures or skips. The head emitted a `ResourceWarning` for an unclosed input file. With a synthetic unrelated mask followed by two complete pairs, the parent reported no table pointer and counted zero loads. The head picked the first complete pair and counted one on-boundary and one off-boundary load. Both revisions handled the single-pair and missing-pair controls as expected. Cargo, GPU, native disassembly and retail smoke were outside this run. AI use: Codex (gpt-6.2-sol) wrote and ran the synthetic checks and drafted this report.
SlopTart commented 2026-11-26 07:03:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-26T06:50:50Z.


Tested on the Linux/Wine lane, full standard env (AMD rig: Ryzen 9 9900X, 96 GB DDR5, RX 7900 XT 20 GB, Arch kernel 7.2.15, Mesa 26.2.5 RADV, wine-11.0 Proton, rustc 1.94.0; d3d12,d3d12core,dxgi,d3d11,d3d10core=n,b overrides, official DXC kit, VKD3D_CONFIG=ignore_shared_fence, threads=2), head e9f20079, mergeable against main b49be183:
non-gpu suite (--skip gpu::): 596 passed, 3 failed, 4 ignored, 733 filtered.
The failure set is identical to bare main b49be183 measured on the same rig the same day (596 passed, 3 failed): gpu_promoted_uav_clear (our #2490), xma2_source_voice (#2481, vendored-FAudio gate). The third red, the sparse tile video-memory test, is a known batch flake (green solo).
Zero delta from this PR; every test it adds passes inside the suite.
Not tested: gpu suite, Windows native.
Correction: an earlier version of this row reported three extra reds; those runs lacked the d3d12,d3d12core=n,b DLL overrides and hit stub-DLL NOTIMPL artifacts. Re-ran with the standard env, artifacts gone.
AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7184841347 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2668#issuecomment-7184841347). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-26T06:50:50Z. --- **Tested** on the Linux/Wine lane, full standard env (AMD rig: Ryzen 9 9900X, 96 GB DDR5, RX 7900 XT 20 GB, Arch kernel 7.2.15, Mesa 26.2.5 RADV, wine-11.0 Proton, rustc 1.94.0; `d3d12,d3d12core,dxgi,d3d11,d3d10core=n,b` overrides, official DXC kit, `VKD3D_CONFIG=ignore_shared_fence`, threads=2), head `e9f20079`, mergeable against main `b49be183`: non-gpu suite (`--skip gpu::`): **596 passed, 3 failed, 4 ignored, 733 filtered**. The failure set is identical to bare main `b49be183` measured on the same rig the same day (596 passed, 3 failed): gpu_promoted_uav_clear (our #2490), xma2_source_voice (#2481, vendored-FAudio gate). The third red, the sparse tile video-memory test, is a known batch flake (green solo). Zero delta from this PR; every test it adds passes inside the suite. **Not tested**: gpu suite, Windows native. **Correction**: an earlier version of this row reported three extra reds; those runs lacked the `d3d12,d3d12core=n,b` DLL overrides and hit stub-DLL NOTIMPL artifacts. Re-ran with the standard env, artifacts gone. **AI use**: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
Foniass commented 2026-12-01 08:38:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:38:22Z.


Triage (#1607) – head e9f2007

No open or merged PR makes the same change. #1519 (loads past the table), #1196 and #2151 (CLI/validation) also edit scripts/re/check_layout.py, but all of them keep the first s_and_b32 sN, s1, 0xff match. This PR picks the first such register whose sN-1 is a copy of s0. The test listing (an unrelated s_and on s13 before the real s[4:5] pair) prints "no table pointer pattern" on main and "1, off: 1" with the fix.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7305583984 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2668#issuecomment-7305583984). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:38:22Z. --- **Triage (#1607)** – head e9f2007 No open or merged PR makes the same change. #1519 (loads past the table), #1196 and #2151 (CLI/validation) also edit `scripts/re/check_layout.py`, but all of them keep the first `s_and_b32 sN, s1, 0xff` match. This PR picks the first such register whose `sN-1` is a copy of `s0`. The test listing (an unrelated `s_and` on s13 before the real s[4:5] pair) prints "no table pointer pattern" on main and "1, off: 1" with the fix. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Decodere commented 2026-12-02 09:09:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T09:09:51Z.


merge-check
base: 1c8b551475
head: e9f200797c
merge: clean (git merge --no-edit onto 1c8b5514, git diff --check clean; scripts/re/check_layout.py and scripts/test_check_layout_pair.py, +42/-3)
build: not run (Tier 0 Python script diff; no Rust code changed)
tests: python -m unittest discover -s scripts -p "test_check_layout_pair.py" -v -> 1 passed, 0 failed (new test file); python -m unittest discover -s scripts -p "test_*.py" -> 66 passed, 1 error (test_discord_mirror.py on Windows, same failure on base 1c8b5514). Rust workspace tests not run (Tier 0).
review: Read the full diff (+42/-3). Collects all s_mov_b32 sN, s0 low-half registers and picks the first s_and_b32 sM, s1, 0xff high-half register whose M - 1 is in low_regs (scripts/re/check_layout.py:47-53), so an earlier unrelated s_and_b32 ..., s1, 0xff no longer masks the actual root-argument table pair. The new test verifies an unrelated s13 mask does not hide s[4:5]. No problems found.
performance: none (offline analysis script in scripts/re/; zero runtime impact)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Python 3.15.2, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7340472278 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2668#issuecomment-7340472278). Originally posted by [Decodere](https://github.com/Decodere) on 2026-12-02T09:09:51Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: e9f200797c1484e03586c1dc01181a18585c2cb5 merge: clean (`git merge --no-edit` onto `1c8b5514`, `git diff --check` clean; `scripts/re/check_layout.py` and `scripts/test_check_layout_pair.py`, +42/-3) build: not run (Tier 0 Python script diff; no Rust code changed) tests: `python -m unittest discover -s scripts -p "test_check_layout_pair.py" -v` -> 1 passed, 0 failed (new test file); `python -m unittest discover -s scripts -p "test_*.py"` -> 66 passed, 1 error (`test_discord_mirror.py` on Windows, same failure on base `1c8b5514`). Rust workspace tests not run (Tier 0). review: Read the full diff (+42/-3). Collects all `s_mov_b32 sN, s0` low-half registers and picks the first `s_and_b32 sM, s1, 0xff` high-half register whose `M - 1` is in `low_regs` (`scripts/re/check_layout.py:47-53`), so an earlier unrelated `s_and_b32 ..., s1, 0xff` no longer masks the actual root-argument table pair. The new test verifies an unrelated `s13` mask does not hide `s[4:5]`. No problems found. performance: none (offline analysis script in `scripts/re/`; zero runtime impact) verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Python 3.15.2, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2668:upstream-pr/2668'
git switch 'upstream-pr/2668'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2668'
git switch 'upstream-pr/2668'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2668'
git switch 'upstream-pr/2668'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2668'
git switch 'main'
git merge --squash 'upstream-pr/2668'
git switch 'main'
git merge --ff-only 'upstream-pr/2668'
git switch 'main'
git merge 'upstream-pr/2668'
git push origin 'main'
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
xcl-dev/xcl!2658
No description provided.