Skip to content

Find complete shader layout pointer pair - #2668

Open
luckyteagirl wants to merge 1 commit into
xcl-dev:mainfrom
luckyteagirl:codex/check-layout-find-complete-pair
Open

luckyteagirl wants to merge 1 commit into
xcl-dev:mainfrom
luckyteagirl:codex/check-layout-find-complete-pair

Conversation

@luckyteagirl

Copy link
Copy Markdown
Contributor

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.

@SlopTart

SlopTart commented Nov 26, 2026 •

Copy link
Copy Markdown

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.

@oni-swr

oni-swr commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

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.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

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

Decodere commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

merge-check
base: 1c8b551
head: e9f2007
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)

@github-actions github-actions Bot added area:docs-ci Documentation, scripts, workflows, repo governance area:tests Unit, integration, e2e tests, or testtitle needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) labels Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs-ci Documentation, scripts, workflows, repo governance area:tests Unit, integration, e2e tests, or testtitle needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants