D3D12.X: retain pRootSignature in device_x::Base until forgotten #1609
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1619"
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 oni-swr on 2026-11-24T18:17:37Z.
device_x::note_basecopied rawD3D12_GRAPHICS_PIPELINE_STATE_DESCbytes intoBASESwithout retainingpRootSignature. In D3D12 a title may release itsID3D12RootSignatureimmediately afterCreateGraphicsPipelineState; later calls toCreateDerivedPipelineStateXor theRSSetDepthBiasXpatched-PSO fallback would then pass a dangling pointer intoCreateGraphicsPipelineState. Retain non-nullpRootSignatureinBaseviaID3D12RootSignature::from_raw_borrowed().cloned()and release replaced or removedBaseentries outside theBASESmutex lock. Part of #1488 (XCL-BT-005).What is in it
device_x.rsretains each tracked graphics PSO’s root signature and drops replaced or removed entries outside the registry lock. The rebase preserves #3292’s shader bytecode ownership and both lifetime tests.Tested
d94caf384eb7b4dff9fb35a040e8fdfa419c3f57on Windows 11 build 26200, Ryzen 7 5700X3D, Radeon RX 7800 XT (driver 32.0.31035.1003), Rust 1.100.0 MSVC, debug profile. The focused tests ran on the CPU.cargo test -j 4 -p xcl --lib 'hle::d3d12x::device_x::tests::base_' -- --nocaptureran the root-signature and shader-bytecode lifetime tests. 2 passed, 0 failed, 0 ignored, 0 skipped, 2564 filtered out.Regression run
Not tested
mainand this head.AI use
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T18:59:20Z.
Full-suite run, since this PR has no test report yet. Tested exact head
8cc8b6c(on its base9e3831e).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: 776 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.base_retains_root_signature_until_forgotten.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 777 passed, 0 failed, 41 ignored. SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).heap_window_out_of_memory_falls_back_to_the_switch_formwas skipped with--skip. It fails on main9e3831etoo, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (XCL_HEAP_WINDOWSunset). Reported as #1651.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T20:37:48Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.Thanks!
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:08:51Z.
XCL PR #1619 focused Windows verification
Tested head
8cc8b6ce2b18e8bdbb6f3df577ab842ef0bd9cf0on STOR-WINLAB from a clean detached checkout. The PR changes onlycrates/xcl/src/hle/d3d12x/device_x.rs.Tested
cargo build --workspacesucceeded.cargo test --workspace --no-runcompiled the workspace test binaries. Both ran outside the Arc lock with incremental compilation and debug info disabled.cargo test -p xcl --lib hle::d3d12x::device_x::tests::base_retains_root_signature_until_forgotten -- --exactran outside the Arc lock withXCL_ADAPTER=NONE_CPU_ONLY. Parsedpr1619-focused.logcounts were 1 passed, 0 failed, 0 ignored, 0 skipped, with 748 filtered out.Arc<Base>is held, final release after that Arc is dropped, and release on replacement. It also checked null root signatures and stream-output exclusion.Not tested
Coverage was limited to full-workspace compilation and the focused PR test. The full GPU workspace suite, real D3D12 pipeline creation and retail-title smoke runs were omitted.
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 against
pr1619-focused.logand published.Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T10:36:10Z.
Independent Windows run on 8cc8b6c. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11.
cargo build --workspace --offline --locked -j 4passed.cargo test --workspace --offline --locked --no-fail-fast -j 4 -- --nocapture --test-threads=4finished with 777 passed, 0 failed, 41 ignored, including three runtime skips in Cargo’s pass count. The stock root-signature ownership test passed.With the D3D12 debug layer enabled and asynchronous PSO creation off, the scratch fixture verified that XCL kept its own root-signature reference. After dropping the caller's reference, both
CreateDerivedPipelineStateXand the patched depth-bias pipeline helper created native pipelines. A repeat request returned the cached variant. The device stayed healthy, and releasing both base entries cleared their metadata and the cached variant.cargo test --offline --locked -j 4 -p xcl --lib local_retained_root_signature_supports_native_derived_pipelines -- --nocapture --test-threads=1passed 1 of 1 without skips. Synthetic pipeline creation and cleanup coverage.AI use: Codex (GPT-6, exact variant unspecified) wrote the scratch fixture, ran the tests and drafted this report.
Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-25T18:47:55Z.
Rebased onto
origin/mainand force-pushed (--force-with-lease).717b19885bc935ef9d0ce98e7fc13b648132dd62origin/main:3f2777019544c0ada2cd294aa792d3c378ff0df8crates/xcl/src/hle/d3d12x/device_x.rsafter #2280. Both sides appended a test at the end ofmod tests; I kept both, and the code change is unchanged.MERGEABLE.Tested (CPU only, no GPU touched; debug build, Windows 11)
cargo build --workspace: finished, 0 errors (3 existing warnings inxcllib)XCL_ADAPTER=NONE_CPU_ONLY cargo test -p xcl --lib hle::d3d12x::device_x::tests::base_retains_root_signature_until_forgotten -- --exact: 1 passed, 0 failed, 0 ignoredNot tested
scripts/smoke.ps1(noxcl-smokeblocks for this head), retail titleAI use: Claude Code (Claude Sonnet 5.5): resolved the rebase conflict and ran the build and test above.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T05:58:03Z.
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
Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-28T03:32:38Z.
Rebased onto current
main(e429936c, after #3085 and the #2959–#2962 stack). The only conflict was two additive test blocks indevice_x.rs; both are kept and the PR's code is unchanged. New head:cec364b6.Tested (CPU/WARP only,
XCL_WARP=1, no retail title, no smoke run):cargo test -p xcl --lib -j 4 d3d12x::device_x: 19 passed, 0 failed, 0 ignored, 0 skipped (includesbase_retains_root_signature_until_forgotten). The full suite and a regression run were not repeated after this rebase.AI use: Claude Code, Claude Sonnet 5.5 (rebase and targeted test run).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:18:22Z.
Triage (#1607) – head
d94caf3#1634 makes the same change:
device_x::Baseholds anID3D12RootSignaturetaken from the desc'spRootSignatureand releases it when the base is forgotten. This PR was opened first, is mergeable, and its test also covers a replaced entry and an in-flightArc<Base>. It also drops the old base outside theBASESlock.The
Build and testcheck fails on this head. The log was not available, so it is not clear whether this change causes it.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.