D3D12.X: hand the title reserved textures with live page tables #3553
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3553"
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 lucsoft on 2026-11-30T23:49:08Z.
On amdgpu (Linux, RADV) a title can fault the GPU on a reserved texture XCL has just created for one of its placements: the GPU reads it through work submitted before the texture existed, and the kernel has not mapped it yet. This hands the title reserved textures whose page tables already exist, and makes the rare new one wait for its mapping. It is on by default only under Wine on an AMD GPU, where the problem exists;
XCL_LIVE_RESERVED=1/0forces it either way.What is in it
vm->delayed). Every unmap, and every sparse rebind (REPLACEputs the old range onvm->freed), first waits for all of the VM's submitted work (amdgpu_vm_clear_freed,AMDGPU_SYNC_EQ_OWNER). A new submit waits forvm->last_update, but work already submitted does not. So while a long frame runs, a reserved texture created after that frame was submitted has no PTEs at all, not even the PRT ones fromvkCreateImage. When the title writes its descriptor into memory that the already-submitted work reads (fine on the console), the read faults:[gfxhub] page fault … client TCP,PERMISSION_FAULTS 0x3, thenDXGI_ERROR_DEVICE_REMOVED. Shown withRADV_DEBUG=bo_history, the kernel log on the same clock and a devcoredump: the faulting virtual BO was created 32–38 ms before the fault, and the hung IB is in a CS BO created 437 ms before the texture.94b0d761. The bottom commits cover failed mapping Signals and Waits on every platform. Only the top commit belongs to #3553.vram.rs, one commit: the parts only work together. Without the wait a burst of new textures outruns the spares and faults; without the spares every new placement waits a frame):ReservedPoolalso takes render-target, depth and UAV textures and textures with an optimised clear value. The key copies and compares only the clear value's meaningful bytes: format + four colour floats, or depth float + stencil byte (the union's tail is never read).XCL_RESERVED_SPARES(default 2) spares made ahead. A spare enters the pool only after a Signal on the mapping queue that was sent after it completes, so its PTEs exist. Missing spares are reserved under the pages lock (pooled, pending and in-flight ones count), so concurrent placements of one description do not over-create them; a drop guard returns the reservation on every early exit. Spares are kept out of theRESERVEDregistry (and so out of dumps) until handed out, and every pool eviction removes the entry before the release.XCL_PLACE_MAP_WAIT_MS(default 1000; 0 = off), by polling the fence with short sleeps: no event is registered, so none can be left with vkd3d-proton after a timeout. If that Signal cannot be queued, the placement fails as a failed creation does (nothing is mapped or noted yet), instead of handing out a texture nothing covers.ID3D12DXVKInteropDevice; DXVK's DXGI may report an NVIDIA GPU as AMD), else by the DXGI adapter. Windows drivers do not run page-table updates behind in-flight work, and the spares and the wait cost time on the title's thread. Elsewhere the previous behaviour is unchanged.XCL_LIVE_RESERVED=1/0forces it;XCL_RESERVED_POOL=0still turns the pool off.CreateReservedResourceper placement still runs on the placing thread. Measured in the retail run below: 66126 spares made in 2071 ms over 130 s (31 µs each on average, longest call 10 ms), about 1.6 % of one thread; the waits of new placements are on top (5.3 s over 125 s, longest 102 ms).place_on_pagesbut solves a different problem.before_executeand recycling (the value stays reachable, no spares pooled, the work is held until a later Signal), a lazy placement without a readiness Signal, a depth clear value placed right before a no-access page, concurrent same-description placements (at most 2 spares), spares kept out of dumps, and a GPU test throughplace_on_pages(with the mapping queue held a new texture waits and gets two spares, the next comes from the pool without a wait; gate off: no spares, no wait).Tested
hle::d3d12x::vram::tests::run on this head under Wine: ok. 83 passed; 0 failed; 1 ignored; 0 measured; 2702 filtered out; finished in 3.11s18547df7: 2,918 passed, 0 failed, 51 ignored in the four-thread workspace suite. Test reportRegression run
Both runs below were made with
-Title <game name>; after the runs that flag was dropped from our wrapper, and thetitle:line of both blocks now showssmoke.ps1's default label instead (f651e787, the hash of the game folder's name). Nothing else in the blocks was changed; the runs are the same.main:
PR:
The PR's kernel log recorded 0 page faults, 0 ring timeouts, 0 ring resets, 0 coredumps, 0 bus losses.
Not tested
XCL_LIVE_RESERVED=1, NVIDIA under Wine, and other AMD generations.AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T00:19:42Z.
merge-check
base:
d0832e614fhead:
83ed4c7e91merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2892 passed, 0 failed, 51 ignored (the lib binary aborted with STATUS_ACCESS_VIOLATION after 2752/2775 tests in the first run, no failures before it; the 23 unreported tests pass alone, and a full rerun of
cargo test -p xcl --lib -- --test-threads=4gave 2744 passed / 0 failed / 31 ignored, counted here together with the other binaries' 148/0/20; matches the open intermittent issue #1487); SKIPPED: 28 (22 no wave64, 2 no heap windows (opt-in), 3 no D3D12 debug layer / d3d12SDKLayers.dll, 1 driver cache needs Developer Mode); failing: nonereview: (1) "PR description" check fails: the Tested / Not tested / AI use sections are missing (no model named), and there are no xcl-smoke blocks for main or for head
83ed4c7e; CI build was still pending. (2) On by default on every platform, but measured only on Linux/Wine/RADV: make_spares (vram.rs:845-879, called at 2597) creates up to 2 reserved textures with CreateReservedResource on the title's thread whenever a description has fewer than 2 pooled or pending ones, which brings back the per-placement cost the pool was added to remove (#1268: 0.6-1.7 ms AMD, ~0.1 ms NVIDIA), and each new placement waits for a GPU round trip (wait_new_placement, 801-841). (3) ReservedKey::from_desc_clear (903-909) compares all 20 bytes of D3D12_CLEAR_VALUE; depth clear values leave 11 bytes uninitialized, so equal depth clears can make different keys (pool misses, spares that are never used, extra waits). (4) The wait spins with yield_now for up to 1000 ms (817-823) instead of waiting on an event. (5) Spares are registered in RESERVED by dev_create_reserved_resource and freed with the original Release when evicted (1073, 2504-2507), leaving stale RESERVED entries. (6) The new GPU test only checks promote_pending (already covered by an existing test); make_spares, wait_new_placement and the place_on_pages changes have no test. (7) Render target, depth and UAV textures are now recycled by default; not tested on any Windows driver. The amdgpu fault itself cannot be reproduced on Windows; no retail title was run here (no smoke run).performance: can cost frame time by default: extra synchronous CreateReservedResource calls and a queue Signal for spares, plus a CPU spin wait of up to 1 s per new placement on the title's thread; not measured on Windows (no retail title on this machine); the PR's own numbers are from Linux/Wine/RADV only
verdict: not yet: PR description check fails (no Tested / Not tested / AI use, no xcl-smoke blocks for main and head
83ed4c7e); clear-value key compares uninitialized bytes for depth clears; default-on spares and CPU wait are unmeasured on Windows (cost per placement, spin wait)hardware / tool and model: NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.2114 / 621.14), AMD Ryzen 7 7800X3D, Windows 11 Pro 10.0.26300, rustc 1.100.0 MSVC / Claude Code, Claude Opus 5.5
Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-01T00:48:55Z.
Thanks for the review. Addressed in
797541b7:mainbaseline run the same way), andxcl-smokeblocks formain86e86fcband head797541b7.CreateReservedResourcecalls or waits on the title's thread there.XCL_LIVE_RESERVED=1/0forces it.SetEventOnCompletion+WaitForSingleObjectwith the timeout) instead of spinning.RESERVEDuntil they are handed out, and every pool eviction goes through one helper that removes the entry before the release.place_on_pages(new texture waits and gets spares, the next comes from the pool without a wait; gate off: neither).Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T01:12:22Z.
Source review of current head
797541b7, following the earlier merge-check. The updated gate, clear-key comparison, and tests address several of its points. I still see these paths to resolve:wait_fencecloses the event after a timeout even when the fence has not completed. vkd3d-proton registers the supplied handle for later signalling and wraps the caller's handle. If it completes after the timeout, a reused handle could signal an unrelated event. Keep a registered handle alive until completion, or use bounded polling without registration. A delayed-completion test should time out, create another event, then confirm that event is not signalled by the old fence.signal_nowincrementspages.valueand ignores a failednative_queue_signal.make_sparescan then publish pending spares against that value, whilebefore_executesubmits a GPU wait for it. If no later successful signal reaches the value, that wait cannot complete. Propagate the signal error, publish a mark only after success, and release the new spares or fail the placement path on error. The existingbind/unmapcallers also discard signal errors; please account for those paths in the fix. An injected signal failure should not leave the next submission waiting on an unreachable value.from_desc_clearnow compares only the meaningful depth/stencil bytes, but firstread_unalignedreads the entire 20-byte clear-value union. A depth/stencil clear may leave its colour-sized tail uninitialised. Copy only the selected prefix into the already-zeroed key; the current test fills the unused tail with garbage, so it does not exercise this case.Candidate clear-key correction
PAGES, but spares are created after releasing it. Concurrent same-key placements can each observe the same shortage and create excess reserved resources. Track in-flight spare reservations under the lock and return them on creation failure. A barrier-controlled concurrent placement test would bound the number created.This is source review, not a new GPU or title test of this head. AI use: OpenAI Codex (GPT-6.2 Sol) traced the current source and vkd3d-proton path; OpenAI Codex (GPT-6.2 Astra) independently checked the lifecycle and concurrency paths.
Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-01T01:35:21Z.
Thanks, all four addressed in
85c1c599:wait_fenceno longer registers an event: it polls the fence with sleeps of at most 0.5 ms up to the timeout, so nothing is left with vkd3d-proton after a timeout. Test: time out, create a new event, signal the old value; the new event stays unsignalled.signal_nowadvances the mapping queue's value only after the Signal was queued and returns the failure; bind/unmap go through it, so a failed Signal never leaves the valuebefore_executewaits on unreachable. A new placement whose Signal fails does not wait, and spares made without their Signal are released and their reservation returned. Test with an injected Signal failure.from_desc_clearcopies only the meaningful prefix withcopy_nonoverlapping(9 bytes for depth-stencil, 20 for colour). Test: a depth clear value placed right before aPAGE_NOACCESSpage.PAGES(counting pooled, pending and in-flight ones), created after the lock, and the reservation is returned on failure through a drop guard. Test: 4 barrier-synchronised placements of one description with the mapping queue held make at most 2 spares, and no reservation is left.Description updated: suite and
xcl-smokeblock for head85c1c599(2499 frames, no device removal, no page fault in the kernel log).Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T01:51:13Z.
Follow-up on head
85c1c599to my earlier review: the event lifetime, clear-value read, and concurrent spare reservation changes address those points. The failed-Signal path still needs to cover mapping and unmapping already queued.Pages::mapandunmap_rangequeueUpdateTileMappings, then discardsignal_now()returningNone. After a failed Signal,bind_rangestill returns success, whilebefore_executewaits only on the previous successful value. A consuming queue can therefore proceed without a fence mark covering the new mapping. On retirement,recycle_readypublishes that old value for a NULL unmap; if it is already complete,drain_recycledcan return the reserved texture to the pool before the unmap finishes. The new failure test invokessignal_nowdirectly and checks spares; it does not exercise either caller.Please track mapping work whose Signal failed and obtain a successful later mark before allowing dependent execution or recycling. If no mark can be queued, keep the mapping/resource unavailable rather than treating the previous completed value as its mark. A regression can complete mark N, inject a failed Signal after a bind or NULL unmap, hold the mapping queue behind a test fence, and verify that execution/recycling waits for a successfully queued N+1 and its completion.
This is a source trace; I did not inject a failure or run a GPU test on this revision. AI use: Codex (GPT-6.2 Sol) checked the revised call paths; Codex (GPT-6.2 Astra) independently reviewed the mapping and retirement sequence.
Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-01T01:55:30Z.
Thanks, the follow-up is right: a failed Signal after
Pages::map/unmap_rangestill leaves the mapping without a mark. I'm fixing that next: mapping work whose Signal failed will need a later successful mark before dependent execution or recycling, with a test through the real callers (complete N, fail the Signal after a bind and after a NULL unmap, hold the mapping queue, check that execution and recycling wait for N+1).On the other points raised elsewhere:
make_sparesis complete in the branch; a review tool that showed it cut off was limited by the diff size.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T02:03:38Z.
merge-check
base:
d0832e614fhead:
85c1c599f2merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2899 passed, 0 failed, 51 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 cannot disable the driver cache); failing: none. The new vram tests (live_reserved_is_on_by_default_only_under_wine_on_amd, concurrent_placements_make_at_most_the_spares_of_one, a_failed_signal_publishes_no_value_and_no_spares, live_placements_wait_when_new_and_take_spares_without_waiting, wait_fence_returns_at_the_signal_or_times_out, the depth-clear key tests) ran and passed.
review: whole diff read. All points of the earlier merge-check and of the second review are addressed: on by default only under Wine with an AMD adapter (XCL_LIVE_RESERVED=1/0 forces it), the clear key compares only the meaningful bytes, the wait polls instead of spinning or registering an event, failed Signals publish no value, spares leave RESERVED when evicted, and the new paths have tests. On Windows + NVIDIA the default path adds no CreateReservedResource, Signal or wait. Remaining: (1)
797541b7and85c1c599are review fixups that rewrite the first two commits (the wait went spin -> event -> polling); CONTRIBUTING wants them squashed. (2) about 821 changed lines (351 runtime, 462 test) with no reason in the description why it cannot be split. (3) not verified: DXVK's dxgi (Proton) can report an NVIDIA GPU as AMD, which would turn live mode on there (time, not a crash). (4) nits: signal_now's doc comment sits on reserve_spares; no linked issue.performance: smoke 240 s on the merged tree 3fa20d5a vs main
d0832e61(same title, same input script): every run, main included, loses the device to a GPU page fault (DRED state 7) during the world load: main at 100.4 s / 100.4 s with 2195 / 2219 presents, this PR at 93.4 s with 1987 (90 %); peak commit 31916 MB vs 34766 / 32760 MB. Within run-to-run noise (an earlier run of83ed4c7ehad 2222); the live mode is off here, so the AMD/Wine path is not exercised on this machine.verdict: not yet: squash the review fixups
797541b7/85c1c599into the first commits (and say why ~820 lines cannot be split); the code has no blocking findinghardware / tool and model: NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.2114 / 621.14), AMD Ryzen 7 7800X3D, Windows 11 Pro 10.0.26300, rustc 1.100.0 MSVC / Claude Code, Claude Opus 5.5
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T02:11:11Z.
One ordering detail for the failed-Signal fix you described on head
85c1c599:before_executecallsrelease_held_unmapsbefore it readspages.valuefor the consumer wait. That helper can queue a new NULL unmap throughself.unmap, whose Signal can fail. A recovery check only atbefore_executeentry would miss that unmarked work.If recovery happens in
before_execute, check again afterrelease_held_unmapsand before usingpages.valuefor the wait or reclaim decision. The real-caller regression should include a held unmap that becomes releasable duringbefore_execute, with its NULL-mapping Signal forced to fail. This is a source-ordering check; I did not run the new revision. AI use: Codex (GPT-6.2 Sol) verified the call order; Codex (GPT-6.2 Astra) independently traced this path.Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T03:13:30Z.
One separate lifetime point on head
85c1c599, forXCL_DUMP_TARGETS:make_sparescreates each idle spare through the title-facingdev_create_reserved_resourcewrapper. For a 3D texture, that wrapper callslut3d::created, which stores its raw pointer inVOLS.forget_reservedremoves only the separate reserved-resource record. If the spare is later evicted, the original COMReleasebypasses the normal hook that callslut3d::forget.to_dumpcan then callGetDescthrough that freed pointer, even for a volume it would otherwise exclude from readback.Create an internal spare through the existing PC creator and register diagnostics only when a resource is handed to the title. The GPU-owned and sampled placement paths already do the latter after successful placement. Clearing
VOLSonly at eviction would still leave idle spares in dumps and miss the originalReleaseafter a failedQueryInterfaceon checkout.Candidate diff against this head
Please add a deterministic regression with dump tracking enabled: make a 3D spare, check that the idle spare is absent from diagnostic enumeration, force pool eviction, then check that enumeration cannot touch the released resource. A checked-out 3D texture should still be registered. I traced this in source; I did not run that regression or a GPU test on this head. AI use: Codex (GPT-6.2 Sol) checked the release and diagnostic paths; Codex (GPT-6.2 Astra) independently traced the spare lifecycle.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T03:52:43Z.
One additional cold-placement case for the failed-Signal fix on head
85c1c599: withXCL_TEXTURE_LEVEL_PAGES=1(off by default), a newly created, eligible sampled texture takes the lazy level path without queueing a tile map. Its initial page-table readiness then depends onwait_new_placement's Signal. If that Signal fails, the helper returnsNone, but the placement caller ignores it and returns success. A title could then use the descriptor before the newly created texture has live page-table entries. Repairing failed bind or unmap Signals inbefore_executealone would miss this case: neither operation has queued a mapping, and previously submitted work cannot be made to wait there.Please distinguish a disabled placement wait from a failed Signal. On failure, queue a successful readiness mark and wait for it before returning the resource, or roll back the placement and propagate failure. A focused regression can disable spares, hold the mapping queue behind a test fence, inject the first Signal failure during a cold lazy placement, and verify the caller does not receive a usable resource before a successful retry completes. This is a source trace; I did not run that failure injection or a GPU test on this head.
AI use: Codex (GPT-6.2 Sol) checked the call path; Codex (GPT-6.2 Astra) independently checked the page-table invariant.
Imported from ivall/xcl. Originally posted by Aniseto on 2026-12-01T07:54:07Z.
Ran the
vram::testsmodule at85c1c599on an NVIDIA Blackwell desktop part with 16 GB of VRAM. The widervramfilter and amaincontrol are also reported below.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build,
XCL_ADAPTER=NVIDIA, detached worktree at the exact PR head, no local patches.The 78/0/1 of
vram::testsmatches the description's lib-suite count for that module. On this Windows NVIDIA host the new behaviour is gated off (it defaults on only under Wine with an AMD adapter), so this is a no-registration check of the module, not a test of the gate's active path. The widervramfilter also selectsplaced_title_textures_share_vram_and_preserve_pixels, which already fails here onmain(row 5: stale shadowed texture corrupted B); the seven other failures in that run arePoisonErrorcascades, and the three new tests pass when run alone. The control onmaindid not finish cleanly, so no A/B verdict is drawn from it.Not tested: Wine with AMD/RADV (where the change is on by default), the
XCL_LIVE_RESERVED=1forced path on NVIDIA, an injected Signal failure with the gate active, the full workspace suite, a title run, native wave64 hosts, Intel GPUs, release profile, game data.AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-01T08:09:05Z.
Squashed into one commit,
5d7820cf, which also covers the open points:@Foniass's merge-check:
main86e86fcb.ID3D12DXVKInteropDevice) and falls back to the DXGI adapter only when that is not available. Test: Vulkan NVIDIA behind a DXGI AMD stays off, and the reverse is on.signal_nowdoc comment now sits onsignal_now. There is no linked issue.@thehollowedone:
before_execute(7298335865): a mapping whose Signal fails is markedunmarked.before_executefirst runsrelease_held_unmaps, then gets a later mark (Pages::mark) and has the title's queue wait for that. If no Signal can be queued, the work does not go. A retired texture whose NULL unmap has no mark stays out of the pool until a later one completes. Testmappings_whose_signal_failed_get_a_later_mark_before_useholds the mapping queue behind a test fence and covers a bind, a held unmap that becomes releasable insidebefore_executewith its NULL mapping's Signal failing, the case with no Signal at all, and recycling.pc_create_reserved_resource, so they are not inVOLSorRESERVEDwhile idle; they are registered when handed out. Testspares_stay_out_of_dump_tracking_until_handed_out(an idle 3D spare is neither a reserved resource nor a dumped 3D texture, one released from the pool leaves nothing the dump enumerates, and a handed-out one is tracked).wait_new_placementnow tells a disabled wait from a failed Signal. On failure a retry is queued and waited for; if that fails too, the placement fails the way a failed creation does: nothing is mapped or noted yet, the texture is released and the title gets no resource. Testa_lazy_placement_without_a_readiness_signal_is_not_handed_out.Description updated: suite (one module per process, 2 threads, failing modules rerun with 1) and the
xcl-smokeblock for5d7820cf(2358 frames, no device removal, no page fault in the kernel log).Imported from ivall/xcl. Originally posted by Aniseto on 2026-12-01T08:12:31Z.
This is a new response on the same thread as my report at
85c1c599(https://github.com/xcl-dev/xcl/pull/3553#issuecomment-7304624546); the head moved to5d7820cf(the four commits squashed into one), so I am not editing that comment.Ran the
vram::testsmodule at5d7820cfon an NVIDIA Blackwell desktop part with 16 GB of VRAM.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build,
XCL_ADAPTER=NVIDIA, detached worktree at the exact PR head, no local patches.All 82 tests pass at the squashed head, four more than the 78 of my earlier report at
85c1c599. On this Windows NVIDIA host the new behaviour is still gated off by default (it turns on under Wine with an AMD adapter), so this is a no-registration check of the module, not a test of the active path. I did not repeat the widervramfilter here; its earlier 8 failures came from the pre-existingplaced_title_textures_share_vram_and_preserve_pixelsfailure and poisoned-lock cascades.Not tested: Wine with AMD/RADV (where the change is on by default), the
XCL_LIVE_RESERVED=1forced path on NVIDIA, the full workspace suite, a title run, native wave64 hosts, Intel GPUs, release profile, game data.AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:11:20Z.
merge-check
base:
7d86c5d2b7head:
5d7820cf3emerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2909 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: re-review (my earlier merge-checks were on
83ed4c7eand85c1c599); read the whole current diff (vram.rs +1298/-16, ~455 runtime lines and ~840 test lines, title_textures.rs, real.rs, lut3d.rs). The earlier points, mine and thehollowedone's, are addressed in the code. On Windows the live path is off (live_decideshort-circuits before any vendor query); the only change there is how a failed Signal is handled. Under Wine on AMD it's on by default. Findings: (1) whenvram::before_executereturns false (the mapping's Signal and a retry both failed, with no device removal),refresh_partsreturns RetryRequired (title_textures.rs~2066) andprepare_title_submissionends the title with "sparse upload preparation still failed after bounded retries" (real.rs~12091-12098): the work is stopped, on every platform, with a message naming the wrong cause, where the description says it's held. Rare, but worth a clearer path. (2) In live mode the PR's own counters show 66,172 spares made for 65,536 placements, so about one CreateReservedResource per placement still runs synchronously on the title's thread (make_spares, ~2827), the cost the pool (#1268) existed to avoid; only frames were measured (92 % of main's). (3) 1,334 lines; the Signal-failure handling applies everywhere and could be its own preparation PR. (4) The PR's CI crash (0xc0000005 ineh::tests, before any vram test) looks like the intermittent #1487; see the run above. The PR's smoke blocks under Wine read 0 MB peak commit, so the 125 % check can't catch anything there. Still no linked issue. Fine: the gate takes the vendor from the Vulkan device behindID3D12DXVKInteropDevice, the depth clear key reads only 9 bytes, the wait polls without registering an event, spares stay out ofRESERVED/VOLSuntil handed out and are forgotten before Release, the spare reservation is returned through a drop guard on every early exit, and the GPU tests useskip_test.performance: 60 s smoke of a retail title, main
7d86c5d2vs this merge (bc3334cd): 1663 -> 1690 frames shown (101 %; last presents per 2 s: 60 60 61), peak commit 17153 -> 17335 MB, 0 device removals, 0 crashes. This Windows run takes the Signal-failure change only; the live path is Wine-only.verdict: not yet: 1,334 changed lines (about 455 of them runtime), with no stated reason it can't be split; the Signal-failure handling, which applies on every platform, could be its own preparation PR. Also, a failed mapping Signal now ends the title with a message that names the wrong cause (finding 1). My earlier blocking points are fixed
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-01T09:49:00Z.
Thanks. All four points of 7306339703 are addressed; the new head is
db57f30c:refresh_partsnow returns a separatePreparationOutcome::MappingUnmarked. The title stops with "a texture page mapping has no Signal of the mapping queue (its own and a retry failed)", and the wait-inside-a-submit path names the same cause. The description now says the title stops instead of "held". It stays fail-closed, like the other preparation failures: the D3D12 submit is void, so there is nothing to retry later.main's in that run) are in the description.69700342, onmain86e86fcb, about 290 lines with its tests). This PR is stacked on it: the first commit is #3566, and its own commitdb57f30cis the Wine-on-AMD part (about 1100 lines: about 380 runtime with comments invram.rs, about 690 tests, the rest test hooks inreal.rsandlut3d.rs).Suite and
xcl-smokeblocks are in both descriptions for their exact heads.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:55:27Z.
Re-review (head
db57f30c; range-diff from5d7820cf, which I merge-checked, read). Not a new merge-check: this head is stacked on #3566, which is still a draft.Both blockers from my merge-check are answered. The Signal-failure handling, the part that applies on every platform, is now #3566, the first commit here, which I reviewed separately. With it, a failed mapping Signal no longer ends the title with the misleading "bounded retries" message. The commit message now says why the rest is one change: the wait, the spares and the marks only work together.
Size. This PR's own commit is still +1097 / -7, about 1,077 of it in
vram.rsand mostly tests. With the reason now stated, that is for the maintainer to accept.New since
5d7820cf:lut3d.rs);CreateReservedResourcecalls with a number per run.The new tests cover the failing-Signal spare and a cold lazy placement.
Once #3566 is out of draft and merged, a suite run and smoke pair of this commit on main would make it ready. On Windows the live path stays off, so the default path there is unchanged.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Aniseto on 2026-12-01T10:01:10Z.
This is a new response on the same thread as my report at
5d7820cf(https://github.com/xcl-dev/xcl/pull/3553#issuecomment-7305015149); the head moved todb57f30c(now stacked on #3566), so I am not editing that comment.Ran the
vram::testsmodule atdb57f30con an NVIDIA Blackwell desktop part with 16 GB of VRAM.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build,
XCL_ADAPTER=NVIDIA, detached worktree at the exact PR head, no local patches.All 83 tests pass at the stacked head, one more than the 82 of my previous report. The new behaviour remains gated off by default on Windows NVIDIA, so this is a no-registration check of the module, not a test of the Wine/AMD path.
Not tested: Wine with AMD/RADV (where the change is on by default), the
XCL_LIVE_RESERVED=1forced path on NVIDIA, the full workspace suite, a title run, native wave64 hosts, Intel GPUs, release profile, game data.AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:13:30Z.
Triage (#1607) – head
db57f30Stacked on #3566: its first commit (
69700342) is #3566, and that is where the 153 shared added lines come from. Not a duplicate. This PR's own commit,db57f30c, adds the live reserved-texture pool, spares made ahead, and the wait for new placements invram.rs. It is gated to Wine on AMD (live_decide) orXCL_LIVE_RESERVED.#3124 touches the same spot in
place_on_pagesbut solves a different problem (a NULL mapping for an NVIDIA removal).No problems found in the diff.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-01T10:49:55Z.
The Windows CI job on
db57f30cran into its 45-minute timeout: with 4 test threads, severalvram::testsnever finished. Cause: there is one D3D12 device per adapter, so every test shares its mapping queue, and this PR's tests hold that queue behind a test fence; a test placing textures meanwhile withoutVRAM_TEST_LOCKwaited behind it (a deadlock on WARP; on RADV it showed as a wait counter off by one).ee13d5adchanges only tests: every fence that holds the mapping queue gets a watchdog that opens it after 10 s at the latest (so a race can fail a test but never hang the job), andreserved_resource_with_private_data_is_excluded_from_recycletakes the lock.vram::with 4 threads: 5 of 5 clean here (0 of 3 before). #3566 is unchanged (69700342; its CI is green). Newxcl-smokeblock in the description (2700 frames, no page fault).Imported from ivall/xcl. Originally posted by Aniseto on 2026-12-01T10:59:42Z.
This is a new response on the same thread as my report at
db57f30c(https://github.com/xcl-dev/xcl/pull/3553#issuecomment-7307545847); the head moved toee13d5ad, so I am not editing that comment.Ran the
vram::testsmodule atee13d5adon an NVIDIA Blackwell desktop part with 16 GB of VRAM.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build,
XCL_ADAPTER=NVIDIA, detached worktree at the exact PR head, no local patches.All 83 tests pass at this head, the same count as at
db57f30c. The new behaviour remains gated off by default on Windows NVIDIA, so this is a no-registration check of the module, not a test of the Wine/AMD path.Not tested: Wine with AMD/RADV (where the change is on by default), the
XCL_LIVE_RESERVED=1forced path on NVIDIA, the full workspace suite, a title run, native wave64 hosts, Intel GPUs, release profile, game data.AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T14:23:16Z.
merge-check
base:
b2b1f109d2head:
ee13d5ada0merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2916 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: re-check of this head (
ee13d5ad, stacked on #3566); my earlier merge-check (5d7820cf) and re-reviews (db57f30c, then test-only hardening) have the details. The PR's own commit hands the title reserved textures with live page tables, on by default only under Wine with an AMD GPU (judged by the Vulkan device behind vkd3d-proton), so on Windows the default path is unchanged;XCL_LIVE_RESERVED=1/0forces it. My earlier blockers are answered: the Signal-failure handling is now #3566 underneath, with a correct stop reason, and the commit message says why the rest is one change (the wait, the spares and the marks only work together). Since then: a spare whose Signal fails is released, not pooled; a new texture whose readiness Signal can't be queued fails as a failed creation does; spares are kept out of dump tracking; and the log reports the time spent making spares on the placing threads. Still large (+1,097 of its own, mostlyvram.rstests), with the reason stated. Fine: spares stay out ofRESERVED/VOLSuntil handed out and are forgotten before Release, the spare reservation is returned through a drop guard on every early exit, and the GPU tests useskip_test. The smoke run below covers Windows' default path, where the live path is off.performance: 60 s smoke of a retail title, main
b2b1f109vs this merge (c8d15eee): 1671 -> 1624 frames shown (97 %; last presents per 2 s: 61 60 60), peak commit 17394 -> 19144 MB, 0 device removals, 0 crashes. On Windows the live path is off, so this measures #3566's Signal-failure handling and the unchanged default path. Peak commit is 11.5 % above main in this one run, within the 125 % limit; my earlier smoke of this PR (5d7820cf) was 17335 MB and other runs today varied by 1-2 GB between runs of the same merge, so I read it as run-to-run variation.verdict: safe to merge once #3566 below it carries the test watchdog (this head's copy of
mappings_whose_signal_failed_get_a_later_mark_before_usehasopen_at_the_latestand passed here; #3566's own head hangs on it, see my comment there)hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by capy-ai[bot] on 2026-12-01T15:07:25Z.
Review of head
ee13d5ad(not a full merge-check: no test suite or title run on this machine)mainb2b1f109: clean,git diff --checkclean. Also clean together with #3536.cargo check --workspace --all-targets --target x86_64-pc-windows-gnu: ok for this merge and for #3566 alone, with the same warning count asmain.liveis decided once per device and stays off on Windows (live_decidereturns before any vendor query).wait_new_placementpolls without registering an event and does not holdPAGESwhile it waits.Blocking: the first commit,
69700342(#3566 as it stands), lands with a test that can hang the suite.mappings_whose_signal_failed_get_a_later_mark_before_useinstalls its ownPagesfor the shared device and holds its mapping queue behind gate fences.reserved_resource_with_private_data_is_excluded_from_recycleplaces textures on that device withoutVRAM_TEST_LOCK. When the two overlap, or any assert fails betweenmq.Waitand the gate's Signal, the queue never reopens and the test process cannot exit. That is the mechanism described in https://github.com/xcl-dev/xcl/pull/3553#issuecomment-7308791444, and the hang Foniass hit on #3566 in https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7313134336. The fix (open_at_the_lateston the three gates, plus the lock) exists only inee13d5ad. Merged as it is, the hanging version goes into history and #3566 closes along with it.What would unblock it: move
open_at_the_latestand theVRAM_TEST_LOCKline into #3566's commit, rebase this PR onto it, then merge #3566 and this PR in that order. With that change, this is ready from my side: Foniass's run of the merged tree passed the full Windows/NVIDIA suite with 0 failures.Not blocking:
Hardware: Linux x86_64 cloud machine, no GPU. The crate was type-checked only, not built for or run on Windows.
AI use: Capy (Claude Opus 5.5) did the merge, the type-check and the diff review, and wrote this comment.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T20:55:31Z.
Test report (not a merge-check:
PR descriptionred: its smoke block is for an older head)base:
6bfb5c5153head:
18547df7c5merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2918 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: follow-up on
18547df7(rebased fromee13d5ad, the head of my merge-check above; stacked on #3566 atf5a57437). The PR's own commit was only rebased, apart from two hunks dropped because #3566 now carries them: theVRAM_TEST_LOCKguard inreserved_resource_with_private_data_is_excluded_from_recycle, and its threeopen_at_the_latest(&gate*)calls in #3566's failed-Signal test, which now uses #3566'sGate. The commit message is the same (1,117 insertions against 1,121 before). Nit: the PR's own tests still useopen_at_the_latest(vram.rs~6240, ~6312, ~6419), so the module now has two watchdogs for held mapping queues; its doc comment (~6805) still says it exists for "a shared device's mapping queue" though the remaining callers hold privatePages::newqueues, and when it fires it doesn't fail the test, unlike #3566'sGate. It can't hang the process, so it doesn't block. Fine: the rebased commit sits onf5a57437without duplicated code and merges cleanly into current main; theGate/AtomicU8/mpscimports don't clash; the lock order is the same in both (VRAM_TEST_LOCK, thenRECYCLE_DRAIN_TEST_LOCK, thenPAGES), and the PR adds nodrain_recycledcall outside tests. The Windows default path is unchanged:live_decideis still on by default only whenunder_wine()is true and the Vulkan vendor is 0x1002, withXCL_LIVE_RESERVEDforcing it either way.performance: 60 s smoke of a retail title, main
6bfb5c51vs this merge (8125b27e): 1646 -> 1663 frames shown (101 %; last presents per 2 s: 60 60 61), peak commit 18685 -> 18384 MB, 0 device removals, 0 crashes. The first run of this merge lost the lib test binary to the knownuma_drivercoherent-window abort; this is the rerun. On Windows the live path is off by default, so the smoke run covers the default path only.assessment: merges, builds and passes the whole suite on current main at
18547df7(with #3566'sf5a57437underneath, whose test no longer hangs), and the smoke run is clean; the PR's own commit was only rebased. What remains for a merge-check is the description's smoke block on this head, and #3566 below it landing firsthardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T22:34:36Z.
merge-check
base:
f07e426dadhead:
5800b721b3merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2918 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: re-check of
5800b721, stacked on #3566 at94b0d761. Since my test report on18547df7the PR's own commit is unchanged (git range-diff:=); only #3566's new commit94b0d761came in underneath (reviewed on #3566). Againstee13d5ad, the own commit was only rebased, apart from two hunks dropped because #3566 now carries them: theVRAM_TEST_LOCKguard inreserved_resource_with_private_data_is_excluded_from_recycle, and its threeopen_at_the_latest(&gate*)calls in #3566's failed-Signal test, which now uses #3566'sGate. The commit message is the same (1,117 insertions against 1,121 before). Nit: the PR's own tests still useopen_at_the_latest(vram.rs~6240, ~6312, ~6419), so the module now has two watchdogs for held mapping queues; its doc comment (~6805) still says it exists for "a shared device's mapping queue" though the remaining callers hold privatePages::newqueues, and when it fires it doesn't fail the test, unlike #3566'sGate. It can't hang the process, so it doesn't block. Fine: the rebased commit sits onf5a57437without duplicated code and merges cleanly into current main; theGate/AtomicU8/mpscimports don't clash; the lock order is the same in both (VRAM_TEST_LOCK, thenRECYCLE_DRAIN_TEST_LOCK, thenPAGES), and the PR adds nodrain_recycledcall outside tests. The Windows default path is unchanged:live_decideis still on by default only whenunder_wine()is true and the Vulkan vendor is 0x1002, withXCL_LIVE_RESERVEDforcing it either way.performance: 60 s smoke of a retail title, main
f07e426dvs this merge (5fd0b6ce): 1672 -> 1658 frames shown (99 %; last presents per 2 s: 60 60 60), peak commit 17352 -> 18865 MB, 0 device removals, 0 crashes. On Windows the live path is off by default, so the smoke run covers the default path only.verdict: safe to merge once #3566 below it is merged: the PR's own commit is unchanged since my last review, the merge passes the whole suite and the smoke run is clean; on Windows the live path is off by default, so the run covers the default path, and the remaining nit (two test watchdogs) doesn't block
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:06:38Z.
Review: COMMENTED
Review of
5800b721: 2 finding(s) (1 high, 1 medium), most severe first.crates/xcl/src/hle/d3d12x/vram.rs:2794: Whenwait_new_placementtimes out (FenceWait::TimedOut), the new texture is placed and returned anyway, so the fault this PR fixes can still happen, and each new placement can block the title thread for the full XCL_PLACE_MAP_WAIT_MS. (inline)crates/xcl/src/hle/d3d12x/vram.rs:2188: Not certain about this one:live_reserved_forruns insidePages::new, called fromor_insert_withwhile the global PAGES mutex is held. (inline)These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:06:39Z.
Code review location:
crates/xcl/src/hle/d3d12x/vram.rs; line 2794High: When
wait_new_placementtimes out (FenceWait::TimedOut), the new texture is placed and returned anyway, so the fault this PR fixes can still happen, and each new placement can block the title thread for the full XCL_PLACE_MAP_WAIT_MS. If a GPU frame (loading screen, heavy compute) runs past 1000 ms, every new reserved texture placed meanwhile waits 1 s on the placing thread and is then handed out with no PTEs. The title writes its descriptor into memory the in-flight work reads, which is the amdgpu page fault and DXGI_ERROR_DEVICE_REMOVED. N new textures in that window stall the title N seconds. On timeout, handing out a spare (or keeping the texture back until its page tables are live) would avoid both.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:06:39Z.
Code review location:
crates/xcl/src/hle/d3d12x/vram.rs; line 2188Medium: Not certain about this one:
live_reserved_forruns insidePages::new, called fromor_insert_withwhile the global PAGES mutex is held. It does QueryInterface for the vkd3d interop, GetModuleHandle/LoadLibraryA of vulkan-1.dll, and possibly CreateDXGIFactory1 plus EnumAdapterByLuid. On the first placement under Wine, when the interop lookup fails, a DXGI factory is created (DXVK builds a VkInstance, tens of ms) or a DLL is loaded under PAGES.lock(). Every other streaming thread, before_execute and drain_recycled block meanwhile, and the loader lock is taken while holding an application mutex, a lock-order risk with any DllMain that calls back into XCL. Computing the decision once per device before taking the lock would avoid it.