D3D12.X: a list reset while its last submit runs records on a spare #2163
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!2163
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2163/head"
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?
@throny on GitHub · 2026-11-25 06:40 UTC · original
throny:d3d12x-resubmit-spare-list→main· +292 −35 · 4 files · 2 commits · merged 2026-11-25 10:42 UTCStacked on #2160; only the top commit (
78fba7b) belongs here.The retail title resets a command list and submits its new recording on the same queue while the GPU still runs the list's previous submit. A console allows that; PC D3D12 does not (debug layer id 553), and on NVIDIA the device is removed soon after (#1452). With this change such a recording goes onto a spare PC list instead, the way
alloc_poolalready swaps allocators, so no PC list is submitted again while it runs. No CPU wait.The title resets through the newer console list layout's #139 (allocator, NULL, 0). The title list's wrapper forwards that slot to the PC list it records on, where it reaches
list_x::reset_x, bypassing the wrapper's own #10 Reset. Soreset_xnow sends a reset of a wrapped list's PC list to the wrapper's Reset, which decides between the primary PC list and a stand-in.Part of #1452. It does not fix the device removal on its own, see below.
What is in it
crates/xcl/src/hle/d3d12x/title_list.rs:SegmentBook::first, a PC list recording in place of the primary while the primary's last submit runs. Reset puts the new recording on it,push_segmentssubmits it in the primary's place, and the next Reset after the GPU is done returns to the primary.pop_spareskips spares still on the GPU,put_spareis new, andreleasefreesfirst.crates/xcl/src/hle/d3d12x/list_x.rs:reset_stand_in(a finished spare or a new PC list, reset like the primary).reset_xroutes a wrapped list's reset through the wrapper; the old body isreset_pc. Side effect: a #139 Reset on a split list now resets from the primary and reclaims the extra segments, where before it reset only the last segment.crates/xcl/src/hle/d3d12x/alloc_pool.rs:in_flight(list).a_reset_while_the_last_submit_runs_records_on_another_pc_list, through #10 and throughreset_xon the PC list, as #139 resolves. A queue Wait holds the first submit; three Reset and submit rounds must use three different PC lists with no resubmit, then the primary again once the GPU is done. Without the change it fails ("the new recording must not be on the PC list still on the GPU").Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4on78fba7b(on #2160,main6020a33): 1 156 passed, 0 failed, 46 ignored, first run (one more than #2160: this PR's test). Same 25SKIPPEDlines as #2160 (wave64, per-lane refusals, heap windows, driver cache).XCL_DIRECT_DXIL=1, this commit and #2160 on top ofmain177cd40(where the removal reproduces here in 4 of 4 runs at 92 – 100 s), two 5-minute runs:So the resubmits are gone. The removal still happened in 1 of 2 runs, later, again a few seconds after cross-queue waits started timing out one signal short (#1452). That part is not this.
Regression run
scripts/smoke.ps1, the retail title, 60 s, release builds of both commits,mainfirst.main:
PR:
Not tested
reset_xon the PC list directly, which is what #139 resolves to.AI use
🤖 Generated with Claude Code
@JJAutoCompare on GitHub · 2026-11-25 06:59 UTC · original
Independent Windows x64 + Intel Arc A770 test report on commit
78fba7b6609c922cbd944ae78603b1617d5bb69c.Environment
32.0.101.9175, Tiled Resources Tier 4, Resource Heap Tier 1,DoublePrecisionFloatShaderOps=0)rustc 1.100.0 (0ef1bc386 2026-11-09), DXC1.9.2609.5 (01b62ad47)Command
Executed under serialized Arc A770 GPU mutex (
XCL_ADAPTER=A770) with pre/post-mutex executable SHA-256 verified (2AE9743B9D1CFBF3D01EEA418BCF180DA029074D419EE5A4D692D89697F8C277):Results
alloc_poolandlist_xtests passed withoutSKIPPEDoutput.Not tested
AI use
gemini-4-neon).@futurepro62 on GitHub · 2026-11-25 07:07 UTC · original · edited 2026-11-25 07:11 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
78fba7b(on its base6020a33).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1144 passed, 0 failed, 44 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.a_resubmit_while_the_previous_submit_runs_is_noticed,a_reset_while_the_last_submit_runs_records_on_another_pc_list.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1155 passed, 0 failed, 46 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main568e7dbtoo, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests,const_and_null_mask_operands_agree_with_hlsl_on_the_gpuandmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-25 07:20 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@luckyteagirl on GitHub · 2026-11-25 07:43 UTC · original
Focused Windows check on exact PR head
78fba7b6609c922cbd944ae78603b1617d5bb69c(base568e7db7729c8fa6c8f0f4b32d798faaf11462bb).Environment: Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M, driver
30.0.13002.13003; Rust 1.99.0 MSVC. Clean detached worktree.Tested: Built the XCL lib-test executable with
cargo test --locked -p xcl --lib -j 2 a_reset_while_the_last_submit_runs_records_on_another_pc_list -- --test-threads=1 --show-output. Then reran that exact-head executable with--exact hle::d3d12x::list_x::tests::a_reset_while_the_last_submit_runs_records_on_another_pc_list --test-threads=1 --show-output,XCL_REQUIRE_GPU=wave64, and a temporary Windows high-performance per-app preference for that executable. The preference was restored after the run.Result: 1 passed, 0 failed, 0 ignored, 0
SKIPPED. Both Reset paths in the test completed; the log shows four spare-list reset messages. The test callscreate_device(None), soXCL_ADAPTERalone would not select the dGPU. A separate LUID probe on this host under the same per-app preference selected RX 6800M (00000000:00014d72), while the default without it selected the integrated AMD GPU. The test itself does not print a device LUID; the RX 6800M attribution follows from the per-app selection and matching device-creation call.Scope: Focused test only. I did not run the full workspace suite, reproduce the title's real #139 layout path, or run a paired title smoke test on this PR head.
AI use: OpenAI Codex built and ran the test, checked the GPU-selection method and exact revision, and prepared this report.
@Royalflamejlh on GitHub · 2026-11-25 09:03 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA test of
78fba7bagainst its base #2160 alone (637b82a), 3 runs of 100 s of the title each: with #2160 alone its warning reached#16(between 16 and 31 resubmits; it prints #1–8, then powers of two) in 3 of 3 runs, and each of the 9 lines it printed per run said a new recording on the same queue. With this change none of that kind was printed, the stand-in line reached#1024, and 1 resubmit of another kind came in 2 of the 3 runs. No run lost the device either way; all six stopped presenting at 76 to 80 s, before the 89 to 101 s where the description sees the removal, so this shows the stand-in working, not its effect on the removal.Setup: Fedora 44, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, RTX 4070 12 GB (driver 615.71.09). Both trees on
main568e7db+ #684, release,x86_64-pc-windows-gnu,XCL_PSO_PRELOAD=0. Retail title 1.0.2.1, the first-run screens completed once and no story progress, A pressed at about 16 s. Order: #2160 alone, with, with, #2160 alone, with, #2160 alone.Tested
78fba7b(3 runs)records on another PC list, last count printedNot tested: the test suite; past 100 s; the debug layer (not under vkd3d-proton); Windows; AMD and Intel.
AI use: Claude Code (Claude Opus 5.5) read the change, built the trees, ran the title and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@VolenNakov on GitHub · 2026-11-25 10:17 UTC · original
Tried this with #2160 on an RTX 4060 Ti 16 GB: the spare path works, but #2160's line still fires for submits of the same recording with no reset in between, and the device is removed later as before.
Setup
XCL_NETWORK=0.4df1e6e) + #2120, #1924, #2176, #2098, #2076, #2174 (tree C in my #2088 comment), then #2160 (637b82a) and this PR (78fba7b) merged locally (fe66c38). Two small conflicts, both sides kept:real.rs(#2160'snote_resubmitsnext to #2057's submit timing) andtitle_list.rsrelease(this PR'sb.firstadded to #2057's per-entry ownership check).XCL_DRED=1 XCL_TRACE_WAITS=1 XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_LOOK_SKIP=1 XCL_PSO_IMAGE_SKIP=1; every compute and graphics pipeline the earlier runs reached already built (6 big builds cold). One run.cargo test --release -p xcl --lib -- --test-threads=4: 1165 passed, 3 failed, 26 ignored. The 3 (title_textures::tests::transitions_apply_when_their_list_is_submitted,…placed_title_textures_share_vram_and_preserve_pixels,vram::tests::d32s8_targets_take_their_own_size_of_video_memory) pass on their own; on this card they fail only next to the other GPU tests, as onmain.What the run logged
a command list reset while its last submit is on the GPU records on another PC list.(the same recording, the same queue): 15.5, 17.8, 22.5, 94.2, 94.3, 94.4, 98.9, 99.4, 118.6 s (#16). None said another recording.#101at 121.6 s; six mid-list splits 123.7–168.2 s; 12 GPU waits released on the CPU from 166.2 s (the first round: q3 / q0 waiting on q1 and q1, the direct queue, waiting on q0, values submitted and not completed, as in #1452);0x887a0005at 172.2 s, DREDpage fault at GPU VA 0x0; allocations there: []with no breadcrumb line; then the title's0x80000003at+0x2474606.0x887a0005at 194.4 s (#1452). So no change in where it ends, from one run each.Reading
Not tested: more than one run; the debug layer on this tree;
mainwithout #2057.AI use: Claude Code with Claude Opus 5.5 merged and built the tree, ran it on my PC, read the log and wrote this comment.
@VolenNakov on GitHub · 2026-11-25 10:29 UTC · original
Follow-up: the same-recording resubmits don't look like the cause here. On the same tree and caches as above, plus a local diagnostic in #2160's
note_resubmitsthat makes the CPU wait (up to 2 s) for a list's previous submit before it is submitted again:0x887a0005, DRED empty) at 221.3 s, after 65 536 dispatches (32 768 and 172.2 s in the run above).One run each, so the later end may only be the slower submits. On this card the next things I'd look at are #2195 and video memory, which is full at that point in every run.
AI use: Claude Code (Claude Opus 5.5) wrote the diagnostic, ran it on my PC and wrote this.
@VolenNakov on GitHub · 2026-11-25 11:17 UTC · original
Correction to my comments here: the runs in them did not have
XCL_NETWORK=0; I listed it in the setup by mistake, and networking was at XCL's default (on). Nothing else in the setup or the results changes. My runs from now on useXCL_NETWORK=0.AI use: Claude Code (Claude Opus 5.5) made the mistake and wrote this correction.
@throny on GitHub · 2026-11-25 11:52 UTC · original · edited 2026-11-25 11:55 UTC
Related: #929 (shelbykb2) also changes slot #139 on the newer list layout. It makes the wrapper's #139 run
title_list::reset, so a list that was split mid-way drops its old segments. This PR handles the other case: a list reset while its last submit is still on the GPU records on a spare.The two merge without conflicts (
git mergeof #929 into this head). I haven't built or tested them together yet. With the mid-list split on, both paths run on every reset, so they'd best be tested as a pair before either is merged.AI use: Claude Code (Claude Opus 5.5).
Edit: one NVIDIA world-load run with both PRs on a
177cd40base and the split on (RTX 4080): no resubmits, the device still removed at 86.7 s. The pair doesn't fix the NVIDIA world-load stop on its own; that one now looks like the sparse windows' in-flight tile remaps (#262, details on #1269).