D3D12.X: a root signature with a huge constant count gets no layout #1280
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1290"
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 emirduran707 on 2026-11-24T14:20:55Z.
layout_from_blob(console_list.rs) built a root signature's argument layout from the title's RTS0 blob and trustedNum32BitValues:4 * countoverflows u32. Debug builds (andcargo test) panic; release builds wrap.Set*RootSignatureon it then allocates that many zeroed bytes (bind.rs), and when commit runs out the allocation failure aborts the title.It is reachable: when the PC refuses such a root signature,
dev_create_root_signaturesubstitutes an empty one but still records the title's own blob for the layout. Microsoft's root signature limits put the whole root signature at 64 DWORDs.The byte count and the running size now use checked arithmetic, and a layout over
MAX_ARGS(4096 bytes) is refused. A malformed blob gets no layout, the same as one that does not parse. 4096 bytes is 16 times the PC's limit: the console's own limit is not documented, so the cap only stops absurd sizes.What is in it
crates/xcl/src/hle/d3d12x/console_list.rs:a_huge_constant_count_has_no_layout. Counts 0x4000_0000 and 0x3FFF_FFFF, a root descriptor followed by 0xFFFF_FFFF constants, and a 4100-byte layout give no layout; a layout of exactly 4096 bytes still parses.Tested
cargo test --workspace -- --test-threads=4on35665aa: 742 passed, 0 failed, 41 ignored; no SKIPPED GPU testslayout_from_blob); with themcargo test -p xcl --lib hle::d3d12x::console_listpasses, 5 passedRegression run
main:
this PR:
Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T14:33:28Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:38:46Z.
Full-suite run on NVIDIA and AMD to go with the subset check above. Tested exact head
35665aa(on its base47efa2e).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.a_huge_constant_count_has_no_layout.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T16:01:57Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodifiedmain.)Thanks!
upstream-sync referenced this pull request2026-11-25 06:04:27 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T04:47:28Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin