D3D12.X: retain pRootSignature in device_x::Base until forgotten #1619
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!1619
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@oni-swr on GitHub · 2026-11-24 18:17 UTC · original
oni-swr:d3d12x/retain-base-root-signature→main· +91 −8 · 1 files · 1 commits · opendevice_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
crates/xcl/src/hle/d3d12x/device_x.rs: retainpRootSignatureinBaseonnote_base, drop oldBaseentries outside theBASESlock innote_base/forget_base/register_test_base, and add unit testbase_retains_root_signature_until_forgotten. Rebased ontomain379725a; the only conflict was the end of thetestsmodule, where both tests were kept.Tested
3aa4690173e1651d4d51a5681e927f88b01edb88, no uncommitted changes.cargo test -p xcl --lib hle::d3d12x::device_x::tests::base_retains_root_signature_until_forgotten -- --exact: 1 passed / 0 failed.cargo build --workspaceandcargo build --release -p xcl: passed.cargo test --workspace --no-fail-fast -- --test-threads=4: 1254 passed / 1 failed / 46 ignored. The one failure isgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722,res[30] = 0x1, CPU 0x7fffffff). It fails the same way on cleanmain379725aon this GPU (run separately: 0 passed / 1 failed), so it is not caused by this PR.SKIPPED(7 lines, not coverage):f16_programs_on_the_gpux4 andf32_programs_on_the_gpux2 (unsupported V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32, #1426), andheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Regression run
same title, 60 s, release, same GPU; first
main, then this PR's headNot tested
CreateDerivedPipelineStateXor the patched-PSORSSetDepthBiasXfallback. No claim of title performance improvement.maintoo (see above).AI use
main, resolved the conflict, reran the build, test suite and both smoke runs, and rewrote this description.mainand this PR head, and updated the Regression run blocks.🤖 Generated with Claude Code
@futurepro62 on GitHub · 2026-11-24 18:59 UTC · original
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
@DavidM1911 on GitHub · 2026-11-24 20:37 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.Thanks!
@JJAutoCompare on GitHub · 2026-11-25 05:08 UTC · original
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.@thehollowedone on GitHub · 2026-11-25 10:36 UTC · original
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.
@oni-swr on GitHub · 2026-11-25 18:47 UTC · original
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.
github-bot referenced this pull request2026-11-26 06:18:30 +00:00
@DavidM1911 on GitHub · 2026-11-26 05:58 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.