D3D12.X: strip console-only root-signature flags in D3D12SerializeRootSignature #2447
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2447
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2447"
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?
@Decodere on GitHub · 2026-11-25 19:18 UTC · original
Decodere:fix-d3d12-serialize-rs-flags→main· +105 −34 · 1 files · 1 commits · openWhat is in it
Strip Xbox console-only root-signature flags in
D3D12SerializeRootSignatureand share sanitization/error-blob handling withD3D12SerializeVersionedRootSignatureincrates/xcl/src/hle/d3d12x/mod.rs(+105/-34lines, single file):D3D12SerializeVersionedRootSignaturealready stripped console-only bits abovePC_FLAGS = 0xFFF(such as0x3000000) and logged/cleaned up error blobs, whereas 1.0D3D12SerializeRootSignatureforwarded rawD3D12_ROOT_SIGNATURE_DESCdirectly to Windowsd3d12.dll, which rejects unknown flag bits withE_INVALIDARG(0x80070057).serialize_root_sig<const QWORDS: usize>helper withPC_FLAGS = 0xFFF: copies the descriptor into an 8-byte-aligned stack buffer (40bytes / flags at+32forD3D12SerializeRootSignature;48bytes / flags at+40forD3D12SerializeVersionedRootSignature) only when!PC_FLAGSbits are set, drops unknown bits without mutating the caller's struct, zeroes caller-provided*errbefore forwarding, logs error-blob diagnostics on failure even whenerrisNULL, and releases temporary error blobs cleanly.hle::d3d12x::tests::serialize_root_signature_strips_console_flags_and_preserves_pc_flags) verifying descriptor layout offsets, console-flag stripping and PC-flag preservation viaD3D12CreateRootSignatureDeserializerfor both 1.0 and versioned serializers, caller-struct immutability, Windows 10 in-box / Agilityd3d12.dllfailure handling without assuming non-empty runtime error text on unknown versions (guardingblob_releasewhenerr_outis null), and runtime-independent error-blob forwarding andown_errcleanup via a mockID3DBlobvtable.Part of #1452
Part of #1333
Tested
origin/main(569f0fc5):XCL_ADAPTER=warp cargo test -p xcl --lib hle::d3d12x::tests -- --test-threads=1 --nocapturefailed1of1(D3D12SerializeRootSignature rejected console flags: 0x80070057).hle::d3d12x::tests(bd586636, rebased ontoorigin/maine1d84b7d):XCL_ADAPTER=warp cargo test --release -p xcl --lib hle::d3d12x::tests -- --test-threads=1 --nocapture):1 passed; 0 failed; 0 ignored(0.14 s).cargo test --release -p xcl --lib hle::d3d12x::tests -- --test-threads=1 --nocapture):1 passed; 0 failed; 0 ignored(0.37 s).cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture, RTX 4060):37test binaries,1424 passed; 0 failed; 46 ignored.29pre-existingSKIPPEDlines on this RTX 4060 host (21no wave64,3per-lane wave32 refused,3no D3D12 debug layer /d3d12SDKLayers.dll,1no heap windows,1cannot disable driver cache;0skipped inhle::d3d12x::tests).Regression run
Paired 60 s RTX 4060 smoke (
scripts/smoke.ps1 -Seconds 60) on baseorigin/mainvs PR head (1566vs1550frames =101.0%,60 60 60steady pace,0device removals,0crashes):Base (
origin/main):PR head:
Not tested
D3D12SerializeRootSignaturewith console-only flag bits (console-only flag stripping, PC-flag preservation viaD3D12CreateRootSignatureDeserializer, and error-blob cleanup are covered by the unit test against real Windowsd3d12.dlland mockID3DBlob).d3d12.dllwithout Agility SDK (this host runs Windows 11 26200; the updated test removes the assumption that unknown-version failures emit non-empty"version"text and guardsblob_releaseon null).d3d12SDKLayers.dllnot installed on this host).AI use
Written and verified with Google Antigravity (Gemini 4 Neon). All changes were validated locally with failing-first WARP tests, full release workspace tests, and paired 60 s RTX 4060 smoke runs.
@SlopTart on GitHub · 2026-11-25 20:02 UTC · original
gpu_suite (cold cache): 160 passed / 4 failed, no crashes. The four are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, depth-buffer state refusal, andgpu_promoted_uav_clear_values_pass_create_committed_resource(report); none caused by this PR.(
empty_stream_descriptors_do_not_change_the_keywas not picked up by substring filter in the--libtarget; suite covers the gpu-side changes.)@DavidM1911 on GitHub · 2026-11-25 20:21 UTC · original
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!
@xpatfussy69x on GitHub · 2026-11-25 22:21 UTC · original
Test run on exact head
75c835d(75c835d425f8a614d346aceaf3402d23c0f1785d, on its base2898511), clean tree.Tested
cargo test --workspace -- --test-threads=4: 1364 passed, 0 failed, 46 ignoredV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32(onmaintoo)cargo test -p xcl --lib serialize_root_signature: 1 passed, 0 failedserialize_root_signature_strips_console_flags_and_preserves_pc_flags: okRegression run (60 s, default settings, a retail title)
main:
this PR:
No crash or device removal; frames 104 % of
main's, peak commit 100 %.Not tested
main(tested on its own base; it merges intoe1d84b7without conflicts)AI use
@HAL9000RELOADED on GitHub · 2026-11-25 22:53 UTC · original
Windows 10 data point for
75c835d: RX 7900 XTX (RDNA3), driver 32.0.32015.7029, Windows 10 22H2 (19045.6456), Rust 1.98.1 MSVC.serialize_root_signature_strips_console_flags_and_preserves_pc_flags:XCL_D3D12_DIR), on the card and withXCL_ADAPTER=warp: passes. Merged on6d12f58it also passes with the whole crate.XCL_D3D12_DIR), card and WARP, merged on889ef3e: fails with "caller error blob missing diagnostic". The flag checks before that pass; only the version-99 case differs. The in-boxD3D12SerializeRootSignaturefails as expected but its error blob has no text (I printed it:""), socontains("version")is false.So the stripping works on Windows 10 too. The last assertion depends on the runtime's error text, which the in-box runtime doesn't give. Checking only the failure code there would let the test pass on Windows 10 without Agility.
@Decodere on GitHub · 2026-11-25 23:05 UTC · original
@HAL9000RELOADEDThanks for the Windows 10 in-boxd3d12.dlltest point!Updated in
bd586636(and rebased ontoe1d84b7d): theversion = 99check now verifies the failure HRESULT and*errinitialization without assuming non-empty"version"text on in-box Windows 10 runtimes (and guardsblob_releasewhenerr_outis null), while a runtime-independent mockID3DBlobcheck onserialize_root_sigdeterministically covers caller error-blob forwarding and internalown_errcleanup. Re-verifiedhle::d3d12x::tests(1/0on both WARP and RTX 4060), full release workspace (1424 passed, 0 failed), and paired 60 s smoke (1550 -> 1566,0crashes/removals).@DavidM1911 on GitHub · 2026-11-26 01:50 UTC · original
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
@bmjask on GitHub · 2026-11-25 20:37 UTC · original · reviewed
No code-level blocker found. The shared helper preserves the caller descriptor, strips only console-only bits for both layouts, and current Windows CI is green. Nonblocking test gap: shared error-blob handling is covered only through the 1.0 serializer. A failing versioned-serializer case with NULL/non-NULL error output would validate ownership/reset in that path.
@HAL9000RELOADED on GitHub · 2026-11-26 09:29 UTC · original
Re-run at
bd58663on the same Windows 10 22H2 (19045) machine, RX 7900 XTX (RDNA3), driver 32.0.32015.7029.XCL_D3D12_DIR):serialize_root_signature_strips_console_flags_and_preserves_pc_flagspasses, 3/3 runs.XCL_D3D12_DIR): passes too.At
75c835dthe same test failed here on the in-box runtime, so the change covers it.AI-assisted (Claude Code): tests run on my machine, text drafted with Claude.
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.