D3D12.X: drop alloc_pool fences on queue release and skip real::FENCES #1935
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1945"
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 Decodere on 2026-11-24T23:46:31Z.
Stops allocator-pool internal fences from leaking with
Refcount: 2across released command queues.Two compounding paths kept every fence created in
alloc_pool::executedalive after its command queue hit finalRelease:d.CreateFenceon the adopted title device went throughreal::dev_create_fence, which permanentlyAddRefd the fence intoreal::FENCES(alloc_poolonly signals and polls these internal fences and never waits on them, soend_titledoes not need them).alloc_pool::State.fences(andState.last_submit, added in #2163) kept the per-queueID3D12Fenceafter queue release becausereal::q_releasenever notifiedalloc_poolwhen a queue's refcount reached zero.Fixes #1909
What is in it
crates/xcl/src/hle/d3d12x/real.rs: addcreate_pc_fencecalling the nativeCreateFenceslot viaorig_fnon adopted devices (falling back todev.CreateFenceon unhooked test devices), notifyalloc_pool::forget_queueinq_releasewhenn == 0, and exposeis_fenceaspub(super)for testing.crates/xcl/src/hle/d3d12x/alloc_pool.rs: usereal::create_pc_fenceinexecuted, addforget_queueto removeState.fences, prune completedBacking.marks(moving still-pending GPU marks toBacking.retiredso queue-address reuse cannot overwrite in-flight work before completion), and prune completedState.last_submitentries for the released queue (clearinglast.queue = 0on still-in-flight entries so queue-address reuse cannot reportsame_queueinnote_resubmits, and reaping orphaned completed entries on subsequent releases). Clearretiredon backing reuse intitle_reset_in, drop removed/replaced fences outsideSTATE.lock()inforget_list,forget_queue, andexecuted, clean up the unadopted list and queue ina_recording_outlives_the_reset_of_the_titles_allocatorviaforget_list/forget_queuebefore dropping them so recycled addresses do not inherit stale state across tests, and add CPU (AtomicU64/AtomicU32fake COM fence) and GPU regression tests (forget_queue_prunes_completed_and_preserves_pending_across_address_reuseandreleased_queue_frees_alloc_pool_fence_and_skips_title_fences).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5; release build.released_queue_frees_alloc_pool_fence_and_skips_title_fencesfails independently withoutcreate_pc_fence(fence registered inreal::FENCES) and withoutq_release→alloc_pool::forget_queue(State.fencesandState.last_submitretain released queue's fence), and reproduced the deterministicleft: 4, right: 1test-order failure under--test-threads=1before addingforget_queuecleanup toa_recording_outlives_the_reset_of_the_titles_allocator.cargo test --release -p xcl --lib hle::d3d12x::alloc_pool::tests:-- --test-threads=1 --nocapture(3 consecutive runs, RTX 4060): 6 passed, 0 failed, 0 ignored each run.-- --test-threads=4 --nocapture(RTX 4060): 6 passed, 0 failed, 0 ignored.XCL_ADAPTER="Microsoft Basic Render Driver"-- --test-threads=1 --nocapture(WARP): 6 passed, 0 failed, 0 ignored.cargo build --release --workspace+cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1243 passed, 2 pre-existing failures on parent96331383(fixed onmainimmediately after in #2245:gpu::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), 46 ignored across 23 test binaries.SKIPPEDlines on stderr (27 total):no wave64(gpu::recomp::lower::tests(4),gpu::recomp::lower_dxil::tests(14),gpu::recomp::tests(2))#1426refusals (gpu::recomp::lower_dxil::tests:f16_programs_on_the_gpu(2),f32_programs_on_the_gpu(1))shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(cannot disable driver cache without Windows Developer Mode)heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)test_title_draws_with_a_root_signature_under_the_debug_layer,uploads_start_from_each_subresources_state: nod3d12SDKLayers.dll)Regression run
main:
this PR:
Not tested
d3d12SDKLayers.dllis not installed on this machine), debug-profile full workspace test run, or stacked on top of open#1691's queue-retention fix across multi-cycle synthetic copy workloads; the smoke run above is a regression check only.AI use
State.last_submitrebase integration, wrote the fix, CPU/GPU regression tests, and this description, and ran the workspace test suite and paired smoke runs on the hardware listed above.Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-24T23:55:03Z.
Independent validation — PASS
Tested exact commit
907cf34cc587eb74c763ce87de4911c55037cbf1on my RTX 3090, driver 621.01, Windows 26H1.I also checked three-way merge compatibility with #1691 (
81f6397). The only reported content conflict is inreal.rs, insideq_release().When integrating both PRs, allocator-pool cleanup needs to be preserved on both final-release paths introduced by #1691.
I have a prepared three-cycle synthetic workload with D3D12 live-object reporting that can validate the combined fix once this integration is resolved.
Thanks for addressing #1909!
AI assistance: ChatGPT (GPT-6.2). Synthetic tests only.
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T23:57:11Z.
Full-suite run, since this PR has no test report yet. Tested exact head
907cf34(on its base20cf130).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: 968 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.forget_queue_prunes_completed_and_preserves_pending_across_address_reuse,released_queue_frees_alloc_pool_fence_and_skips_title_fences.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 977 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
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T23:57:20Z.
Heads-up from reading the diff (not run):
alloc_pool::forget_queuegoes in theif n == 0branch ofq_release. #1819 and #1899 put their hooks on that same line, so the four PRs conflict there (git merge-treeof this head907cf34with each of #1691, #1819 and #1899 reports a conflict).The other point is when that branch runs. On
main,presentkeeps a reference to every queue the title submitted to (#1668), so a queue the title submitted to rarely gets ton == 0, andforget_queuewould rarely run until #1691 is in. #1691 adds a second path,n == 1 && present::forget_queue(this), which releases again and callslist_x::on_queue_releasewhen the count reaches 0. A hook only in the first branch misses that path. Details are in https://github.com/xcl-dev/xcl/pull/1899#issuecomment-7146729916. A single per-queue cleanup function, called from both places wherenreaches 0, would let these PRs merge in any order.AI-assisted (Claude Code).
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:54:20Z.
Code review on
907cf34:forget_queue+Backing.retired+create_pc_fence(crates/xcl/src/hle/d3d12x/alloc_pool.rs,real.rs) cleanly handles queue address reuse while marks are still in flight and keeps internal tracking fences out ofreal::FENCES, with strong unit and GPU test coverage (forget_queue_prunes_completed_and_preserves_pending_across_address_reuse,released_queue_frees_alloc_pool_fence_and_skips_title_fences).CIworkflow approved (running). Note#1967touches the sameq_releasehook.Remaining before merge:
Build and testfinishing green plus AMD verification on907cf34.Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T02:04:11Z.
CI update on
907cf34:Build and test (Windows, no GPU)failed inhle::d3d12x::alloc_pool::tests::released_queue_frees_alloc_pool_fence_and_skips_title_fencesatcrates/xcl/src/hle/d3d12x/alloc_pool.rs:646(left: 4, right: 1on the no-GPU/WARP runner — likely WARP retaining internal fence references across queue/command work before device destruction).@upipibi's point above aboutq_release'spresent::forget_queue(this)branch (n == 1) if#1691lands alongside this.Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T02:14:11Z.
@raylitebull Found and fixed the exact cause of the
Build and testfailure (alloc_pool.rs:646:left: 4, right: 1) and rebased cleanly ontomain(3da2abb8) atf5810578:signaled == 4vs1): Under--test-threads=1(as on CI),a_recording_outlives_the_reset_of_the_titles_allocatorran earlier withoutreal::adopt(dev), calledexecuted(queue, ...)3 times, and droppedqueuewithout going throughq_release, leaving(q_key -> (fence, 3))inSTATE.fences. Whenreleased_queue_frees_alloc_pool_fence_and_skips_title_fencesthen created a queue at the recycled pointerq_key,executedincremented3 -> 4(rather than WARP retaining a fence ref).forget_queue(queue.as_raw() as usize);beforedrop(queue);ina_recording_outlives_the_reset_of_the_titles_allocatorand added defensiveforget_queue(q_key)/forget_queue(q2_key)guards inreleased_queue_frees_alloc_pool_fence_and_skips_title_fences; runtime code inalloc_pool.rsandreal.rsis unchanged from907cf34.left: 4, right: 1deterministically under--test-threads=1; after the fix,hle::d3d12x::alloc_pool::testspassed5/5x3 under--test-threads=1(RTX 4060),5/5parallel (RTX 4060), and5/5under--test-threads=1on WARP (XCL_ADAPTER="Microsoft Basic Render Driver"), plus full workspace1,113 passed, 0 failed, 46 ignoredand paired 60 sscripts/smoke.ps1(1,582 -> 1,547frames,0crashes/removals).#1691/#1967note: Checked livemain(#1691is still open sopresent::forget_queue(this)is not inq_releaseyet); if#1691merges first, we will rebase immediately so both paths stay intact on final queue release. (Notefuturepro62also verified the identical runtime fix on AMD Radeon iGPU in#issuecomment-7147975903.)Ready for CI re-run!
AI use: Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-25T02:38:55Z.
Independent validation of
f5810578ae1da2a34808ea6c75373cc9e5b36050on RTX 3090 / Windows.--test-threads=1: 15/15 passed.--test-threads=5: 15/15 passed.Total: 35/35 passed.
The exact upstream revision was tested without source modifications.
The updated test cleanup appears stable in these runs. However, passing repeated tests does not establish the absence of data races or resolve the separate
Cell<u64>synchronization concern.Testing and report analysis assisted by ChatGPT (GPT-6.2).
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T02:50:31Z.
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!
Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-25T04:36:06Z.
Follow-up validation for #1909.
I tested the updated PR revision
f581057, both independently and combined with #1691 (81f6397), against maincbc296ab.Results:
The additional cross-PR tests exercised submit tracking and allocator-pool cleanup on the same command queue, with and without an outstanding reader reference.
Verified behavior includes:
real::FENCES.Backing.retired.Pending completion was modeled using a native D3D12 fence with CPU signaling, rather than deliberately blocking outstanding GPU work.
Integration note: #1691 and #1945 conflict in
real.rs::q_release. Moving the final-zero cleanup after #1691's tracking-reference removal preserves both fixes. The resulting combined tree (81f0dbb) passed all the above checks.The retail-title crash remains present on main, both individual PRs, and the combined build. This should be investigated separately and does not invalidate the allocator lifecycle test results.
AI assistance: ChatGPT (GPT-6.2). All reported builds and tests were executed on actual Windows hardware.
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T06:26:32Z.
Update, merged with
main:ace754cmerged--no-ffontomain08db802(merge commit0548a52, clean), same card and settings:cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4: 1302 passed, 0 failed, 27 ignored (the same 25SKIPPEDlines asmain);cargo test -p xcl --lib -- hle::d3d12x --test-threads=4, 3 runs: 256 passed, 0 failed each time. This is the merge, not the head:ace754con its own base still fails the two base tests below until it is rebased.Update, head
ace754c(on base9633138; RTX 3070, driver 616.56, Windows 11, debug,--skip hle::xaudio2):cargo test -p xcl --lib -- --test-threads=4: 1165 passed, 2 failed, 26 ignored:hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa("format 85 kept", left 28, right 85) andgpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator.cargo test -p xcl --lib -- hle::d3d12x --test-threads=4, 3 runs: 207 passed, 1 failed each time (thepc_resource_desc_…test).9633138alone, and this PR touches neither file (alloc_pool.rs,real.rsonly).mainhas since changeddevice_x.rsandpso.rs; onmain08db802the full suite passes (1295 passed, 0 failed) and thehle::d3d12xfilter passed in 2 of 3 runs, with an unrelateda_dispatch_with_a_pipeline_still_building_waits_at_the_submitfailure once. So the two failures belong to the base; a rebase ontomainshould clear them. I haven't run the rebased branch.Test report at the current head
f581057: RTX 3070 (Ampere, driver 616.56), Windows 11, debug.cargo test -p xcl --lib -- hle::d3d12x --test-threads=4, 3 runs: 166 passed, 0 failed each time.main6ea813awith the same command, alternated with these runs: 177 passed, 0 failed each time.cargo test -p xcl --lib -- --test-threads=4run ended in a device hang (0x887a0006) right after aWait64BitValueXwas bridged to a GPU queue wait. That is the fence area this PR changes, but it didn't come back in the 3 targeted runs above, so I can't attribute it to the PR.XCL_DIRECT_DXIL=1 ... gpu_: 125 passed, 2 failed. Both come from the PR's older base:gpu_fmt_encode_int_sat_and_f16_rtzis fixed onmainby #2043, andgpu_image_get_resinfo_1d_arrayalso fails onmain(#2046).AI-assisted (Claude Code). Synthetic tests only.
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T11:28:44Z.
Rebased onto
96331383(clean againstmain426a5a74) ->ace754ce:alloc_pool.rsconflict with #2163 (State.last_submit/note_resubmits):forget_queuenow also prunes completedState.last_submitentries for the released queue (and completed orphaned entries), zeroeslast.queue = 0on still-in-flight entries so queue-address reuse cannot reportsame_queue, and drops all removed/replaced COM fence handles outsideSTATE.lock().alloc_pool::tests(6/6x3--test-threads=1,6/6--test-threads=4,6/6WARP) and paired 60 s RTX 4060 smoke (1526 -> 1530frames,0removals/crashes,14482 -> 14468 MB).AI use: rebased, tested, and drafted with Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T11:42:23Z.
Independent Windows run on ace754c. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, debug.
cargo build --offline --locked --workspacepassed on the exact revision.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapturereported 1,243 passed, 2 failed, 46 ignored. Both failures were the stale assertions fixed by #2245. With this revision merged locally into 426a5a7, the same commands reported 1,245 passed, 0 failed, 46 ignored. Each run had 25 runtime skips included in Cargo's pass count.I reran the simulated queue-key reuse check with native D3D12 fences. Releasing the old key left its old list marked in flight and cleared the queue identity from that submission. Finishing the newer native submission kept both the older list in flight and the backing busy. Signaling the old fence cleared both conditions, and the next queue cleanup removed the old submission record. No live work was blocked and no allocator was reset.
On the exact revision,
cargo test --offline --locked -p xcl --lib released_queue_key_reuse_keeps_the_older_pending_fence -- --test-threads=1 --nocapturepassed 1/0/0 with zero skips. Earlier side-by-side check on #1967.Synthetic coverage only. AI-assisted. Codex (GPT-6, exact variant unavailable) extended the fixture, ran the tests, and drafted this report.
Imported from ivall/xcl. Originally posted by CalvyPZ on 2026-11-25T22:44:04Z.
This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T22:52:03Z.
@CalvyPZCould you please reopen#1945? (GitHub returnsHTTP 422when a non-collaborator PR author attempts to reopen a PR closed by a collaborator.)#1607groupD72(#1945and#1967) were closed in the22:44Zsweep, leaving#1909open with no active PR.#1607's ownD72row is rateddifferent approachesacross all 4 checks (oni-swr,upipibi,iggyvilla,safesearch77), and#1909's comparison (JJAutoCompare) explicitly recommended advancing#1945over#1967(ace754cecreates internal allocator-pool fences via the native slot outsidereal::FENCES, preserves still-pending marks inBacking::retiredacross queue-address reuse, and prunesState::last_submit).#1945(ace754ce) isMERGEABLE/CLEANwith green CI and independent RTX 3080 Ti verification (thehollowedone).Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-26T05:51:16Z.
NVIDIA and AMD full-suite run of head
ace754ce, on its own base9633138and merged with currentmainb49be183, to go with the reports above by thehollowedone, upipibi, since none of them covers AMD. On its base, the 3 failures come from changes made onmainafter that base (#2245 andea088a5); merged withmain, both cards pass. The bare-head runs come first.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::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1163 passed, 2 failed, 24 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.gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator,hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa. (stale on this base, fixed onmainby #2245; see the merged run below)forget_queue_prunes_completed_and_preserves_pending_across_address_reuse,released_queue_frees_alloc_pool_fence_and_skips_title_fences.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1172 passed, 3 failed, 26 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))).--skipleaves out tests that fail on mainb49be183too, 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,const_and_null_mask_operands_agree_with_hlsl_on_the_gpuandmask_ff0_and_flbit_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.rerouted_disk_entries_follow_the_direct_translator(#2245),gpu_image_get_resinfo_past_last_level(ea088a5),pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa(#2245).mainb49be183(git merge --no-ff, clean, local only): NVIDIAXCL_REQUIRE_GPU=mesh cargo test --workspacewith the same skips: 1425 passed, 0 failed, 45 ignored; AMD Radeon iGPU (XCL_ADAPTER=radeon, same skips): 1436 passed, 0 failed, 47 ignored.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:41:24Z.
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 throny on 2026-11-27T19:24:31Z.
merge-check claim
head:
ace754ce63Imported from ivall/xcl. Originally posted by throny on 2026-11-27T19:43:49Z.
merge-check
base:
6089122ahead:
ace754ce63merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1467 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1465 passed, 0 failed, 47 ignored
review: one blocking finding: allocator_in_flight (alloc_pool.rs, unchanged by this PR) looks at a backing's marks only, not at the new retired list. After forget_queue moves a still-pending mark to retired, list_x can see the allocator as idle and reset or drop a PC allocator the GPU is still using; before this PR the mark stayed in marks. Backing::free() does check retired. Otherwise fine: fences are released outside STATE, the hand-written test fence is test-only and its reference counts add up, and the tests would not pass without the change. Open from earlier: forget_queue hooks only the last-release branch of q_release.
performance: one small Vec push and a usually empty scan per ExecuteCommandLists (reasoned).
verdict: not yet: allocator_in_flight must also count retired (with a test); I will rerun the suite on the new head.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-27T20:11:31Z.
I prepared a candidate fix for the allocator query following the merge check. It applies to this PR after merging main
6089122a1c96into headace754ce635c. The query is present on the merged source. The candidate uses one pending-fence predicate for both backing reuse and allocator activity, while only backing reuse checks whether a list still owns its recording.Tested
On Windows 11 (Core i7-13700), a CPU-only Python model checked 50 combinations of live marks, retired marks and recording ownership, plus four allocator lookup cases. I checked the candidate source against those predicates and ran
git diff --check. The existing mock-fence Rust test now checks the allocator query after queue release, after queue-address reuse, and after completion.Not tested
This machine has no configured Rust toolchain. The candidate is awaiting a native run of
cargo test -p xcl --lib forget_queue_prunes_completed_and_preserves_pending_across_address_reuse. No Rust build, GPU run or retail smoke was performed here.OpenAI Codex (GPT-6) prepared the patch and ran the model checks.
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T00:18:45Z.
merge-check claim
head:
ace754ce63Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T01:10:48Z.
merge-check
base:
2c717a043chead:
ace754ce63merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1468 passed, 0 failed, 47 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: none. The suite ran on this PC at the same time as 5 other PRs' suites, in one queued job.
review: none. Whole diff read (alloc_pool.rs: Backing.retired, forget_list, forget_queue, executed, note_resubmits, title_reset_in + 3 tests; real.rs create_pc_fence, q_release, is_fence). Pending marks of a released queue move to retired and keep the backing busy until the GPU passes them; fences are released outside STATE's lock; the internal per-queue fence is created through the original CreateFence, so it is not adopted or added to FENCES. Note: #1967 changes the same q_release line and also adds queue-release cleanup to alloc_pool.rs; the two conflict.
performance: reasoned, not measured: executed() (per ExecuteCommandLists) also polls the backing's retired list, normally empty; the rest runs on queue release only.
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 6f619f83851af02f38151d294993eb4e10b097a9 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T03:11:42Z.
Follow-up to the allocator-query candidate: it covers the reported case where a queue is fully cleaned up before its address is reused. I found a separate interleaving that its test does not cover.
In
q_release, nativeReleasereturns zero beforeforget_queueremoves the old address-keyed fence. If another thread creates a queue at that address and submits before cleanup,executedcan signal the old fence on the new queue. That can make pending work on the old queue appear complete; a submission using the same backing can also replace its pending mark. The delayed cleanup can then remove the new queue's state. This requires concurrent address reuse; I have traced the source path, not observed it on a GPU.A focused regression could pause A after native
Releasereturns zero, adopt and submit B at A's address, then resume A's cleanup. B must use a fresh fence, its state must survive A's cleanup, and A's allocator must remain busy until A's own fence completes. The smallest safe fix appears to be a generation for each adopted queue, with retirement of the old generation before publishing the new one and release cleanup conditional on the generation captured before nativeRelease. The address-keyed state inlist_xalso needs the same ordering. Holding a global lock across nativeReleaserisks reentrant COM release, so I would avoid that shortcut.AI use: Codex (GPT-6.2 Sol and GPT-6.2 Astra) traced the source and drafted this review. No build or runtime test was run for this interleaving.
Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-28T04:25:39Z.
Following up on the queue lifetime feedback with a candidate for current main. It is based on
e429936c. The earlierebb00b11candidate now conflicts inalloc_pool.rsandreal.rs.The candidate uses main’s retirement worker to clear the allocator and command-list caches while it still holds a reference to the queue. It registers PC-created queues before returning them to the caller. After the native reference count reaches zero, release can remove only the lease it captured for that queue. The regular submission marker, receipt marker and retirement marker use Decodere’s private fence constructor from this PR.
I checked eight source properties against main, including the release routing, cleanup order, marker identity check and title-fence registry. Five edited Rust files had no additional tree-sitter diagnostics, and
git diff --checkpassed. I extended the lease unit test and added GPU tests for ownership before the first submission and for private fence registration. I could not build or run the Rust tests on this host. Native Windows verification of the candidate, including GPU and retail coverage, is still pending.AI use — OpenAI Codex (GPT-6) prepared the port, tests and source checks.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:08:57Z.
Triage (#1607) – head
ace754cPart of this PR is now on main. Commit
4a4c5f7baddedalloc_pool::forget_queue, whichpresent::invalidate_queue_cachescalls once a released queue's retirement mark completes. It dropsState.fences, the backingmarksand thelast_submitentries.So the
forget_queue/retired/q_releasepart here repeats main and conflicts with it.The
real::create_pc_fencepart is not on main and is still needed for #1909. On main, alloc_pool's internal fences are still made throughdev_create_fence, which AddRefs them and records them inFENCES, so they are never freed. That is theRefcount: 2reported in #1909.#1967 makes the same queue-release change, smaller.
Recommendation: keep open (rebase down to the
create_pc_fencechange).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.