D3D12.X: a wait after a write into title memory in the same list is met by that write #1256
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!1256
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1256"
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?
@upipibi on GitHub · 2026-11-24 13:48 UTC · original
upipibi:fix/title-memory-write-then-wait→main· +33 −0 · 1 files · 1 commits · openwait_memorydrops aWait32/64BitValueXwhose address the same list already wrote (has_prior_write): the GPU reaches the write before the wait, and polling the address on the CPU before the list is submitted would only run into the timeout. Two writers do not record their range, because they go to the CPU instead (cpu_writes):Write32/64BitValueXinto the title's own memory outside the unified-memory windows;So a wait on such an address later in the same list stayed.
execute_with_waits_onpolled it before submitting the list, while the CPU makes the write only after the submit, so every such wait ran out its timeout and was then let through. Both writers now record the range, as the GPU writers (write,fill,CopyMemoryToMemoryX, timestamps into a window) already do.Found while checking defect 1 of @chazi123's report on #646 ("the CPU poll for a list's Wait ran before that same list was submitted"). For writes into the unified-memory windows,
mainalready drops or splits such waits. This was the one path where it can still happen. I can't tell whether it is the case in that report (their counter is in a window), so this PR does not claim to fix the+0x23cf683stop.What is in it
hle/d3d12x/list_x.rs:write()'s title-memory branch andtimestamp()'s readback branch callnote_writefor the range they queue.a_wait_after_a_title_memory_write_in_the_same_list_is_met_by_it: a synthetic list writes a heap word throughwrite()(no unified memory in the test, so it takes the CPU path), then waits on it and on another word. Only the wait on the other word may stay. It fails onmain(2 waits left) and passes here. It needs no GPU.Tested
cargo build --workspace+cargo test --workspace --no-fail-fast -- --test-threads=4:23d1aa8): 752 passed, 0 failed, 41 ignored;main930e8b4: 751 passed, 0 failed, 41 ignored.gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware.Regression run
From Kalmarv's run (https://github.com/ivall/xcl/pull/1256#issuecomment-7136777645), thanks:
main:
PR:
Limits (from bmjask's review): the write stays CPU-emulated and is made only after the whole list's fence completes (
cpu_writes::after), so commands after the dropped wait can run before the marker or timestamp lands.mainhas the same ordering (its CPU poll of the wait times out and lets the list through); this PR removes only the timeout. Ordering it properly means splitting the list at such a wait, which is a separate, larger change.Overlap with #2506 (tiagonleal): #2506 drops a same-list wait only when the value the list wrote meets it, and keeps dropping it when no value is recorded. This PR records the title-memory and timestamp writes with
note_write(no value), so on top of #2506 it would drop those waits whatever the value. The two conflict inlist_x.rs. If #2506 lands first, I'll rebase this so the title-memorywrite()records its value through #2506'snote_write_value, and the timestamp readback (value unknown) no longer drops a wait.Not tested
AI use
🤖 Generated with Claude Code
@DavidM1911 on GitHub · 2026-11-24 14:02 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
@Kalmarv on GitHub · 2026-11-24 15:53 UTC · original
Regression pair for
23d1aa8againstmain930e8b4(this PR's base), for the Regression run section. Both runs pass: no device removal, no crash, 100 % ofmain's frames, 106 % of its peak commit.Tested
scripts/smoke.ps1, the same retail title for 60 s each:mainat930e8b4(this PR's base) first, then this PR's head, one after the other on the same machine.XCL_ACTIVITY=1on both.main930e8b4:this PR,
23d1aa8:Wait…BitValueX timed outlines (the run you asked for): 0 onmainand 0 on this PR. Both logs have the 30activity (2 s)lines and their other warnings, so the warning would have been logged; neither 60 s run hit a wait timeout at all. The activity lines' frame-event waits also match: 2624 onmain, 2620 here, none timed out.Not tested
AI use: Claude Code (Claude Opus 5.5)
@thehollowedone on GitHub · 2026-11-25 11:06 UTC · original
Independent Windows run on 23d1aa8. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, debug.
cargo build --offline --locked --workspacepassed.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapturereported 752 passed, 0 failed, 41 ignored, with two wave64 skips included in Cargo's pass count.I extended the checked-in timestamp fixture in a scratch copy. One native D3D12 list recorded a 32-bit immediate write, two 64-bit timestamp writes, and matching waits on all three CPU-memory destinations. All three destinations were zero before submission. The recording left only an unrelated wait pending. Once I satisfied that wait, one native submission delivered the immediate value 42 and both nonzero GPU timestamps. The device remained healthy. Restoring the original recording code left all four waits pending and failed the assertion before submission.
cargo test --offline --locked -p xcl --lib timestamps_outside_unified_memory_land_after_the_queue -- --nocapture --test-threads=1passed 1/0/0 with zero fixture skips. This covers matching same-list waits in the synthetic case. AI-assisted. Codex (GPT-6, exact variant unavailable) extended the fixture, ran the tests, and drafted this report.@oni-swr on GitHub · 2026-11-25 19:44 UTC · original
AMD RX 7800 XT test report
Tested locally by merging PR head
23d1aa8dfa38db7f468991d2850db0dfacbe79c7onto basemain3f2777019544c0ada2cd294aa792d3c378ff0df8(no push). The base is an ancestor of currentmainand both trees merge cleanly.Hardware and tools: AMD Radeon RX 7800 XT, driver 32.0.31035.1003; Windows 10 Pro; Rust 1.100.0 / Cargo 1.100.0; DXC 1.8.2502.11 (DXIL 1.8.2502.11). Debug test build.
cargo test --workspace --no-fail-fast -- --test-threads=4: 1,356 passed, 2 failed, 46 ignored. There were 7SKIPPEDreports: six GPU cases (wave32/wave64 variants for three unsupported instruction forms) and one heap-window case. The two failures and all 7SKIPPEDreports match the baseline (1,355 passed, 2 failed, 46 ignored).Not tested
AI use
Codex (gpt-6-luna) ran Phase 2 tests and wrote this report (Phase 1 pre-compile / initial baseline run used Claude Code (Claude Sonnet 5.5)).
@ClosetPie107 on GitHub · 2026-11-25 20:46 UTC · original
Independent AMD RDNA4 / Linux (RADV, native wave64) test report for head
23d1aa8dfa38db7f468991d2850db0dfacbe79c7(merged cleanly ontomain6d12f58).Hardware & environment
experimental-11.0-20261112),vkd3d-protonmasterec207194(3.2.0) +dxil-spirvb540c8a2+ relaxed-vtable patch (-Db_ndebug=true), DXVKv3.1.1-209, DXC1.9.2609.5, Rustx86_64-pc-windows-gnu(debug for tests, release for retail)Unit / GPU tests (
XCL_REQUIRE_GPU=wave64,XCL_DXC_DIR,VKD3D_CONFIG=ignore_shared_fence,--test-threads=1 --nocapture)hle::d3d12x::list_x::: 41 passed, 0 failed, 0 ignored (0 skipped)Combined retail sanity run (
main6d12f58+#2068,#1771,#1740,#1256merged together;XCL_DIRECT_DXIL=1,XCL_TEXTURE_LEVEL_PAGES=1,XCL_PSO_WAIT_MS=50,XCL_SPLIT_MIDLIST_WAIT=0,XCL_COHERENT_MB=1024,VKD3D_CONFIG=ignore_shared_fence,XCL_PSO_PRELOAD=0,XCL_NETWORK=0)exit=0) with 0 crashes and 0 device removals (11.55 GiBpeak VRAM / 0 GTT spill,13.35 GiBpeak RSS,1,800+frames presented,16,442translated draws,4,499dispatches,11,257Opus packets).Not tested
AI use
main, ran the tests and combined retail run under Proton on this machine, and drafted this report.@upipibi on GitHub · 2026-11-25 20:50 UTC · original
@bmjask Agreed on P1: this doesn't order the CPU-emulated write before the commands after the wait.
cpu_writes::aftermakes the write only once the whole list's fence completes, so commands after the wait can run before the marker lands. The same holds for the timestamp readback.For context,
maindoesn't order it either. There,execute_with_waits_onpolls that wait on the CPU before the list is submitted, the write only happens after the submit, so the wait runs out its timeout and is then let through, and the later commands still run before the write. This PR removes that timeout; it doesn't change the ordering. I've added that to the description as a limit.The proper fix is what you describe: split the list at such a wait and make the write (or a GPU write of the same value) before the post-wait part. That is a bigger change in
execute_with_waits_on's segmenting than this PR, so I'd rather do it separately than grow this one. If the maintainers prefer to hold this PR until then, that's fine.AI-assisted (Claude Code, Claude Opus 5.5).
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.