D3D12.X: a mid-list split gets its next segment before it closes the list #2717
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!2717
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2717"
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?
@Kalmarv on GitHub · 2026-11-26 08:17 UTC · original
Kalmarv:split-close-order→main· +167 −23 · 2 files · 1 commits · openA mid-list split (a
Wait64BitValueXafter aWrite64BitValue*in the same list) closed the title's list before it had the next segment. When the next segment could not be made (CreateCommandListfailed), the split gave up with the list already closed: the title went on recording into a closed list. All of it was lost, Write64 cell writes included, and the title's ownClosethen failed. Now the split gets the next segment first: a spare, or a new list made closed withCreateCommandList1. It is opened on the allocator only after the Close, because an allocator backs one recording at a time. When none can be had, the list stays open and the wait stays in it, as when the split is turned off (XCL_SPLIT_MIDLIST_WAIT=0).Part of #1452. This may not be what stops the reporter's run (#1452), where a Write64 cell is recorded and never submitted. That log shows a successful split (
#1) and, in what was posted, nomid-list split … CreateCommandList failedwarning. This is one path that gives that state; #2691 (a list forgotten after the runtime frees it, so a new list at its address loses its Write64s) is another. The dump line that tells them apart is in #2718 (stacked on #2244). @xpatfussy69x, if you can: one run of your route with that PR andnvidia-smi dmon -s pucm -o Tbeside it, plus anymid-list splitlines from the log.What is in it
crates/xcl/src/hle/d3d12x/list_x.rs:splittakes the next segment (next_segment_list) before it closes the list. A failed Close puts the segment back as a spare. A failed Reset of it falls back toCreateCommandListon the allocator, as before.crates/xcl/src/hle/d3d12x/real.rs:create_closed_pc_command_list(CreateCommandList1, closed, no allocator), next tocreate_raw_pc_command_list.a_split_without_a_next_segment_leaves_the_list_recording: a split with no next segment to be had (a test-only switch), then one that makes its segment with CreateCommandList1. A GPU write recorded after each wait must land, and both Write64s must count as submitted.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4at7fce1295(onmainb49be183): 1434 passed, 2 failed, 47 ignored. The 2 aregpu::recomp::link_tests::gpu_linked_memory_accessorsandlinked_programs_keep_their_declarations: this machine's DXC (Windows SDK, 1.7.2308) rejects[WaveSize]on a function that is not an entry point. They fail the same way onmain's code.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'ssplitand the same switch (the list is closed after the failed split, so the next split's Close fails and no segment is made: 1 segment, expected 2), and passes with this change.Regression run
main (
b49be18):this PR (
7fce129):Not tested
CreateCommandListfailure: the test switches the creation offsplit command listline in either log), so they check the rest of the runtime onlyAI use
🤖 Generated with Claude Code
@DarkPanda69 on GitHub · 2026-11-26 08:36 UTC · original
AMD run (listed as untested): the new test passes on an RX 9070 XT, and the
d3d12x::tests pass on it and on an RTX 3060.Head
7fce129applied onmainb49be18, debug, Windows 11 Pro 26200, card chosen withXCL_ADAPTER, run with--nocapture:a_split_without_a_next_segment_leaves_the_list_recording: ok, no SKIPPED. The test makes its device on the default adapter, which is the RX 9070 XT (RDNA4, driver 32.0.32029.2010) on this machine.cargo test -p xcl --lib -- d3d12x::: 255 passed, 0 failed, 2 ignored, no SKIPPED, on both the RX 9070 XT and the RTX 3060 (12 GB, driver 32.0.16.1088).Not tested: the reporter's route on the RTX 3060. There is no title here, and the new test always uses the default adapter, so it did not run on the RTX 3060. Also not tested: Intel, a real
CreateCommandListfailure.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@luckyteagirl on GitHub · 2026-11-26 08:37 UTC · original · reviewed
At exact head
7fce129on current mainb49be18, a failed Reset abandons an owned command-list reference. This is a source-derived review; I did not inject a D3D12 Reset failure.The no-spare path now gets
nextfromcreate_closed_pc_command_list, whose normal-device branch transfers ownership withinto_raw()and adopts it. After the current list closes,splittriesreset_list(next, …). If that Reset fails, the branch atlist_x.rs:2834–2845replacesnextwith a separately created fallback list or returnsNone; neither outcome releases or pools the failednext. The earlier code had a similar hole for a popped spare, but this PR makes a fresh list reachable through the failure path too, including when resource pressure is already causing Reset/creation failures.Could the failed
nextbe released through the adopted-list cleanup path before trying the fallback (rather than reusing a list whose Reset failed)? A fault-injected Reset failure with both successful and failed fallback creation could assert that the abandoned list's COM reference is released exactly once.AI assistance: three GPT-6.2 Sol agents independently identified the ownership path; GPT-6.2 Astra checked the exact-head source and wording.
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.