D3D12.X: the same root signature set again keeps the root arguments #2494
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2504"
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 tiagonleal on 2026-11-25T21:01:38Z.
SetComputeRootSignature and SetGraphicsRootSignature zeroed the root arguments on every call. In D3D12 a redundant set of the same root signature keeps the bindings; only a different root signature makes them stale. Microsoft Learn, Using a Root Signature (https://learn.microsoft.com/en-us/windows/win32/direct3d12/using-a-root-signature): "If the root signature is redundantly set to the same one currently set, existing root signature bindings do not become stale." Compute and graphics each have their own root signature. A title that sets the same signature again and then binds only some parameters left the rest at address 0 in the argument table of the translated shader.
The arguments are cleared only when the layout is not the one already set (the same layout object, so a signature made at a freed one's address still clears). The console list replay does the same. Reset and ClearState still clear everything. No tracked issue fits this exactly, so none is linked; neither #667 nor #1652 changes this clearing.
Rebased onto
main309c3ec5. The only conflict was in the test module, wheremainadded tests in the same place.What is in it
bind.rs:set_compute_root_signature/set_graphics_root_signatureclear only for a different layout; testthe_same_root_signature_again_keeps_the_root_arguments(same signature twice keeps the arguments, a different one clears, compute and graphics are independent, a signature re-made at the same address clears, ClearState and Reset clear)console_list.rs:same_layouthelper, used by the replay ofRS_MARKERTested
cargo test -p xcl --lib the_same_root_signature: 0 passed, 1 failed. After the fix, run 5 times: 1 passed, 0 failed each time.cargo build --workspaceandcargo test --workspace --no-fail-fast -j 6 -- --test-threads=4, run twice: 1420 passed, 4 failed, 46 ignored both times (25SKIPPEDlines). The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3; they fail the same way onmain6d12f58a(cargo test -p xcl --lib fuzz_validate_and_gpu: 0 passed, 4 failed).main309c3ec5(headea1258f8):cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4, one run: 2139 passed, 4 failed, 48 ignored (25SKIPPEDlines). All 4 failures also fail onmain309c3ec5on this machine (2138 passed, 4 failed, 48 ignored): the 4gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_*(#1919 fixes them). The other results in this section are from the earlier heads named in them.Regression run
scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e(Newer Retail Game), release builds of both commits in clean trees,main309c3ec5first, one run each, in one queue with this account's other PRs. Both runs hadXCL_PREPARE=0and the same warm DXIL cache. A warm-up run ofmaincame before them and is not shown. A second run ofmainat the end of the queue showed 302 frames and a peak commit of 10988 MB, so differences of a few tens of frames between runs are noise here.mainis slow for about the first minute of this title since #2959 (#3164 has the cause), which is why both runs show few frames.main(309c3ec5):This PR (
ea1258f8):Not tested
AI use
Imported from ivall/xcl. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T21:01:52Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T21:14:09Z.
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!
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T21:15:38Z.
gpu_suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.Targeted run of
the_same_root_signature_again_keeps_the_root_arguments: passed.Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T21:29:23Z.
Independent AMD RDNA4 (native wave64) test report on exact head
bbd16e969f8277edba453d43d683f0fa6b4818a1(clean detached checkout, no local changes).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1421 passed, 3 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused by per-lane form;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.hle::d3d12x::bind::tests::the_same_root_signature_again_keeps_the_root_arguments.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599) are pre-existing on unmodifiedmainon this GPU;hle::d3d12x::list_x::tests::a_dispatch_with_a_pipeline_still_building_waits_at_the_submitfailed once under--test-threads=4(left: 135, right: 421) and passed immediately on single-threaded rerun (--test-threads=1,0.48s).Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T03:05:29Z.
Independent desktop NVIDIA verification of PR #2504 at head
bbd16e969f8277edba453d43d683f0fa6b4818a1(1commit; exact parent & merge-base:6d12f58a229bc73889878a448c64dc3af25eeba0, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted release tests & build (
bbd16e96)cargo test --release -p xcl --lib the_same_root_signature_again_keeps_the_root_arguments -- --nocapture(3 consecutive runs)1 passed; 0 failed; 0 ignored; 1324 filtered out× 3 (0.00s× 3,0skipped)cargo test --release -p xcl --lib hle::d3d12x::bind:: -- --test-threads=1(3 consecutive runs)9 passed; 0 failed; 0 ignored; 1316 filtered out× 3 (0.43s,0.43s,0.43s,0skipped)cargo test --release -p xcl --lib hle::d3d12x::console_list:: -- --test-threads=1(3 consecutive runs)7 passed; 0 failed; 0 ignored; 1318 filtered out× 3 (0.17s× 3,0skipped)cargo build --release -p xcl1m 08s, exit0,0new warnings)Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
6d12f58a229bc73889878a448c64dc3af25eeba0, cached baseline on the same machine):PR #2504 (
bbd16e969f8277edba453d43d683f0fa6b4818a1):Runtime log observations (
xcl.log)9223log lines,0[ERROR]/ device-removal / panic lines.19633 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14006 MB committed by the process; video memory 6116 MB local, 4682 MB non-local.Limits of coverage
the_same_root_signature_again_keeps_the_root_arguments(3/3),hle::d3d12x::bind::(9/9× 3), andhle::d3d12x::console_list::(7/7× 3).title: 29640639exercises live console root-signature binding across19633draws and1024dispatches with zero errors or device removals (frame-count delta vs. cached parent reflects single-run startup variance, not this PR).AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by Alm0stSurely on 2026-11-27T12:19:13Z.
I reproduced the graphics descriptor-table case on an isolated #2057-based integration and tested the production changes from
bbd16e969f8277edba453d43d683f0fa6b4818a1.The test binds a synthetic graphics root signature with a one-SRV table and a 32-bit constant, sets both, sets the same signature again, then changes only the constant from 11 to 12. I checked the actual
user_data_gfxresult. Before the patch the table word ins8became zero whiles9correctly became 12. With the patch,s8retained the original table word ands9became 12. Replacing the layout with a new object at the same address also cleared both words as expected.This is a CPU regression test through the graphics setters. The effect on a retail frame is still unverified. Tested with assistance from OpenAI Codex (gpt-6.2-astra).
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-29T03:25:09Z.
merge-check
base:
fa204595a4head:
ea1258f893merge: clean (trial merge 0ebf529b7547ced525e49bb6d5cf2b476217fa4b, local, not pushed; bind.rs and console_list.rs auto-merged;
git diff --checkclean)build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> 2609 passed, 0 failed, 49 ignored; SKIPPED: 26, the usual set (21 no wave64 on this 32-lane GPU, 3 per-lane f16/f32 forms refused (#1426 semantics), 2 no heap windows). The new
bind::tests::the_same_root_signature_again_keeps_the_root_argumentsran and passed.review: none blocking; whole diff read, and checked against current main after the merge. This matches D3D12: setting the root signature that is already set keeps the bound root arguments, and only a different one invalidates them.
same_layoutcompares the layouts'Arcs, so a signature re-made at a freed one's address (a freshnote_root_signature) still counts as different and clears; the test covers that. Graphics and compute keep separate layouts and arguments.ResetandClearStatestill set both layouts toNoneand clear both argument tables, so a signature set after them starts empty. A mid-list split (prepare_split/install_prepared_spliton main) moves the sameArclayout with its arguments, sosame_layoutgives the same answer across segments. The console-list replay inconsole_list::close(RS_MARKER) follows the same rule. Two layout-less signatures count as the same ((None, None)), which is harmless: their argument table is empty either way.performance: avoids reallocating and zeroing the argument table when a title sets the same signature again; nothing measured. Title run (release build of the merge, scratch/fast-world.py fast profile, about 85 s in world): exit 0, 0 crashes, 0 device removals, world entry 90.8 s, peak commit 31,365 MB, 91 WARN lines,
failed_pipelines0, no translation errors. Against a mainfa204595run on the same harness (world entry 76.8 s, peak commit 33,027 MB, 86 WARN lines) the only new WARN kind is Windows' "the system is running out of commit", caused by other jobs on this shared machine. Both runs show 0 fps in the world because the cache doesn't match the translator identity; world-entry and commit differences follow cache contents and machine load.verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74, wave32 only), AMD Ryzen 9 9950X, Windows 11 build 26200; rustc 1.99.0, debug test profile, release build for the title run, DXC 1.9.2609 via XCL_DXC_DIR. Claude Code, Claude Opus 5.5: merge, build, suite, title run and full-diff review; this report.
Imported from ivall/xcl. Originally posted by throny on 2026-11-29T08:23:26Z.
merge-check claim
head:
ea1258f893Imported from ivall/xcl. Originally posted by throny on 2026-11-29T08:40:56Z.
merge-check
base:
d8bd9a38head:
ea1258f893merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2619 passed, 0 failed, 49 ignored (27 SKIPPED lines). Base alone at
d8bd9a38: 2618 passed, 0 failed, 49 ignored.review: no finding. Setting the root signature that is already bound (the same layout object, compared by
Arc::ptr_eq) no longer zeroes the bound arguments, in the binding code and in the replay of a recorded stream. That is D3D12's rule: only a different signature invalidates the bindings. The pointer comparison is sound because the old layout stays alive while it is bound, so a signature made again at the same address is a different object. Reset and ClearState still clear both. The test fails without the change; the replay path has no test of its own.performance: not measured.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).