D3D12.X: late release seals and waits only when nothing is in flight #1250
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!1250
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1250"
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?
@duudiis on GitHub · 2026-11-24 13:44 UTC · original
duudiis:pr/late-release-cheap→main· +113 −15 · 1 files · 1 commits · openLate release (#866) gets cheaper on the title's threads. A resource's last
Release(hold) calleddrain_known(true)every time. That signalled every known queue (about 10) and then busy-spun up to 300 µs (IDLE_WAIT) on the title's thread. While the GPU has frames in flight, the spin always ran to its end, because a value signalled now is passed only after the work already queued. Every submit (note_execute→drain_known(false)) also cloned every queue and drained, whether anything was due or not. A retail game releases many resources while it loads.holdcloses a batch of its own and waits only when no work is known in flight: the queues are past the newest sealed batch, or nothing is sealed. In that case it behaves as before: a title that frees the memory under a resource right after its lastReleasefinds the resource released. With work in flight, the resource could not have gone withinIDLE_WAITanyway. It joins the open batch, which is closed everySEAL_EVERY, and the late-release thread lets it go, as it did after the wait.drain_knownfirst checks cheaply whether anything is due, before it takes any queue. It checks the front sealed batch's marks (GetCompletedValue) and whether an open batch is ready to close.This touches the same lines of
holdas #1070 (hold(res, memory),Dead). The two changes are independent, but whichever is merged second needs a small rebase.What is in it
D3D12.X: late release seals and waits only when nothing is in flight:Held::due,Held::in_flight,Held::admit,Batch::passed, the newholdand the check at the top ofdrain_known, and two tests (crates/xcl/src/hle/d3d12x/late_release.rs)Tested
cargo build --workspace --release: okcargo test --workspace --release -- --test-threads=4: 751 passed, 0 failed, 41 ignoredSKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64a_drain_is_due_only_when_a_batch_can_go_or_be_closedcovers when a drain is due: nothing held, an open batch never closed, closed just now,seal_now, and a batch with no marks.a_resource_held_with_work_in_flight_does_not_close_a_batch_of_its_ownuses a queue held on a fence: a resource held behind it reports work in flight and closes no batch of its own, and both batches go in order once the queue is let go.Regression run
main (b8b1f49`):This PR (
a235703):Both runs reach the loading screen; neither reaches the world, so they are a regression check, not a measurement of the gain.`
Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 14:02 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
@ExoCalibra on GitHub · 2026-11-24 15:58 UTC · original
Tested exact head
a235703(clean merge ontomain930e8b4).Tested
610.88(32.0.16.1088), Ryzen 7 7800X3D, 63.1 GB RAM, Windows 11 Pro10.0.26200,rustc 1.100.0, DXC1.8.2502.11..\scripts\test.ps1(debug): 751 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware. New tests passed:a_drain_is_due_only_when_a_batch_can_go_or_be_closed,a_resource_held_with_work_in_flight_does_not_close_a_batch_of_its_own.cargo build --release -p xcl+ 60 sscripts/smoke.ps1(XCL_NETWORK=0; local VRAM6155 MBvs6154 MBonmain, target pages3577 MBvs3578 MB):main(930e8b4):PR
#1250(a235703):Notes
late_release.rschecks out (HELDdropped before queue snapshot and COMRelease).drain_known(small rebase for whichever merges second);due()avoids touchingvram::queues()on submits when nothing is due.Not tested
AI use
@thehollowedone on GitHub · 2026-11-24 13:49 UTC · original · edited 2026-11-25 09:33 UTC
Independent two-queue check on
a235703, Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug.I exercised the late-release batch logic with native D3D12 direct and copy queues, two batches, and separate gate fences. Completing both marks on the direct queue retired neither batch while the copy queue was blocked. Completing the first copy mark retired only the first batch, while the second stayed in flight. Completing the second mark retired the second batch. A second admission while both queues were blocked was classified as in flight, and the batch sealed on the periodic drain.
All five focused tests passed with no skips, including this scratch fixture. It checks batch eligibility and order with real fences and synthetic resource IDs. CPU release latency and retail behavior were outside this run. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch fixture and drafted this report.
Full workspace follow-up on a235703. Clean detached checkout, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Windows 11 build 26300, 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 751 passed, 0 failed, 41 ignored. Cargo’s pass count includes two native-wave64 runtime skips. All four stock late-release tests passed. No retail run. AI use: Codex (GPT-6, exact variant unspecified) ran the suite and drafted this update.@oni-swr on GitHub · 2026-11-25 18:54 UTC · original
AMD RDNA3 full-suite run on exact head
a235703(a23570302a229a1b3b99d6e305af0aa1bea72e66), merged ontomain3f27770(clean merge, local detached merge commit, nothing pushed).Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on the merged tree: 1357 passed, 2 failed, 46 ignored.late_release::tests::a_drain_is_due_only_when_a_batch_can_go_or_be_closedanda_resource_held_with_work_in_flight_does_not_close_a_batch_of_its_ownpassed.maintoo:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1andgpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier.main3f27770alone, same command and machine: 1352 passed, 5 failed, 46 ignored. The 3 extra baseline failures (title_textures::placed_title_textures_share_vram_and_preserve_pixels,title_textures::transitions_apply_when_their_list_is_submitted,vram::d32s8_targets_take_their_own_size_of_video_memory) passed in this run; I did not rerun the baseline, so I can't say if they are flaky or load-dependent.main):f16_programs_on_the_gpuandf32_programs_on_the_gpu(refusals for unsupported V_*_F16 forms),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Not tested
scripts/smoke.ps1/ the regression run, any retail title, a release build, other GPUs. A single run, not repeated.AI use
@ClosetPie107 on GitHub · 2026-11-25 19:54 UTC · original
Independent AMD RDNA4 / Linux (RADV, native wave64) test report for head
a23570302a229a1b3b99d6e305af0aa1bea72e66(merged cleanly ontomain2898511).Hardware & environment
experimental-11.0-20261112),vkd3d-protonmasterec207194(3.2.0) +dxil-spirvb540c8a2+ relaxed-vtable patch (-Db_ndebug=true), DXVKv3.1.1-209, DXC1.9.2609.5, Rustx86_64-pc-windows-gnu(debug for tests, release for retail)Unit / GPU tests (
XCL_REQUIRE_GPU=wave64,XCL_DXC_DIR,VKD3D_CONFIG=ignore_shared_fence,--test-threads=1 --nocapture)hle::d3d12x::late_release: 4 passed, 0 failed, 0 ignored (0 skipped)Combined retail sanity run (
main2898511+#2103,#838,#1250,#1733merged together;XCL_DIRECT_DXIL=1,XCL_TEXTURE_LEVEL_PAGES=1,XCL_PSO_WAIT_MS=50,XCL_SPLIT_MIDLIST_WAIT=0,XCL_COHERENT_MB=1024,VKD3D_CONFIG=ignore_shared_fence,XCL_PSO_PRELOAD=0,XCL_NETWORK=0, warm PSO cache)45,841translated draws,154,125dispatches (+4,634chained split-compute),47,255Opus packets (0 errors),13.2 GiBpeak VRAM (0 GTT spill),15.1 GiBpeak RSS (vs19.3 GiBon cleanmain2898511).268.4 son the same pre-existingmain0xc0000005TOCTOU race intitle_textures::subresources(copy_nonoverlappingreading0x793a08000) also reproduced on cleanmain2898511(161.8 s).Not tested
AI use
main, ran the tests and combined retail run under Proton on this machine, and drafted this report.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.