D3D12.X: retain graphics root signature across bind state #1925
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!1925
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1925"
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?
@n-romanovich on GitHub · 2026-11-24 23:22 UTC · original
n-romanovich:d3d12x/bind-retain-gfx-rootsig→main· +96 −12 · 1 files · 1 commits · openFixes #1488.
State.rs_gfxpreviously stored the graphics root signature as an unretained rawusize, causing a COM use-after-free ingraphics_boundorexecute_indirectif the title released itsID3D12RootSignaturereference afterSetGraphicsRootSignature.execute_indirectalso boundrs_gfxeven onCOMPUTEcommand lists.This PR retains
ID3D12RootSignatureinState.rs_gfx(when adopted viareal::is_adopted) and restrictsexecute_indirect's graphics root signature binding to non-dispatch indirect signatures on non-COMPUTEcommand lists.What is in it
crates/xcl/src/hle/d3d12x/bind.rs:State::rs_gfxfromusizetoOption<ID3D12RootSignature>, retaining adopted objects inset_graphics_root_signature, cloning ininherit_for_split, and clearing onreset,clear_state, andforget.execute_indirect, only binds.rs_gfxwhen!signature_dispatches(sig)andlist.GetType() != D3D12_COMMAND_LIST_TYPE_COMPUTE(checkings.rs_gfxbefore callingGetType()).graphics_root_signature_is_retained_and_skipped_on_compute_ei.Tested
Hardware: Windows 11 x64, NVIDIA GeForce RTX 5060 Ti.
cargo test -p xcl --lib bind::tests -- --test-threads=4: 7 passed, 0 failed, 0 ignored (945 filtered out)cargo test --workspace -- --test-threads=4: 976 passed, 0 failed, 45 ignoredSKIPPED:gpu::recompwave64 and unsupported per-lane f16 tests (21 skipped:no wave64/ refused per-lane f16),shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode is required,0x887A002D),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)Regression run
Main (
5478c4a7c1ae5adba127c8d27018d7fdbf3a8725):PR (
7ce63fc0422aff13e5867af651f27a44d096bc92):Not tested
AI use
smoke.ps1runs, and audited the diff with an independent subagent.@futurepro62 on GitHub · 2026-11-24 23:55 UTC · original · edited 2026-11-25 00:09 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
cfd026d(on its base689f2db).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::dxil::fuzz_tests: 966 passed, 0 failed, 43 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.graphics_root_signature_is_retained_and_skipped_on_compute_ei.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 975 passed, 0 failed, 45 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main62265d3too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651) and the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests (follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@raylitebull on GitHub · 2026-11-25 01:54 UTC · original
Code review on
cfd026d:State.rs_gfxincrates/xcl/src/hle/d3d12x/bind.rsto retain anOption<ID3D12RootSignature>(only whenreal::is_adopted(rs)), propagating it ininherit_for_split, and guardingexecute_indirectwith!signature_dispatches(sig)andlist.GetType() != D3D12_COMMAND_LIST_TYPE_COMPUTEcleanly prevents dangling raw root-signature pointers and invalidSetGraphicsRootSignaturecalls on compute command lists.CIworkflow approved (running).Remaining before merge:
Build and testfinishing green plus AMD verification oncfd026d.@DavidM1911 on GitHub · 2026-11-25 02:34 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
@JJAutoCompare on GitHub · 2026-11-25 02:55 UTC · original
PR #1925 compatibility verification
Commit
cfd026db9ff9ddd9c9cde6ba6d540c492e6543a7(detached PR head). The change keeps an owned COM reference to the title's graphics root signature in bind state, clones it when splitting a command list, and clears it on reset or clear-state. The PC fallback forExecuteIndirectskips the graphics bind for dispatch signatures and compute lists.Tested
DoublePrecisionFloatShaderOps=0). Rust 1.100.0 (0ef1bc386), DXC/DXIL 1.9.2609.5,XCL_ADAPTER=A770, unoptimized builds with debug info disabled.cargo build --workspaceandcargo test --workspace --no-runboth succeeded.cargo test -p xcl hle::d3d12x::bind::tests -- --nocapturereported 7 passed, 0 failed, 0 ignored, and no skips. The new regression exercised retention after caller release, split inheritance, clearing, and the compute-list guard using a mock command list.cargo test -p xcl test_title_draws_with_a_root_signature_under_the_debug_layer -- --nocapturereported 1 skip becaused3d12SDKLayers.dllis missing. The harness reportedokafter the early return.Workspace suite
cargo test --workspace --no-fail-fast -- --test-threads=4ran once under the shared Arc lock and exited 101. Across 20 harness summaries, Cargo reported 951 passed, 25 failed, 45 ignored. The new regression passed again.CreateComputePipelineState(0x80070057), including FP64 cases. Four showed result mismatches in fused multiply-add, implicit mip LOD, f16 lane packing, or pixel wave reduction.SKIPPEDlines inpr1925-suite.log(17 no wave64, 3 refused wave32 per-lane forms, 1 driver cache could not be disabled, 1 no heap windows). The separate targeted run exposed the debug-layer skip, which Cargo captured in the workspace run. Skip lines can count subcases, and skips provide no coverage.Not tested
Debug-layer draw assertions, retail-title smoke, release builds, and other adapters. The workspace failures were measured on the PR head only, so their status on
mainis unverified.AI use
T3 Code / Codex (
gpt-6.2-sol,reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity,gemini-4-neon) verified counts againstpr1925-suite.logand published this report.@luckyteagirl on GitHub · 2026-11-25 03:04 UTC · original
Tested
cfd026db9ff9ddd9c9cde6ba6d540c492e6543a7on Windows 11 build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M driver30.0.13002.13003(plus an AMD integrated GPU), Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5.XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=1, andXCL_DIRECT_DXIL=0were set for the test commands.cargo test --locked -p xcl --lib -j 2 hle::d3d12x::bind::tests::graphics_root_signature_is_retained_and_skipped_on_compute_ei -- --exact --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, no explicit skip. The test creates a D3D12 device using the system default adapter, with a WARP fallback; it does not useXCL_ADAPTERto select its device, and I did not record that device's LUID.hle::d3d12x::bind::testsgroup: 7 passed, 0 failed, 0 ignored. The broaderhle::d3d12x::subset: 156 passed, 0 failed, 2 ignored, with one explicitSKIPPEDline because this adapter makes no reserved cube with mips. Both subset runs used one test thread.cargo build --locked --workspace -j 2andcargo build --locked --release -p xcl -j 2: passed.Smoke attempt
Two monitored 7-second runs of a locally owned title on the RX 6800M reached the first frame. The first logged the
XCL_RUN_SECONDS: 7 send marker; the second was stopped just after its 6-second activity sample. In both, low system commit availability triggered the local memory guard beforescripts/smoke.ps1could write itsxcl-smoke v1summary. Neither attempt is a completed smoke result, and there is no paired main run to compare. I have not counted them as a pass.Not tested
AI use
OpenAI Codex (GPT-6, exact variant not exposed in this session) inspected the diff, ran the builds and tests, monitored the smoke attempts, reviewed their logs, and drafted this report.
@Royalflamejlh on GitHub · 2026-11-25 04:55 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA test of
cfd026dmerged onmain80f4819with #684: 10 runs of 100 s of a retail title with it, 5 without. 9 of the 10 with it stopped presenting at 74.7 to 92.2 s (without it: 78.2 to 99.6 s); 1 stopped at 52 s and ended at the title's stall watchdog. I found nothing that ties that stall to the change.Setup: Fedora 44, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, RTX 4070 12 GB (driver 615.71.09), 62 GB RAM. Release, cross-compiled to
x86_64-pc-windows-gnu(rustc 1.98.0),XCL_PSO_PRELOAD=0. Retail title 1.0.2.1, the first-run screens completed once and no story progress, A pressed when the title presents steadily.Tested
cfd026d(10 runs)game+0x23cf683(the stall watchdog)host.rs:65-68), and it was late without the change too, by 3.3 s and 1.1 s in two runs. The audio thread kept time throughout. No thread dump was taken.Read
bind.rs:177: the reference is kept only for a root signature XCL adopted, and every one the title gets is adopted where it is made (real.rs:5259atcfd026d). Root signatures have noReleasehook of XCL's, so taking and dropping the reference under the bind state's lock waits on nothing of XCL's.Not tested: the bind the change is for (every run's last count line has 0 draws with PC pipelines); a title that releases its root signature before a draw; Windows; AMD and Intel; past 100 s.
AI use: Claude Code (Claude Fable 5.2) read the diff, built the trees, ran the title and the tests, and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@throny on GitHub · 2026-11-25 18:18 UTC · original
Two contributors checked independently and found that #1764 solves the same problem (for #1488) in a different way: #1607, group D93. 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.
@DavidM1911 on GitHub · 2026-11-26 06:41 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
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.