D3D12.X / XG: async texture upload, detiling, VRAM, XG ABI, and PSO scheduling improvements #539

Closed
github-bot wants to merge 16 commits from gh-pr/539/head into gh-pr/539/base
Owner

@⁠JGonzalezRodriguez on GitHub · 2026-11-24 01:34 UTC · original
JGonzalezRodriguez:feat/d3d12x-perf-and-xg-fixes → main · +2645 −154 · 10 files · 16 commits · closed without merging

Draft rollup PR for Windows testing — opened so another contributor can pull and test these changes on native Windows across retail titles / D3D12.X workloads. Once validated, this rollup will be split into individual focused PRs.

This branch bundles D3D12.X performance, scheduling, and XG ABI/correctness fixes targeting heavy streaming and shader-compilation workloads (no Linux/Wine-specific workarounds are included).

What is in it

  • Async texture upload staging & command-list reuse (crates/xcl/src/gpu/texture.rs, crates/xcl/src/hle/d3d12x/title_textures.rs, crates/xcl/src/hle/d3d12x/vram.rs, crates/xcl/src/hle/d3d12x/real.rs): per-device async Uploader with fence-ordered consuming-queue waits, reusable mapped staging chunks and allocators, and tracked in-flight destination refs for safe texture release and vram::Pages ordering.
  • xg::CopyFromSubresource 7-argument ABI fix & destination span guard (crates/xcl/src/hle/xg.rs, crates/xcl/tests/xg_oracle.rs): handle the extra u32 argument before src, bounds-check the destination span, and log invalid arguments.
  • Texture detiling & layout table optimizations (crates/xcl/src/gpu/tiling.rs, crates/xcl/src/hle/d3d12x/title_textures.rs): copy linear mip levels row-by-row, hoist tiled detiling with parallel batch detiling, and cache Layout offset tables via Arc slices while trimming unused high-bit tables.
  • vram::Pages overhead reduction (crates/xcl/src/hle/d3d12x/vram.rs): coalesce page-queue fence signals and throttle idle-page sweeps.
  • Sorted VirtualQuery span cache (crates/xcl/src/hle/d3d12x/title_textures.rs): cache VirtualQuery memory region spans across sorted entries in recheck_gpu_view_sources.
  • Asynchronous PSO compilation & scheduling (crates/xcl/src/hle/d3d12x/pso_async.rs, crates/xcl/src/hle/d3d12x/bind.rs, crates/xcl/src/hle/d3d12x/real.rs):
    • pre-compile compute PSOs in the background while keeping graphics PSOs lazy;
    • route large compute driver compiles to a dedicated worker pool so small PSOs are not starved;
    • run background PSO worker threads at BELOW_NORMAL priority;
    • give bound lazy graphics PSOs a dedicated urgent worker pool;
    • skip draws using pending graphics PSOs instead of blocking the render thread;
    • add opt-in XCL_ASYNC_COMPUTE=1 non-blocking compute PSO mode.
  • Cross-queue Wait64BitValueX GPU fence bridge, cycle-breaking, and GPU-completion watchdog (crates/xcl/src/hle/d3d12x/list_x.rs, crates/xcl/src/hle/d3d12x/real.rs):
    • What: bridge monotonic 64-bit Write64BitValue{Bottom,Top}OfPipeX → Wait64BitValueX (GREATER_EQUAL, full 64-bit mask) onto per-address ID3D12Fence queue.Signal / queue.Wait calls, bypass redundant waits when the producer already submitted earlier on the same queue (D3D12 FIFO order), detect and break cross-queue fork-join wait cycles before hoisting queue.Wait, and monitor armed GPU waits with a bounded GPU-completion watchdog (falling back to bounded CPU polling for non-monotonic or ineligible waits).
    • Why: workloads that submit a consumer list with Wait64BitValueX ahead of the producer list on another queue previously stalled the CPU submission thread until timeout or risked cross-queue/unsubmitted-producer deadlocks; moving eligible waits to GPU fences preserves ordering without blocking command submission.

Tested

  • Cross-compile check (rustc 1.98.1, debug): cargo check -p xcl --target x86_64-pc-windows-msvc --tests passed (0 errors, 0 warnings).
  • Targeted unit & GPU tests run under Wine/Proton + vkd3d-proton on NVIDIA RTX 4090:
    • list_x::tests: 19/19 passed (including write_buffer_immediate_on_open_existing_heap_visible_to_cpu, cross_queue_wait64_before_signal_does_not_deadlock_submit_thread, cross_queue_cycle_and_same_queue_fifo_do_not_deadlock)
    • vram: 6/6 passed
    • title_textures: 9/9 passed
    • gpu::texture: 15/15 passed
    • gpu::tiling: 11/11 passed
    • hle::xg: 4/4 passed
    • bind: 4/4 passed

Regression run

  • Pending native Windows 11 scripts/smoke.ps1 runs (draft PR for contributor testing; will be split and include main + PR xcl-smoke blocks before review).

Not tested

  • Native Windows 11 scripts/test.ps1 (full workspace suite) and scripts/smoke.ps1 regression runs (opening as draft for a Windows contributor to test).
  • AMD and Intel GPUs.

AI use

  • Antigravity with Gemini neon (wrote code, tests, and PR description; reviewed and compiled by author).
**@⁠JGonzalezRodriguez** on GitHub · 2026-11-24 01:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/539) `JGonzalezRodriguez:feat/d3d12x-perf-and-xg-fixes` → `main` · +2645 −154 · 10 files · 16 commits · closed without merging > **Draft rollup PR for Windows testing** — opened so another contributor can pull and test these changes on native Windows across retail titles / D3D12.X workloads. Once validated, this rollup will be split into individual focused PRs. This branch bundles D3D12.X performance, scheduling, and `XG` ABI/correctness fixes targeting heavy streaming and shader-compilation workloads (no Linux/Wine-specific workarounds are included). **What is in it** - Async texture upload staging & command-list reuse (`crates/xcl/src/gpu/texture.rs`, `crates/xcl/src/hle/d3d12x/title_textures.rs`, `crates/xcl/src/hle/d3d12x/vram.rs`, `crates/xcl/src/hle/d3d12x/real.rs`): per-device async `Uploader` with fence-ordered consuming-queue waits, reusable mapped staging chunks and allocators, and tracked in-flight destination refs for safe texture release and `vram::Pages` ordering. - `xg::CopyFromSubresource` 7-argument ABI fix & destination span guard (`crates/xcl/src/hle/xg.rs`, `crates/xcl/tests/xg_oracle.rs`): handle the extra `u32` argument before `src`, bounds-check the destination span, and log invalid arguments. - Texture detiling & layout table optimizations (`crates/xcl/src/gpu/tiling.rs`, `crates/xcl/src/hle/d3d12x/title_textures.rs`): copy linear mip levels row-by-row, hoist tiled detiling with parallel batch detiling, and cache `Layout` offset tables via `Arc` slices while trimming unused high-bit tables. - `vram::Pages` overhead reduction (`crates/xcl/src/hle/d3d12x/vram.rs`): coalesce page-queue fence signals and throttle idle-page sweeps. - Sorted `VirtualQuery` span cache (`crates/xcl/src/hle/d3d12x/title_textures.rs`): cache `VirtualQuery` memory region spans across sorted entries in `recheck_gpu_view_sources`. - Asynchronous PSO compilation & scheduling (`crates/xcl/src/hle/d3d12x/pso_async.rs`, `crates/xcl/src/hle/d3d12x/bind.rs`, `crates/xcl/src/hle/d3d12x/real.rs`): - pre-compile compute PSOs in the background while keeping graphics PSOs lazy; - route large compute driver compiles to a dedicated worker pool so small PSOs are not starved; - run background PSO worker threads at `BELOW_NORMAL` priority; - give bound lazy graphics PSOs a dedicated urgent worker pool; - skip draws using pending graphics PSOs instead of blocking the render thread; - add opt-in `XCL_ASYNC_COMPUTE=1` non-blocking compute PSO mode. - Cross-queue `Wait64BitValueX` GPU fence bridge, cycle-breaking, and GPU-completion watchdog (`crates/xcl/src/hle/d3d12x/list_x.rs`, `crates/xcl/src/hle/d3d12x/real.rs`): - **What**: bridge monotonic 64-bit `Write64BitValue{Bottom,Top}OfPipeX` → `Wait64BitValueX` (`GREATER_EQUAL`, full 64-bit mask) onto per-address `ID3D12Fence` `queue.Signal` / `queue.Wait` calls, bypass redundant waits when the producer already submitted earlier on the same queue (D3D12 FIFO order), detect and break cross-queue fork-join wait cycles before hoisting `queue.Wait`, and monitor armed GPU waits with a bounded GPU-completion watchdog (falling back to bounded CPU polling for non-monotonic or ineligible waits). - **Why**: workloads that submit a consumer list with `Wait64BitValueX` ahead of the producer list on another queue previously stalled the CPU submission thread until timeout or risked cross-queue/unsubmitted-producer deadlocks; moving eligible waits to GPU fences preserves ordering without blocking command submission. **Tested** - Cross-compile check (`rustc 1.98.1`, debug): `cargo check -p xcl --target x86_64-pc-windows-msvc --tests` passed (0 errors, 0 warnings). - Targeted unit & GPU tests run under Wine/Proton + vkd3d-proton on NVIDIA RTX 4090: - `list_x::tests`: 19/19 passed (including `write_buffer_immediate_on_open_existing_heap_visible_to_cpu`, `cross_queue_wait64_before_signal_does_not_deadlock_submit_thread`, `cross_queue_cycle_and_same_queue_fifo_do_not_deadlock`) - `vram`: 6/6 passed - `title_textures`: 9/9 passed - `gpu::texture`: 15/15 passed - `gpu::tiling`: 11/11 passed - `hle::xg`: 4/4 passed - `bind`: 4/4 passed **Regression run** - Pending native Windows 11 `scripts/smoke.ps1` runs (draft PR for contributor testing; will be split and include `main` + PR `xcl-smoke` blocks before review). **Not tested** - Native Windows 11 `scripts/test.ps1` (full workspace suite) and `scripts/smoke.ps1` regression runs (opening as draft for a Windows contributor to test). - AMD and Intel GPUs. **AI use** - Antigravity with Gemini neon (wrote code, tests, and PR description; reviewed and compiled by author).
Avoid per-batch CPU stalls, upload-buffer churn, and command list
allocation in title texture uploads by reusing a per-device async
Uploader (fence-ordered GPU waits on consuming queues, dynamic 4-64 MiB
staging chunks mapped once per chunk, capped idle pool/allocator
recycling, and dedicated pinning on queue.Signal failure).

Track Uploader's in-flight destination COM references so res_release
detaches title-dropped textures from title_textures immediately (while
deferring vram::forget until the GPU copy completes), order vram::Pages
unmap/remap tile updates after the async upload fence without
UPLOADERS/PAGES lock inversion, drop retired COM objects outside
UPLOADERS, and clear queue wait tracking on both queue creation and
release.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:25:02 +00:00
github-bot closed this pull request 2026-11-26 04:25:02 +00:00
Author
Owner

@⁠grahamster2 on GitHub · 2026-11-24 02:37 UTC · original

Evidence for the cross-queue Wait64BitValueX problem this PR targets, from the retail title that trips #232. Setup: RTX 3080 10 GB, Windows 11, release builds, XCL_NETWORK=0. Counters are given as offsets from one 256-byte block of title memory (base B).

main 9ce2070 + #435, with a local env-gated trace of writes, waits and submits on that block (once the shader cache is warm enough to reach the world, ~80 s):

  • 79.62 s: Write64BitValueBottomOfPipeX(B+0x58, 0x613) is recorded on a direct list D1. Wait64BitValueX(B+0x58 >= 0x613) is recorded on a compute list C1. The same pattern repeats for B+0x10, +0x18, +0x68, +0xe8: four more counters, all used for the first time at world start (memory 0). Writers and waiters are on both queue types.
  • 80.445 s: the submit thread submits C1. execute_with_waits → wait_all blocks that thread on the CPU.
  • 82.447 / 84.459 / 86.460 s: three 2 s timeouts (B+0x58, +0x10, +0xe8; memory still 0).
  • 86.468 s: only now does the same thread submit D1, the writer of B+0x58, then D2 (writer of +0x10/+0xe8). The producer is queued behind its own consumer on one thread.
  • The compute lists then run on unready data. The next frame dump is fully black (0 of 518,400 samples lit); presents stop and the #232 watchdog fires at 109 s. In another run the same sequence ended in a read at -1 with -inf values in the registers.

This PR (head 4ff33f0, on its own base): the bridge does what it says. At 91.5 s three waits (B+0x58, +0x10, +0xe8 >= 0x6d5, compute waiting on direct producers) became GPU queue.Wait calls and the submit thread was not blocked. 1 s later:
GPU queue.Wait at B+0x58 >= 0x6d5 did not complete within 1000 ms (waiter_ty=2, prod_ty=Some(0), recorded=0x6d5, submitted=0x6d5, completed=0x0) – released on CPU. The same happened for B+0x68 (producer on the compute queue). The title then crashed at 93 s with the same garbage-data read. A local run with the watchdog raised to 10 s didn't reach this point: the new binary had to retranslate, and the compile backlog tripped #232 first. So that run is inconclusive.

Question for you and the maintainer (design): XCL checks every Wait*BitValueX of a list before the whole list is submitted, but on the console the wait sits where it was recorded. In the trace, one compute list records wait +0x10, write +0x18, wait +0x68 / +0xe8, write +0xf0, and a direct list waits on +0x18. With the waits moved to the front of the list, +0x18 can't be written until +0x68 is ready, though on the console it is written before that wait. That can turn a valid console chain into a cycle. It may also explain completed=0x0 (the other explanation: the GPU really is that slow here, with 12.8 GB of video memory in use on a 10 GB card). Would splitting a list at each recorded wait (close the PC list, continue in a new one, queue.Wait between the parts) be the intended direction?

Test report written with Claude Code (Claude Opus 5.5) from my own runs; the trace patch is local only.

**@⁠grahamster2** on GitHub · 2026-11-24 02:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/539#issuecomment-7120332758) Evidence for the cross-queue `Wait64BitValueX` problem this PR targets, from the retail title that trips #232. Setup: RTX 3080 10 GB, Windows 11, release builds, `XCL_NETWORK=0`. Counters are given as offsets from one 256-byte block of title memory (base `B`). **main 9ce2070 + #435, with a local env-gated trace of writes, waits and submits on that block** (once the shader cache is warm enough to reach the world, ~80 s): - 79.62 s: `Write64BitValueBottomOfPipeX(B+0x58, 0x613)` is recorded on a **direct** list D1. `Wait64BitValueX(B+0x58 >= 0x613)` is recorded on a **compute** list C1. The same pattern repeats for B+0x10, +0x18, +0x68, +0xe8: four more counters, all used for the first time at world start (memory 0). Writers and waiters are on both queue types. - 80.445 s: the submit thread submits C1. `execute_with_waits` → `wait_all` blocks that thread on the CPU. - 82.447 / 84.459 / 86.460 s: three 2 s timeouts (B+0x58, +0x10, +0xe8; memory still 0). - 86.468 s: only now does the same thread submit D1, the writer of B+0x58, then D2 (writer of +0x10/+0xe8). The producer is queued behind its own consumer on one thread. - The compute lists then run on unready data. The next frame dump is fully black (0 of 518,400 samples lit); presents stop and the #232 watchdog fires at 109 s. In another run the same sequence ended in a read at -1 with -inf values in the registers. **This PR (head 4ff33f0, on its own base):** the bridge does what it says. At 91.5 s three waits (B+0x58, +0x10, +0xe8 >= 0x6d5, compute waiting on direct producers) became GPU `queue.Wait` calls and the submit thread was not blocked. 1 s later: `GPU queue.Wait at B+0x58 >= 0x6d5 did not complete within 1000 ms (waiter_ty=2, prod_ty=Some(0), recorded=0x6d5, submitted=0x6d5, completed=0x0) – released on CPU`. The same happened for B+0x68 (producer on the compute queue). The title then crashed at 93 s with the same garbage-data read. A local run with the watchdog raised to 10 s didn't reach this point: the new binary had to retranslate, and the compile backlog tripped #232 first. So that run is inconclusive. **Question for you and the maintainer (design):** XCL checks every `Wait*BitValueX` of a list before the whole list is submitted, but on the console the wait sits where it was recorded. In the trace, one compute list records `wait +0x10`, `write +0x18`, `wait +0x68 / +0xe8`, `write +0xf0`, and a direct list waits on `+0x18`. With the waits moved to the front of the list, `+0x18` can't be written until `+0x68` is ready, though on the console it is written before that wait. That can turn a valid console chain into a cycle. It may also explain `completed=0x0` (the other explanation: the GPU really is that slow here, with 12.8 GB of video memory in use on a 10 GB card). Would splitting a list at each recorded wait (close the PC list, continue in a new one, `queue.Wait` between the parts) be the intended direction? _Test report written with Claude Code (Claude Opus 5.5) from my own runs; the trace patch is local only._
Author
Owner

@⁠alpz1000 on GitHub · 2026-11-24 02:38 UTC · original · edited 2026-11-24 02:40 UTC

Native Windows/NVIDIA test of the draft on RTX 3060 12 GB (driver 610.88 / 32.0.16.1088), Core i5-8400, Windows 11 Home 26200.9974, Rust 1.100.0 x86_64-pc-windows-msvc, MSVC 14.44.35230, debug. Tested the exact PR head as-is against the then-current upstream main (no local merge).

Check main 3db536ebe231418d76e8d6e52ccee0b47330a522 PR 4ff33f02789f6f6b9748567e45366568f60f13c9
cargo build --locked --workspace exit 0 exit 0
cargo test --locked -p xcl --lib -- --test-threads=1 --nocapture gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes placed_title_textures_share_vram_and_preserve_pixels 2 passed 2 passed
cargo test --locked -p xcl --test e2e test_title_runs_and_game_folder_is_untouched -- --exact --nocapture 1 passed 1 passed

No skip messages in these runs. The bundled title reported zero failures and the real RTX 3060 backend on both revisions.

Not tested: full workspace suite, opt-in async compute, retail gameplay/loading, or other adapters.

AI use: OpenAI Codex (GPT-6) ran the local checks and drafted the report.

Follow-up: compute checks with the opt-in flag off and on. Same PR head 4ff33f0 and RTX 3060 setup. I ran cargo test --locked -p xcl --test gpu_compute_e2e -- --test-threads=1 --nocapture and cargo test --locked -p xcl --lib async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect -- --nocapture in separate processes with XCL_ASYNC_PSO=1 and XCL_ASYNC_COMPUTE=0 then 1. Both configurations had 2 GPU tests and 1 bind test pass, with zero failures or skips. The GPU integration tests used the real RTX 3060 device and covered cold pipeline resolution and translated compute dispatch/readback. This is compatibility coverage with the setting enabled, with no measurement of pending-dispatch latency or retail loading.

**@⁠alpz1000** on GitHub · 2026-11-24 02:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/539#issuecomment-7120338215) · edited 2026-11-24 02:40 UTC Native Windows/NVIDIA test of the draft on RTX 3060 12 GB (driver 610.88 / 32.0.16.1088), Core i5-8400, Windows 11 Home 26200.9974, Rust 1.100.0 x86_64-pc-windows-msvc, MSVC 14.44.35230, debug. Tested the exact PR head as-is against the then-current upstream main (no local merge). | Check | main `3db536ebe231418d76e8d6e52ccee0b47330a522` | PR `4ff33f02789f6f6b9748567e45366568f60f13c9` | | --- | --- | --- | | `cargo build --locked --workspace` | exit 0 | exit 0 | | `cargo test --locked -p xcl --lib -- --test-threads=1 --nocapture gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes placed_title_textures_share_vram_and_preserve_pixels` | 2 passed | 2 passed | | `cargo test --locked -p xcl --test e2e test_title_runs_and_game_folder_is_untouched -- --exact --nocapture` | 1 passed | 1 passed | No skip messages in these runs. The bundled title reported zero failures and the real RTX 3060 backend on both revisions. **Not tested**: full workspace suite, opt-in async compute, retail gameplay/loading, or other adapters. **AI use**: OpenAI Codex (GPT-6) ran the local checks and drafted the report. **Follow-up: compute checks with the opt-in flag off and on.** Same PR head `4ff33f0` and RTX 3060 setup. I ran `cargo test --locked -p xcl --test gpu_compute_e2e -- --test-threads=1 --nocapture` and `cargo test --locked -p xcl --lib async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect -- --nocapture` in separate processes with `XCL_ASYNC_PSO=1` and `XCL_ASYNC_COMPUTE=0` then `1`. Both configurations had **2 GPU tests and 1 bind test pass**, with zero failures or skips. The GPU integration tests used the real RTX 3060 device and covered cold pipeline resolution and translated compute dispatch/readback. This is compatibility coverage with the setting enabled, with no measurement of pending-dispatch latency or retail loading.
Author
Owner

@⁠ddm-j on GitHub · 2026-11-24 02:50 UTC · original

Tested the two xg commits on Linux (Wine, NVIDIA): the 7-argument ABI fix is right; split out, it would also cover #477.

Tested: ivall/main 9ce2070 + #257 (26fdda6) + only this PR's 7d1c466 (guard dst span) and 9c4c3e6 (7-argument ABI), cherry-picked without conflict, plus a local log line in copy_from (logging only). Compared with the same base without them, same protocol (300 s, Series X, one A press).

Tested

  • Fedora, RTX 4070 Ti 12 GB (NVIDIA 615.78.08), Proton Experimental 11.0 Wine, vkd3d-proton v3.1 with #257's patch, DXC 1.9.2609, release x86_64-pc-windows-gnu.
  • Without these commits, the newer retail title's two CopyFromSubresource calls during world loading arrive with a row pitch that is the low 32 bits of the source pointer (one argument off), so rows land far outside the destination. On an earlier main (a6f5f7a) that ended the run with an access violation in XCL; on 9ce2070 I compared against a local guard that packs the rows instead.
  • With them: row pitch = row size, slice pitch = row size × height, no invalid-span warning, no access violation.
  • It does not change where the run ends afterwards: presents still stop ~2 s after the copies and the title's stall watchdog (#505) ends it ~30 s later, the same as without the fix. So it is a correct fix, not the cause of that stall.

Not tested

  • The other 14 commits of this PR. Windows, AMD. The test suite and scripts/smoke.sh.

The two xg commits apply cleanly on their own; as a separate PR they would be small and easy to check.

AI use

  • Claude Code (Claude Opus 5.5) built and ran each version and wrote this comment from the logs; checked by me.
**@⁠ddm-j** on GitHub · 2026-11-24 02:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/539#issuecomment-7120523111) **Tested the two `xg` commits on Linux (Wine, NVIDIA): the 7-argument ABI fix is right; split out, it would also cover #477.** Tested: `ivall/main` `9ce2070` + #257 (`26fdda6`) + only this PR's `7d1c466` (guard dst span) and `9c4c3e6` (7-argument ABI), cherry-picked without conflict, plus a local log line in `copy_from` (logging only). Compared with the same base without them, same protocol (300 s, Series X, one A press). **Tested** - Fedora, RTX 4070 Ti 12 GB (NVIDIA 615.78.08), Proton Experimental 11.0 Wine, vkd3d-proton v3.1 with #257's patch, DXC 1.9.2609, release `x86_64-pc-windows-gnu`. - Without these commits, the newer retail title's two `CopyFromSubresource` calls during world loading arrive with a row pitch that is the low 32 bits of the source pointer (one argument off), so rows land far outside the destination. On an earlier `main` (`a6f5f7a`) that ended the run with an access violation in XCL; on `9ce2070` I compared against a local guard that packs the rows instead. - With them: row pitch = row size, slice pitch = row size × height, no invalid-span warning, no access violation. - It does not change where the run ends afterwards: presents still stop ~2 s after the copies and the title's stall watchdog (#505) ends it ~30 s later, the same as without the fix. So it is a correct fix, not the cause of that stall. **Not tested** - The other 14 commits of this PR. Windows, AMD. The test suite and `scripts/smoke.sh`. The two `xg` commits apply cleanly on their own; as a separate PR they would be small and easy to check. **AI use** - Claude Code (Claude Opus 5.5) built and ran each version and wrote this comment from the logs; checked by me.
Author
Owner

@⁠JGonzalezRodriguez on GitHub · 2026-11-24 03:28 UTC · original

Closing this rollup PR and replacing it with a clean, single-purpose PR against current main: #684 (XG: fix CopyFromSubresource 7-argument ABI and guard destination span, fixing #477 and the first crash in #662 — thanks @⁠ddm-j for verifying the xg fix independently).

Summary of what was dropped from #539:

  • Already landed on main:
    • Linear row-by-row detiling, hoisted tiled detiling, parallel batch detiling, and persistent upload buffer/list reuse → #451 (plus #486 skip-unchanged and #602 in-place detile/hash).
    • Compact tiling::Layout high-coordinate tables → #435.
    • ExecuteIndirect pending-PSO skip gate → #574.
    • In-memory and on-disk compute PSO driver blob caching → #636 and #634.
  • Covered by focused open PRs:
    • Async title-queue texture uploads without CPU waits → #455 (and VRAM unmap ordering → #594 / #496).
    • O(1) idle-page sweeping in vram::Pages → #490.
    • Graphics PSO prioritization and bounded PSO/commit waits → #628, #533, #267, #214, #567.
  • Deferred for redesign / separate PRs:
    • Wait64BitValueX GPU fence bridge: thanks @⁠grahamster2 for the trace and feedback showing that hoisting all waits to the front of a command list breaks mid-list wait/write interleaving; that needs a dedicated list-splitting design rather than reviving the hoisted-wait patch.
    • Minor standalone optimizations (vram::Pages fence signal coalescing, sorted VirtualQuery region caching in recheck_gpu_view_sources, BELOW_NORMAL PSO worker priority) were intentionally kept out of #684 to follow the one-logical-change-per-PR rule in CONTRIBUTING.md.
**@⁠JGonzalezRodriguez** on GitHub · 2026-11-24 03:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/539#issuecomment-7121131438) Closing this rollup PR and replacing it with a clean, single-purpose PR against current `main`: #684 (`XG: fix CopyFromSubresource 7-argument ABI and guard destination span`, fixing #477 and the first crash in #662 — thanks @⁠ddm-j for verifying the `xg` fix independently). Summary of what was dropped from #539: - **Already landed on `main`:** - Linear row-by-row detiling, hoisted tiled detiling, parallel batch detiling, and persistent upload buffer/list reuse → #451 (plus #486 skip-unchanged and #602 in-place detile/hash). - Compact `tiling::Layout` high-coordinate tables → #435. - `ExecuteIndirect` pending-PSO skip gate → #574. - In-memory and on-disk compute PSO driver blob caching → #636 and #634. - **Covered by focused open PRs:** - Async title-queue texture uploads without CPU waits → #455 (and VRAM unmap ordering → #594 / #496). - O(1) idle-page sweeping in `vram::Pages` → #490. - Graphics PSO prioritization and bounded PSO/commit waits → #628, #533, #267, #214, #567. - **Deferred for redesign / separate PRs:** - `Wait64BitValueX` GPU fence bridge: thanks @⁠grahamster2 for the trace and feedback showing that hoisting all waits to the front of a command list breaks mid-list wait/write interleaving; that needs a dedicated list-splitting design rather than reviving the hoisted-wait patch. - Minor standalone optimizations (`vram::Pages` fence signal coalescing, sorted `VirtualQuery` region caching in `recheck_gpu_view_sources`, `BELOW_NORMAL` PSO worker priority) were intentionally kept out of #684 to follow the one-logical-change-per-PR rule in `CONTRIBUTING.md`.
Author
Owner

@⁠crosettiremi on GitHub · 2026-11-24 03:34 UTC · original

RX 7900 XT comparison for the two Wait64 commits (d419af8d11bc and 4ff33f02789f). Windows 11 build 26100, AMD driver 32.0.32029.2010, retail 1.0.2.1, same saved profile, networking off. Both runs used a local stack with #267, #533 and #574, with a 1 ms graphics wait and 4,000 ms compute wait. The comparison adds only the two fence commits to that stack.

  • Before the bridge, one submission thread logged 29 Wait64 timeouts of 2 s each. For 22 of those, the observed counter was exactly one behind the requested value. The title watchdog fired at 192.718 s. No device removal was logged.
  • With the bridge, the log showed eight wait-before-signal messages (the log is rate-limited), 11 cycle skips and 34 GPU waits released by the CPU timeout. For one release, the requested value was 0x755, the highest recorded value was 0x756, and both the submitted and completed values were still 0x754. The last interval with a present ended at 148.219 s. At 149.365 s D3D12 reported DXGI_ERROR_DEVICE_HUNG (0x887a0006), and the game hit a breakpoint. Windows recorded LiveKernelEvent 141. I stopped the unresponsive game process after collecting the log.
  • The bridge stack passed 715 workspace tests with 41 ignored. The retail run reached loading artwork. Playable world rendering remains unverified on this machine.

This confirms the bridge executes on RDNA3. I could not determine which GPU command caused the hang or establish that a particular CPU fence release caused it.

AI disclosure: Codex ran the tests and prepared this report.

**@⁠crosettiremi** on GitHub · 2026-11-24 03:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/539#issuecomment-7121230746) RX 7900 XT comparison for the two Wait64 commits (`d419af8d11bc` and `4ff33f02789f`). Windows 11 build 26100, AMD driver 32.0.32029.2010, retail 1.0.2.1, same saved profile, networking off. Both runs used a local stack with #267, #533 and #574, with a 1 ms graphics wait and 4,000 ms compute wait. The comparison adds only the two fence commits to that stack. * Before the bridge, one submission thread logged 29 Wait64 timeouts of 2 s each. For 22 of those, the observed counter was exactly one behind the requested value. The title watchdog fired at 192.718 s. No device removal was logged. * With the bridge, the log showed eight wait-before-signal messages (the log is rate-limited), 11 cycle skips and 34 GPU waits released by the CPU timeout. For one release, the requested value was 0x755, the highest recorded value was 0x756, and both the submitted and completed values were still 0x754. The last interval with a present ended at 148.219 s. At 149.365 s D3D12 reported `DXGI_ERROR_DEVICE_HUNG` (0x887a0006), and the game hit a breakpoint. Windows recorded LiveKernelEvent 141. I stopped the unresponsive game process after collecting the log. * The bridge stack passed 715 workspace tests with 41 ignored. The retail run reached loading artwork. Playable world rendering remains unverified on this machine. This confirms the bridge executes on RDNA3. I could not determine which GPU command caused the hang or establish that a particular CPU fence release caused it. AI disclosure: Codex ran the tests and prepared this report.
Author
Owner

@⁠artor410 on GitHub · 2026-11-24 03:37 UTC · original

Native Windows test of 4ff33f0 (this PR's head, as checked out; not rebased, so this is not the conflict-resolved tree)

Tested

  • NVIDIA RTX 3070 Ti 8 GB (32-lane waves), Ryzen 5 5600, Windows 11 10.0.26300, rustc 1.100.0, DXC 1.9.2602.17, debug.
  • cargo build --workspace then cargo test --workspace --no-fail-fast -- --test-threads=4: 688 passed, 1 failed, 41 ignored. SKIPPED (no wave64): gpu_wave32_program_in_wave64_hardware, gpu_geometry_wave32_prefix_count_over_a_mask.
  • The one failure, e2e::test_title_draws_with_a_root_signature_under_the_debug_layer, comes from my environment, not from this PR: the checkout's path is long, and the test title's overlay and PLS steps fail with os error 3 / 206 (path too long). main at the merge base 508a0c7 fails the same test with the same three [FAIL] lines in the same location.
  • All list_x, vram, title_textures, gpu::texture, gpu::tiling, hle::xg and bind tests pass natively here, including the new cross-queue Wait64 ones.

Not tested

  • scripts/smoke.ps1 / any retail title (I have none); AMD and Intel; release build; the tree after resolving this PR's current conflicts with main.

AI use: Claude Code (Claude Opus 5.5) ran the commands above and wrote this report.

**@⁠artor410** on GitHub · 2026-11-24 03:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/539#issuecomment-7121271407) **Native Windows test of `4ff33f0`** (this PR's head, as checked out; not rebased, so this is not the conflict-resolved tree) **Tested** - NVIDIA RTX 3070 Ti 8 GB (32-lane waves), Ryzen 5 5600, Windows 11 10.0.26300, rustc 1.100.0, DXC 1.9.2602.17, debug. - `cargo build --workspace` then `cargo test --workspace --no-fail-fast -- --test-threads=4`: **688 passed, 1 failed, 41 ignored**. SKIPPED (no wave64): `gpu_wave32_program_in_wave64_hardware`, `gpu_geometry_wave32_prefix_count_over_a_mask`. - The one failure, `e2e::test_title_draws_with_a_root_signature_under_the_debug_layer`, comes from my environment, not from this PR: the checkout's path is long, and the test title's overlay and PLS steps fail with os error 3 / 206 (path too long). `main` at the merge base `508a0c7` fails the same test with the same three `[FAIL]` lines in the same location. - All `list_x`, `vram`, `title_textures`, `gpu::texture`, `gpu::tiling`, `hle::xg` and `bind` tests pass natively here, including the new cross-queue `Wait64` ones. **Not tested** - `scripts/smoke.ps1` / any retail title (I have none); AMD and Intel; release build; the tree after resolving this PR's current conflicts with `main`. AI use: Claude Code (Claude Opus 5.5) ran the commands above and wrote this report.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.