Scripts: skip BVH shaders without an embedded root signature #1719

Open
jeroenhaentjens wants to merge 1 commit from upstream-pr/1729 into main
jeroenhaentjens commented 2026-11-24 19:59:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jeroenhaentjens on 2026-11-24T19:59:54Z.


The BVH shader extractor can write valid DXBC files with no RTS0 chunk. The layout checker passed None to the root-signature parser and stopped at the first such file. It now reports the file and continues with the rest of the directory.

What is in it

  • Skip files with no RTS0 chunk in scripts/re/check_layout.py. Add a command-line regression test and document the behavior.

Tested

  • Windows 11 Pro 26200, Intel i7-9750H, 32 GB RAM, NVIDIA Quadro RTX 3000 (driver 32.0.15.9706), Rust/Cargo 1.100.0 MSVC, DXC 1.9.2609.5, debug builds without debug symbols or incremental compilation.
  • Local commit 4a16b1f6438ce81db295e86c0fd95566d4d13c96 and GitHub head 7992dff9cf15eb62794c1521c24df2d46e0ed968 have the same Git tree and parent. The runs used the local commit.
  • cargo build --workspace --locked passed. cargo test --workspace --locked --no-fail-fast -- --test-threads=4 reported 863 passed, 0 failed, 42 ignored. XCL_ADAPTER=nvidia and XCL_HEAP_WINDOWS=1. The bundled title tests passed.
  • Two wave64 skips counted as passes by Cargo: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.
  • python -B -m unittest discover -s scripts -p 'test_*.py' passed all 17 tests. The new test failed before the fix with TypeError and now passes. Also checked with DXC-compiled compute shaders, including a directory with one rootless shader and one shader with an embedded root signature.

Regression run

  • Script, test and documentation change.

Not tested

  • Native wave64 hardware, the 42 explicitly ignored tests and real game/SDK data. No XCL_SAMPLE_* inputs were supplied.

AI use

  • Codex (gpt-6.2-sol) investigated, wrote the change and regression test, ran the tests and drafted this description.
<!-- greyfinch-sync:ivall/xcl:issue:5479369611 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1729). Originally posted by [jeroenhaentjens](https://github.com/jeroenhaentjens) on 2026-11-24T19:59:54Z. --- The BVH shader extractor can write valid DXBC files with no RTS0 chunk. The layout checker passed `None` to the root-signature parser and stopped at the first such file. It now reports the file and continues with the rest of the directory. **What is in it** - Skip files with no RTS0 chunk in `scripts/re/check_layout.py`. Add a command-line regression test and document the behavior. **Tested** - Windows 11 Pro 26200, Intel i7-9750H, 32 GB RAM, NVIDIA Quadro RTX 3000 (driver 32.0.15.9706), Rust/Cargo 1.100.0 MSVC, DXC 1.9.2609.5, debug builds without debug symbols or incremental compilation. - Local commit `4a16b1f6438ce81db295e86c0fd95566d4d13c96` and GitHub head `7992dff9cf15eb62794c1521c24df2d46e0ed968` have the same Git tree and parent. The runs used the local commit. - `cargo build --workspace --locked` passed. `cargo test --workspace --locked --no-fail-fast -- --test-threads=4` reported 863 passed, 0 failed, 42 ignored. `XCL_ADAPTER=nvidia` and `XCL_HEAP_WINDOWS=1`. The bundled title tests passed. - Two wave64 skips counted as passes by Cargo: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`. - `python -B -m unittest discover -s scripts -p 'test_*.py'` passed all 17 tests. The new test failed before the fix with `TypeError` and now passes. Also checked with DXC-compiled compute shaders, including a directory with one rootless shader and one shader with an embedded root signature. **Regression run** - Script, test and documentation change. **Not tested** - Native wave64 hardware, the 42 explicitly ignored tests and real game/SDK data. No `XCL_SAMPLE_*` inputs were supplied. **AI use** - Codex (`gpt-6.2-sol`) investigated, wrote the change and regression test, ran the tests and drafted this description.
DavidM1911 commented 2026-11-24 23:08:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T22:37:44Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7146457405 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1729#issuecomment-7146457405). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T22:37:44Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. Thanks!
RavenCurseBurg commented 2026-11-26 02:08:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-26T01:06:08Z.


On 7992dff9cf15eb62794c1521c24df2d46e0ed968 I compiled a tiny compute shader with and without an embedded root signature using DXC 1.9.2609.5. I exercised signature versions 1.0 and 1.1 and both container orders. For each of the four inputs I ran bvhb_shaders.py on a synthetic binary containing the two containers, then check_layout.py on its output directory. Both extracted files matched their compiler output by SHA-256. The checker reported the rootless file, passed only the rooted file to the native disassembler stand-in, and counted its one on-boundary load.

Mixed-directory regression and file-handle fix. The in-process regression exposed a Python ResourceWarning from reading shader files without closing them explicitly. With the context manager and fixture in place, python -B -W always::ResourceWarning -m unittest discover -s scripts -p "test_*.py" passed 18/18 without a resource warning.

Windows 11, Core i7-13700, Python 3.14.3. The containers and root signatures came from DXC; the scalar listing came from a stand-in. No Xbox builder DLL, retail asset, GPU execution or real XCL disassembly. OpenAI Codex (GPT-6) wrote the fixtures and ran the tests.

<!-- greyfinch-sync:ivall/xcl:comment:7179433526 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1729#issuecomment-7179433526). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-26T01:06:08Z. --- On `7992dff9cf15eb62794c1521c24df2d46e0ed968` I compiled a tiny compute shader with and without an embedded root signature using DXC 1.9.2609.5. I exercised signature versions 1.0 and 1.1 and both container orders. For each of the four inputs I ran `bvhb_shaders.py` on a synthetic binary containing the two containers, then `check_layout.py` on its output directory. Both extracted files matched their compiler output by SHA-256. The checker reported the rootless file, passed only the rooted file to the native disassembler stand-in, and counted its one on-boundary load. [Mixed-directory regression and file-handle fix](https://github.com/RavenCurseBurg/xcl/commit/5475ab6c08a1f27c4c9a7666de9ed730f87fe470). The in-process regression exposed a Python `ResourceWarning` from reading shader files without closing them explicitly. With the context manager and fixture in place, `python -B -W always::ResourceWarning -m unittest discover -s scripts -p "test_*.py"` passed 18/18 without a resource warning. Windows 11, Core i7-13700, Python 3.14.3. The containers and root signatures came from DXC; the scalar listing came from a stand-in. No Xbox builder DLL, retail asset, GPU execution or real XCL disassembly. OpenAI Codex (GPT-6) wrote the fixtures and ran the tests.
github-actions[bot] commented 2026-11-30 08:40:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:40:47Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7273207665 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1729#issuecomment-7273207665). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:40:47Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 06:36:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:36:19Z.


Triage (#1607) – head 7992dff

No merged change covers this: main's scripts/re/check_layout.py still calls layout(rs) with rs = None for a shader without RTS0 and crashes in struct.unpack_from.
#1196 and #2151 also skip shaders without RTS0 (silently, if not rs: continue / if rs is None: continue) as part of wider CLI/validation rewrites of the same script; this PR is the minimal fix and also reports the skipped file. Whichever lands first makes the other's guard redundant.
The test builds a valid one-part DXBC container and checks the output lines; no problems found in the diff. The README note is optional for a script 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:7303063306 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1729#issuecomment-7303063306). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:36:19Z. --- **Triage (#1607)** – head 7992dff No merged change covers this: main's `scripts/re/check_layout.py` still calls `layout(rs)` with `rs = None` for a shader without RTS0 and crashes in `struct.unpack_from`. #1196 and #2151 also skip shaders without RTS0 (silently, `if not rs: continue` / `if rs is None: continue`) as part of wider CLI/validation rewrites of the same script; this PR is the minimal fix and also reports the skipped file. Whichever lands first makes the other's guard redundant. The test builds a valid one-part DXBC container and checks the output lines; no problems found in the diff. The README note is optional for a script fix. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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/1729:upstream-pr/1729'
git switch 'upstream-pr/1729'

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/1729'
git switch 'upstream-pr/1729'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1729'
git switch 'upstream-pr/1729'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1729'
git switch 'main'
git merge --squash 'upstream-pr/1729'
git switch 'main'
git merge --ff-only 'upstream-pr/1729'
git switch 'main'
git merge 'upstream-pr/1729'
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!1719
No description provided.