Scripts: harden check_layout CLI, DXBC validation, and error handling #2141

Open
HumanlyDev wants to merge 1 commit from upstream-pr/2151 into main
HumanlyDev commented 2026-11-25 06:24:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by HumanlyDev on 2026-11-25T06:24:45Z.


Harden scripts/re/check_layout.py so malformed/non-DXBC files, DXBC blobs without RTS0, subdirectories, disassembler errors, off-boundary loads, and missing/invalid CLI arguments are handled cleanly instead of crashing or silently passing, and add unit tests in scripts/test_check_layout.py. Non-runtime change under scripts/.

What is in it

  • scripts/re/check_layout.py:
    • Move CLI execution under if __name__ == '__main__': (parse_args, check_listing, main) with <dir> [--xcl <path>] argument validation.
    • Validate b'DXBC' magic and chunk/RTS0 bounds in parts() and layout(), skip subdirectories and non-.dxbc files, handle rs is None cleanly, and read files with with open(...).
    • Verify the xcl binary exists and subprocess.run exits 0, and return exit code 1 when off-boundary loads (bad > 0) or disassembler errors occur.
  • scripts/test_check_layout.py:
    • 8 unit tests covering parts/layout (with/without RTS0, non-DXBC, truncated containers), directory scanning with subdirs/non-.dxbc/invalid .dxbc, mocked xcl disasm failures and missing --xcl, on-boundary vs off-boundary s_load_dword detection, and CLI argument error handling.

Tested

  • Hardware & toolchain: NVIDIA GeForce RTX 4060 (32.0.16.1088), AMD Ryzen 5 7600, Windows 11 Pro 10.0.26200 (build 26200), Python 3.14.6, rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.8.2502.11.
  • python -m unittest scripts/test_check_layout.py -v: 8 passed, 0 failed (OK in 0.218s).
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4, RTX 4060, debug): 1154 passed, 0 failed, 46 ignored across 21 targets (25 SKIPPED GPU checks: 20 no wave64, 3 per-lane form #1426 refusals, 1 no heap windows, 1 cannot disable the driver cache (Windows Developer Mode is required)).

Regression run

  • Not needed: script/test-only change under scripts/ (no runtime files under crates/xcl/src/ modified).

Not tested

  • Running scripts/re/check_layout.py against a live directory of extracted bvhb_shaders.py .dxbc files (not present on this machine), retail titles / XCL_SAMPLE_*, AMD RDNA3/4, Linux / Wine.

AI use

  • Antigravity (Google DeepMind; Gemini 4): audited scripts/re/check_layout.py, wrote the hardening changes and scripts/test_check_layout.py, ran the unit tests and workspace suite, and drafted this PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5486328494 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2151). Originally posted by [HumanlyDev](https://github.com/HumanlyDev) on 2026-11-25T06:24:45Z. --- Harden `scripts/re/check_layout.py` so malformed/non-DXBC files, DXBC blobs without `RTS0`, subdirectories, disassembler errors, off-boundary loads, and missing/invalid CLI arguments are handled cleanly instead of crashing or silently passing, and add unit tests in `scripts/test_check_layout.py`. Non-runtime change under `scripts/`. **What is in it** - `scripts/re/check_layout.py`: - Move CLI execution under `if __name__ == '__main__':` (`parse_args`, `check_listing`, `main`) with `<dir> [--xcl <path>]` argument validation. - Validate `b'DXBC'` magic and chunk/RTS0 bounds in `parts()` and `layout()`, skip subdirectories and non-`.dxbc` files, handle `rs is None` cleanly, and read files with `with open(...)`. - Verify the `xcl` binary exists and `subprocess.run` exits `0`, and return exit code `1` when off-boundary loads (`bad > 0`) or disassembler errors occur. - `scripts/test_check_layout.py`: - 8 unit tests covering `parts`/`layout` (with/without `RTS0`, non-DXBC, truncated containers), directory scanning with subdirs/non-`.dxbc`/invalid `.dxbc`, mocked `xcl disasm` failures and missing `--xcl`, on-boundary vs off-boundary `s_load_dword` detection, and CLI argument error handling. **Tested** - Hardware & toolchain: NVIDIA GeForce RTX 4060 (`32.0.16.1088`), AMD Ryzen 5 7600, Windows 11 Pro `10.0.26200` (build `26200`), Python `3.14.6`, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC `1.8.2502.11`. - `python -m unittest scripts/test_check_layout.py -v`: 8 passed, 0 failed (`OK` in 0.218s). - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`, RTX 4060, debug): 1154 passed, 0 failed, 46 ignored across 21 targets (25 SKIPPED GPU checks: 20 `no wave64`, 3 `per-lane form` `#1426` refusals, 1 `no heap windows`, 1 `cannot disable the driver cache (Windows Developer Mode is required)`). **Regression run** - Not needed: script/test-only change under `scripts/` (no runtime files under `crates/xcl/src/` modified). **Not tested** - Running `scripts/re/check_layout.py` against a live directory of extracted `bvhb_shaders.py` `.dxbc` files (not present on this machine), retail titles / `XCL_SAMPLE_*`, AMD RDNA3/4, Linux / Wine. **AI use** - Antigravity (Google DeepMind; Gemini 4): audited `scripts/re/check_layout.py`, wrote the hardening changes and `scripts/test_check_layout.py`, ran the unit tests and workspace suite, and drafted this PR description.
DavidM1911 commented 2026-11-25 07:05:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T07:04:46Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7155464288 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2151#issuecomment-7155464288). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T07:04:46Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
raylitebull commented 2026-11-25 11:09:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:46:47Z.


Diff audited (scripts/re/check_layout.py bounds checks + test_check_layout.py) and CI workflow approved (running). Needs Build and test green plus independent test verification.

<!-- greyfinch-sync:ivall/xcl:comment:7160161659 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2151#issuecomment-7160161659). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T10:46:47Z. --- Diff audited (`scripts/re/check_layout.py` bounds checks + `test_check_layout.py`) and CI workflow approved (running). Needs `Build and test` green plus independent test verification.
RavenCurseBurg commented 2026-11-25 12:06:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-25T11:43:14Z.


I compared this head (aa825c088e65db380f67a112e0474e56ea841b6a) with #1088 using a native disassembler stand-in and the same two synthetic shader files. Both reported stderr, but a child that exited 23 with a stdout-only diagnostic lost its message here. A one-line follow-up and regression assertion retain stdout when stderr is empty. The batch still checks the second file, counts its successful load and exits 1. Stderr still takes precedence; a silent failure retains the numeric fallback. Five native cases passed on the candidate, including an all-success control. The new assertion failed on the original script; with the fix, python -B -m unittest discover -s scripts -p "test_*.py" passed 33/33. The eight focused tests also passed when combined locally with the earlier null-offset candidate 931c40a. Windows 11, Core i7-13700, Python 3.14.3; no retail shaders or GPU work. OpenAI Codex (GPT-6) prepared the fix and ran the checks.

Earlier verification

Tested aa825c088e65db380f67a112e0474e56ea841b6a on Windows 11 24H2 (26100.9711), i7-13700, Python 3.14.3.

Tested

  • python -B -m unittest discover -s scripts -p test_check_layout.py passed all 8 tests (0 failures, 0 skips).
  • Ran scripts/re/check_layout.py <fixture-dir> --xcl <fixture-disasm.cmd> on a synthetic root signature with one 8-byte CBV at offset 0. The stand-in printed the pointer-copy instructions and one scalar load. Offsets 0x0 and 0x4 each counted as one on-boundary load (exit 0). Offset 0x8 counted as one off-boundary load (exit 1).
  • For the zero-offset spelling s_load_dword s5, s[2:3], null, the checker reported 0 on, 0 off (exit 0). This exact load is in the tracked LLVM example, and XCL's formatter emits null for this case.
  • I tested a follow-up commit based on this head. The extended assertion failed on the PR head and all 8 tests passed with the patch. In the same CLI fixture, null then counted as one on-boundary load and the other three results stayed the same.

Not tested

Actual XCL disassembly, retail shader inputs or the Rust/GPU workspace suite.

AI use

OpenAI Codex (GPT-6) ran the tests, wrote the CLI fixture and follow-up patch, and prepared this report.

Follow-up on the review at aa825c088e65. Tested candidate 23825658d. A directory containing only a four-byte DXBC file previously returned 0. The candidate returned 1 and reported that no valid container remained, without invoking disassembly. The existing mixed batch with a valid container lacking RTS0 and an invalid file still passed. All 34 script tests passed.

Command on the candidate: python -B -m unittest discover -s scripts -p "test_*.py". Windows 11 build 26100, Core i7-13700, Python 3.14.3. OpenAI Codex (GPT-6) prepared the patch and ran the tests with synthetic inputs. I did not run the full Rust/GPU suite.

<!-- greyfinch-sync:ivall/xcl:comment:7161411009 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2151#issuecomment-7161411009). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T11:43:14Z. --- I compared this head (`aa825c088e65db380f67a112e0474e56ea841b6a`) with #1088 using a native disassembler stand-in and the same two synthetic shader files. Both reported stderr, but a child that exited 23 with a stdout-only diagnostic lost its message here. A [one-line follow-up and regression assertion](https://github.com/RavenCurseBurg/xcl/commit/1272701ae58bbf705c85c9d2fa9564f9c87476ef) retain stdout when stderr is empty. The batch still checks the second file, counts its successful load and exits 1. Stderr still takes precedence; a silent failure retains the numeric fallback. Five native cases passed on the candidate, including an all-success control. The new assertion failed on the original script; with the fix, `python -B -m unittest discover -s scripts -p "test_*.py"` passed 33/33. The eight focused tests also passed when combined locally with the earlier null-offset candidate `931c40a`. Windows 11, Core i7-13700, Python 3.14.3; no retail shaders or GPU work. OpenAI Codex (GPT-6) prepared the fix and ran the checks. <details> <summary>Earlier verification</summary> Tested `aa825c088e65db380f67a112e0474e56ea841b6a` on Windows 11 24H2 (26100.9711), i7-13700, Python 3.14.3. **Tested** - `python -B -m unittest discover -s scripts -p test_check_layout.py` passed all 8 tests (0 failures, 0 skips). - Ran `scripts/re/check_layout.py <fixture-dir> --xcl <fixture-disasm.cmd>` on a synthetic root signature with one 8-byte CBV at offset 0. The stand-in printed the pointer-copy instructions and one scalar load. Offsets `0x0` and `0x4` each counted as one on-boundary load (exit 0). Offset `0x8` counted as one off-boundary load (exit 1). - For the zero-offset spelling `s_load_dword s5, s[2:3], null`, the checker reported **0 on, 0 off** (exit 0). This exact load is in the [tracked LLVM example](https://github.com/xcl-dev/xcl/blob/aa825c088e65db380f67a112e0474e56ea841b6a/tests/data/llvm-amdgpu/gfx10_smem.txt#L829), and [XCL's formatter](https://github.com/xcl-dev/xcl/blob/aa825c088e65db380f67a112e0474e56ea841b6a/crates/xcl/src/gpu/rdna2.rs#L725) emits `null` for this case. - I tested a [follow-up commit based on this head](https://github.com/RavenCurseBurg/xcl/commit/931c40ae2586f1b259b2c381c3aa9a5b67e8cf90). The extended assertion failed on the PR head and all 8 tests passed with the patch. In the same CLI fixture, `null` then counted as one on-boundary load and the other three results stayed the same. **Not tested** Actual XCL disassembly, retail shader inputs or the Rust/GPU workspace suite. **AI use** OpenAI Codex (GPT-6) ran the tests, wrote the CLI fixture and follow-up patch, and prepared this report. </details> Follow-up on [the review](https://github.com/xcl-dev/xcl/pull/2151#pullrequestreview-6072089852) at `aa825c088e65`. [Tested candidate 23825658d](https://github.com/RavenCurseBurg/xcl/commit/23825658dda90e3bc14826b9cd72ddc9ba649d9a). A directory containing only a four-byte `DXBC` file previously returned 0. The candidate returned 1 and reported that no valid container remained, without invoking disassembly. The existing mixed batch with a valid container lacking `RTS0` and an invalid file still passed. All 34 script tests passed. Command on the candidate: `python -B -m unittest discover -s scripts -p "test_*.py"`. Windows 11 build 26100, Core i7-13700, Python 3.14.3. OpenAI Codex (GPT-6) prepared the patch and ran the tests with synthetic inputs. I did not run the full Rust/GPU suite.
raylitebull commented 2026-11-25 19:09:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T18:28:33Z.


Review note on aa825c0: @RavenCurseBurg noted that scripts/re/check_layout.py misses zero-offset s_load_dword ..., null spellings (emitted by XCL's formatter and LLVM AMDGPU examples). Addressing that plus getting independent verification of test_check_layout.py will unblock merge.

<!-- greyfinch-sync:ivall/xcl:comment:7170958261 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2151#issuecomment-7170958261). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T18:28:33Z. --- Review note on `aa825c0`: `@RavenCurseBurg` noted that `scripts/re/check_layout.py` misses zero-offset `s_load_dword ..., null` spellings (emitted by XCL's formatter and LLVM AMDGPU examples). Addressing that plus getting independent verification of `test_check_layout.py` will unblock merge.
luckyteagirl commented 2026-11-26 10:06:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T10:06:03Z.

Review: COMMENTED


On aa825c0, a directory whose only .dxbc file is malformed now exits 0 after validating nothing. I reproduced this with a four-byte bad.dxbc containing only DXBC and an existing stand-in --xcl executable that was never called. This head printed skipping invalid DXBC (not a DXBC container) and loads on parameter boundaries: 0, off: 0, then exited 0; the PR base and current main exited 1 on the same input. The new catch skips the file without incrementing errors, so an all-invalid batch appears green. The existing mixed-file fixture expects success despite a corrupt file, which leaves the intended contract for an all-invalid directory unclear.

Could the script distinguish malformed inputs from valid files that simply lack RTS0, and fail when no checkable file remains (or count malformed .dxbc files as validation errors if that is the intended policy)? A malformed-only fixture should pin down the exit status while the scanner still continues through a mixed batch. This was an exact-head CPU-only differential; no GPU shader disassembly ran.

<!-- greyfinch-sync:ivall/xcl:review:6072089852 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2151#pullrequestreview-6072089852). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T10:06:03Z. **Review:** COMMENTED --- On `aa825c0`, a directory whose only `.dxbc` file is malformed now exits 0 after validating nothing. I reproduced this with a four-byte `bad.dxbc` containing only `DXBC` and an existing stand-in `--xcl` executable that was never called. This head printed `skipping invalid DXBC (not a DXBC container)` and `loads on parameter boundaries: 0, off: 0`, then exited 0; the PR base and current main exited 1 on the same input. The new catch skips the file without incrementing `errors`, so an all-invalid batch appears green. The existing mixed-file fixture expects success despite a corrupt file, which leaves the intended contract for an all-invalid directory unclear. Could the script distinguish malformed inputs from valid files that simply lack `RTS0`, and fail when no checkable file remains (or count malformed `.dxbc` files as validation errors if that is the intended policy)? A malformed-only fixture should pin down the exit status while the scanner still continues through a mixed batch. This was an exact-head CPU-only differential; no GPU shader disassembly ran.
throny commented 2026-11-28 08:01:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T08:01:46Z.


Two contributors checked independently and found that #1196 solves the same problem in a different way: #1607, group D146. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

<!-- greyfinch-sync:ivall/xcl:comment:7236315031 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2151#issuecomment-7236315031). Originally posted by [throny](https://github.com/throny) on 2026-11-28T08:01:46Z. --- <!-- xcl-1607-hint:D146 --> Two contributors checked independently and found that #1196 solves the same problem in a different way: #1607, group D146. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Foniass commented 2026-12-01 07:29:36 +00:00 (Migrated from github.com)

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


Triage (#1607) – head aa825c0

Overlaps with other open check_layout.py PRs. #1196 rewrites the same CLI: it finds xcl through XCL_EXE or the target dirs and adds -h. This PR adds argparse --xcl and validates DXBC/RTS0 bounds instead. #1088 also reports xcl disasm failures, but it exits on the first one. #1729 (and #1196) also skip shaders without RTS0. They all rewrite the same loop, so only one can merge cleanly.
No problems found in the diff. The tests mock subprocess.run and cover the new exit codes.
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:7304122103 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2151#issuecomment-7304122103). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:29:36Z. --- **Triage (#1607)** – head aa825c0 Overlaps with other open `check_layout.py` PRs. #1196 rewrites the same CLI: it finds xcl through `XCL_EXE` or the target dirs and adds `-h`. This PR adds argparse `--xcl` and validates DXBC/RTS0 bounds instead. #1088 also reports `xcl disasm` failures, but it exits on the first one. #1729 (and #1196) also skip shaders without RTS0. They all rewrite the same loop, so only one can merge cleanly. No problems found in the diff. The tests mock `subprocess.run` and cover the new exit codes. 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 08:58:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T08:58:14Z.


merge-check
base: 1c8b551475
head: aa825c088e
merge: clean (git merge-tree --write-tree 1c8b5514 aa825c08 -> tree 47a90845e6d3, git diff --check clean; scripts/re/check_layout.py and scripts/test_check_layout.py, +338/-21)
build: not run (Tier 0 Python script diff; no Rust code changed)
tests: python -m unittest -v scripts/test_check_layout.py -> 8 passed, 0 failed; python -m unittest discover -s scripts -p "test_*.py" -> 73 passed, 1 error (test_discord_mirror.py missing %ComSpec%/%SystemRoot% on Windows, same failure on base 1c8b5514). Rust workspace tests not run (Tier 0).
review: Read the full merged diff (+338/-21). Findings: (1) Corrupt .dxbc inputs silently succeed with exit code 0: in scripts/re/check_layout.py:119-126, catching ValueError prints a message to stderr and continues without incrementing errors, so main returns 0 at line 151 (reproduced locally on a 4-byte DXBC file: rc=0, loads on parameter boundaries: 0, off: 0, stderr bad.dxbc: skipping invalid DXBC (not a DXBC container)). (2) scripts/re/check_layout.py:141 reads only proc.stderr.strip() on non-zero xcl disasm exit, dropping stdout-only diagnostics. (3) scripts/re/check_layout.py:86-89 only matches hex offsets (0x[0-9a-f]+), missing zero-offset null spellings. Also overlaps #1196 and #1088 (#1607 group D146).
performance: none (offline analysis script in scripts/re/; zero runtime impact)
verdict: not yet: malformed .dxbc files still cause main() to exit 0 without counting an error (scripts/re/check_layout.py:124-126,151), stdout-only disassembler failure messages are dropped (:141), and overlap with #1196/#1088 (#1607 D146) is unresolved
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:7340179027 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2151#issuecomment-7340179027). Originally posted by [Decodere](https://github.com/Decodere) on 2026-12-02T08:58:14Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: aa825c088e65db380f67a112e0474e56ea841b6a merge: clean (`git merge-tree --write-tree 1c8b5514 aa825c08` -> tree `47a90845e6d3`, `git diff --check` clean; `scripts/re/check_layout.py` and `scripts/test_check_layout.py`, +338/-21) build: not run (Tier 0 Python script diff; no Rust code changed) tests: `python -m unittest -v scripts/test_check_layout.py` -> 8 passed, 0 failed; `python -m unittest discover -s scripts -p "test_*.py"` -> 73 passed, 1 error (`test_discord_mirror.py` missing `%ComSpec%`/`%SystemRoot%` on Windows, same failure on base `1c8b5514`). Rust workspace tests not run (Tier 0). review: Read the full merged diff (+338/-21). Findings: (1) Corrupt `.dxbc` inputs silently succeed with exit code 0: in `scripts/re/check_layout.py:119-126`, catching `ValueError` prints a message to stderr and `continue`s without incrementing `errors`, so `main` returns `0` at line `151` (reproduced locally on a 4-byte `DXBC` file: `rc=0`, `loads on parameter boundaries: 0, off: 0`, stderr `bad.dxbc: skipping invalid DXBC (not a DXBC container)`). (2) `scripts/re/check_layout.py:141` reads only `proc.stderr.strip()` on non-zero `xcl disasm` exit, dropping stdout-only diagnostics. (3) `scripts/re/check_layout.py:86-89` only matches hex offsets `(0x[0-9a-f]+)`, missing zero-offset `null` spellings. Also overlaps `#1196` and `#1088` (`#1607` group D146). performance: none (offline analysis script in `scripts/re/`; zero runtime impact) verdict: not yet: malformed `.dxbc` files still cause `main()` to exit 0 without counting an error (`scripts/re/check_layout.py:124-126,151`), stdout-only disassembler failure messages are dropped (`:141`), and overlap with `#1196`/`#1088` (`#1607` D146) is unresolved 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)
misaka-maples commented 2026-12-03 03:13:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by misaka-maples on 2026-12-03T03:13:12Z.


merge-check
base: 395405e4c0
head: aa825c088e
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3007 passed, 5 failed, 56 ignored. SKIPPED: 28 notices (22 no wave64, 2 no heap windows, 2 missing d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 could not disable the driver cache). Failing: gpu::dxil::fuzz_tests::{fuzz_validate_and_gpu_0, fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_2, fuzz_validate_and_gpu_3} and gpu::dxil::ops_tests::int64_bit_ops_match_cpu. All five reproduced on this base with cargo test -p xcl --lib -- --test-threads=4 (2851 passed, 5 failed, 36 ignored on each tree for the library target), with the same fuzz seeds and CreateComputePipelineState result 0x8007000E. Python: python -B -m unittest scripts/test_check_layout.py -v -> 8 passed. Top-level script discovery (python -B -m unittest discover -s scripts -p "test_*.py" -v) -> 94 passed, 1 error on the merge and 86 passed, 1 error on the base. The same Discord mirror test cleared ComSpec and SystemRoot before invoking the Windows shell on both trees.
title run: none
review: scripts/re/check_layout.py:124-126,151 can report success when every DXBC input is invalid. A batch containing one plain-text .dxbc returned 1 on this base and 0 on the merge, with zero loads checked and a warning. The new unit tests check that invalid files can be skipped but leave the malformed-only success case unguarded. Existing coverage gap: XCL emits null for zero offsets, which check_layout.py:86-89 does not match. The new mocks use 0x0. This is a Tier 0 change confined to the standalone script and its unit tests.
performance: No default frame-time or runtime memory impact is expected from this standalone Python tool. Its parser now collects every chunk before looking for RTS0, so standalone CLI memory use can increase. No timing measurement was taken.
verdict: not yet: the layout checker returns success for malformed-only input after checking zero loads.
hardware / tool and model: NVIDIA GeForce RTX 5060 Laptop GPU (8151 MiB, driver 592.19), Intel Core i7-14650HX, Windows 11 25H2 build 26200.9168, rustc 1.100.1 (MSVC), DXC 1.9.2609.5, Python 3.13.15 / OpenAI Codex (GPT-6)

<!-- greyfinch-sync:ivall/xcl:comment:7366330424 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2151#issuecomment-7366330424). Originally posted by [misaka-maples](https://github.com/misaka-maples) on 2026-12-03T03:13:12Z. --- merge-check base: 395405e4c0ed814afde0610a724dc96a3af329de head: aa825c088e65db380f67a112e0474e56ea841b6a merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3007 passed, 5 failed, 56 ignored. SKIPPED: 28 notices (22 no wave64, 2 no heap windows, 2 missing d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 could not disable the driver cache). Failing: gpu::dxil::fuzz_tests::{fuzz_validate_and_gpu_0, fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_2, fuzz_validate_and_gpu_3} and gpu::dxil::ops_tests::int64_bit_ops_match_cpu. All five reproduced on this base with cargo test -p xcl --lib -- --test-threads=4 (2851 passed, 5 failed, 36 ignored on each tree for the library target), with the same fuzz seeds and CreateComputePipelineState result 0x8007000E. Python: python -B -m unittest scripts/test_check_layout.py -v -> 8 passed. Top-level script discovery (python -B -m unittest discover -s scripts -p "test_*.py" -v) -> 94 passed, 1 error on the merge and 86 passed, 1 error on the base. The same Discord mirror test cleared ComSpec and SystemRoot before invoking the Windows shell on both trees. title run: none review: scripts/re/check_layout.py:124-126,151 can report success when every DXBC input is invalid. A batch containing one plain-text .dxbc returned 1 on this base and 0 on the merge, with zero loads checked and a warning. The new unit tests check that invalid files can be skipped but leave the malformed-only success case unguarded. Existing coverage gap: XCL emits null for zero offsets, which check_layout.py:86-89 does not match. The new mocks use 0x0. This is a Tier 0 change confined to the standalone script and its unit tests. performance: No default frame-time or runtime memory impact is expected from this standalone Python tool. Its parser now collects every chunk before looking for RTS0, so standalone CLI memory use can increase. No timing measurement was taken. verdict: not yet: the layout checker returns success for malformed-only input after checking zero loads. hardware / tool and model: NVIDIA GeForce RTX 5060 Laptop GPU (8151 MiB, driver 592.19), Intel Core i7-14650HX, Windows 11 25H2 build 26200.9168, rustc 1.100.1 (MSVC), DXC 1.9.2609.5, Python 3.13.15 / OpenAI Codex (GPT-6)
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/2151:upstream-pr/2151'
git switch 'upstream-pr/2151'

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