Repository navigation
Conversation
A last Release (`hold`) called `drain_known(true)` each time: it Signalled every known queue (about 10) and then spun up to 300 us (`IDLE_WAIT`) on the title's thread, and while the GPU has frames in flight the spin always ran to its end. Each submit (`note_execute`) also cloned every queue and took their locks to drain, due or not. A retail game releases many resources while it loads. - `hold` closes a batch of its own and waits only when no work is known in flight (the queues past the newest sealed batch, or none sealed). Then it is as before: a title that frees the memory under a resource right after its last Release (an imported heap pins the pages under its resources) finds it released. With work in flight the resource could not go within the wait anyway (a value signalled now is passed after that batch's), so it joins the open batch, closed every SEAL_EVERY, and the thread here lets it go, as it did after the wait. - `drain_known` first asks whether anything is due (the front sealed batch's marks, GetCompletedValue; or an open batch to close) before it takes any queue. Assisted-by: Claude Code (Claude Opus 5.5)
|
Independent two-queue check on 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.
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
…all#1248, ivall#1250, ivall#1265, ivall#1273, ivall#1277, ivall#1278 Fix sudden RAM OOM during world loading under XCL_PSO_WAIT_MS and integrate 6 new upstream PRs: - pso_async.rs: track active waiters via WantGuard so build_is_wanted() drops back to false once resolve_within times out, preventing all background workers from bypassing BIG_COMPILES and commit-memory guards simultaneously (adds unit test a_timed_out_bind_clears_wanted_demand). - ivall#1248: pack <= 4 KiB sampled textures into 4 KiB heap slots instead of 64 KiB tiles (~768 MiB VRAM saved). - ivall#1250: late_release seals/waits only when nothing is in flight. - ivall#1265: default SRVs of multisampled depth buffers use Texture2DMS/Texture2DMSArray. - ivall#1273: skip budgeted bind waits when all workers are busy / build is queued behind others. - ivall#1277: exit sparse::upload_dirty cleanly if staging ring fence wait times out. - ivall#1278: isolate >= 4 MiB DXIL compute driver compiles in a dedicated GIANT_COMPILES queue. Assisted-by: Antigravity (Google DeepMind)
|
Tested exact head Tested
PR Notes
Not tested
AI use
|
Late 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