Skip to content

D3D12.X: a copy back after a submission does not wait for the title - #1993

Open
Ariorh1337 wants to merge 1 commit into
xcl-dev:mainfrom
Ariorh1337:sparse/async-readback
Open

Ariorh1337 wants to merge 1 commit into
xcl-dev:mainfrom
Ariorh1337:sparse/async-readback

Conversation

@Ariorh1337

@Ariorh1337 Ariorh1337 commented Nov 25, 2026 •

Copy link
Copy Markdown

readback_after_execute makes the sparse queue GPU-wait for the title's queue, then waits on the CPU for the copy back, on the thread that is submitting. A title's queues can wait for work that thread submits next. In the retail title of #505, four compute queues wait for a Write64 on q1 whose list is recorded but not submitted yet. So every such submission waited 5 s for its copy back, and the uploads queued behind it on the sparse queue waited as well (before_execute waiting for ring room). lucsoft hit the same cycle on RDNA3 / Linux and found it was the whole stop there (#505 comment). This PR moves the copies back to a queue of their own and makes them asynchronous.

Part of #505.

What is in it (one commit, crates/xcl/src/hle/d3d12x/)

  • sparse.rs:
    • Readback queue. The copies back run on a queue of their own (rbq), which GPU-waits for the title's queue. Readback buffers are sized to the copy (64 KiB and up) and reused. If the queue cannot be made, the old path runs.
    • Landing the data. The data reaches the title's memory once the copy is done (drain_readbacks): on the next submit, and from a thread that looks every 0.5 ms.
    • Before a CPU read. settle_readbacks runs before Map's readback and in the CPU memory waits. It also waits for a copy whose title work is already done.
  • real.rs: the title's fence observations settle copies back first.
    • GetCompletedValue settles them before it returns.
    • SetEventOnCompletion with an event gives the fence an event of XCL's own. A thread-pool wait on that event settles them, then sets the title's event.
    • Without asynchronous copies back so far, both are as before.
  • list_x.rs: the CPU wait of Wait64BitValueX / Wait32BitValueX settles copies back between its polls.
  • Tests:
    • sparse::tests::a_copy_back_does_not_wait_for_the_title_queue (GPU, or WARP). A title queue is blocked on a fence nobody has signalled and then copies into a tile. The copy back must return at once and land once the queue goes on. On the old path it waits 5.0 s (checked by switching the readback queue off in the test).
    • gpu_sparse_vram_descriptors_buffers_and_xmem settles before its CPU reads, as its fence wait is not one of the title's.

Tested

  • RTX 5090 32 GB (driver 32.0.16.1692), Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 26300, rustc 1.99.0, DXC 1.9.2609.5.
  • cargo test --workspace -- --test-threads=4 (debug, --no-fail-fast):
    • this PR (4df0a2d): 987 passed, 4 failed, 45 ignored;
    • main (8e87fc7): 986 passed, 4 failed, 45 ignored.
    • The 4 failures are the same on both: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3, CreateComputePipelineState: … (0x8007000E) at seed 70.
    • SKIPPED (24, the same on both): 19 for no wave64, 3 refused per-lane f16 / f32 forms, plus pso_measurement_compiles_an_exact_synthetic_record (no Developer Mode) and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • e2e. Without the fence hooks, both e2e tests failed on this branch: the test title read Write32BitValueBottomOfPipeX: 0x0 after its fence wait. With them, cargo test -p xcl --test e2e: 3 passed (also 3 passed on main).
  • Retail title (1.0.2.1), on a local tree: main b9b6ea6 plus open PRs, D3D12.X: the committed window gets a copy in video memory #1329, and a local switch that puts the title's two large GPU heaps in the sparse windows, so most of the title's GPU memory goes through readbacks. Before this change, the submitting thread sat in readback_ranges → wait_for and the title stopped after the world load. With it, the title reached the in-game HUD and ran 465 s after the first #101, with 0 draws and 0 dispatches skipped. One run.

Regression run
scripts/smoke.ps1 -Game <retail title> -Seconds 60 (start screen, no input), XCL_HEAP_WINDOWS=1 for both, same machine. An earlier main run peaked at 16 883 MB (1183 frames); in that run the title stopped loading in the background before the 60 s were up. The run below has the same commit growth after 40 s as this PR's.

xcl-smoke v1
commit: 8e87fc7b62a87ea589ccb9ea6182f514016cf7db
gpu: NVIDIA GeForce RTX 5090
title: a155fb60
seconds: 60
exit: 0x0
frames shown: 1172 (PresentX 1173)
presents per 2 s (last 3): 0 13 51
device removals: 0
crashes: 0
peak commit: 25423 MB
xcl-smoke v1
commit: 4df0a2d1d01c101d81d80d46fb9d865fddc4da25
gpu: NVIDIA GeForce RTX 5090
title: a155fb60
seconds: 60
exit: 0x0
frames shown: 1245 (PresentX 1245)
presents per 2 s (last 3): 33 46 29
device removals: 0
crashes: 0
peak commit: 27250 MB

Not tested

  • AMD and Intel GPUs. lucsoft's RDNA3 run used a different change with the same aim (a bounded CPU wait instead of the GPU wait).
  • The retail title on main + this PR alone. With the title's heaps in the coherent window (the default), its lists write little into the sparse windows. The smoke run above does not reach the world.
  • Reads this PR does not cover. A title reading memory its lists wrote right after a fence observation XCL does not see: ID3D12Fence1, or a wait through WaitForMultipleObjects on an event it shares with another fence. The 0.5 ms thread lands the data there.
  • More than one title run.

AI use

  • Claude Code (Claude Opus 5.5) found the cycle in thread dumps of the title runs, wrote the change and the tests, ran the test suites and the smoke runs on the machine above, and wrote this description. I read the diff and checked the results before opening the PR.

🤖 Generated with Claude Code

`readback_after_execute` made the sparse queue GPU-wait for the title's
queue and then waited on the CPU for the copy, on the thread that was
submitting. The title's queues can wait for work that same thread submits
next (four compute queues waiting for a Write64 on q1 whose list is
recorded but not submitted yet). So the copy waited its 5 s on every such
submission, and the uploads queued behind it on the sparse queue waited
too (`before_execute` waiting for ring room). In thread dumps of a retail
title on an RTX 5090, the submitting thread is in `readback_ranges` ->
`wait_for` while another title thread waits for the sparse state's lock in
`commit_range`. lucsoft found the same cycle on RDNA3 / Linux (xcl-dev#505).

The copies now run on a queue of their own, which GPU-waits for the
title's queue, and the submitting thread returns. Readback buffers are
sized to the copy (64 KiB and up) and reused. Without a readback queue (it
could not be made), the old path runs.

The data lands in the title's memory once the copy is done, before the
title can see the work it follows is done:
- on the next submit, and from a thread that looks every 0.5 ms;
- before Map's readback and in the CPU memory waits of Wait64BitValueX
  (`settle_readbacks`), which wait for the copy once the title's lists it
  follows are done;
- in the title's fence observations: `GetCompletedValue` settles the copies
  first. `SetEventOnCompletion` hands the fence an event of XCL's own, and a
  thread-pool wait on it settles them, then sets the title's event.

The new test `a_copy_back_does_not_wait_for_the_title_queue` waits 5.0 s
on the old path and under 1 s with this change. Without the fence hooks,
the e2e test title read 0 for its Write32BitValueBottomOfPipeX after its
fence wait. With them, both e2e tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CharlyRien

Copy link
Copy Markdown

A caution from a local change of the same design: with the copy back asynchronous, the shared rb_fence lets a copy run before its own title queue has run the lists. Reading this diff, the pattern is still there (s.rb_value += 1; queue.Signal(&s.rb_fence, v); q.Wait(&s.rb_fence, v) in after_execute, one rb_fence and one counter for every title queue). I have not run this PR.

What happened in my tree, which had the same idea (copies back on their own queue, landed by a thread):

  • rb_fence only counts up, and each title queue signals the next value of one counter. A copy issued for queue A at value N is satisfied as soon as queue B has signalled N+1, even if A has not reached its own Signal yet (A may be standing behind one of the title's waits, which is exactly the case this PR is about). The copy then reads video memory before A's lists ran, the old bytes land in the title's memory, and nothing copies that range again.
  • In the retail title the ranges are its sync cells. The submit thread polls such a cell on the CPU (Wait64BitValueX fallback) and sits out the full 2 s every time: 76 polls, 152 s blocked in one 280 s run, and the compute queues waiting for what that thread would submit next were released by the 5 s watchdog, about twenty per frame.
  • A probe showed it directly: readback 0x5a8 of q1 is already satisfied when issued (rb fence at 0x5a8, set by another queue), then 9.7 s later the CPU wait on a cell in that range times out with the old value while a synchronous copy from video memory at that moment returns the wanted one. Same in all 11 probed timeouts.
  • With one source fence per title queue (only that queue signals it) and one copy queue per title queue, 4 runs had 0 watchdog releases, 0 timed-out polls and 0 sparse: the queue has not reached fence value waits, at 1.3 – 1.4 frames per second in the world. Details and the table: D3D12.X: the committed window gets a copy in video memory #1329 (comment)

So it may be worth giving each title queue its own fence here (or checking drain_readbacks / settle_readbacks against the queue's own progress rather than rb_fence.GetCompletedValue() >= rb_v), and a test with two title queues where the second one signals while the first is still blocked.

Setup of the runs above (not this PR): main 9e3831e merged locally with #1288, #1448, #684, #889, #1323, #929, #640, #1326, #1327, #1329 and #1791 (by hand), plus local diagnostics and the local asynchronous copy back; XCL_UMA_SHADOW=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1, release, warm caches, no XCL_PSO_WAIT_MS. On that path the committed window is a copy in video memory, so the title's sync cells go through these copies back; with the default imported window they may not, and the effect could be smaller there. RTX 3090 24 GB (driver 616.56), Ryzen 9 5950X, Windows 11 22631, TdrDelay 30 s.

Not tested: this PR itself, current main, AMD.

AI use: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the journal and the probe) ran the measurements; I read this PR's diff and drafted the comment.

@futurepro62

futurepro62 commented Nov 25, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head 4df0a2d (on its base 8e87fc7).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 980 passed, 0 failed, 43 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: a_copy_back_does_not_wait_for_the_title_queue.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 990 passed, 0 failed, 45 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 7994cd1 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests and const_and_null_mask_operands_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@raylitebull

Copy link
Copy Markdown
Member

Code review on 4df0a2d:

  • Moving readback_after_execute onto rbq (rb_jobs, rb_pool, RB_PENDING, xcl-sparse-readback drain thread, settle_readbacks / settle_readbacks_try) and adding a_copy_back_does_not_wait_for_the_title_queue is well-structured for avoiding submission-thread stalls against a blocked title queue.
  • Diff audited and CI workflow approved (currently running).
  • Important technical check: @CharlyRien's caution above on the single monotonic rb_fence (s.rb_value += 1; queue.Signal(&s.rb_fence, v); q.Wait(&s.rb_fence, v)) looks real for multi-queue titles — if queue B signals v + 1 while queue A is still gated behind an earlier wait, q.Wait(&s.rb_fence, v) can unblock and read stale VRAM before queue A's copy/write executes. Worth either keying source fences per queue (or tracking per-queue fence progress in drain_readbacks) and adding a 2-queue ordering test.

Remaining before merge: Addressing the multi-queue rb_fence ordering concern, Build and test finishing green, and an AMD verification pass.

@treybertram06

treybertram06 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Correction (retracting this report): these four runs are not valid. A test script I had stopped kept running and launched the title in parallel with these runs: each launch ended the other's run, and log copies were overwritten. The fourth row's log actually holds a device removal at 171 s, not "none". I have no clean A/B of #1993 on this machine. I'll post a new one if I rerun it. Sorry for the noise.


Test report for #1993 at head 4df0a2d, as @Ariorh1337 asked on #505: the retail title on an RTX 3080, with and without this PR, at the default coherent window and at XCL_COHERENT_MB=1024. No device removal or crash in any of the four runs. This PR ran at least as well as the base at the default setting, and was within noise at 1024.

Tested

  • RTX 3080 10 GB (32-lane waves), driver 621.40, Ryzen 9 5900X, 64 GB, Windows 11 Pro 26300, rustc 1.100.0, release.
  • Base tree (not a clean main): main c4d37be + D3D12.X: a placed buffer's last Release does not wait for the sparse lock #1478 + D3D12.X: allow title texture pages in system memory #1702 (its switch left off) + local logging, with a cap that refuses two programs over 8 MB of HLSL. The PR build is the same tree with 4df0a2d merged. The only conflict was in sparse.rs, where my logging line sat in the readback code this PR rewrites; I took the PR's side and re-added the logging after its waits.
  • The retail title, heap windows, warm caches, A pressed every 5 s from 10 to 60 s, 300 s of title time per run, one run per row:
build XCL_COHERENT_MB frames in 300 s GPU waits released on the CPU device removal / crash
base default (4095) 1444 6 none
#1993 default (4095) 2175 4 none
base 1024 1240 1 none
#1993 1024 1095 1 none
  • At the D3D12.X: a copy back after a submission does not wait for the title #1993 run's watchdog releases, the only XCL-issued wait still unmet was a title queue on the sparse upload fence (q2, 6 times). There were no readback waits, as expected with the readback queue.
  • Frame counts include the world-load compile phase, and each row is a single run, so I would not read much into the 1444 / 2175 or 1240 / 1095 differences.

Not tested

AI use: Claude Code (Claude Opus 5.5) built both trees, ran the runs and wrote this report.

@JJAutoCompare

Copy link
Copy Markdown

PR #1993 verification on STOR-WINLAB

PR head 4df0a2d1d01c101d81d80d46fb9d865fddc4da25 was fetched from origin (xcl-dev/xcl) and tested in a clean detached checkout. The remote still advertised that head after the run. The assigned slot had no Git checkout, so the source checkout was created under L:\XclTooling\neon-slot-6\source.

origin/main was 86719eec1e9fc4c36c5fb568ec4951fd47a31b88. git merge-tree --write-tree origin/main HEAD exited 1 with a content conflict in crates/xcl/src/hle/d3d12x/sparse.rs.

Tested

  • STOR-WINLAB, Intel Arc A770 16 GiB with driver 32.0.101.9175, DoublePrecisionFloatShaderOps=0, wave range 8–32. AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation build 26200.9974.
  • rustc 1.100.0 (0ef1bc386 2026-11-09), unoptimized dev and test profiles, debuginfo and incremental compilation disabled. DXC and DXIL 1.9.2609.5, XCL_ADAPTER=A770. The full-suite log identifies the A770 in the runtime backend.
  • cargo build --workspace and cargo test --workspace --no-run both exited 0 outside the shared GPU lock.
  • cargo test -p xcl --lib a_copy_back_does_not_wait_for_the_title_queue -- --show-output and cargo test -p xcl --lib gpu_sparse_vram_descriptors_buffers_and_xmem -- --show-output each reported 1 passed, 0 failed, 0 ignored, and 0 skips under the shared GPU lock. Both passed again in the full suite. The copy-back test creates a default D3D12 device with a WARP fallback and emits no adapter name of its own.
Set-ExecutionPolicy -Scope Process Bypass -Force
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output }

One full workspace run exited 101. Libtest reported 965 passed, 26 failed, 45 ignored across 19 test binaries and one doc-test target. The log recorded 26 SKIPPED messages across 16 named tests. Libtest can report a pass when a test or subcase skips. Skipped work contributes no coverage.

Target Passed Failed Ignored
xcl library 917 25 25
xcl CLI 0 0 0
bcpack_parity.rs 1 0 0
console_dlls_e2e.rs 13 0 0
console_shaders.rs 3 0 4
disasm_e2e.rs 1 0 0
e2e.rs 2 1 0
gpu_compute_e2e.rs 4 0 0
gpu_pso_e2e.rs 7 0 0
heap_probe.rs 0 0 4
low_va.rs 1 0 0
pls_quota.rs 1 0 0
predication_e2e.rs 1 0 0
rpf_e2e.rs 2 0 0
shaders_e2e.rs 4 0 0
sparse_reinit.rs 1 0 0
texture_states.rs 1 0 0
xg_oracle.rs 6 0 12
xcl-testtitle 0 0 0
Doc-tests xcl 0 0 0

Failures

  • CreateComputePipelineState returned 0x80070057 in 21 library tests. The four DXIL fuzz failures were fuzz_validate_and_gpu_0 (seed 2), fuzz_validate_and_gpu_1 (506), fuzz_validate_and_gpu_2 (1003), and fuzz_validate_and_gpu_3 (1501).
  • The same pipeline creation error occurred in doubles_match_cpu, groupshared_barrier_and_atomics_run, gpu_direct_f32_round_modes_dynamic_and_denormals, gpu_direct_f32_round_preserved_denormal_times_inf_is_inf, gpu_direct_f32_round_modes_static, f64_programs_on_the_gpu, gpu_clamp_and_omod_per_instruction, gpu_f64_class_compare, gpu_f64_literal_high_word, gpu_f64_compares_with_nan, gpu_f64_rounding_and_conversions, gpu_f64_roots, gpu_f64_math_random, gpu_frexp_f64_exp_and_mant, gpu_ldexp_f64, gpu_float_compares_random, gpu_rndne_f64.
  • gpu_nonfused_mad_and_mac_prevent_fma_contraction failed its fused FMA overflow assertion. The output was 2139095040, expected 1946157055.
  • gpu_ps_image_sample_offset_implicit_lod_between_mips returned 25.609375 for pixel (0,0), expected 26.
  • gpu_valu_16_and_64_bit returned zero in the lane 0 v_add_f16 high-half preservation check, expected 3203351424.
  • gpu_wave64_ps_whole_wave_reductions returned [2, 217, 2] for pixel 0, expected [2, 216, 2].
  • test_title_runs_and_game_folder_is_untouched failed the test title's RSSetDepthBiasX(-1000.5) check (Split wave64: masks read only lane by lane stay in their half #94). The top-right pixel was blue [0, 0, 255, 255] and the check expected green.

Skips

SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu: const_mask, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64
SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
SKIPPED shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)
SKIPPED placed_title_textures_share_vram_and_preserve_pixels: tiled tier < 2
SKIPPED test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dll
SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
SKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer (The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D))

Raw logs in L:\XclTooling\neon-slot-6\tmp include pr1993-build.log, pr1993-compile-tests.log, pr1993-targeted.log, and pr1993-suite.log.

Not tested

This run covered the PR head on STOR-WINLAB. No main test baseline, merged-tree run, retail-title smoke run, sample-backed coverage (XCL_SAMPLE_* inputs unset), or additional adapters were tested. The run does not establish which failures reproduce on main.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the build and tests and drafted this report. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against pr1993-suite.log and published this report.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main (crates/xcl/src/hle/d3d12x/sparse.rs) — needs a rebase before it can be tested.

theaustinayers added a commit to theaustinayers/xcl that referenced this pull request Nov 25, 2026
… commits is looked at (local test)

From a review of the local changes:
- The fence cells the title reads (`fence_x`) are stored after the copies back a value covers have
  landed (a value the title waits for promises the memory behind it), read and stored one refresh
  at a time.
- A copy back (and a stored immediate) lands 64-byte chunk by chunk, never over a chunk the CPU
  wrote since it was last sent: those bytes are newer and go up with the next look.
- `settle_readbacks_within` waits for the state's lock up to a bound; GetCompletedValue no longer
  spins 2 ms per copy back.
- Memory the title commits, and the memory of a texture it places, is looked at for a while
  (`mark_hot`): a write made right after the commit was seen up to 20 ms late.
- A copy back that finds no readback buffer still signals its queue's fence; at most 32 finished
  readback buffers are kept; `pagelog::counts` takes no blocking lock in the exception filter.

Loading:
- The watched ranges are made of 16 MiB blocks of the textures' sources, not from all textures (tens
  of thousands of them, each submit while a title loads).
- A DirectStorage destination in a sparse window is written without a VirtualQuery (a query there
  walks the whole committed heap: 3-5 ms a request, with a 2 GB heap). A part the title gave back
  fails the write (`write_title`).

The unit test of xcl-dev#1993 waits for the per-queue fences now. `submit_cost` also counts ranges,
re-checks and texture uploads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Dezmonius

Copy link
Copy Markdown

Independent native Windows test of #1993 (4df0a2d) adapted locally onto cbc296ab + #1931 + the same local #1464 and activity counters used in my #1931 report. I resolved two context conflicts in sparse.rs, preserving the base's lock helper and its synchronous fallback's internal-wait logging. RTX 5070 / 610.88, i7-7700K, 32 GiB RAM, Windows 10 19045, Rust 1.100.0 release. The pair used direct DXIL, offline Series X, the same scripted input, cache location, DRED and wait settings (1000 ms/pipeline and 500 ms/frame). The #1993 run was second.

Earlier control With #1993
PresentX calls in activity samples 821 819
GPU queue.Wait watchdog releases 10 10
Exit time and code 266.6 s, 0xc0000005 268.8 s, 0xc0000005

Both stopped at world loading. The later run logged no asynchronous-copy timeout. In both runs the queue watchdog eventually released waits for a submitted producer fence whose completion was one value behind. This pair did not reproduce a reduction in queue timeouts or prevent the title error. It does not isolate or disprove the readback cycle addressed in the PR.

On the adapted tree, a_copy_back_does_not_wait_for_the_title_queue and gpu_sparse_vram_descriptors_buffers_and_xmem both passed, with no skips reported. Full suite not run. No game assets or raw logs attached. AI-assisted (OpenAI Codex, GPT-6).

@upipibi

upipibi commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

A parallel-test hang this PR's change brings in, found through #2057, which carries it as cbba2d9d (same title and diff as this PR's 4df0a2d). RTX 3070 (Ampere, driver 616.56, Windows 11, 32 logical CPUs). tiagonleal's filter on #2057, release, default test threads, each run capped at 180 s: cargo test --release -p xcl --lib -- d3d12x::list_x d3d12x::fence_x d3d12x::sparse hle::acphal gpu::fence.

A first-parent bisect of #2057 named cbba2d9d. Checked against its parent, 3 runs each, every run holding the GPU alone:

tree runs hung (cap hit)
4de1452d (parent) 3 0 (54 passed each)
cbba2d9d (this change) 3 2
cbba2d9d, --skip ...a_copy_back_does_not_wait_for_the_title_queue 3 0 (54 passed each)
cbba2d9d, a_copy_back_does_not_wait_for_the_title_queue alone 3 0

In the hung runs, the new test and older list_x tests were still running after 60 s: cross_queue_cycle_and_same_queue_fifo_do_not_deadlock, mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares, write_buffer_immediate_on_open_existing_heap_visible_to_cpu, cross_queue_wait64_before_signal_does_not_deadlock_submit_thread. So neither the change without its new test nor the test alone hangs; it takes the new test running in parallel with the other queue tests in one process. That fits the earlier reports here, where the test passed alone (JJAutoCompare, Dezmonius) and in a debug suite (futurepro62). A possible cause is CharlyRien's caution about the shared rb_fence (7149051542); I haven't verified that.

On #2057 the same hang shows on all three heads (41303e4, f7e08e6, 4df1e6e, 3 of 3 runs each) and not on main 568e7db (0 of 3).

AI-assisted (Claude Code). Synthetic tests only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants