D3D12.X: release alloc_pool queue fence on queue release #1967
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!1967
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1967"
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-25 00:04 UTC · original
n-romanovich:d3d12x/alloc-pool-release-queue-fence→main· +71 −0 · 2 files · 1 commits · openFixes #1909.
alloc_pool::State.fencespreviously retained(ID3D12Fence, u64)per command queue indefinitely with no cleanup whenreal::q_releasereleased the queue at refcount 0.This PR adds
alloc_pool::on_queue_release(queue), called fromreal::q_releasewhenn == 0, to drop the queue's retained fence fromState.fencesand clear any already-completedBacking.marksentries for that queue (while leaving in-flight marks alive until completion/reset).What is in it
crates/xcl/src/hle/d3d12x/alloc_pool.rs: addon_queue_release(queue)and unit testreleased_queue_drops_retained_fence_from_state.crates/xcl/src/hle/d3d12x/real.rs: callsuper::alloc_pool::on_queue_release(this as usize)inq_releasewhenn == 0.Tested
Hardware: Windows 11 x64, NVIDIA GeForce RTX 5060 Ti.
cargo test -p xcl --lib alloc_pool -- --test-threads=4: 4 passed, 0 failed, 0 ignored (961 filtered out)cargo test --workspace -- --test-threads=4: 989 passed, 0 failed, 45 ignoredSKIPPED: 22gpu::recompwave64 / refused per-lane f16 tests (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 (
4fffef38d1edb0be45b3c51859b0f711e7f85098):Not tested
AI use
smoke.ps1runs.@futurepro62 on GitHub · 2026-11-25 00:26 UTC · original · edited 2026-11-25 00:42 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
61db31a(on its basefc14fab).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::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 978 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.released_queue_drops_retained_fence_from_state.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 988 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 main80f4819too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests andconst_and_null_mask_operands_agree_with_hlsl_on_the_gpu(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
61db31a:crates/xcl/src/hle/d3d12x/alloc_pool.rs,real.rs) andCIworkflow approved (running).#1945(alloc_pool.rs+q_release):#1945additionally moves still-pending queue marks intoBacking.retiredonforget_queue(so a new queue reusing the same address cannot overwrite an in-flight mark) and usescreate_pc_fenceto bypassreal::FENCES. If#1967moves forward instead, it still needsBuild and testgreen plus AMD verification.@JJAutoCompare on GitHub · 2026-11-25 02:54 UTC · original
PR #1967 compatibility verification
Tested
61db31aacab5bcc912eb8426f180ba6881d12d2fon STOR-WINLAB. The allocator-pool regression test passed in both runs. The workspace suite exited 101 with 25 failures.Environment
Windows 11 Enterprise Evaluation build 26200.9974, Ryzen 7 3800X, Intel Arc A770 16 GiB with driver 32.0.101.9175. Wave range 8–32,
DoublePrecisionFloatShaderOps=0, and nod3d12SDKLayers.dll. Rust 1.100.0 (0ef1bc386, 2026-11-09), DXC/DXIL 1.9.2609.5, unoptimized builds with debug info and incremental compilation disabled,XCL_ADAPTER=A770.Tested
cargo build --workspaceandcargo test --workspace --no-runsucceeded.cargo test -p xcl hle::d3d12x::alloc_pool::tests -- --nocapturereported 4 passed, 0 failed, 0 ignored, and 0 skip markers.released_queue_drops_retained_fence_from_statesubmitted a D3D12 list, waited for completion, then called the cleanup directly and verified removal of the retained fence and completed backing mark. Source inspection confirmed thatq_releasecalls the cleanup when the native reference count reaches zero.cargo test --workspace --no-fail-fast -- --test-threads=4ran once under the shared Arc lock. Across 20 result summaries, Cargo reported 964 passed, 25 failed, 45 ignored. The log contained 23SKIPPEDlines. Some tests emit multiple markers, and skipped paths contribute no coverage.Of the 25 failures, 20 library tests reported
CreateComputePipelineStateerror0x80070057, and four library tests had result mismatches in fused FMA, implicit-LOD sampling, f16 VALU, and wave reductions. The test-title e2e case failed itsRSSetDepthBiasXcheck (blue pixel, expected green). Skip markers covered 18 wave64 cases, three refused wave32 lowering cases, one driver-cache prerequisite, and one heap-window case.Not tested
Baseline on
main, retail-title smoke, other GPUs, the D3D12 debug layer, or optionalXCL_SAMPLE_*data. The focused test did not exercise the release hook directly, an in-flight mark at release, or queue-address reuse.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 againstpr1967-suite.logand published this report.@DavidM1911 on GitHub · 2026-11-25 03:09 UTC · original
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!
@thehollowedone on GitHub · 2026-11-25 11:12 UTC · original
Independent Windows check on 4fffef3. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, debug.
The stock allocator-pool tests passed 5/0/0 with zero skips (
cargo test --offline --locked -p xcl --lib hle::d3d12x::alloc_pool::tests -- --test-threads=1 --nocapture).I also tested simulated queue-key reuse with native D3D12 fences. An unsignaled fence represented the old queue. The backing stayed busy after the release callback. After a new native submission under the same key completed, the backing reported free while the old fence was still unsignaled. The same fixture on #1945’s f581057 kept the backing busy until I signaled the old fence.
The scratch check used
cargo test --offline --locked -p xcl --lib released_queue_key_reuse_keeps_the_older_pending_fence -- --test-threads=1 --nocapture(with-j 4on #1945). It failed the busy-state assertion on #1967 and passed 1/0/0 on #1945, with zero skips in both runs. The fixture only queried eligibility. It never reset a busy allocator or blocked live GPU work. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote the fixture, ran the checks, and drafted this report.@thiagocalile on GitHub · 2026-11-25 16:44 UTC · original
Independent test report for head
4fffef38d1edb0be45b3c51859b0f711e7f85098on an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).Tested
32.0.21045.29003,XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11.XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --lib -- alloc_pool --test-threads=4: 5 passed, 0 failed, 0 ignored (0skipped).Regression run (
scripts/smoke.ps1 -Seconds 60, release builds,XCL_ADAPTER=radeon)main(06c9f55):PR
#1967(4fffef3):Not tested: full workspace test suite on this head, NVIDIA/Intel GPUs, Linux/Wine, or world load past the 60 s smoke window.
AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.
@oni-swr on GitHub · 2026-11-25 18:05 UTC · original
AMD RX 7800 XT run of
4fffef38d1edb0be45b3c51859b0f711e7f85098(PR head, as-is).Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on the head: lib 1161 passed, 4 failed, 26 ignored; every other test binary passed. The newalloc_pool::tests::released_queue_drops_retained_fence_from_statepassed.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1fails (seed 722:res[30] = 0x1, CPU 0x7fffffff); it fails the same way onmainin my run, so it is not caused by this PR. The other three (pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator,recomp::tests::gpu_image_get_resinfo_past_last_level,d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa) pass on current main, so I think they come from the old base (5478c4a): the branch is behind main.origin/main68a284a596bd558b6bd9db6eedda6d6aa178c360locally (clean merge,cargo test -p xcl --lib): 1219 passed, 2 failed, 26 ignored. The 2 failures are the fuzz test above andlower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier; plainmaingives the same 2 (1218 passed). So no regression from this change on this card.Not tested
scripts/smoke.ps1regression run on a real title (no title I can use for a posted smoke block), so the runtime-change requirement is not met by this report.AI use
@upipibi on GitHub · 2026-11-25 19:05 UTC · original · edited 2026-11-25 19:22 UTC
NVIDIA test report for
4fffef3. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, aftercargo build --workspace,cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2:5478c4a): 1217 passed, 2 failed, 46 ignored. The two aregpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translatorandhle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa. Both are stale test expectations thatmainfixed in0d13b071, which this PR's base doesn't have. The PR only touchesalloc_pool.rsandreal.rs, so a rebase ontomainfixes both.mainat569f0fc: 1320 passed, 1 failed, 46 ignored. The one failure isgpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier.mainat569f0fcalone, same machine and command: 1319 passed, 1 failed, 46 ignored, the same test. #2420 (merged 18:45Z) fixed that test onmain;mainat2898511is green. So the merge adds one passing test and no failure.hle::xaudio2, because its tests fail or hang on this machine onmaintoo. SKIPPED lines: 26 in the merged run, the same as onmain.AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.
github-bot referenced this pull request2026-11-26 06:18:30 +00:00
@LocranKing on GitHub · 2026-11-26 04:48 UTC · original
Independent NVIDIA test report on exact head
4fffef38d1edb0be45b3c51859b0f711e7f85098(clean detached checkout, no local changes).Tested
32.0.16.2140/ 621.40), AMD Ryzen 5 5500, 32 GB RAM, Windows 11 Home (build 26300), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), Windows SDK10.0.26100.0.cargo build --workspace+cargo test --workspace --no-fail-fast -- --test-threads=4(debug): 1226 passed, 2 failed, 46 ignored (xcl --lib: 1163 passed, 2 failed, 26 ignored).mainbase (08db802) and pass on currentmain(b49be18):gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator(left: 68, right: 1)hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa(left: 28, right: 85)alloc_pool, integration, ande2etests passed.SKIPPEDGPU tests on this adapter: 20 wave64-only (no wave64), 3 wave32 per-lane f16/f32 semantics, 1no heap windows, 1no d3d12SDKLayers.dll, 1 cannot disable driver cache without Developer Mode (0x887A002D).Regression run
scripts/smoke.ps1 -Seconds 60, release builds oforigin/main(b49be18) and this PR's head (4fffef38):main:
PR:
Not tested
XCL_SAMPLE_*tests; the 60 s smoke run covers boot/intro/menus and does not enter the 3D world.AI use
smoke.ps1commands on this machine and drafted this report from the captured outputs.@bmjask on GitHub · 2026-11-25 21:33 UTC · original · reviewed
P1 queue-address reuse: on_queue_release removes State.fences[queue] but leaves incomplete backing marks keyed by raw queue address. If new queue reuses address before old work completes, executed() creates new fence and b.marks.insert overwrites old incomplete mark, allowing backing reuse while old queue still uses it. Key marks by queue generation/fence identity or retain multiple marks; add release-with-incomplete-submit then same-address-reuse regression. Current test waits completion before release and misses this.
@DavidM1911 on GitHub · 2026-11-26 06:51 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.