D3D12.X: clamp root argument writes to the target parameter's size #1309

Merged
b3IKK merged 1 commit from upstream-pr/1319 into main 2026-11-30 03:37:47 +00:00
b3IKK commented 2026-11-24 14:40:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T14:40:45Z.


bind::put_in and console_list::close destructured Param::Constants without checking count, only bounds-checking against the entire root argument buffer. Writing constants with offset + n > count (or writing past a 4-byte table / 8-byte descriptor slot) silently overwrote the adjacent root parameter, and large offsets could overflow in bind::put_in.

This clamps writes to each parameter's own byte span using checked arithmetic in bind::put_in and stops at off + k >= count in console_list::close (while still advancing at += 1 + n past the recorded command packet).

What is in it

  • crates/xcl/src/hle/d3d12x/bind.rs: clamp writes in put_in to the target parameter's byte span with checked arithmetic; add unit test out_of_bounds_root_constants_do_not_clobber_adjacent_parameter (verified failing before the fix).
  • crates/xcl/src/hle/d3d12x/console_list.rs: stop constant writes at off + k >= count in close.

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 752 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 no wave64 — gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)
  • cargo test -p xcl --lib out_of_bounds_root_constants_do_not_clobber_adjacent_parameter: 1 passed, 0 failed (failed before the fix, overwriting adjacent descriptor bytes)

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1226 (PresentX 1226)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15341 MB

PR:

xcl-smoke v1
commit: 82b7cb3eb85843afd79c3961014e21dd70a7c6e5
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1650 (PresentX 1650)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14599 MB

Not tested

  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Gemini 4 Neon: audited bind.rs and console_list.rs, wrote the fix and unit test, ran the test suite and scripts/smoke.ps1 regression runs, and drafted this PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5474300707 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1319). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T14:40:45Z. --- `bind::put_in` and `console_list::close` destructured `Param::Constants` without checking `count`, only bounds-checking against the entire root argument buffer. Writing constants with `offset + n > count` (or writing past a 4-byte table / 8-byte descriptor slot) silently overwrote the adjacent root parameter, and large offsets could overflow in `bind::put_in`. This clamps writes to each parameter's own byte span using checked arithmetic in `bind::put_in` and stops at `off + k >= count` in `console_list::close` (while still advancing `at += 1 + n` past the recorded command packet). **What is in it** - `crates/xcl/src/hle/d3d12x/bind.rs`: clamp writes in `put_in` to the target parameter's byte span with checked arithmetic; add unit test `out_of_bounds_root_constants_do_not_clobber_adjacent_parameter` (verified failing before the fix). - `crates/xcl/src/hle/d3d12x/console_list.rs`: stop constant writes at `off + k >= count` in `close`. **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 752 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 `no wave64` — `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware`) - `cargo test -p xcl --lib out_of_bounds_root_constants_do_not_clobber_adjacent_parameter`: 1 passed, 0 failed (failed before the fix, overwriting adjacent descriptor bytes) **Regression run** main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1226 (PresentX 1226) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15341 MB ``` PR: ``` xcl-smoke v1 commit: 82b7cb3eb85843afd79c3961014e21dd70a7c6e5 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1650 (PresentX 1650) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14599 MB ``` **Not tested** - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Gemini 4 Neon: audited `bind.rs` and `console_list.rs`, wrote the fix and unit test, ran the test suite and `scripts/smoke.ps1` regression runs, and drafted this PR description.
futurepro62 commented 2026-11-24 15:06:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:45:13Z.


Full-suite run, since this PR has no test report yet. Tested exact head 82b7cb3 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: out_of_bounds_root_constants_do_not_clobber_adjacent_parameter.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7134890796 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1319#issuecomment-7134890796). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T14:45:13Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `82b7cb3` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `out_of_bounds_root_constants_do_not_clobber_adjacent_parameter`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**, no skips. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
DavidM1911 commented 2026-11-24 16:07:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T15:24:13Z.


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

  • cargo test -p xcl --lib -- --test-threads=1: 708 passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7135966391 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1319#issuecomment-7135966391). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T15:24:13Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib -- --test-threads=1`: 708 passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodified `main`.) Thanks!
xpatfussy69x commented 2026-11-25 12:06:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-25T11:40:52Z.


Test report for head 82b7cb3 as pushed (not merged onto current main) – NVIDIA, wave32.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.2124; AMD Ryzen 5 7500F; 32 GB RAM; Windows NT 10.0.26300; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.2609.5
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 752 passed, 0 failed, 41 ignored
  • SKIPPED GPU tests on this adapter: 2 (no wave64)
  • this PR's tests: out_of_bounds_root_constants_do_not_clobber_adjacent_parameter ran and passed
  • no XCL_SAMPLE_* data set (game-data tests not run)

Not tested

  • a smoke run on a title; AMD / native wave64; release build; the head merged onto current main

AI use

  • Claude (Claude Opus 5.5) wrote the script that ran the suite on my PC, read the log and wrote and posted this report with my approval; the run is mine.
<!-- greyfinch-sync:ivall/xcl:comment:7161359843 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1319#issuecomment-7161359843). Originally posted by [xpatfussy69x](https://github.com/xpatfussy69x) on 2026-11-25T11:40:52Z. --- Test report for head `82b7cb3` as pushed (not merged onto current `main`) – NVIDIA, wave32. **Tested** - NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.2124; AMD Ryzen 5 7500F; 32 GB RAM; Windows NT 10.0.26300; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.2609.5 - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 752 passed, 0 failed, 41 ignored - SKIPPED GPU tests on this adapter: 2 (no wave64) - this PR's tests: `out_of_bounds_root_constants_do_not_clobber_adjacent_parameter` ran and passed - no `XCL_SAMPLE_*` data set (game-data tests not run) **Not tested** - a smoke run on a title; AMD / native wave64; release build; the head merged onto current `main` **AI use** - Claude (Claude Opus 5.5) wrote the script that ran the suite on my PC, read the log and wrote and posted this report with my approval; the run is mine.
oni-swr commented 2026-11-25 14:09:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-25T13:19:14Z.


AMD RDNA3 (native wave64) test report for exact head 82b7cb3eb85843afd79c3961014e21dd70a7c6e5, as pushed on its base 930e8b4 (not merged onto current main).

Tested

  • AMD Radeon RX 7800 XT (RDNA3, native wave64), driver 32.0.31035.1003; Windows 11 Pro 10.0.26200; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.0.5512 (dxcompiler.dll)
  • cargo build --workspace: ok
  • Targeted: out_of_bounds_root_constants_do_not_clobber_adjacent_parameter: 1 passed; bind filter: 11 passed, 0 failed, 0 ignored
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 752 passed, 0 failed, 41 ignored (summed over all test binaries)
  • SKIPPED lines: none in the output

Not tested

  • No game title, no scripts/smoke.ps1 regression run (synthetic GPU/unit tests only)
  • Not merged onto current main; other GPUs (NVIDIA / Intel / RDNA2 / RDNA4)
  • Whether the new test fails without the fix (I did not revert it)

AI use: Claude Code (Claude Sonnet 5.5) ran the build and tests and wrote this report; the numbers are from the runs above.

<!-- greyfinch-sync:ivall/xcl:comment:7163605954 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1319#issuecomment-7163605954). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T13:19:14Z. --- AMD RDNA3 (native wave64) test report for exact head `82b7cb3eb85843afd79c3961014e21dd70a7c6e5`, as pushed on its base `930e8b4` (not merged onto current `main`). **Tested** - AMD Radeon RX 7800 XT (RDNA3, native wave64), driver 32.0.31035.1003; Windows 11 Pro 10.0.26200; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.0.5512 (dxcompiler.dll) - `cargo build --workspace`: ok - Targeted: `out_of_bounds_root_constants_do_not_clobber_adjacent_parameter`: 1 passed; `bind` filter: 11 passed, 0 failed, 0 ignored - `cargo test --workspace --no-fail-fast -- --test-threads=4`: 752 passed, 0 failed, 41 ignored (summed over all test binaries) - SKIPPED lines: none in the output **Not tested** - No game title, no `scripts/smoke.ps1` regression run (synthetic GPU/unit tests only) - Not merged onto current `main`; other GPUs (NVIDIA / Intel / RDNA2 / RDNA4) - Whether the new test fails without the fix (I did not revert it) **AI use**: Claude Code (Claude Sonnet 5.5) ran the build and tests and wrote this report; the numbers are from the runs above.
vasanex commented 2026-11-28 20:19:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vasanex on 2026-11-28T20:19:45Z.


Test report for 82b7cb3e, with a real case this PR fixes: the builder crash of #2867.

The case. XboxBvhBuilder.dll sets four root constants (SetComputeRoot32BitConstants, offset 0) on a pass whose root signature declares three (its hierarchy pass, record c4d9c4a0c4839d0a). bind::put_in stores a write only when all of it fits the root arguments, so the pass got none of the four: it ran with a null result-header pointer, read a primitive count of 0 and wrote nothing, and the next pass (ConstructBVH4) then built nodes from stale tables and stored them at node pointer 0 and far outside its result, into the title's own data. That is the "title reads bad addresses" crash of #2867. The console list path (console_list::close) already kept the constants that fit, which is why the builder's e2e tests pass. With this PR the three declared constants are stored and the fourth is dropped, which is what the pass needs.

Tested

  • NVIDIA GeForce RTX 3080 10 GB, driver 621.40, AMD Ryzen 9 7950X, 64 GB, Windows 11 Pro build 26200, Rust 1.100.0; unit tests in debug, title runs in release.
  • 82b7cb3e cherry-picked onto nvidia-dev d1be8103 (applies cleanly), plus one unit test of the builder's shape (more constants than the parameter declares, at offset 0 and at an offset inside it, compute and graphics):
    cargo test -p xcl --lib -- root_constants --test-threads=4: 2 passed, 0 failed, 0 ignored (this PR's out_of_bounds_root_constants_do_not_clobber_adjacent_parameter and the added one). On d1be8103 without the PR the added test fails (0 passed, 1 failed: the arguments stay [0, 0, 0, 0] where [1, 2, 3, 4] is expected). main 765b2c5b still has the same put_in.
  • Retail title, 760 s runs, Series S profile. The build is nvidia-dev 54225f58 with the open PRs our runs need merged (#2905 #2987 #3039 #2815 #2816 #2817 #3037 #609 #2753 #2975 #3052 #2590 #3091 #3092 #2229, and #3094 off) and local changes; this PR's two hunks applied by hand (a local fix of the same lines was in the way of a clean cherry-pick), with a local switch that puts nvidia-dev's put_in back for the comparison:
    • with this PR's put_in, three runs: a local log line shows the case in each ("compute root constants of parameter 3 at byte 24 of 36 past the signature: 12 of 16 bytes kept": the arguments are 36 bytes, the parameter's three constants are their last 12, the title sets four). Two runs reached the world (at 513 s and 537 s) and went on to the end of the 760 s with no crash and no device removal. The third reached it at 449 s and crashed at 689 s on something else: the title read a page XCL had moved to its other mapping 207 ms before (the limit of #1031), not the builder.
    • with nvidia-dev's put_in, one run: the same writes are dropped whole ("16 bytes of parameter 3 at byte 24 of 36 dropped whole"), the world is reached at 483 s, and 31 s later the title crashes reading address 0xffffffffffffffff (unhandled exception 0xc0000005 in the title's code), the bad-address crash of #2867.

Not tested

  • The PR's head as pushed on its own base (930e8b4), and main: the title does not get as far as the builder on main on this machine.
  • AMD and Intel GPUs. Other titles.
  • The console_list::close hunk: the title's builder goes through bind::put_in.

AI use

  • Claude Code (Claude Fable 5.2) found the cause, wrote the added unit test, ran the tests and the title runs and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7245205749 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1319#issuecomment-7245205749). Originally posted by [vasanex](https://github.com/vasanex) on 2026-11-28T20:19:45Z. --- Test report for `82b7cb3e`, with a real case this PR fixes: the builder crash of #2867. **The case.** `XboxBvhBuilder.dll` sets four root constants (`SetComputeRoot32BitConstants`, offset 0) on a pass whose root signature declares three (its hierarchy pass, record `c4d9c4a0c4839d0a`). `bind::put_in` stores a write only when all of it fits the root arguments, so the pass got none of the four: it ran with a null result-header pointer, read a primitive count of 0 and wrote nothing, and the next pass (ConstructBVH4) then built nodes from stale tables and stored them at node pointer 0 and far outside its result, into the title's own data. That is the "title reads bad addresses" crash of #2867. The console list path (`console_list::close`) already kept the constants that fit, which is why the builder's e2e tests pass. With this PR the three declared constants are stored and the fourth is dropped, which is what the pass needs. **Tested** - NVIDIA GeForce RTX 3080 10 GB, driver 621.40, AMD Ryzen 9 7950X, 64 GB, Windows 11 Pro build 26200, Rust 1.100.0; unit tests in debug, title runs in release. - `82b7cb3e` cherry-picked onto `nvidia-dev` `d1be8103` (applies cleanly), plus one unit test of the builder's shape (more constants than the parameter declares, at offset 0 and at an offset inside it, compute and graphics): `cargo test -p xcl --lib -- root_constants --test-threads=4`: 2 passed, 0 failed, 0 ignored (this PR's `out_of_bounds_root_constants_do_not_clobber_adjacent_parameter` and the added one). On `d1be8103` without the PR the added test fails (0 passed, 1 failed: the arguments stay `[0, 0, 0, 0]` where `[1, 2, 3, 4]` is expected). `main` `765b2c5b` still has the same `put_in`. - Retail title, 760 s runs, Series S profile. The build is `nvidia-dev` `54225f58` with the open PRs our runs need merged (#2905 #2987 #3039 #2815 #2816 #2817 #3037 #609 #2753 #2975 #3052 #2590 #3091 #3092 #2229, and #3094 off) and local changes; this PR's two hunks applied by hand (a local fix of the same lines was in the way of a clean cherry-pick), with a local switch that puts `nvidia-dev`'s `put_in` back for the comparison: - with this PR's `put_in`, three runs: a local log line shows the case in each ("compute root constants of parameter 3 at byte 24 of 36 past the signature: 12 of 16 bytes kept": the arguments are 36 bytes, the parameter's three constants are their last 12, the title sets four). Two runs reached the world (at 513 s and 537 s) and went on to the end of the 760 s with no crash and no device removal. The third reached it at 449 s and crashed at 689 s on something else: the title read a page XCL had moved to its other mapping 207 ms before (the limit of #1031), not the builder. - with `nvidia-dev`'s `put_in`, one run: the same writes are dropped whole ("16 bytes of parameter 3 at byte 24 of 36 dropped whole"), the world is reached at 483 s, and 31 s later the title crashes reading address `0xffffffffffffffff` (`unhandled exception 0xc0000005` in the title's code), the bad-address crash of #2867. **Not tested** - The PR's head as pushed on its own base (`930e8b4`), and `main`: the title does not get as far as the builder on `main` on this machine. - AMD and Intel GPUs. Other titles. - The `console_list::close` hunk: the title's builder goes through `bind::put_in`. **AI use** - Claude Code (Claude Fable 5.2) found the cause, wrote the added unit test, ran the tests and the title runs and drafted this report.
Parakeet-Wheat commented 2026-11-30 03:13:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Parakeet-Wheat on 2026-11-30T03:13:08Z.


merge-check
base: 45ebed1005
head: 82b7cb3eb8
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2827 passed, 0 failed, 51 ignored; SKIPPED: 29 (22 no wave64, 3 wave32 per-lane form refused (#1426), 2 no heap windows, 1 driver cache needs Developer Mode, 1 no GPU_UPLOAD heaps); failing: none
review: No blocking finding; whole diff read. With both non-test hunks reverted, out_of_bounds_root_constants_do_not_clobber_adjacent_parameter fails; with them restored, it passes. The test covers only bind::put_in. No test exercises the console_list::close change. The clamp sizes match the layout: constants take 4 × count bytes, a descriptor 8 and a table 4 (console_list.rs:149-151). Every table and descriptor caller in bind.rs writes exactly 4 or 8 bytes, so only constant writes change. A constant write that runs past count now keeps the part that fits and drops the rest.
performance: Boot-only smoke pair, 60 s, no input, release, XCL_NETWORK=0: base 1534 frames, peak commit 19882 MB; merge 1614 frames, peak commit 15318 MB. Both runs show 0 device removals and 0 crashes. The base run's last presents per 2 s are 61 53 49, and its peak commit is 4.5 GB higher; we did not rerun it to find why. Default path: each root argument write in put_in adds up to five checked operations and one min.
verdict: safe to merge (the new test fails without the fix, and the suite and smoke pair show no regression on our RTX 3070)
hardware / tool and model: RTX 3070 8 GB (610.88), AMD Ryzen 5 5600X, Windows 11 Home 26300, Rust 1.95.0, debug (smoke in release) / Claude Code, Claude Opus 5.5 (merge, build, suite, mutation, smoke and review)

<!-- greyfinch-sync:ivall/xcl:comment:7267692716 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1319#issuecomment-7267692716). Originally posted by [Parakeet-Wheat](https://github.com/Parakeet-Wheat) on 2026-11-30T03:13:08Z. --- merge-check base: 45ebed1005ac3260a034c296b226f7cfffab1719 head: 82b7cb3eb85843afd79c3961014e21dd70a7c6e5 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2827 passed, 0 failed, 51 ignored; SKIPPED: 29 (22 no wave64, 3 wave32 per-lane form refused (#1426), 2 no heap windows, 1 driver cache needs Developer Mode, 1 no GPU_UPLOAD heaps); failing: none review: No blocking finding; whole diff read. With both non-test hunks reverted, `out_of_bounds_root_constants_do_not_clobber_adjacent_parameter` fails; with them restored, it passes. The test covers only `bind::put_in`. No test exercises the `console_list::close` change. The clamp sizes match the layout: constants take 4 × count bytes, a descriptor 8 and a table 4 (`console_list.rs:149-151`). Every table and descriptor caller in `bind.rs` writes exactly 4 or 8 bytes, so only constant writes change. A constant write that runs past `count` now keeps the part that fits and drops the rest. performance: Boot-only smoke pair, 60 s, no input, release, `XCL_NETWORK=0`: base 1534 frames, peak commit 19882 MB; merge 1614 frames, peak commit 15318 MB. Both runs show 0 device removals and 0 crashes. The base run's last presents per 2 s are 61 53 49, and its peak commit is 4.5 GB higher; we did not rerun it to find why. Default path: each root argument write in `put_in` adds up to five checked operations and one `min`. verdict: safe to merge (the new test fails without the fix, and the suite and smoke pair show no regression on our RTX 3070) hardware / tool and model: RTX 3070 8 GB (610.88), AMD Ryzen 5 5600X, Windows 11 Home 26300, Rust 1.95.0, debug (smoke in release) / Claude Code, Claude Opus 5.5 (merge, build, suite, mutation, smoke and review)
brainhay5 commented 2026-11-30 03:19:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T03:19:25Z.


merge-check claim
head: 82b7cb3eb8

<!-- greyfinch-sync:ivall/xcl:comment:7267789213 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1319#issuecomment-7267789213). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T03:19:25Z. --- merge-check claim head: 82b7cb3eb85843afd79c3961014e21dd70a7c6e5
relativespace2K commented 2026-11-30 03:20:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by relativespace2K on 2026-11-30T03:20:19Z.


merge-check
base: 53e85fb1
head: 82b7cb3eb8
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2789 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in --test gpu_two_pass_cache_e2e, so 5 failing tests give 6 failures). The same five fail on base 53e85fb1 alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its new test passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused.
review: no blocking finding; two files, every hunk read. put_in now carries each parameter's own end (Constants from its count, a Descriptor 8 bytes, a Table 4) and clamps the write to it, so a root constant past the parameter can no longer land in the next parameter's bytes; the arithmetic is checked_add throughout, which is why an offset of u32::MAX is dropped instead of panicking, and the console list's constant loop stops at the same count. The test pins exactly the reported failure (offset 2 of a count=2 parameter must leave the CBV beside it untouched), the partial-write case (3 dwords from offset 1 keep only the one that fits) and the overflow case. One note, not blocking: too-long writes are clamped and the fitting prefix is copied rather than the call being refused, which is the safe direction but means a title with a wrong root signature keeps running with truncated data instead of failing loudly; D3D itself would flag that use only under the debug layer. No duplicate: nothing else bounds root arguments; #1435 and #2504 are the root-argument signature fixes.
performance: two comparisons per root argument write, at command recording time; nothing per draw.
verdict: safe to merge
hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.

<!-- greyfinch-sync:ivall/xcl:comment:7267802882 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1319#issuecomment-7267802882). Originally posted by [relativespace2K](https://github.com/relativespace2K) on 2026-11-30T03:20:19Z. --- merge-check base: 53e85fb1 head: 82b7cb3eb85843afd79c3961014e21dd70a7c6e5 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2789 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in `--test gpu_two_pass_cache_e2e`, so 5 failing tests give 6 failures). The same five fail on base 53e85fb1 alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its new test passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused. review: no blocking finding; two files, every hunk read. `put_in` now carries each parameter's own end (`Constants` from its count, a `Descriptor` 8 bytes, a `Table` 4) and clamps the write to it, so a root constant past the parameter can no longer land in the next parameter's bytes; the arithmetic is `checked_add` throughout, which is why an offset of `u32::MAX` is dropped instead of panicking, and the console list's constant loop stops at the same count. The test pins exactly the reported failure (offset 2 of a `count=2` parameter must leave the CBV beside it untouched), the partial-write case (3 dwords from offset 1 keep only the one that fits) and the overflow case. One note, not blocking: too-long writes are clamped and the fitting prefix is copied rather than the call being refused, which is the safe direction but means a title with a wrong root signature keeps running with truncated data instead of failing loudly; D3D itself would flag that use only under the debug layer. No duplicate: nothing else bounds root arguments; #1435 and #2504 are the root-argument signature fixes. performance: two comparisons per root argument write, at command recording time; nothing per draw. verdict: safe to merge hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.
brainhay5 commented 2026-11-30 03:25:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T03:25:35Z.


merge-check
base: a7980178a8
head: 82b7cb3eb8
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2833 passed, 1 failed, 51 ignored; 29 SKIPPED lines
failing: test_title_runs_and_game_folder_is_untouched
review: automated overnight check: diff read for safety (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed.
performance: not assessed beyond the suite.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017

<!-- greyfinch-sync:ivall/xcl:comment:7267881795 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1319#issuecomment-7267881795). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T03:25:35Z. --- merge-check base: a7980178a81e27225ac01dffc4f900f63a09afb3 head: 82b7cb3eb85843afd79c3961014e21dd70a7c6e5 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2833 passed, 1 failed, 51 ignored; 29 SKIPPED lines failing: test_title_runs_and_game_folder_is_untouched review: automated overnight check: diff read for safety (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed. performance: not assessed beyond the suite. verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017
Pipodi commented 2026-11-30 07:36:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-11-30T07:36:56Z.


Test report for 82b7cb3e on a retail title. It looks at the same builder pass as vasanex's report above, and at a second symptom of the #2867 cause.

What we tested

  • The title writes past a root parameter in two places. Both are SetComputeRoot32BitConstants at offset 0 on the last parameter of their table: 4 dwords into a 3-constant parameter (parameter 3, 9-dword table), and 6 dwords into a 5-constant parameter (parameter 6, six root UAVs followed by constants(5), 17-dword table). No write past a parameter in the middle of a table was seen.
  • So clipping keeps what the console's unchecked setter keeps: the extra dword would go past the end of the table there. The second pass's shader has no load at the dropped dword's offset (+0x44). On main, put_in drops both writes whole (53e85fb1 bind.rs:1471, 72 > 68 bytes for the second shape).
  • Mechanism (first shape): the dropped write carries the qword at cb+0x18, which is the BVH header pointer of the radix pass c4d9c4a0c4839d0a. With it null, the pass reads a node count of 0 and stores no parents, and the next pass (290043819c198954) then loads parents that were never written.

Effect, in our diagnostic tree (main af2cecc4 + local diagnostics + #1319's bind.rs change, identical lines), run r262 against run r261 without the change:

  • 24-byte list corruption count: 80 → 0 (second run: 0).
  • Bad parent loads in 290043819c198954: 30.7M → 1. The header pointer at cb+0x18 is now non-null in 11 of 11 logged builds. The radix pass stores in 96 % of its dispatches.
  • Those 24-byte runs in vertex and index lists are what drew skin-coloured wedge fans on skinned characters in the open world in earlier runs of the diagnostic tree. The frames of r262 were not judged for them; the count above is the measure.
  • Both runs exited 0, with no device removal and no crash (454 s and 559 s).
  • One caveat: run r261 also lacked ea1258f8 (#2504, now on main). The fix is credited to this PR because the clipped write is logged ("parameter 3 offset 0 dwords: 4 dwords written, 3 fit") and the header pointer it carries is now set.

Main-based runs

  • M0 is 53e85fb1 + #3214 + local press commits. M1 is M0 + this PR + a one-line warning. Both built cleanly. In runs of 420 s and 720 s, in release, every measured run of both arms exited 0x0, with 0 device removals and 14 of 14 presses.
  • Every M1 run logs exactly the two shapes above, once each.
  • M1 suite, cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 (debug): 2799 passed, 1 failed, 49 ignored, 28 SKIPPED. The failure is hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, which is main's own test and was since fixed by #3474.

Tested

  • NVIDIA RTX 4090, driver 621.40; Intel i9-13900K; Windows 11 Pro 10.0.26300; rustc 1.100.0; title runs in release.

Not tested

  • The fans on main. In 420 s and 720 s, neither M0 nor M1 got past the cinematic and menus into the open-world scenes where the fans appeared. Both arms show coherent characters in the cinematic and look the same frame for frame, so the fans were not judged with this PR on any tree: the result is the corruption count above.
  • The PR's head as pushed on its base 930e8b4.
  • AMD and Intel GPUs, and other titles.
  • The console_list::close hunk: the title's builder goes through bind::put_in.

AI use

  • Claude Code: Claude Opus 5.5 (diagnosis, this report), Claude Sonnet 5.5 (builds and runs).
<!-- greyfinch-sync:ivall/xcl:comment:7271929844 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1319#issuecomment-7271929844). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-11-30T07:36:56Z. --- Test report for `82b7cb3e` on a retail title. It looks at the same builder pass as vasanex's report above, and at a second symptom of the #2867 cause. **What we tested** - The title writes past a root parameter in two places. Both are `SetComputeRoot32BitConstants` at offset 0 on the **last** parameter of their table: 4 dwords into a 3-constant parameter (parameter 3, 9-dword table), and 6 dwords into a 5-constant parameter (parameter 6, six root UAVs followed by constants(5), 17-dword table). No write past a parameter in the middle of a table was seen. - So clipping keeps what the console's unchecked setter keeps: the extra dword would go past the end of the table there. The second pass's shader has no load at the dropped dword's offset (+0x44). On `main`, `put_in` drops both writes whole (`53e85fb1` bind.rs:1471, 72 > 68 bytes for the second shape). - Mechanism (first shape): the dropped write carries the qword at cb+0x18, which is the BVH header pointer of the radix pass `c4d9c4a0c4839d0a`. With it null, the pass reads a node count of 0 and stores no parents, and the next pass (`290043819c198954`) then loads parents that were never written. **Effect**, in our diagnostic tree (main af2cecc4 + local diagnostics + #1319's bind.rs change, identical lines), run r262 against run r261 without the change: - 24-byte list corruption count: 80 → 0 (second run: 0). - Bad parent loads in `290043819c198954`: 30.7M → 1. The header pointer at cb+0x18 is now non-null in 11 of 11 logged builds. The radix pass stores in 96 % of its dispatches. - Those 24-byte runs in vertex and index lists are what drew skin-coloured wedge fans on skinned characters in the open world in earlier runs of the diagnostic tree. The frames of r262 were not judged for them; the count above is the measure. - Both runs exited 0, with no device removal and no crash (454 s and 559 s). - One caveat: run r261 also lacked ea1258f8 (#2504, now on `main`). The fix is credited to this PR because the clipped write is logged ("parameter 3 offset 0 dwords: 4 dwords written, 3 fit") and the header pointer it carries is now set. **Main-based runs** - M0 is `53e85fb1` + #3214 + local press commits. M1 is M0 + this PR + a one-line warning. Both built cleanly. In runs of 420 s and 720 s, in release, every measured run of both arms exited 0x0, with 0 device removals and 14 of 14 presses. - Every M1 run logs exactly the two shapes above, once each. - M1 suite, `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4` (debug): 2799 passed, 1 failed, 49 ignored, 28 SKIPPED. The failure is `hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline`, which is `main`'s own test and was since fixed by #3474. **Tested** - NVIDIA RTX 4090, driver 621.40; Intel i9-13900K; Windows 11 Pro 10.0.26300; rustc 1.100.0; title runs in release. **Not tested** - The fans on `main`. In 420 s and 720 s, neither M0 nor M1 got past the cinematic and menus into the open-world scenes where the fans appeared. Both arms show coherent characters in the cinematic and look the same frame for frame, so the fans were not judged with this PR on any tree: the result is the corruption count above. - The PR's head as pushed on its base `930e8b4`. - AMD and Intel GPUs, and other titles. - The `console_list::close` hunk: the title's builder goes through `bind::put_in`. **AI use** - Claude Code: Claude Opus 5.5 (diagnosis, this report), Claude Sonnet 5.5 (builds and runs).
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!1309
No description provided.