D3D12.X: switch KickoffX onto an idle spare PC list when the submitted list is in flight #2320
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!2320
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2320"
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?
@Decodere on GitHub · 2026-11-25 14:07 UTC · original
Decodere:fix-2163-kickoff-in-flight-spare→main· +552 −59 · 2 files · 1 commits · openWhat is in it
Follow-up to #2163 (Part of #1452).
list_x::kickoff_x()previously closed and submitted the active PC command list (this) — plus any earlier split segments — and immediately calledReseton that same PC list (or onprimaryafter a mid-list split), even when its submission was still in flight on the GPU. When a title issues back-to-backKickoffXcalls or followsKickoffXwithClose+ExecuteCommandListsbefore the previous kickoff retires, PC D3D12 rejects resubmitting an in-flight command list (debug layer ID 553,EXECUTECOMMANDLISTS_COMMANDLIST_STILL_IN_FLIGHT) and strict drivers can trigger device removal.crates/xcl/src/hle/d3d12x/title_list.rs:primary_of(wrapper),switch_active_for_kickoff(wrapper, old_active, new_active), andmark_kickoff_unreset(wrapper)(backed bySegmentBook::kickoff_unreset, cleared onreset/switch_active_for_kickoff) to updateF_BACKING,WRAPPER_OF,book.first, andbook.sparesonly afterResetsucceeds, keepF_PRIMARYout ofbook.firstandbook.spares, and suppresspush_segmentsuntil the title's nextResetifKickoffXcannot obtain/reset an idle target.switch_active_for_kickoff_keeps_primary_out_of_sparesandkickoff_unreset_suppresses_push_segments_until_reset.crates/xcl/src/hle/d3d12x/list_x.rs:create_closed_spare(template, ty, alloc)(used by bothreset_stand_inandkickoff_x) so a newly created spare whose initialClosefails is forgotten and released rather than returned to the spare pool.acquire_kickoff_target(...)and added an early empty-batch return inexecute_with_waits_on: for wrapped console lists (wrapper = Some(w)), prefer returning toprimaryonce idle, otherwise try every idle pooled spare and thencreate_closed_sparewhenevercurrent_targetis still in flight, returning any failed spares toput_spare. If no idle candidate can be created or reset whilecurrent_targetis still in flight, never fall back toreset_one(current_target)(preserving the idle-list invariant even whenID3D12GraphicsCommandList::Reseton an in-flight list would returnS_OK): leavecurrent_targetclosed and calltitle_list::mark_kickoff_unreset(w)so neither a follow-upKickoffXnorExecuteCommandListsresubmits it before the title's nextReset(caught by@pickles976).#2118'srecord_deferred(wrapper)inkickoff_x, transferredbind+ListState+ DRED pipeline labels ontotarget, cleared retired segment state, and guardedinit_psoand predication restore forCOPYcommand lists.kickoff_x_while_in_flight_switches_to_idle_spare_and_preserves_state,kickoff_x_after_midlist_split_switches_to_idle_spare, andkickoff_x_failure_paths_never_reset_in_flight_target(covering both no-spare/create failure and spare-Resetfailure whileprimaryis gated in flight, multi-spare recovery, suppressedpush_segments/execute_with_waits_on, and post-drainResetrecovery).(Rebased onto
origin/main6d12f58a.)Tested
Hardware / toolchain: Windows 11 Home 26200, Intel Core i5-11400F, 32 GB RAM, NVIDIA GeForce RTX 4060 8 GB (driver 621.14, wave32-only), Rust 1.100.0, DXC 1.9.2609.5.
kickoff_xon RTX 4060,--test-threads=1):cargo test -p xcl --lib kickoff_x_ -- --test-threads=1 --nocapture:0 passed; 2 failed(kickoff_x_while_in_flight_switches_to_idle_spare_and_preserves_stateandkickoff_x_after_midlist_split_switches_to_idle_spareboth reproduced live D3D12 ID 553 in-flight command-list resubmission warnings#1..#3and failed assertions).62f6d473rebased ontoorigin/main6d12f58a,--release -- --test-threads=1 --nocapture):hle::d3d12x::title_list::tests:5 passed; 0 failed; 0 ignored(0.02 son both RTX 4060 and WARP,0skipped).kickoff:6 passed; 0 failed; 0 ignored(0.31 sRTX 4060,0.33 sWARP,0skipped; includeskickoff_x_failure_paths_never_reset_in_flight_target).predication_e2e:1 passed; 0 failed; 0 ignored(0.51 sRTX 4060,0skipped; verifies unwrappedKickoffXbehavior stays intact).Regression run
cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocaptureon62f6d473):1428 passed; 0 failed; 46 ignoredacross37test binaries (29pre-existing host-capabilitySKIPPED:21no wave64,3wave32, per-lane form: refused,3missing D3D12 debug layer,1no heap windows,1cannot disable the driver cache;0skipped intitle_list,kickoff, orpredication_e2e).scripts/smoke.ps1 -Seconds 60):Baseline (
origin/main889ef3e8aa7f267323ab4879e735e65da6bcef10):PR head (
62f6d4737b28a5fc7e9808350724c0c1a4a0f168):Not tested
d3d12SDKLayers.dllis not installed on this host; in-flight resubmission avoidance is verified viaalloc_pool::note_resubmitsandGetDeviceRemovedReason().is_ok()).KickoffXon aCOPYcommand list (theCOPYlistinit_pso/ predication guard was verified by code inspection).list_x::testsunder--test-threads=4on NVIDIA driver 621.14 (also reproduced 3/15 times on unmodifiedorigin/mainafc5ee86withDXGI_ERROR_DEVICE_HUNG/E_OUTOFMEMORYacrosscross_queue_wait64_before_signal,mid_list_write64_wait64_split, androtating_queue_self_deadlock; out of scope for this PR, while the two new gated-queueKickoffXtests serialize against each other via a test-only mutex).AI use
Assisted by Google Antigravity (Gemini 4 Neon) for code analysis, implementation, test authoring, and verification.
@nnonno91 on GitHub · 2026-11-25 14:17 UTC · original
Independent focused check of
4db9383acea69d0c355ce5d2cb339a9f6ad1d2bb.Tested
cargo test --locked -p xcl --lib kickoff -- --nocapture --test-threads=1gave 4 passed, 0 failed, 0 ignored and no skips. Both new in-flight queue scenarios completed, including after a mid-list split. The spare bookkeeping and existing render-target binding tests also passed.Not tested
Explicit per-adapter or WARP runs, before/after reproduction, the full workspace suite and retail smoke.
AI use
OpenAI Codex (GPT-6.2 Sol) ran the checks, verified the logs and wrote this report.
@thehollowedone on GitHub · 2026-11-25 14:30 UTC · original
Independent check of 4db9383. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11.
cargo build --offline --locked --workspace -j 6.cargo test --offline --locked --workspace --no-fail-fast -j 6 -- --test-threads=4 --nocapturefinished with 1,268 passed, 0 failed, 46 ignored, including 26 runtime skips in the pass count. All four stock KickoffX and spare-list bookkeeping tests passed.cargo test --offline --locked -p xcl --lib -j 6 kickoff_x_ -- --test-threads=1 --nocapturein separate processes with test-only changes that selected the RTX 3080 Ti and Microsoft WARP explicitly and read the D3D12 debug queue. Both runs passed 3/3 with zero skips. Each adapter completed the two gated-queue cases (back-to-back kickoff and mid-list split) with zero ID 553 messages, zero D3D12 warnings or errors, and a healthy device. Runtime code was unchanged.Synthetic input only. No retail smoke on this machine.
AI-assisted. Codex (GPT-6, exact variant unavailable) added the temporary test instrumentation, ran the tests and drafted this report.
@luckyteagirl on GitHub · 2026-11-25 14:53 UTC · original
Independent RX 6800M verification of exact PR head
4db9383acea69d0c355ce5d2cb339a9f6ad1d2bb.Environment: Windows 11 build 26200; Ryzen 9 5980HX; discrete AMD Radeon RX 6800M driver
30.0.13002.13003alongside integrated Radeon graphics; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. Isolated debug Cargo target.On the unchanged head,
cargo test --locked -p xcl --lib kickoff_x_ -- --test-threads=1 --show-outputpassed 3 passed, 0 failed, 0 ignored, with no skips. Itstest_device_or_warphelper does not print or select the adapter, so that run alone is not attributable to the RX 6800M.For an attributable GPU check, I changed only that test helper locally to use
gpu::adapter::Selector::from_env_or("auto")pluscandidates, then ran the same filter withXCL_ADAPTER=6800M. It again passed 3/0/0, no skips. Both new in-flight tests printedKickoffX test adapter: AMD Radeon RX 6800M: back-to-back gated KickoffX switched to distinct idle spares and returned to primary after draining; the mid-listWrite64/Wait64split resumed on an idle spare. Their built-in checks reported no in-flight resubmits and a healthy device. The third passing test is the existing render-target binding check. I removed the test-only selector edit and verified the worktree is clean.Limits: Focused synthetic tests only. I did not run the full workspace suite, a paired title smoke, or a live D3D12 debug-layer check on this head. A separate title smoke attempt for another PR had stopped under the available-commit memory guard. This does not cover an actual title's back-to-back KickoffX sequence.
AI use: OpenAI Codex (GPT-6; exact variant unavailable in this session) ran the Windows checks, made and restored the test-only selector, and drafted this report. No game data was used.
@oni-swr on GitHub · 2026-11-25 15:26 UTC · original
Independent AMD report for
4db9383acea69d0c355ce5d2cb339a9f6ad1d2bb.Tested
main).cargo test -p xcl --lib kickoff: 4 passed, 0 failed.switch_active_for_kickoff: 1 passed. Both new in-flight scenarios ran on the RX 7800 XT (no SKIPPED line).cargo test --workspace --no-fail-fast -- --test-threads=4: 1267 passed, 1 failed, 46 ignored. The one failure isgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722:res[30] = 0x1, CPU 0x7fffffff). It fails identically onmain06c9f550on this adapter (cargo test -p xcl --lib fuzz_validate_and_gpu_1), so it is not caused by this PR.f16_programs_on_the_gpu/f32_programs_on_the_gpuper-lane cases refused forV_MUL_F16,V_PK_MUL_F16orV_CVT_F16_F32, plusheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).scripts/smoke.ps1 -Seconds 60on a real title (same title, same time), release build. main06c9f550: 1531 frames, last presents per 2 s 60 36 38, peak commit 17752 MB, no device removal, no crash. PR head4db9383a: 1571 frames, last presents per 2 s 59 61 59, peak commit 15155 MB, no device removal, no crash. Both exit 0x0.Not tested
Retail title with a before/after reproduction of the #1452 debug-layer error, other adapters, NVIDIA.
AI use
Claude Code (Claude Sonnet 5.5) ran the tests and the smoke runs and wrote this report. No game files, dumps or shader names are included.
@thiagocalile on GitHub · 2026-11-25 15:50 UTC · original
Independent test and 60 s smoke report for head
4db9383acea69d0c355ce5d2cb339a9f6ad1d2bbon an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).Tested
32.0.21045.29003,XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11.XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --lib -- kickoff --test-threads=4: 4 passed, 0 failed, 0 ignored (0skipped).Regression run (
scripts/smoke.ps1 -Seconds 60, release builds,XCL_ADAPTER=radeon)main(06c9f55):PR
#2320(4db9383):Not tested: full workspace test suite on this head, NVIDIA/Intel GPUs, Linux/Wine, or world load past the 60 s smoke window.
AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.
@Decodere on GitHub · 2026-11-25 17:14 UTC · original
Rebased onto
50a9fdef(6a3d4a38, resolving thelist_x::testsEOF conflict with#1291). Re-verifiedtitle_list::tests(4/0),list_x::tests(38/0), and paired 60 s RTX 4060 smoke (1544 -> 1578,0device removals/crashes); workspace hit only50a9fdef's pre-existing#2074a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrierfailure (1291 passed, 1 failed).@DavidM1911 on GitHub · 2026-11-25 17:52 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!
@Lum7nt on GitHub · 2026-11-25 19:11 UTC · original
RX 9070 XT verification of exact PR head
6a3d4a38b4b62522fda36a75d5ba3499d6d436eb.Hardware: AMD Radeon RX 9070 XT, Windows, retail GTA 6 Xbox 1.0.2.1; Rust 1.100.0 MSVC, bundled DXC.
Focused tests:
cargo test --locked -p xcl --lib kickoff -- --test-threads=1— 4 passed, 0 failed, 0 ignored, 0 skipped. This includes both new in-flight KickoffX cases and the spare-list bookkeeping checks.60-second
scripts/smoke.ps1regression pair:PR head:
Current main:
The retail smoke passed but did not specifically trigger back-to-back in-flight KickoffX; the focused gated-queue tests cover that path. The D3D12 debug layer is not installed here, so there is no live ID 553 debug-queue check on this card.
AI use: OpenAI Codex (GPT-6; exact variant not exposed in this session) ran these checks and wrote this report.
@pickles976 on GitHub · 2026-11-25 19:31 UTC · original
Code-review finding on
6a3d4a38b4b62522fda36a75d5ba3499d6d436eb: the idle-spare invariant is not preserved on allocation/reset failure paths inkickoff_x.In the candidate/
reset_oneblock inlist_x.rs:current_targetis in flight,pop_spare(w).or_else(|| create_closed_spare(...))can returnNone(including native create/initial Close failure). The finalelsethen callsreset_one(current_target)anyway.reset_one(cand)fails, the code also falls back to(current_target, reset_one(current_target)), without establishing thatcurrent_targethas retired.The fallback Reset is not a retirement check: Microsoft explicitly permits
ID3D12GraphicsCommandList::Resetwhile the command list is still executing. If it succeeds before the earlier fence completes, the function resumes recording on the in-flight list that this change is intended to avoid reusing. [INFERENCE] A subsequent Kickoff/Execute before retirement can therefore return to the ID 553 path under spare-allocation pressure, despite passing the success-path gated-queue tests.Could the error path preserve the same invariant—do not resume/subsequently submit this target until its previous fence retires, or terminate the operation safely—and add coverage for both no-spare/create failure and spare-Reset failure while the old target is gated? Simply checking
reset_hr < 0after falling back does not cover successful Reset of a still-in-flight command list.Context/limits: our separate Linux/Wine retail integration logged same-recording, same-queue resubmits while approaching a conservative 6000 MiB VRAM cutoff. It does not contain this PR, and that warning alone does not establish that KickoffX caused our run's resubmits. I inspected your source and the API contract here; I did not induce allocation failures or run your PR, and I am not submitting a competing fix. This is general failure-path feedback relevant to limited-memory hosts, not a claim about a specific GPU or the root cause of our earlier host freeze.
AI assistance: OpenAI coding assistant reviewed the linked code/contract and drafted this report.
@Decodere on GitHub · 2026-11-25 20:23 UTC · original
Good catch — fixed in
62f6d473(rebased onto6d12f58a).Extracted
list_x::acquire_kickoff_targetsokickoff_xnever falls back to resettingcurrent_targetwhilealloc_pool::in_flight(current_target)is true (on either no-spare/create failure or spare-Resetfailure), instead leavingcurrent_targetclosed and callingtitle_list::mark_kickoff_unreset(w)(with an empty-batch early return inexecute_with_waits_on) so neither a follow-upKickoffXnorClose+ExecuteCommandListscan resubmit the in-flight list until the title's nextReset. Addedtitle_list::tests::kickoff_unreset_suppresses_push_segments_until_resetand gated-queuelist_x::tests::kickoff_x_failure_paths_never_reset_in_flight_target(passing on both RTX 4060 & WARP; workspace1428 passed, 0 failed).@oni-swr on GitHub · 2026-11-25 22:09 UTC · original
Independent AMD report for
62f6d4737b28a5fc7e9808350724c0c1a4a0f168.Tested
XCL_ADAPTER=radeon. Exact PR head (not a local merge ontomain); main at the time was6d12f58a.cargo test --workspace --no-fail-fast -j 4 -- --test-threads=4: 1427 passed, 1 failed, 46 ignored. The one failure isgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722:res[30] = 0x1, CPU 0x7fffffff); it fails identically onmain6d12f58aon this adapter (cargo test -p xcl --lib fuzz_validate_and_gpu_1), so it is not caused by this PR.f16_programs_on_the_gpu/f32_programs_on_the_gpuper-lane cases refused forV_MUL_F16,V_PK_MUL_F16orV_CVT_F16_F32, andheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).cargo test -p xcl --lib kickoff-area tests ran in the workspace run: the three newlist_x::tests::kickoff_x_*GPU scenarios (in-flight switch to idle spare, mid-list Wait split, failure paths) andtitle_list::tests::kickoff_unreset_suppresses_push_segments_until_reset/switch_active_for_kickoff_keeps_primary_out_of_sparesall passed, with no SKIPPED line for them (they ran on the RX 7800 XT, not the WARP fallback).Not tested
scripts/smoke.ps1/ a retail title (no regression run), other adapters, NVIDIA. No game data was used.AI use
Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report. No game files, dumps or shader names are included.
@bmjask on GitHub · 2026-11-25 21:19 UTC · original · reviewed
No concrete source-level defect found. In-flight primary protection, spare selection/reset failure behavior, split segment bookkeeping, and state transfer look sound; current CI and broad gated-queue evidence are green. Residual gaps: no live COPY-list back-to-back in-flight reproduction, and current targeted debug-layer coverage would strengthen latest failure-path changes. The deliberate suppression until title Reset after allocation/reset failure should remain documented. I found no blocker.
@DavidM1911 on GitHub · 2026-11-26 08:15 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: 1 failure under parallel scheduling; clean on--test-threads=1rerun (1312 passed, 0 failed, 27 ignored, 82s). Intermittent single-test flake — tracked in #1978.Thanks!
— Devin
github-bot referenced this pull request2026-11-26 08:35:19 +00:00
View 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.