Repository navigation
Conversation
|
Source review of The ready ranges are popped from Keeping the flag (or a small "draining" count) set until the merge is done, or having a caller that sees the flag drop wait on the drain in progress, would close it. Not tested: no build or run on our side. AI use: Gemini (Antigravity) found it in a review. Claude Code (Claude Opus 5.5) checked it against the source at |
|
Update for head AMD run (listed as untested): the new tests pass on an RX 9070 XT. Base
The new tests make their device with Not tested: native wave64 GPU tests (this change is in |
release_global and release_global_sampler previously returned freed ranges straight to GLOBAL.free / GLOBAL_SAMPLER.free (and release_global immediately overwrote them with fill_nulls), allowing in-flight GPU command lists to read overwritten or nulled shader-visible descriptors. Quarantine released shared view and sampler ranges behind per-queue completion fences across all live device queues (signaled outside GLOBAL/GLOBAL_SAMPLER/HEAPS/SLOT_WRITES locks, queried via real::fence_completed). For GLOBAL, defer fill_nulls and NAMES.clear until fence completion when draining into free (outside HEAPS and GLOBAL so SLOT_WRITES lock order is preserved), keeping zero-queue calls immediate and failed-signal ranges quarantined without wedging subsequent healthy ranges. Serialize drain_global_retired under GLOBAL_DRAIN, keep GLOBAL_RETIRED set across fill_nulls until merge_release completes, and bump GLOBAL_DRAIN_SEQ under GLOBAL on every merge_release (checked in reverse Acquire order in slot() after GLOBAL_RETIRED) so a concurrent slot() or second drainer cannot miss descriptors mid-drain and return an unmapped index while ranges are about to become free. Tested: cargo test -p xcl --lib console_heap -- --test-threads=4 (22 passed, 0 failed, debug and release on RTX 5080 and RTX 2080 SUPER, including deterministic concurrency test for both slot() and second-drainer mid-fill_nulls paths). Assisted-by: Google Antigravity CLI (Gemini 4 Hydrogen (High)) Assisted-by: Google Antigravity CLI (Gemini 4 Neon (High))
|
Thanks for catching that window, @KDenKC — squashed the fix into
Tested
Not tested
AI use
|
b755223 to
9ddd2fe
Compare
Prime1997
left a comment
There was a problem hiding this comment.
Updated source status: retain; validation pending. Rechecked current head 9ddd2feb57a2e1bee79d387c5a3cf057798eed47 against the previously reviewed b755223752d79186a0aca209a3c86641c18a7eed, targeting nvidia-dev at af2cecc40886a8682ecf3267f5328c6dc4b66ad7.
The new revision directly addresses the earlier retired/free publication gap: GLOBAL_DRAIN serializes draining through null-fill and free-range publication, GLOBAL_RETIRED stays set during that interval, and GLOBAL_DRAIN_SEQ lets an exhausted allocation observe a completed concurrent drain and retry. The fallback drops HEAPS before waiting on the drain and reacquires/re-finds the heap afterward. The previous exact-head finding should not be treated as an unchanged defect or a reason to close this revision.
I inspected the full175-line delta and the surrounding allocation path. The added child-isolated fixture exercises an in-flight drain and the sequence-observation helper with owned fake COM objects. I have not built or run this new head, the new fixture, or a GPU lifetime workload. Its80ms sleep also should not be presented as proof of every scheduling interleaving. The earlier native results for other PRs do not transfer to this revision.
Disposition is blocked on current-head validation and the remaining integration checks, rather than rejection. No merge or closure is made by this report.
AI use: Codex (GPT-6) inspected the revision and relevant call path; no new execution is claimed. Optional temporary Discord for coordinating contributor work, testing and comparing results.
|
Two Linux/Wine lanes on head Lanes
All 22 Not cleared by this PR (expected, different code path): the two Tested: head + base full lib suite and |
|
Test report: in the world on an RTX 4080 16 GB. No harm seen; it does not change this card's device losses. Tested
Not tested
AI use: Claude Code (Claude Fable 5.2) ran this on the owner's machine and wrote the report. |
|
Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2782 at Setup
Targeted RTX 4060 release unit & GPU tests (
|
| Metric (60 s quiet default-flags run) | nvidia-dev base (af2cecc4) |
PR #2782 (9ddd2feb) |
|---|---|---|
Frames shown / PresentX |
1547 / 1547 |
1477 / 1477 |
| Presents per 2 s (last 3) | 60 60 60 |
60 60 60 |
| Peak process commit | 16342 MB |
16264 MB |
End process commit (xcl.log) |
15009 MB |
15163 MB |
| Peak / end local VRAM | 6245 MB / 6182 MB |
6181 MB / 6181 MB |
| End non-local VRAM | 4749 MB |
4722 MB |
| Console descriptor heap log lines | 16 (1,000,000-slot shared heap) |
16 (1,000,000-slot shared heap) |
| Translated draws / dispatches (last log line) | 18,382 draws / 1,024 dispatches (0 skipped) |
18,448 draws / 1,024 dispatches (0 skipped) |
Base origin/nvidia-dev (af2cecc4):
xcl-smoke v1
commit: af2cecc40886a8682ecf3267f5328c6dc4b66ad7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1547 (PresentX 1547)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16342 MB
PR #2782 head (9ddd2feb):
xcl-smoke v1
commit: 9ddd2feb57a2e1bee79d387c5a3cf057798eed47
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1477 (PresentX 1477)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16264 MB
Limits of coverage
- Full workspace test suite was not run on
9ddd2feb(only the 3 new tests individually, 3 parallel passes ofhle::d3d12x::console_heap::,hle::d3d12x::real::, and the paired 60 s default-flags smokes). - The 60 s no-input menu/intro smoke confirms clean steady-state behavior on an 8 GB desktop RTX 4060, but heavy interactive world-load descriptor-heap release/reclaim contention was covered only by the targeted D3D12 unit tests (
released_shared_ranges_stay_quarantined_until_queue_completes,retired_descriptor_ranges_stay_quarantined_until_all_queues_complete, andslot_waits_for_in_flight_drain_before_returning_unmapped). - Single discrete NVIDIA 8 GB GPU (
RTX 4060) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host.
AI use
Ran the targeted release tests, paired quiet 60 s smoke runs, and xcl.log comparisons with assistance from Google Antigravity (Gemini 4 Neon); all test counts, memory figures, and smoke blocks were extracted directly from cargo test, xcl.log, and scripts/smoke.ps1 outputs.
|
Checked at AI use: Claude Code (Claude Opus 5.5) checked the source at that head and wrote this. |
|
Ran the shared-descriptor-range quarantine tests at Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, 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. All 22 pass here, including Not tested: a real second D3D12 queue under the title, a paired 60 s smoke run, the full workspace suite, release profile, AMD and Intel GPUs, native wave64, Wine, game data. AI-assisted (OpenCode), model: DeepSeek V4.1 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. |
On
nvidia-dev,release_globalimmediately overwrote freed shared view ranges withfill_nulls, clearedNAMES, and returned them toGLOBAL.free, whilerelease_global_samplerreturned freed sampler ranges straight toGLOBAL_SAMPLER.freewithout coalescing or waiting for the GPU. Any in-flight command list still reading those shader-visible descriptor slots could observe nulled or overwritten descriptors.This change quarantines released shared view and sampler ranges behind per-queue completion fences across all live device queues (signaled outside
SLOT_WRITES,HEAPS,GLOBAL, andGLOBAL_SAMPLERlocks, preserving lock order). ForGLOBAL,fill_nullsandNAMES.clearare deferred until every signaled queue passes its fence mark when draining completed ranges back intofree.drain_global_retiredis serialized underGLOBAL_DRAIN(GLOBAL_DRAIN -> SLOT_WRITES -> GLOBAL, never held alongsideHEAPS), keepsGLOBAL_RETIREDset untilmerge_releasefinishes, and bumpsGLOBAL_DRAIN_SEQunderGLOBALon each merge (checked afterGLOBAL_RETIREDinslot()) so a concurrentslot()or second drainer cannot miss descriptors mid-drain and return an unmapped index. Zero-queue unit tests release immediately, and failed fence signals keep ranges safely quarantined without blocking later healthy ranges.What is in it
D3D12.X: fence-quarantine released shared descriptor ranges(9ddd2feb):crates/xcl/src/hle/d3d12x/console_heap.rs(per-queue fence quarantine forGLOBALandGLOBAL_SAMPLER, batched release on heap unregister, serialized deferredfill_nulls+NAMES.cleardrain underGLOBAL_DRAINwithGLOBAL_DRAIN_SEQsynchronization forslot(), coalesced sampler free list, and unit tests for multi-queue quarantine, coalescing, deferred view null-fill, mid-drain concurrentslot()and second-drainer waiting, zero-queue immediate release, and failed fence signals)Tested
Commit
9ddd2feb57a2e1bee79d387c5a3cf057798eed47(based onnvidia-devaf2cecc40886a8682ecf3267f5328c6dc4b66ad7, clean worktree).32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200,rustc 1.97.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5,XCL_ADAPTER=NVIDIA.9ddd2feb:cargo test -p xcl --lib console_heap -- --test-threads=4(debug): 22 passed, 0 failed (slot_waits_for_in_flight_drain_before_returning_unmappedpassed);cargo test --release -p xcl --lib console_heap -- --test-threads=4: 22 passed, 0 failed.9ddd2feb:cargo build --release -p xcl(exit 0) + 60 s retailscripts/smoke.ps1(XCL_PREPARE=0, RTX 5080):1640frames,15757MB peak commit,0removals,0crashes.b7552237(debug,cargo test --workspace --no-fail-fast -- --test-threads=4): 1749 passed, 7 failed, 48 ignored,27 SKIPPED(6 failures reproduce on unmodifiednvidia-devaf2cecc4:texture_upload::tests×2,d3d12_mesh_stream,gpu_compute_e2e,gpu_two_pass_cache_e2e×2; the 7th was intermittente2eNVIDIAumdlogs, which passed4/0/0×3 standalone on bothaf2cecc4andb7552237).32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200,rustc 1.99.1(stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC1.8.2502.11,XCL_ADAPTER=NVIDIA.console_heap.rsdiff immediately before squashing to9ddd2feb:cargo test -p xcl --lib console_heap -- --test-threads=4(debug): 22 passed, 0 failed;cargo test --release -p xcl --lib console_heap -- --test-threads=4: 22 passed, 0 failed.b7552237(debug,cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture): 1749 passed, 7 failed, 48 ignored,30 SKIPPED(same 6 pre-existingaf2cecc4failures plus unrelated parallel flakegamesave::tests::atomic_writes_preserve_xcltmp_blobs_and_skip_leftover_temps, which passed3/3standalone on bothb7552237andaf2cecc4).Regression run
main(b49be183, RTX 5080, release):PR (
9ddd2feb, RTX 5080, release,XCL_PREPARE=0):Not tested
9ddd2febafter theconsole_heap.rs-only concurrency fix (covered by debug + releaseconsole_heaptests on both PCs and the fresh RTX 5080 smoke on9ddd2feb).scripts/smoke.ps1on the RTX 2080 SUPER.nvidia-dev(the 60 s smoke verifies stability and memory parity).AI use
Ran via Samaritan:
b7552237, and performed the independent read-only concurrency audit of thedrain_global_retiredfix (catching a check-order race inslot()and confirming PASS after the fix).b7552237.GLOBAL_DRAIN/GLOBAL_DRAIN_SEQfix and deterministic concurrency test for@KDenKC's review, ran the dual-PCconsole_heapdebug/release checks and fresh RTX 5080 smoke on9ddd2feb, ranscripts/pr_check.py --local, updated this description, and pushed9ddd2feb.