Scripts: flag BVH shader loads past the root-argument table #1509
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1519"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by GonZiin on 2026-11-24T17:11:53Z.
The BVH layout checker counted scalar loads as valid whenever their starting offset matched a root parameter, even if the load extended past the packed table. Check the full load width so these reads appear in the report.
What is in it
scripts/re/check_layout.pyreports loads that extend past the root-argument table. The README documents the command.scripts/test_check_layout_bounds.pyexercises a synthetic root signature with three in-bounds loads and two overruns, using mocked disassembly.Tested
Linux x86_64, Python 3.14.4, head
a30bf7667794b4627881d2e6a5510a100ab77f62.python3 -B -m unittest discover -s scripts -p 'test_*.py': 17 passed, 0 failed, 0 skipped. Before the fix, the new test reported both overruns as in bounds.git diff --cached --checkpassed before committing.Windows 11 Pro build 26300, Ryzen 7 7800X3D, Radeon RX 9070 XT (driver 32.0.32029.2010), DXC 1.8.2502.11, Rust 1.100.0 (
x86_64-pc-windows-msvc), debug. Exact heada30bf7667794b4627881d2e6a5510a100ab77f62..\scripts\test.ps1: workspace build passed and the suite reported 776 passed, 0 failed, 41 ignored. The bundled end-to-end title test passed. One runtime GPU skip inside the passing count:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).python -B -m unittest discover -s scripts -p 'test_*.py'on Windows (Python 3.13.15): 17 passed, 0 failed, 0 skipped.python -B scripts/re/check_layout.py <synthetic-shader-dir>used the Windowsxcl disasmexecutable and reported three in-bounds reads and two overruns.Not tested
XCL_SAMPLE_*tests. No sample paths were set.AI use
gpt-6.2-sol) implemented the change and regression test, ran the Linux and Windows checks, and drafted this description.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:53:58Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-26T03:27:36Z.
Tested
a30bf7667794b4627881d2e6a5510a100ab77f62with an independent synthetic 64-byte root table (an 8-byte descriptor followed by 14 dword constants). For each of five widths — 1, 2, 4, 8 and 16 dwords — I ranpython -B scripts/re/check_layout.py <fixture-directory>with a disassembler stand-in. All five loads ending exactly at byte 64 passed. Moving each start four bytes later flagged all five. The 1-dword case started outside the table. The other four started at a recognized parameter offset but ended beyond the table. The author head printed those findings and returned 0, and its original bounds test passed.On the earlier #1196/#1088 CLI integration, the four wider cases counted as successful loads. Candidate carrying this width check onto that CLI matched the author’s counts for all ten cases, returned 1 for each flagged load and 0 for each exact end. A separate child-error control still returned the disassembler’s exit code 23 and its diagnostic.
python -B -m unittest discover -s scripts -p "test_*.py"passed all 18 tests on the integrated candidate, with no failures or skips. Windows build 26100, i7-13700, Python 3.14.3. OpenAI Codex (GPT-6) ported the change, wrote the independent fixture and ran the tests. No real shader disassembly, GPU, game or Rust build.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:42:16Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:59:26Z.
Triage (#1607) – head
a30bf76No open or merged PR makes the same change. #2668 edits the same script (scripts/re/check_layout.py) to find the right table pointer pair; the shared lines are only the test fixture boilerplate, and the two will conflict lightly.
The README addition describes an internal reverse-engineering script in the user-facing section; it is not needed for this fix.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.