D3D12.X: retain deferred Write64 until the producer fence completes #850
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!850
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-850"
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?
@Abuudiii on GitHub · 2026-11-24 06:44 UTC · original
Abuudiii:xcl-deferred-write64→main· +187 −51 · 3 files · 2 commits · openFollow-up to #708. A non-UMA
Write64BitValueBottomOfPipeXprogress value could become visible when its producer fence was still pending. Wait for confirmed completion before publishing the 64-bit word, without changing the upstream GPU wait bridge.What is in it
mainat1ec4c98: #873’s throttled warning still reports the legacy fallback, without suggesting that a deferred 64-bit progress value was published early.Tested
beaa245observed0x123456789abcdef0while the producer fence was still zero. With the patch,cpu_writes::tests::reported 3 passed, 0 failed, 0 ignored, including independent queue progress.maina1672ef,cargo test --workspace -- --test-threads=4reported 714 passed, 0 failed, 41 ignored, no GPU skips.cargo test -p xcl --lib cpu_writesreported 4 passed, 0 failed.a314f04: on the RX 9070 / GE-Proton setup above,cargo test --locked --offline --target x86_64-pc-windows-gnu -p xcl --lib hle::d3d12x::cpu_writes::tests:: -- --test-threads=1 --nocapturereported 3 passed, 0 failed, 0 ignored, no skips. The regression exercised both the legacy fallback warning and the 64-bit pending-producer warning while the fence was still pending.Regression run
The previous native Windows report contains the clean
mainbaseline below and a smoke for the prior PR head8ad4155. That PR-head smoke does not apply after the merge. A fresh run ata314f04is pending; the baseline is reusable for the same setup, title, and duration.Not tested
a314f04; wave32-only GPUs and gameplay past the menus.AI use
@SlopTart on GitHub · 2026-11-24 07:17 UTC · original
Linux / AMD RDNA3 datapoint.
Merged state: head
8ad4155onto mainbeaa245, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 704 passed, 10 failed, 41 ignored. Failures are the known Wine-lane set from my #42 rows plus #718 trio members; nothing here fails because of your change. Deferred Write64 retention tests green; no new failures against the known Wine-lane set.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@badoomtch on GitHub · 2026-11-24 07:16 UTC · original · edited 2026-11-24 07:45 UTC
Updated head
a314f04don native WindowsI ran the unmodified 60-second smoke script from clean release checkouts of main and the updated PR head, on the same RTX 5080, with fresh offline state for each run. Both exited cleanly.
Main
Updated PR head
On the local integration containing both changed Rust files byte-for-byte from
a314f04d, all three deferred-write tests passed. In the mixed-write test the legacy prefix reached the 10-second fallback. The following 64-bit progress write stayed pending until its producer fence completed. The 60-second retail tests ended before the later world-loading transition.Tested on native Windows 11 build 26300, Core Ultra 7 265, RTX 5080 (610.88), Rust 1.96.0 MSVC.
At the exact PR head
8ad4155, all threehle::d3d12x::cpu_writes::testspassed in debug (0 failed, 0 ignored). The real-fence test crossed the 10 s deadline with the first queue's write still unpublished, allowed the independent queue to complete, and then verified the first queue's ordered writes after its fence signalled.60-second retail regression pair. Clean release builds of the PR parent and head. Each checkout's unmodified
scripts/smoke.ps1ran through the same local launcher, which adds a network-isolated Windows AppContainer and passes through the real process exit status and log. Both used fresh title state and the script's default 60 s duration.Parent:
PR head:
Longer integration runs. On our separate integration build based on
beaa245, the control recorded 1,450 presents and hit the title watchdog at 111.469 s. Adding the two runtime files from8ad4155to that same build gave 1,325 presents and the same abort at 110.386 s. Its last saved capture, frame 1,320, was fading loading artwork. Both logged one command-list split, five GPU wait bridges, and zero legacy Wait64 timeout messages. The PR's ten-second producer warning did not appear in the game run. Outstanding GPU waits at exit were not measured. This pair establishes native ordering in the regression fixture; the longer runs still stop during loading.AI use: Codex (GPT-6) ran the tests, checked the captured reports and drafted this comment.
@eizispark on GitHub · 2026-11-24 07:14 UTC · original · edited 2026-11-24 07:48 UTC
Hardware check of
a314f04d798d6d73c65096d317e1369f045c1ac9(verified clean merge withmain1ec4c98): pass.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo test --workspace --no-fail-fast -- --test-threads=4:713 passed, 3 failed, 41 ignored(GPU tests skipped on this adapter:none); the 3 failures were the known concurrent--test-threads=4VRAM contention flake inhle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixelsplus two downstream mutexPoisonErrorcascades (transitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory)cargo test -p xcl --lib hle::d3d12x -- --test-threads=1:115 passed, 0 failed, 1 ignored(GPU tests skipped on this adapter:none)hle::d3d12x::cpu_writes::tests::write64_bottom_progress_waits_past_legacy_timeout,hle::d3d12x::cpu_writes::tests::writes_land_after_the_queue,hle::d3d12x::cpu_writes::tests::readback_u64_lands_after_the_queue, andhle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue(ok)Regression run
main(beaa245):PR (
a314f04):Not tested
AI use
scripts/smoke.ps1harness on this machine and formatted this report.@iggyvilla on GitHub · 2026-11-24 07:53 UTC · original
Read of
a314f04(not built or run by me; the loop below is unchanged since8ad4155), one point on the new wait incpu_writes.rs:In
spawn_queue_worker, once the 10 s wait has timed out for aWrite::ImmediateU64, the worker loops onfence::completed_valueevery 20 ms until the value reachesjob.value, with no deadline. It leaves the loop only when the fence completes orcompleted_valuereturns an error (a removed device). If the producer's queue is stuck but the device is not removed, that worker never leaves the loop, holds the device and fence, and every later write queued on that queue waits behind it;forget_queueonly disconnects the channel after the outstanding jobs drain, so it does not end it either. Before this change the worker wrote after 10 s and moved on.Holding the value back is the point of the PR, so a very long wait may be the right call. A hard upper bound (a few minutes, then an error log and either dropping the write or writing it) would keep one hung queue from keeping a thread and the queue's later writes forever. Whether the title can produce a producer fence that never completes without a device removal I don't know.
AI use: read with Claude Code, Claude Sonnet 5.5, against the PR head; the point is mine.
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@iggyvilla on GitHub · 2026-11-24 09:31 UTC · original
Read of
a314f04(not built or run by me; the loop below is unchanged since8ad4155), one point on the new wait incpu_writes.rs:In
spawn_queue_worker, once the 10 s wait has timed out for aWrite::ImmediateU64, the worker loops onfence::completed_valueevery 20 ms until the value reachesjob.value, with no deadline. It leaves the loop only when the fence completes orcompleted_valuereturns an error (a removed device). If the producer's queue is stuck but the device is not removed, that worker never leaves the loop, holds the device and fence, and every later write queued on that queue waits behind it;forget_queueonly disconnects the channel after the outstanding jobs drain, so it does not end it either. Before this change the worker wrote after 10 s and moved on.Holding the value back is the point of the PR, so a very long wait may be the right call. A hard upper bound (a few minutes, then an error log and either dropping the write or writing it) would keep one hung queue from keeping a thread and the queue's later writes forever. Whether the title can produce a producer fence that never completes without a device removal I don't know.
AI use: read with Claude Code, Claude Sonnet 5.5, against the PR head; the point is mine.
@throny on GitHub · 2026-11-24 11:45 UTC · original
Two world-loading runs of
a314f04on an RTX 4080 withXCL_PSO_WAIT_MS=50, against two runs ofmainwith the same settings. Both runs of this PR were still presenting when my memory guard ended them, later than anymainrun has lived here, but with more timed-out GPU waits and more memory.Tested
stable-x86_64-pc-windows-msvc; release.a314f04merged ontomain47efa2e(clean merge); themainruns are on384f7f7.xcl run <folder>withXCL_NETWORK=0,XCL_ACTIVITY=1,XCL_PSO_WAIT_MS=50,XCL_PRESS_ATfor the profile prompt, 420 s limit, warm DXIL and driver-blob caches. Retail title 1.0.2.1.main, run 1main, run 2GPU queue.Wait … did not complete within 5000 msmainhas never got past 174 s here. Neither run shows where the title would stop with this PR: my guard ended them when the machine's free commit fell under 4 GB (the process at 34 GB; this PC's commit limit is about 68 GB and another job was running).Not tested
XCL_PSO_WAIT_MS.AI use
@JJAutoCompare on GitHub · 2026-11-25 05:45 UTC · original
Empirical test report (
a314f04d)Verified PR #850 at
a314f04d798d6d73c65096d317e1369f045c1ac9.Hardware / environment
1.100.0 (0ef1bc386 2026-11-09), DXC1.9.2609.5 (01b62ad47). Unoptimized Cargo test profile with debug info and incremental compilation disabled.Commands and results
cargo test --workspace --no-runfinished with exit code 0 outside the Arc test lock.Ran the prebuilt library test executable inside
Invoke-ArcTest.ps1withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1:Exit code 0. 4 passed, 0 failed, 0 ignored, 0 skipped, with 692 filtered out. The focused run took 11.19 s.
Observed behavior
Not tested
The full GPU workspace suite and game smoke runs were omitted.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr850-focused.logand published.@DavidM1911 on GitHub · 2026-11-25 10:15 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@pickles976 on GitHub · 2026-11-26 05:56 UTC · original · edited 2026-11-26 06:46 UTC
Wine / RTX 4060 Laptop verification of exact #850
a314f04d798d6d73c65096d317e1369f045c1ac9: 3/3 focused tests pass.Tested: Linux, NVIDIA 590.48.1, RTX 4060 Laptop 8 GiB, 16 GiB RAM, Wine 11.0, DXVK 3.1.1; Rust 1.98.1 Windows MSVC target. Diagnostic runtime caveat: vkd3d-proton 3.2.0
2576c0b4adfae4a+, locally built with assertions disabled and allocator/listfrom_ifacevtable checks removed (null checks retained), not stock vkd3d compatibility.Fresh compilation from the exact owner checkout confirmed. The log enumerates the real NVIDIA adapter, no GPU skip.
write64_bottom_progress_waits_past_legacy_timeoutexercises the interception path, a real CPU-held producer fence past the 10 s legacy timeout, progress/tail retention, independent-queue progress, then release and ordered completion. No GPU queue was deliberately stalled. The two existing immediate/readback tests also passed.29 resource samples: max global GPU222 MiB, min available RAM9581 MiB, max GPU-query latency28.6 ms; scope9 GiB / swap512 MiB. Local log
verify-pr850-wine-fences.log.Not tested in this exact-head result: whole workspace, retail gameplay, sustained load, queue-disconnect cancellation, or a matched-base regression run. The previously noted indefinite wait on a never-completing producer is not claimed fixed. A separate local integration preserving newer memory helpers also passes the same3 tests; its title follow-through will be labeled mixed-stack, not attributed to this exact PR.
AI-assisted verification/report: omp, OpenAI Codex GPT-6 Astra. No upstream code push.
Separate mixed-stack title follow-through: added the verified #850 worker/ImmediateU64 behavior to our local #2573
1bfa05d9+ #2630 sparse-pool + #735/1080p integration, retaining its newer UMA helpers. Same three fixtures passed again; fresh release build confirmed. With lazy texture pages,1080p, vendor unmasking and unchanged guards, both18/32 s captures were black. The samegame_scarlett_master.exe+0x2215c35null-write access violation returned; this does not identify #850 as its cause. Before the crash the log still reported the legacy fallback (fence at0,wanted1;2 queued writes); nodeferred 64-bit write ... still waitingline appeared. The immediate-64 fixture pass therefore does not demonstrate correction of the failing title path.The GPU monitor subsequently timed out. New timestamped guard events show query spawn49.053 s → timeout51.054 s → scope-kill request51.054 s → kill command returned51.062 s. The telemetry child did not reap within200 ms after SIGKILL; launcher cleanup ended63.012 s, exit5. Last valid sample48.05 s:4923 MiB GPU,8547 MiB available RAM,3035 MiB scope/2535 MiB anon,19.282 GiB disk. These are incomplete samples, not a whole-run GPU-budget pass. No input/gameplay. Evidence
20261126T055546Z-{console.log,resources.csv,guard-events.jsonl}. No unchanged title retry planned; remaining legacy/readback behavior and queue-progress cause need separate ownership.Static diagnosis and diagnostic limit (2026-11-26)
Bounded Ghidra disassembly of an unchanged title code page, preserving original VAs, confirms the earlier
game+0x2215c35fault is an explicit absolute-null store followed by INT3. Its containing function (+0x2215a60..+0x2215e09) has a30-iteration unchanged-heartbeat countdown and a separate timed-entry fatal condition; both reach that deliberate crash. The recorded EBP=0 is consistent with the countdown route. The heartbeat-update helper calls the importedQueryPerformanceCounter. This narrows the failure to a deliberate monitor/fatal path; it does not identify the stalled subsystem or prove #850 causality. No title patch/watchdog suppression. Derived-slice ELF decompilation uses a different ABI, so argument recovery was not treated as authoritative; conclusions above use exact instructions/import metadata.An attempt to collect pre-crash thread state produced a different diagnostic-path AV, not another reproduction of that watchdog: the captured return address resolves to the
RtlVirtualUnwindcall insideeh::dump_threads, which resumes a target before reading its live stack. Full scoped evidence, current-main source applicability, and limits are reported in #106. I stopped using that unchanged probe. Neither the heuristic stacks nor the accompanying telemetry timeout establish a title/driver root cause. Existing exact-head three-test pass and mixed-title negative verdict above remain distinct.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.