Repository navigation
Conversation
|
Rerun on the new head
My first rerun below repeated the module only 5 times at 4 threads, too few to catch what @ivall found. Rerun on
Earlier rerun, on
First run, on Tested: RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug, Graphics Tools (D3D12 debug layer) installed. Not tested: a title with AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch debug-layer check, and wrote this report. |
|
Independent RX 6800M check on exact head Tested
This adds a discrete RDNA2 and older AMD driver to the existing Radeon/NVIDIA checks. I did not run the full workspace suite or a retail-title smoke comparison for this PR, and these focused tests do not cover an in-flight console command list. AI use: OpenAI Codex (GPT-6) ran the checks and prepared this report. |
…#2296, xcl-dev#2297, xcl-dev#2320, xcl-dev#2323, xcl-dev#2329, xcl-dev#2333 Integrates shader heap-base addresses (xcl-dev#1803), fenced superseded texture unmaps (xcl-dev#2270), cross-queue VRAM heap reclamation fencing (xcl-dev#2275, using create_raw_fence under Wine), PcCall frame clamping and orphan PSO drop (xcl-dev#2296), PSO pointer guards (xcl-dev#2297), KickoffX idle spare list switching (xcl-dev#2320, preserving UnadoptGuard), console-list descriptor heap binding (xcl-dev#2323), ClearUnorderedAccessView PC handles (xcl-dev#2329), and dispatch_chain PSO retention (xcl-dev#2333).
af0b667 to
e406771
Compare
|
Thank you @nnonno91, @fromthemoonx, and @luckyteagirl for testing across RTX 5090, RX 7900 XTX / Arc A770, and RX 6800M! Rebased
|
|
By reading only, on With default switches this fallback also reaches Wait-split segments, and after an allocator swap the title's allocator is the wrong key for them.
Fix: register it where it is made, Tested: nothing run. Not tested: whether a retail title hits it. AI use: Claude Code (Claude Opus 5.5) found it, Claude Fable 5.2 checked it; checked by a person before posting. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
e406771 to
02ba2f9
Compare
|
Good catch Updated the branch to
|
…1946, xcl-dev#1803, xcl-dev#2297, xcl-dev#2320, xcl-dev#2333 Carries forward still-open high-value upstream PRs onto upstream/main (2898511) + our updated Wine PR stack (xcl-dev#867, xcl-dev#1395-successor, xcl-dev#871, xcl-dev#877, xcl-dev#1732). Preserves UnadoptGuard in xcl-dev#2320 KickoffX reset_one. Assisted-by: Antigravity (Gemini 4 Neon)
…s) + xcl-dev#2333 list_x Integrates xcl-dev#2384 (shaders read buffers in a GPU view of the title's memory) preserving xcl-dev#877 ensure_lazy_mapped in dev_create_uav_at_x, plus the xcl-dev#2333 Wait-split backing allocator tracking in list_x.rs. Assisted-by: Antigravity (Gemini 4 Neon)
, xcl-dev#2333, and UnadoptGuard test submits Assisted-by: Antigravity (Gemini 4 Neon)
|
Read in full (body, thread, diff) and tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug. The three fixes look right to me. One thing holds the merge: the new test What happens (
Cause
Fix I tried
@Decodere, could you take that line (or forget the address in the test) and rerun your smoke for the new head? Not tested: a title run with this PR; the two fixed cases that the tests do not reach. AI use: Claude Code (Claude Opus 5.5) read the thread and the diff, ran the tests, found the cause and wrote this on the maintainer's behalf. |
…SOs in dispatch_chain Fix four lifetime/bookkeeping issues around `dispatch_chain` and `alloc_pool`: 1. `dispatch_chain::resolve_allocator` previously returned `0` when `alloc_pool::recording_backing(list)` was `None` (untracked / direct PC list or `XCL_ALLOC_SWAP=0`), dropping scratch and retained-PSO cleanup for that list. Fall back to `caller_alloc` (keeping `resolve_allocator` non-zero when `caller_alloc != 0`). 2. `dispatch_chain::dispatch_whole` previously dropped the resolved whole `ID3D12PipelineState` immediately after `SetPipelineState` instead of retaining it against the backing allocator until reset/release, risking use-after-free while GPU execution is in flight. Retain it on `resolve_allocator(list, caller_alloc)`. 3. `list_x::try_split_for_wait` (`None` spare branch) created a fresh mid-list Wait split segment on `pc_alloc = alloc_pool::current(alloc)` without calling `alloc_pool::created_on(p as usize, pc_alloc, ty.0)` (or `real::dispatch_chain::list_reset`), leaving `recording_backing` as `None` after an allocator swap. Register the fresh segment on `pc_alloc` so `resolve_allocator` tracks the swapped backing allocator. 4. `alloc_pool::created_on` used `s.types.entry(raw).or_insert(ty)` instead of `s.types.insert(raw, ty)` (unlike `reset_list`), preserving stale allocator types when a non-adopted test allocator address was reused by a different command-list type. Overwrite with the newly created list's type (`s.types.insert(raw, ty)`). Add unit tests covering `resolve_allocator` / whole-PSO retention and fresh Wait-split segment tracking across an `alloc_pool` swap. Part of xcl-dev#2080 Part of xcl-dev#1452 Assisted-by: Google Antigravity (Gemini 4 Neon)
bmjask
left a comment
There was a problem hiding this comment.
No source-level defect found in the reviewed paths. The untracked-list allocator fallback and retained whole-PSO lifetime both line up with the backing-list registration and allocator-reset release paths, and the tests cover the main fallback/dedup cases. The head is mergeable_state=dirty, so please rebase and refresh CI before merge.
02ba2f9 to
a7b93a8
Compare
|
Thanks for tracking that down! Updated |
…1946, xcl-dev#1803, xcl-dev#2297, xcl-dev#2320, xcl-dev#2333 Carries forward still-open high-value upstream PRs onto upstream/main (2898511) + our updated Wine PR stack (xcl-dev#867, xcl-dev#1395-successor, xcl-dev#871, xcl-dev#877, xcl-dev#1732). Preserves UnadoptGuard in xcl-dev#2320 KickoffX reset_one. Assisted-by: Antigravity (Gemini 4 Neon)
…s) + xcl-dev#2333 list_x Integrates xcl-dev#2384 (shaders read buffers in a GPU view of the title's memory) preserving xcl-dev#877 ensure_lazy_mapped in dev_create_uav_at_x, plus the xcl-dev#2333 Wait-split backing allocator tracking in list_x.rs. Assisted-by: Antigravity (Gemini 4 Neon)
, xcl-dev#2333, and UnadoptGuard test submits Assisted-by: Antigravity (Gemini 4 Neon)
|
Independent Windows/RTX 3080 Ti verification of #2333 head Tested — Windows 11 Pro build 26300, RTX 3080 Ti 12 GB / driver 621.35, Ryzen 7 9800X3D, 32 GB RAM, Rust 1.99.1 MSVC, DXC 1.8.2502.11.
Not tested — paired retail smoke, AI-assisted: Codex (GPT-6, exact variant unavailable) inspected the change, ran the tests, and drafted this report. |
|
Tested
Not tested
AI use
|
A title allocator's backing that is still busy at the title's Reset is put aside, and another takes its place. A put-aside backing was reset only when a later Reset of the same title allocator found the current one busy and took it back; until then it kept what was recorded on it: its command memory and the recordings of split compute dispatches on it (`dispatch_chain::allocator_reset`), with their scratch and, with xcl-dev#2404, each chained ExecuteIndirect's command buffer. At a title Reset, each put-aside backing of that allocator that was used since its last reset and whose GPU work is done is now reset. With xcl-dev#2404 and xcl-dev#2333 on Linux (RTX 4060 Ti, 1 run each), the split recordings held went from 672 to 11,061 under 156 allocators in 100 s of frames; with this change they stayed between 3,316 and 5,563 under 59 to 82 allocators from 120 to 200 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…track With the allocator pool on, `execute_indirect` kept the recording with the PC allocator the list records on (`alloc_pool::recording_backing`). For a list the pool does not track it got 0, so it returned Ok(false) and the ExecuteIndirect ran its whole form. XCL makes such lists itself: a mid-list split's next list is created on `alloc_pool::current(alloc)` with no `created_on`. Under Wine + vkd3d-proton on an RTX 4060 Ti, this branch chained 2 ExecuteIndirects and ran 26-30 whole in three runs of a title, and the title presented nothing after its loading burst. In a fourth run with a log line, all 32 that declined did so for this reason. Such a list is now taken on by the pool, on the PC allocator the title's allocator stands for, which is the one the list was made on (`alloc_pool::recording_backing_or_take_on`), and the recording is kept there. xcl-dev#2333 keeps these recordings with the title's allocator instead (its `resolve_allocator`). The pool then knows nothing of the list, so it can take that allocator for free and release the recordings (scratch and commands buffer) while the list still records or runs on the GPU. Taken on, the list keeps its backing busy until it is reset elsewhere or released, and its submits mark the backing like any other list's. The title's allocator also gets the list's type, so that a Reset while the list holds its backing swaps it like the title's own lists. Reported by @Royalflamejlh (xcl-dev#2404). With xcl-dev#2333 merged under this branch and its fallback in `execute_indirect`, every ExecuteIndirect chained in four runs (22 to 70,341 of them, 0 whole). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e free A chained ExecuteIndirect keeps its slicer scratch and commands buffer with the recording of its PC allocator until that allocator is reset (dispatch_chain::allocator_reset, from reset_pc_allocator) or released. When the title resets an allocator whose recording is still held or on the GPU, alloc_pool puts the PC allocator aside and gives the title another. The one put aside is reset only when the same title allocator is reset again and reuses it, which may never happen. Until then its recordings, and the memory they keep, stay. dhillonjagdeep650-boop found it on an RTX 3080 Ti (xcl-dev#2404): 1,887 recordings under 48 allocators at 110 s, local and non-local memory growing about 150 MB/s, then a device removal at 110.8 s. The allocator log said 119 made and 119 put aside. Every title Reset now also releases the recordings of each PC allocator put aside that nothing holds any more: no list records on it and its submits are done. This happens outside the pool's lock. allocator_reset of an allocator without recordings does nothing, and the allocator is reset as before when it is reused. This relies on every chained recording being filed with the PC allocator its list records on, and on that list being known to the pool (an earlier commit here takes on the lists it had not seen). A recording filed with a title's allocator, as xcl-dev#2333's lines file one, would go when that allocator is free, while its list still records or runs on the GPU elsewhere. The first test fails without the sweep: the free allocator put aside still holds its recordings after another title allocator's Reset. Two more show that a taken-on list's recording stays while the list records on its allocator put aside and while its submit runs, and goes after both; and that a free title allocator put aside does not take a live list's recording with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
…l is put off need_by_submit marked a put-off call's pipeline by_submit and moved it ahead of the workers' queue, but not wanted, and the big-compile gate reads only wanted: until record_deferred reached the call and marked the next four, those builds went through the gate one at a time, behind the background slot. In a retail title's world start on Linux (RTX 4060 Ti, with xcl-dev#2404 and xcl-dev#2333) the put-off builds spent 3,153 s waiting at the gate against 320 s in the driver. Since ae00ec7 wanted builds have a hard cap of their own (XCL_HUGE_PSO_WANTED_CONCURRENCY), so marking them all at once no longer lets an unbounded number skip the commit headroom; the look-ahead window of four in record_deferred, and want/want_bound behind it, go. Found by reading the gate waits of Bench E's runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What is in it
Follow-up to #2080 (
Part of #2088,Part of #1269) fixing four runtime allocator/lifetime bugs acrosscrates/xcl/src/hle/d3d12x/real/dispatch_chain.rs,crates/xcl/src/hle/d3d12x/bind.rs,crates/xcl/src/hle/d3d12x/list_x.rs, andcrates/xcl/src/hle/d3d12x/alloc_pool.rs:alloc_pool: Extractedresolve_allocator(resolve_allocator_with) so whenalloc_pool::enabled()is true andalloc_pool::recording_backing(list)returnsNone(as for console command lists created viadev_create_command_list_xand bundles),dispatch_chainfalls back to the caller'sallocatorinstead of0. Previously, zeroing the allocator forced every console-list split compute dispatch onto the synchronous unsplitchain.whole()fallback.alloc_poolbacking: Inlist_x::split, when no idle spare exists and a fresh segment is created onpc_alloc = alloc_pool::current(alloc), callalloc_pool::created_on(p as usize, pc_alloc, ty.0)(andreal::dispatch_chain::list_reset(p as usize)). Previously, leaving the new segment unregistered causedresolve_allocatorto fall back to the title allocatorAafter an allocator swap (current(A) == B), so a later titleReset()reusingAwould calldispatch_chain::allocator_reset(A)and drop scratch/retained PSOs while the split segment onBwas still alive (caught by@pvfreis).Arc<Chain>(and its boundwholePSO) untilallocator_reset: ChangedRecording::{scratch, first}toOption<Arc<Scratch>>/Option<ID3D12PipelineState>, updateddispatch_chain::whole(list, pso, allocator)(and itsbind.rsExecuteIndirectcallsite), and addedretain_whole(allocator, chain)on both thedispatch()wholefallback andExecuteIndirect'swhole()path. Wheneverallocator != 0,Arc<Chain>is retained inRECORDINGS[allocator](deduplicated per allocator, dropping any duplicateArc<Chain>outsideRECORDINGS.lock()) soforget(pso)while the command list is still in flight does not destroy the boundwholeID3D12PipelineStatebeforeallocator_reset(allocator).alloc_pool::created_on: Changeds.types.entry(raw).or_insert(ty)tos.types.insert(raw, ty)(matchingreset_list), so recycling a non-adopted test allocator address under a different command-list type does not keep a stale allocator type across parallel tests (caught by@ivall).(Rebased onto
origin/main6d12f58a.)Tested
whole_fallback_retains_chain_until_allocator_reset_preflight: confirmed unmodifieddispatch()wholefallback failed (0 passed; 1 failed—Chainand itswholePSO dropped immediately onforget(pso)).wait_split_fresh_segment_tracks_swapped_backing_allocator(WARP, beforecreated_on): failed0 passed; 1 failed(recording_backing_for_test(seg1)wasNoneinstead ofSome(pc_alloc_b)).--release -- --test-threads=1 --nocapture, commita7b93a85):hle::d3d12x::real::dispatch_chain::tests:4 passed, 0 failed, 0 ignored(0skipped) on both RTX 4060 (0.41 s) and WARP (0.40 s), includinga_list_recorded_after_another_goes_on_in_its_scratch.hle::d3d12x::list_x::tests::wait_split_fresh_segment_tracks_swapped_backing_allocator:1 passed, 0 failed, 0 ignored(0skipped) on both RTX 4060 (0.23 s) and WARP (0.23 s), verifying a realalloc_poolswapA -> B, fresh mid-list split segment tracking onB,resolve_allocatorreturningB, and reuse/reset ofAleavingseg1keyed toB.cargo test --release -p xcl --lib -- dispatch_chain list_x::tests alloc_pool --test-threads=8): 20 consecutive runs,0/20failures (57 passed, 0 failedper run).cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocaptureon RTX 4060):37test binaries,1426 passed, 0 failed, 46 ignored(29pre-existing hardware/debug-layerSKIPPED:21no wave64,3wave32 per-lanerefused,3missing D3D12 debug layer,1driver cache toggle,1no heap windows;0skipped in our tests).Regression run
Paired 60 s
scripts/smoke.ps1runs on the same RTX 4060 host againstorigin/main(889ef3e8aa7f267323ab4879e735e65da6bcef10) and PR head (a7b93a853ec56621bdef65a695cd858094878bfe):Baseline (
origin/main):PR head:
Not tested
XCL_CONSOLE_LISTS=1or D3D12 debug-layer execution (d3d12SDKLayers.dllis not installed on this host; allocator fallback, Wait-splitalloc_poolregistration, andwholePSO lifetime retention are verified directly by the unit/D3D12 tests).AI use
Implemented and verified with Google Antigravity (Gemini 4 Neon).
Part of #2088
Part of #1269