D3D12.X: hold BASES lock across DEPTH_BIAS_PSOS in depth_bias_pso and forget_base #1321
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1331"
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 b3IKK on 2026-11-24T14:50:24Z.
In
depth_bias_pso, the temporaryMutexGuardfromBASES.lock()was dropped at the semicolon before acquiringDEPTH_BIAS_PSOS.lock(), andforget_baselikewise droppedBASESbefore lockingDEPTH_BIAS_PSOS. Ifforget_baseran between those two locks, it removedbasefromBASESand scanned an emptyDEPTH_BIAS_PSOS, after whichdepth_bias_psoinserted the derived PSO under stalealive == trueÔÇöleaking the derived PSO permanently and risking stale cache hits if the base COM address is later reused.This holds both locks in consistent
BASES -> DEPTH_BIAS_PSOSorder incache_depth_bias_psoandforget_base_entries(still releasing PSOs outside the locks).What is in it
crates/xcl/src/hle/d3d12x/device_x.rs: extractcache_depth_bias_psoandforget_base_entriesholdingBASESacrossDEPTH_BIAS_PSOS; add 200-iteration concurrent testconcurrent_depth_bias_cache_and_forget_base_never_orphans_pso.Since the last push: rebased onto
main06c9f55; the only conflict wasuav_format_promotion_and_linearization, a testmainhad added at the same place, and both are kept.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 1266 passed, 0 failed, 46 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses,no heap windows, andcannot disable the driver cache (Windows Developer Mode is required))cargo test -p xcl --lib concurrent_depth_bias_cache_and_forget_base_never_orphans_pso: 1 passed, 0 failedRegression run
main (
426a5a7, clean tree, no local changes):PR (
e860e83, clean tree, no local changes):(The main block is
426a5a7, an ancestor of the currentmain, from the same machine and data folder.)Not tested
AI use
main06c9f55, resolved the conflicts, ran the suite and thescripts/smoke.ps1pair at the head above.Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:55:17Z.
Full-suite run, since this PR has no test report yet. Tested exact head
bf129cf(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.concurrent_depth_bias_cache_and_forget_base_never_orphans_pso.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T15:10:05Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 707 passed, 1 failed (coherent_buffer_sanitizes_console_flags_and_state— the known flake from #913; passes standalone), 21 ignored.Thanks!
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T15:58:38Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodifiedmain.)Thanks!
upstream-sync referenced this pull request2026-11-24 22:06:25 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T04:53:16Z.
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:31:47Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:27:23Z.
Triage (#1607) – head
e860e83Main still has the race this fixes. In
device_x.rson main,depth_bias_psochecks the base inBASES, drops that lock, and only then inserts intoDEPTH_BIAS_PSOS, andforget_basetakes the two locks one after the other. No open PR makes the same change. The newBASES -> DEPTH_BIAS_PSOSorder matches every other place that takes both locks, so it adds no deadlock.The branch conflicts with main. When you rebase, the test's
Base { .. }literal must gain the fields main has added since (e.g.shader_blobs).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.