D3D12.X: a full write-watch buffer goes on after its last page #347
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!347
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/347/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?
@Kalmarv on GitHub · 2026-11-24 00:07 UTC · original
Kalmarv:fix/write-watch-resume→main· +52 −10 · 1 files · 1 commits · merged 2026-11-24 03:39 UTCrefresh_oncelooks for CPU writes before each of the title's submits. When its 16,384-entryGetWriteWatchbuffer came back full, it asked again from the start of the range. The pages already reported had been reset, but every call walked them again, so a look over many written pages cost more than one pass.take_writtennow continues after the last page reported.Related:
What is in it
title_textures::take_written: one range's look, each call starting after the last page the previous one reported. The pages found, their order and the reset are the same as before.written_pages_past_a_full_buffer_are_all_found_once: a 64-entry buffer over 1,000 write-watched pages, with 857 pages written, then 128 (exactly two buffers full). Each page is found once and in order, and a second look finds none. When the line that moves past the reported pages is replaced withbreak(stop at a full buffer), the test fails.GetWriteWatch(WRITE_WATCH_FLAG_RESET)sequence with a 16,384-entry buffer on committed, resident, write-watched memory. Medians of 5–15 looks, Ryzen 9 9950X:The difference appears only once a look needs more than one call, i.e. more than 16,384 written pages (64 MiB).
Tested
cargo test --workspace -- --test-threads=4:d6cbfcdon85bdf21): 666 passed, 0 failed, 41 ignored over 16 test binaries (lib: 626 / 0 / 21). Two GPU tests print SKIPPED (no wave64 on this GPU):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.main85bdf21, the control: 665 passed, 0 failed, 41 ignored (lib: 625 / 0 / 21), the same two SKIPPED. The one test more is this PR's.d6cbfcdmerged ontomaina6f5f7a.scripts/test.ps1: 677 passed, 0 failed, 41 ignored, no SKIPPED GPU tests.d6cbfcdmerged ontomaina6f5f7a.cargo test --workspace -- --test-threads=4: 677 passed, 0 failed, 41 ignored (lib 637 / 0 / 21), the two no-wave64 skips. With the advance replaced bybreak, the new test fails on its first case (857 pages written).main85bdf21and this head: 910 and 912 frames, no crash or device removal (https://github.com/ivall/xcl/pull/347#issuecomment-7119193868).Regression run
Our own runs, one after the other on the machine under Tested (RTX 5070 Ti), release builds, no uncommitted changes.
main:
PR:
Not tested
AI use
🤖 Generated with Claude Code
@ghost on GitHub · 2026-11-24 00:19 UTC · original
AMD run:
d6cbfcdmerged ontomaina6f5f7a(clean merge): pass.Tested
.\scripts\test.ps1: 677 passed, 0 failed, 41 ignored; noSKIPPEDGPU tests.cargo test -p xcl --lib written_pages:written_pages_past_a_full_buffer_are_all_found_oncepasses.Not tested
title_textures.rswith it.AI use
@throny on GitHub · 2026-11-24 00:23 UTC · original
NVIDIA run with the negative control the AMD report above lists under Not tested:
d6cbfcdmerged ontomaina6f5f7a(clean merge, merge commitdacaa0a): pass.Tested
stable-x86_64-pc-windows-msvc, debug; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0)cargo build --workspace && cargo test --workspace -- --test-threads=4: 677 passed, 0 failed, 41 ignored (lib: 637 / 0 / 21,written_pages_past_a_full_buffer_are_all_found_onceok)SKIPPEDon this adapter:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)at = buf[n - 1] as usize + *page as usize;replaced bybreak;(stop at a full buffer, as the description says),cargo test -p xcl --lib written_pages_past_a_full_bufferfails on the first case (857 pages written).Reviewed (read the whole diff)
atreachingend(a buffer that fills exactly on the last page), so it cannot spin. Going on afterbuf[n - 1]relies onGetWriteWatchreporting addresses in ascending order; the test's ordered comparison shows that on this Windows build.Not tested
scripts/smoke.ps1) on a title, noXCL_SAMPLE_*game-data tests, release build.AI use
@srcamarda on GitHub · 2026-11-24 01:27 UTC · original
The write-watch look measured past the menus on a retail title, for the HANDOFF Open item this PR names ("costs in proportion to their size at every submit … pending measurement past the menus"). This is a measurement of
main, not a run of this PR.Setup:
maina6f5f7a, release; RX 7800 XT (RDNA3, driver 32.0.32029.2010), Ryzen 5 5600G, 32 GB; Windows 11 Pro 26300;XCL_NETWORK=0 XCL_ACTIVITY=1, menus walked withXCL_PRESS_A_AT/XCL_PRESS_AT. To get the cost per 2 s rather than at power-of-two submit counts, a local line next to the activity line printed the change insparse::WATCH(µs inrefresh_once'sGetWriteWatchloop, and dirty pages) every 2 s. That line is not part of any PR. The runs stop when free system commit falls under 3 GB (here at ~20.8 GB of XCL process commit, ~15 s into world loading).Per 2 s, one run (the cumulative
sparse windows timinglines of four other runs agree: 1.38–1.45 ms a submit from 28 s on):Example lines from the 30 fps loading screen, and from world loading:
What it shows
Not tested: this PR's head; further into world loading than ~15 s (the commit limit on this machine); NVIDIA.
AI use: Claude Code with Claude Opus 5.5 ran the builds and runs, the local instrumentation and the analysis, and wrote this report. The runs are from my machine.
@CuteBooty on GitHub · 2026-11-24 01:32 UTC · original
Regression run on a retail title for
d6cbfcd, which the description lists as pending: pass (no device removal, no crash, frames and peak commit level withmain).Tested
scripts\smoke.ps1 -Game <folder> -Seconds 60on the PR's head as it is and onmain85bdf21, the commit it is based on, each built from a clean checkout of its commit.main) and 848 frames (PR), also with no device removal or crash.memory:line: 6310 MB local / 4619 MB non-local (main), 6311 MB local / 4619 MB non-local (PR).main:
PR:
Not tested
GetWriteWatchcall reports (the case this changes).AI use: Claude Code with Claude Fable 5.2 made the runs with me present and wrote this comment.