D3D12.X: forget a command list before the runtime frees it #2691
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!2691
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2691"
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?
@SergeAx on GitHub · 2026-11-26 06:27 UTC · original
SergeAx:d3d12x-forget-lists-before-release→main· +70 −5 · 1 files · 1 commits · openFixes #2690.
real::cl_releasedropped what XCL keeps by a command list's address only after the runtime's finalReleasehad freed the list, so a list created on another thread in between could get the address and lose its bind state, allocator, last submit and DRED marks. Asres_releaseand #2422 do, the last reference (AddRefreturns 2) now forgets the list first. When two last-but-one releases race, both miss it and the list is forgotten after its release, as before.What is in it
crates/xcl/src/hle/d3d12x/real.rs:cl_releaseforgets the list before the runtime's finalRelease(forget_command_list).crates/xcl/src/hle/d3d12x/real.rs(list_release_tests):a_new_list_at_a_released_lists_address_keeps_its_state, a fake list whoseReleasehands its address to a new list at once.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4at008fc961(onmainb49be183), with a retail title running on the same GPU: 1430 passed, 6 failed, 47 ignored. The 6: #1905 (fuzz_validate_and_gpu_0.._3);vram::tests::d32s8_targets_take_their_own_size_of_video_memory(#2588, which #2593 fixes);list_x::tests::a_reset_while_the_last_submit_runs_records_on_another_pc_list(#42, parallel-only; not explained by this change, see #2690).V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32);heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowsmain'scl_release(the new list's bind state is gone) and passes with this change.--test-threads=4 hle::d3d12x::list_x, builds alternating:a_dispatch_with_a_pipeline_still_building_waits_at_the_submitfailed in 13 of 200 runs onmainand 6 of 200 with this change. Most of it istitle_list::release's longer window, which #1453 closes (0 of 400 with #1453, 0 of 400 with both).Regression run
main:
this PR:
Not tested
cl_release: the two conflict there textually (forget_command_listwould take #2138's order)AI use
@SlopTart on GitHub · 2026-11-26 06:50 UTC · original · edited 2026-11-26 07:02 UTC
Tested on the Linux/Wine lane, full standard env (AMD rig: Ryzen 9 9900X, 96 GB DDR5, RX 7900 XT 20 GB, Arch kernel 7.2.15, Mesa 26.2.5 RADV, wine-11.0 Proton, rustc 1.94.0;
d3d12,d3d12core,dxgi,d3d11,d3d10core=n,boverrides, official DXC kit,VKD3D_CONFIG=ignore_shared_fence, threads=2), head008fc961, mergeable against mainb49be183:non-gpu suite (
--skip gpu::): 597 passed, 3 failed, 4 ignored, 733 filtered.The failure set is identical to bare main
b49be183measured on the same rig the same day (596 passed, 3 failed): gpu_promoted_uav_clear (our #2490), xma2_source_voice (#2481, vendored-FAudio gate). The third red, the sparse tile video-memory test, is a known batch flake (green solo).Zero delta from this PR; every test it adds passes inside the suite.
Not tested: gpu suite, Windows native.
Correction: an earlier version of this row reported three extra reds; those runs lacked the
d3d12,d3d12core=n,bDLL overrides and hit stub-DLL NOTIMPL artifacts. Re-ran with the standard env, artifacts gone.AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
@luckyteagirl on GitHub · 2026-11-26 07:09 UTC · original
RX 6800M verification at exact PR head
008fc9618549088436a454a2247bfd4d62aeb5ccagainst current mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7(Windows 11, AMD driver30.0.13002.13003, Rust 1.99.0 MSVC):cargo test --locked -p xcl --lib -j 1 hle::d3d12x::real::list_release_tests::a_new_list_at_a_released_lists_address_keeps_its_state -- --exact --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, 1,336 filtered. This is the synthetic pointer-reuse fixture.cargo build --locked --release -p xcl -j 1: passed; head executable SHA-256D81895D827BCDFEEAB5C971FAADC03D381C521690D74C7C40E36AFC948BD8F81.scripts/smoke.ps1 -Seconds 12,XCL_ADAPTER=6800M, and separate data/DXIL cache directories, on the same locally owned title build (hash2ef5fd64):b49be183008fc9610x00x0I attempted a longer 60-second clean-main control. A separate low-memory monitor stopped that control after about 22 seconds when available commit fell to 1,015 MB, so there is no comparable 60-second result. These short runs show startup and presentation; they do not trigger the command-list address-reuse race or establish world-load/performance behavior. I did not run the full workspace suite on this head. AI-assisted test report with Codex.
@sage-sage on GitHub · 2026-11-26 07:40 UTC · original
Test report: passes on NVIDIA, and with #1453 the dispatch flake from #2690 did not show in 300 parallel runs. Exact head
008fc961(its base is currentmainb49be18, so head = merged).Tested
cargo test --workspace -- --test-threads=4on this head: 1436 passed, 0 failed, 47 ignored; onmain+ #2691 + #1453: 1438 passed, 0 failed, 47 ignoredmainon this machine (wave64, debug layer, Developer Mode, heap windows)main+ #2691 + #1453 merged locally (fc8561d), the lib test binary withhle:: --test-threads=12, 300 runs:a_dispatch_with_a_pipeline_still_building_waits_at_the_submitfailed 0 times. Onmain(with only a test-only acphal change, #2700) the same setting failed it 32 times in 300 runs. The other failures in the 300 wereacphal::tests::xapu_connect_returns_oom_and_cleans_up_on_failure(5), a test-only flake #2700 fixes.Not tested
Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
@KDenKC on GitHub · 2026-11-26 09:12 UTC · original
A data point from our AMD iGPU (RDNA2),
list_xwith--test-threads=4. The flakya_dispatch_with_a_pipeline_still_building_waits_at_the_submit(stand-in lost,0x0skipped) failed 3 of 5 runs onmain, 3 of 11 with this PR alone, 0 of 50 with #1453, and 0 of 50 with both. So on this fixture the remaining failures come from thetitle_listpath #1453 fixes. The two merge cleanly together. Details are in #1453: #1453AI use: Claude Code (Claude Opus 5.5) ran the arms and wrote this.
xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590View 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.