D3D12.X: stage GPU-view CopyMemoryToMemoryX sources and shift newer CL1 remaps #1995

Open
github-bot wants to merge 1 commit from github-bot/gh-1995 into main AGit
Owner

@⁠raylitebull on GitHub · 2026-11-25 00:29 UTC · original
raylitebull:feat/world-frame-list-slots → main · +211 −42 · 3 files · 1 commits · open

Stages GPU-view CopyMemoryToMemoryX source ranges (kernelx::mirrors::source_range, resolve_readable_source, list_x::MIRRORS) and shifts vacated older CL1 command-list remap slots 104/105 to console-extension stubs when QUEUE_SHIFTED == true.

Part of #1833.

What is in it

  • crates/xcl/src/hle/kernelx.rs: add mirrors::source_range(va, len) enforcing (va - gpu) + len <= size end-of-range bounds on GPU mirror reservations (preserved alongside #1985's mirrors::gpu_views_of).
  • crates/xcl/src/hle/d3d12x/list_x.rs: route copy_memory_x (saturating_add overlap check) through resolve_readable_source, and key list_x::MIRRORS by (title_start, cpu_src_start, len, uma_mirror) so repeated gpu_va binds hit mirrored(va, bytes) directly with zero per-draw VirtualQuery while sync_title_buffers reads from cpu_src_start.
  • crates/xcl/src/hle/d3d12x/real.rs: route vacated older CL1 slots 104 / 105 to console-extension stubs when QUEUE_SHIFTED == true and add unit tests resolve_readable_source_accepts_direct_and_rejects_unmapped and newer_cl1_slots_shift_older_cl1_remaps_by_two.

Tested

  • Toolchain: Windows 11 x64, rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased cleanly onto f368928 (bdfb2fb).
  • cargo check --workspace --tests: passed on bdfb2fb.
  • cargo test -p xcl --lib resolve_readable_source_accepts_direct_and_rejects_unmapped: passed on bdfb2fb.
  • cargo test -p xcl --lib newer_cl1_slots_shift_older_cl1_remaps_by_two: passed on bdfb2fb.
  • Pre-rebase identical code (50ef7dc): verified across AMD Radeon RX 9070 (1635/1623 frames, 0 device removals/crashes, @Toons29), NVIDIA RTX 3060 Ti, and Intel Arc A770.

Regression run

  • Verified on exact head bdfb2fb1 by @Toons29 (AMD Radeon RX 9070, 60 s retail title smoke vs 1a0bbe3a): 0 device removals, 0 crashes, 1628 -> 1627 frames (100%), 14561 -> 14598 MB peak commit (100%).
xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1628 (PresentX 1628)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14561 MB
xcl-smoke v1
commit: bdfb2fb16da4d1ebb93229333b2d4b4fd8e55da7
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1627 (PresentX 1627)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14598 MB

Not tested

  • 60 s scripts/smoke.ps1 pair on rebased head bdfb2fb, full cargo test --workspace suite, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.

AI use

  • Antigravity assisted with implementation, rebase onto f368928, and unit tests; the author reviewed the diff and test output.
**@⁠raylitebull** on GitHub · 2026-11-25 00:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995) `raylitebull:feat/world-frame-list-slots` → `main` · +211 −42 · 3 files · 1 commits · open Stages GPU-view `CopyMemoryToMemoryX` source ranges (`kernelx::mirrors::source_range`, `resolve_readable_source`, `list_x::MIRRORS`) and shifts vacated older CL1 command-list remap slots `104`/`105` to console-extension stubs when `QUEUE_SHIFTED == true`. Part of #1833. **What is in it** - `crates/xcl/src/hle/kernelx.rs`: add `mirrors::source_range(va, len)` enforcing `(va - gpu) + len <= size` end-of-range bounds on GPU mirror reservations (preserved alongside `#1985`'s `mirrors::gpu_views_of`). - `crates/xcl/src/hle/d3d12x/list_x.rs`: route `copy_memory_x` (`saturating_add` overlap check) through `resolve_readable_source`, and key `list_x::MIRRORS` by `(title_start, cpu_src_start, len, uma_mirror)` so repeated `gpu_va` binds hit `mirrored(va, bytes)` directly with zero per-draw `VirtualQuery` while `sync_title_buffers` reads from `cpu_src_start`. - `crates/xcl/src/hle/d3d12x/real.rs`: route vacated older CL1 slots `104` / `105` to console-extension stubs when `QUEUE_SHIFTED == true` and add unit tests `resolve_readable_source_accepts_direct_and_rejects_unmapped` and `newer_cl1_slots_shift_older_cl1_remaps_by_two`. **Tested** - Toolchain: Windows 11 x64, `rustc 1.99.1 (58cf8f9c3 2026-10-13)`, rebased cleanly onto `f368928` (`bdfb2fb`). - `cargo check --workspace --tests`: passed on `bdfb2fb`. - `cargo test -p xcl --lib resolve_readable_source_accepts_direct_and_rejects_unmapped`: passed on `bdfb2fb`. - `cargo test -p xcl --lib newer_cl1_slots_shift_older_cl1_remaps_by_two`: passed on `bdfb2fb`. - Pre-rebase identical code (`50ef7dc`): verified across AMD Radeon RX 9070 (`1635/1623` frames, 0 device removals/crashes, `@Toons29`), NVIDIA RTX 3060 Ti, and Intel Arc A770. **Regression run** - Verified on exact head `bdfb2fb1` by `@Toons29` (AMD Radeon RX 9070, 60 s retail title smoke vs `1a0bbe3a`): `0` device removals, `0` crashes, `1628 -> 1627` frames (`100%`), `14561 -> 14598 MB` peak commit (`100%`). ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1628 (PresentX 1628) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14561 MB ``` ``` xcl-smoke v1 commit: bdfb2fb16da4d1ebb93229333b2d4b4fd8e55da7 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1627 (PresentX 1627) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14598 MB ``` **Not tested** - 60 s `scripts/smoke.ps1` pair on rebased head `bdfb2fb`, full `cargo test --workspace` suite, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton. **AI use** - Antigravity assisted with implementation, rebase onto `f368928`, and unit tests; the author reviewed the diff and test output.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:13:44 +00:00
Author
Owner

@⁠eizispark on GitHub · 2026-11-25 00:41 UTC · original

Hardware test report — commit 3fcc982

@⁠raylitebull Verified 3fcc9822e736b4e616d22d3f18140957a2952667 on AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64): pass, with the 60 s xcl-smoke pair against ancestor main (8e87fc7).

Tested

  • Hardware: Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver 32.0.32015.16001), 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), debug tests + release smoke
  • Unfiltered cargo test --workspace --no-fail-fast -- --test-threads=4: 997 passed, 2 failed, 45 ignored (8 skipped), with 0 new failures:
    • Both new unit tests (hle::d3d12x::list_x::tests::resolve_readable_source_accepts_direct_and_rejects_unmapped, hle::d3d12x::real::map_tests::newer_cl1_slots_shift_older_cl1_remaps_by_two) and all d3d12x, list_x, and e2e (test_title_runs_and_game_folder_is_untouched) GPU tests passed
    • Only the 2 pre-existing #1679 AMD fuzz seeds failed (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722, gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3 seed 1599)
    • 8 skipped: 6 gpu::recomp::lower_dxil::tests f16/f32 direct-DXIL per-lane cases refused where #1426 semantics differ from the console's; shaders::tests::pso_measurement_compiles_an_exact_synthetic_record (Windows Developer Mode required, 0x887A002D); heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
  • Log check on the 60 s retail run: CopyMemoryToMemoryX staged fired 0 times during the unattended 60 s boot/menu window (0 unmapped CopyMemoryToMemoryX warnings logged there either; the unattended smoke run stops in menus before entering the 3D world)

Regression run (scripts/smoke.ps1, 60 s, warm shader/driver cache)
main (8e87fc7b62a87ea589ccb9ea6182f514016cf7db):

xcl-smoke v1
commit: 8e87fc7b62a87ea589ccb9ea6182f514016cf7db
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1675 (PresentX 1675)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14861 MB

PR (3fcc9822e736b4e616d22d3f18140957a2952667):

xcl-smoke v1
commit: 3fcc9822e736b4e616d22d3f18140957a2952667
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1678 (PresentX 1678)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14860 MB

Not tested

  • interactive play into 3D world entry where non-UMA / GPU-view CopyMemoryToMemoryX sources and newer-layout ResolveSubresourceRegion (#110) execute

AI use

  • Antigravity (Google DeepMind, Gemini 4 Carbon) ran the workspace test suite and 60-second retail smoke check and formatted this report.
**@⁠eizispark** on GitHub · 2026-11-25 00:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7148777518) ### Hardware test report — commit `3fcc982` @⁠raylitebull Verified `3fcc9822e736b4e616d22d3f18140957a2952667` on AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64): **pass**, with the 60 s `xcl-smoke` pair against ancestor `main` (`8e87fc7`). **Tested** - Hardware: Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver `32.0.32015.16001`), 32 GB RAM, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, debug tests + release smoke - Unfiltered `cargo test --workspace --no-fail-fast -- --test-threads=4`: `997 passed, 2 failed, 45 ignored` (`8 skipped`), with `0` new failures: - Both new unit tests (`hle::d3d12x::list_x::tests::resolve_readable_source_accepts_direct_and_rejects_unmapped`, `hle::d3d12x::real::map_tests::newer_cl1_slots_shift_older_cl1_remaps_by_two`) and all `d3d12x`, `list_x`, and `e2e` (`test_title_runs_and_game_folder_is_untouched`) GPU tests passed - Only the 2 pre-existing `#1679` AMD fuzz seeds failed (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722, `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3` seed 1599) - `8 skipped`: 6 `gpu::recomp::lower_dxil::tests` f16/f32 direct-DXIL per-lane cases refused where `#1426` semantics differ from the console's; `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` (`Windows Developer Mode required`, `0x887A002D`); `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows` - Log check on the 60 s retail run: `CopyMemoryToMemoryX staged` fired `0` times during the unattended 60 s boot/menu window (`0` unmapped `CopyMemoryToMemoryX` warnings logged there either; the unattended smoke run stops in menus before entering the 3D world) **Regression run** (`scripts/smoke.ps1`, 60 s, warm shader/driver cache) `main` (`8e87fc7b62a87ea589ccb9ea6182f514016cf7db`): ``` xcl-smoke v1 commit: 8e87fc7b62a87ea589ccb9ea6182f514016cf7db gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1675 (PresentX 1675) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14861 MB ``` PR (`3fcc9822e736b4e616d22d3f18140957a2952667`): ``` xcl-smoke v1 commit: 3fcc9822e736b4e616d22d3f18140957a2952667 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1678 (PresentX 1678) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14860 MB ``` **Not tested** - interactive play into 3D world entry where non-UMA / GPU-view `CopyMemoryToMemoryX` sources and newer-layout `ResolveSubresourceRegion` (`#110`) execute **AI use** - Antigravity (Google DeepMind, Gemini 4 Carbon) ran the workspace test suite and 60-second retail smoke check and formatted this report.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 00:43 UTC · original

@⁠eizispark Thank you for the RX 9070 XT verification (997 passed,

**@⁠raylitebull** on GitHub · 2026-11-25 00:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7148808836) @⁠eizispark Thank you for the RX 9070 XT verification (997 passed,
Author
Owner

@⁠gsucristo on GitHub · 2026-11-25 00:57 UTC · original

Technical review findings:

Major

  1. Missing end-of-range check in GPU-view resolution (list_x.rs, resolve_readable_source): kernelx::mirrors::source(va) only checks va < gpu + size for the start address, not that [va, va + len) stays within the GPU mirror reservation ((va - gpu) + len <= size). If a copy spans past the end of the mirror reservation and another readable CPU allocation sits adjacent to the CPU backing view, readable(cpu, len) succeeds and copy_nonoverlapping reads out-of-bounds memory.
  2. Per-draw VirtualQuery regression in gpu_va for GPU-view buffers (list_x.rs, gpu_va): When va is a GPU view (src_va != va), mirror_of(src_va, bytes, what) registers the mirror under src_va, not va. Subsequent binds of va miss mirrored(va, bytes) and fall through to resolve_readable_source (two VirtualQuery walks + mirrors lock) on every draw.

Minor

  • dst < effective_src + size && effective_src < dst + size in copy_memory_x can overflow on huge size (prefer checked_add/saturating_add).
  • When QUEUE_SHIFTED == true, older CL1 slots 104/105 stay mapped to PC 60/61 (AtomicCopyBufferUINT/UINT64) instead of being unmapped/stubbed.
**@⁠gsucristo** on GitHub · 2026-11-25 00:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7149056625) Technical review findings: **Major** 1. **Missing end-of-range check in GPU-view resolution (`list_x.rs`, `resolve_readable_source`)**: `kernelx::mirrors::source(va)` only checks `va < gpu + size` for the start address, not that `[va, va + len)` stays within the GPU mirror reservation (`(va - gpu) + len <= size`). If a copy spans past the end of the mirror reservation and another readable CPU allocation sits adjacent to the CPU backing view, `readable(cpu, len)` succeeds and `copy_nonoverlapping` reads out-of-bounds memory. 2. **Per-draw `VirtualQuery` regression in `gpu_va` for GPU-view buffers (`list_x.rs`, `gpu_va`)**: When `va` is a GPU view (`src_va != va`), `mirror_of(src_va, bytes, what)` registers the mirror under `src_va`, not `va`. Subsequent binds of `va` miss `mirrored(va, bytes)` and fall through to `resolve_readable_source` (two `VirtualQuery` walks + `mirrors` lock) on every draw. **Minor** - `dst < effective_src + size && effective_src < dst + size` in `copy_memory_x` can overflow on huge `size` (prefer `checked_add`/`saturating_add`). - When `QUEUE_SHIFTED == true`, older CL1 slots `104`/`105` stay mapped to PC `60`/`61` (`AtomicCopyBufferUINT`/`UINT64`) instead of being unmapped/stubbed.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 01:15 UTC · original

Thanks for the careful review and catches, @gsucristo!

Updated #1995 cleanly onto 0f293be (50ef7dc):

  • GPU mirror end-of-range check (kernelx.rs): added mirrors::source_range(va, len) enforcing (va - gpu) + len <= size inside resolve_readable_source so reads crossing the end of a GPU mirror reservation are rejected.
  • list_x::MIRRORS keyed by cpu_src_start (list_x.rs): changed the MIRRORS cache value to track (title_start, cpu_src_start, len, uma_mirror) so repeated gpu_va binds of GPU-view buffers hit mirrored(va, bytes) directly with zero per-draw VirtualQuery while sync_title_buffers reads from cpu_src_start.
  • saturating_add & vacated CL1 slots (list_x.rs, real.rs): switched copy_memory_x's overlap check to saturating_add, and routed vacated older CL1 slots 104/105 to console-extension stubs when QUEUE_SHIFTED == true.

Verified locally (cargo check --workspace --tests + resolve_readable_source_accepts_direct_and_rejects_unmapped + newer_cl1_slots_shift_older_cl1_remaps_by_two: 2 passed, 0 failed).

**@⁠raylitebull** on GitHub · 2026-11-25 01:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7149368740) Thanks for the careful review and catches, `@gsucristo`! Updated `#1995` cleanly onto `0f293be` (`50ef7dc`): - **GPU mirror end-of-range check (`kernelx.rs`):** added `mirrors::source_range(va, len)` enforcing `(va - gpu) + len <= size` inside `resolve_readable_source` so reads crossing the end of a GPU mirror reservation are rejected. - **`list_x::MIRRORS` keyed by `cpu_src_start` (`list_x.rs`):** changed the `MIRRORS` cache value to track `(title_start, cpu_src_start, len, uma_mirror)` so repeated `gpu_va` binds of GPU-view buffers hit `mirrored(va, bytes)` directly with zero per-draw `VirtualQuery` while `sync_title_buffers` reads from `cpu_src_start`. - **`saturating_add` & vacated CL1 slots (`list_x.rs`, `real.rs`):** switched `copy_memory_x`'s overlap check to `saturating_add`, and routed vacated older CL1 slots `104`/`105` to console-extension stubs when `QUEUE_SHIFTED == true`. Verified locally (`cargo check --workspace --tests` + `resolve_readable_source_accepts_direct_and_rejects_unmapped` + `newer_cl1_slots_shift_older_cl1_remaps_by_two`: `2 passed, 0 failed`).
Author
Owner

@⁠Anon64 on GitHub · 2026-11-25 01:47 UTC · original

Regression run for this PR: head 3fcc982, based on main 80f4819. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, XCL_NETWORK=0, A pressed every 4 s from 20 s, scripts/smoke.ps1 on a retail title for 60 s, in one batch with the main run.

main 80f4819:

xcl-smoke v1
commit: 80f4819098e921f2e1ab371144d4832f68ffedd6
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1588 (PresentX 1589)
presents per 2 s (last 3): 47 56 27
device removals: 0
crashes: 0
peak commit: 25184 MB

this PR:

xcl-smoke v1
commit: 3fcc9822e736b4e616d22d3f18140957a2952667
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1614 (PresentX 1614)
presents per 2 s (last 3): 60 40 49
device removals: 0
crashes: 0
peak commit: 23649 MB

No device removals or crashes; 101 % of main's frames, 93 % of its peak commit.

Not tested: the whole suite; world loading; whether the title reaches all of the changed code in these 60 s (default settings: XCL_DIRECT_DXIL and XCL_HEAP_WINDOWS unset).

Written with Claude Code (Claude Opus 5.5) from runs on this machine.

**@⁠Anon64** on GitHub · 2026-11-25 01:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7149962562) Regression run for this PR: head `3fcc982`, based on `main` `80f4819`. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, `XCL_NETWORK=0`, A pressed every 4 s from 20 s, `scripts/smoke.ps1` on a retail title for 60 s, in one batch with the `main` run. main `80f4819`: ``` xcl-smoke v1 commit: 80f4819098e921f2e1ab371144d4832f68ffedd6 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1588 (PresentX 1589) presents per 2 s (last 3): 47 56 27 device removals: 0 crashes: 0 peak commit: 25184 MB ``` this PR: ``` xcl-smoke v1 commit: 3fcc9822e736b4e616d22d3f18140957a2952667 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1614 (PresentX 1614) presents per 2 s (last 3): 60 40 49 device removals: 0 crashes: 0 peak commit: 23649 MB ``` No device removals or crashes; 101 % of main's frames, 93 % of its peak commit. **Not tested:** the whole suite; world loading; whether the title reaches all of the changed code in these 60 s (default settings: `XCL_DIRECT_DXIL` and `XCL_HEAP_WINDOWS` unset). Written with Claude Code (Claude Opus 5.5) from runs on this machine.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 02:49 UTC · original

Empirical verification — PR #1995 (50ef7dcbb6300119933dade417edf88cca64e055)

Tested clean detached PR head 50ef7dcbb6300119933dade417edf88cca64e055 on STOR-WINLAB.

Environment

  • Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, wave range 8–32, DoublePrecisionFloatShaderOps=0, d3d12SDKLayers.dll absent).
  • rustc 1.100.0 (0ef1bc386 2026-11-09) (CARGO_INCREMENTAL=0, debug info 0). Standalone DXC/DXIL 1.9.2609.5 was on PATH; the test title logged Windows SDK DXC 1.9.2602.17 (21d28f72).

Tested

  • cargo build --workspace and cargo test --workspace --no-run exited 0 outside the GPU lock.
  • Focused PR tests (cargo test -p xcl --lib <name> -- --nocapture): 3 passed, 0 failed, 0 ignored, 0 skipped (all 3 also passed in full suite):
    • resolve_readable_source_accepts_direct_and_rejects_unmapped
    • newer_cl1_slots_shift_older_cl1_remaps_by_two
    • layout_split_keeps_the_runtime_on_the_pc_method
  • The synthetic test title logged a pass on command-list memory methods with one same-window CopyMemoryToMemoryX scratch copy.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 (under Invoke-ArcTest.ps1, exited 101): 1,041 passed, 26 failed, 45 ignored across 20 test harnesses, with 23 SKIPPED lines across 13 tests (excluded from coverage; 18 wave64, 3 refused wave32 f16 lowerings, 1 driver-cache disable 0x887A002D, 1 heap-window fallback; missing debug-layer early return captured separately).
    • Failures (26): 25 in xcl --lib native D3D12 shader tests (21 CreateComputePipelineState 0x80070057 + 4 shader output assertions) and 1 in e2e (test_title_runs_and_game_folder_is_untouched, RSSetDepthBiasX #94 blue vs green). Re-running test_title_runs_and_game_folder_is_untouched on parent commit 0f293bec8fd53b1478328627a1f08a6155dd2813 under the same Arc lock reproduced the identical depth-bias failure, confirming it predates PR #1995.

Not tested

  • Retail Xbox title / scripts/smoke.ps1, D3D12 debug layer, live GPU-view reservation copy / vertex-index refresh, and title dispatch through shifted CL1 slots.

AI use

  • T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1995-suite.log and published this report.
**@⁠JJAutoCompare** on GitHub · 2026-11-25 02:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7151224309) ### Empirical verification — PR #1995 (`50ef7dcbb6300119933dade417edf88cca64e055`) Tested clean detached PR head `50ef7dcbb6300119933dade417edf88cca64e055` on STOR-WINLAB. **Environment** - Windows 11 Enterprise Evaluation build `26200.9974`, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver `32.0.101.9175`, wave range 8–32, `DoublePrecisionFloatShaderOps=0`, `d3d12SDKLayers.dll` absent). - `rustc 1.100.0 (0ef1bc386 2026-11-09)` (`CARGO_INCREMENTAL=0`, debug info 0). Standalone DXC/DXIL `1.9.2609.5` was on `PATH`; the test title logged Windows SDK DXC `1.9.2602.17` (`21d28f72`). **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` exited 0 outside the GPU lock. - Focused PR tests (`cargo test -p xcl --lib <name> -- --nocapture`): **3 passed, 0 failed, 0 ignored, 0 skipped** (all 3 also passed in full suite): - `resolve_readable_source_accepts_direct_and_rejects_unmapped` - `newer_cl1_slots_shift_older_cl1_remaps_by_two` - `layout_split_keeps_the_runtime_on_the_pc_method` - The synthetic test title logged a pass on command-list memory methods with one same-window `CopyMemoryToMemoryX` scratch copy. - `cargo test --workspace --no-fail-fast -- --test-threads=4` (under `Invoke-ArcTest.ps1`, exited 101): **1,041 passed, 26 failed, 45 ignored** across 20 test harnesses, with **23 `SKIPPED` lines across 13 tests** (excluded from coverage; 18 wave64, 3 refused wave32 f16 lowerings, 1 driver-cache disable `0x887A002D`, 1 heap-window fallback; missing debug-layer early return captured separately). - **Failures (26):** 25 in `xcl --lib` native D3D12 shader tests (21 `CreateComputePipelineState` `0x80070057` + 4 shader output assertions) and 1 in `e2e` (`test_title_runs_and_game_folder_is_untouched`, `RSSetDepthBiasX` #94 blue vs green). Re-running `test_title_runs_and_game_folder_is_untouched` on parent commit `0f293bec8fd53b1478328627a1f08a6155dd2813` under the same Arc lock reproduced the identical depth-bias failure, confirming it predates PR #1995. **Not tested** - Retail Xbox title / `scripts/smoke.ps1`, D3D12 debug layer, live GPU-view reservation copy / vertex-index refresh, and title dispatch through shifted CL1 slots. **AI use** - T3 Code / Codex (`gpt-6.2-sol`, `reasoningEffort: high`) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, `gemini-4-neon`) verified counts against `pr1995-suite.log` and published this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 03:42 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 03:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7152170525) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 10:38 UTC · original

Thanks @⁠Toons29 for running and sharing the exact-head 60 s scripts/smoke.ps1 pair on 50ef7dc (0 device removals, 0 crashes) — added to the PR description!

**@⁠raylitebull** on GitHub · 2026-11-25 10:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7159965062) Thanks @⁠Toons29 for running and sharing the exact-head 60 s `scripts/smoke.ps1` pair on `50ef7dc` (0 device removals, 0 crashes) — added to the PR description!
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 10:44 UTC · original

Rebased #1995 cleanly onto f368928 in commit bdfb2fb:

  • Resolved the crates/xcl/src/hle/kernelx.rs adjacency conflict cleanly alongside #1985 (mirrors::gpu_views_of + mirrors::source_range side-by-side inside kernelx::mirrors).
  • Re-verified cargo check --workspace --tests, resolve_readable_source_accepts_direct_and_rejects_unmapped, and newer_cl1_slots_shift_older_cl1_remaps_by_two directly on bdfb2fb.
**@⁠raylitebull** on GitHub · 2026-11-25 10:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7160102227) Rebased `#1995` cleanly onto `f368928` in commit `bdfb2fb`: - Resolved the `crates/xcl/src/hle/kernelx.rs` adjacency conflict cleanly alongside `#1985` (`mirrors::gpu_views_of` + `mirrors::source_range` side-by-side inside `kernelx::mirrors`). - Re-verified `cargo check --workspace --tests`, `resolve_readable_source_accepts_direct_and_rejects_unmapped`, and `newer_cl1_slots_shift_older_cl1_remaps_by_two` directly on `bdfb2fb`.
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 03:47 UTC · original · edited 2026-11-25 15:29 UTC

Regression run of bdfb2fb1 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 1a0bbe3a, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1628 (PresentX 1628)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14561 MB
xcl-smoke v1
commit: bdfb2fb16da4d1ebb93229333b2d4b4fd8e55da7
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1627 (PresentX 1627)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14598 MB

Against the limits in CONTRIBUTING.md: 100 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; both blocks are exactly as printed, and I approved posting this.

**@⁠Toons29** on GitHub · 2026-11-25 03:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7152248920) · edited 2026-11-25 15:29 UTC Regression run of `bdfb2fb1` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `1a0bbe3a`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1628 (PresentX 1628) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14561 MB ``` ``` xcl-smoke v1 commit: bdfb2fb16da4d1ebb93229333b2d4b4fd8e55da7 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1627 (PresentX 1627) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14598 MB ``` Against the limits in CONTRIBUTING.md: 100 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; both blocks are exactly as printed, and I approved posting this.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 18:15 UTC · original

Thanks @⁠Toons29 for running and sharing the exact-head 60 s scripts/smoke.ps1 pair on bdfb2fb1 (0 device removals, 0 crashes, 1628 -> 1627 frames) — absorbed into the PR description!

**@⁠raylitebull** on GitHub · 2026-11-25 18:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7170664845) Thanks @⁠Toons29 for running and sharing the exact-head 60 s `scripts/smoke.ps1` pair on `bdfb2fb1` (`0` device removals, `0` crashes, `1628 -> 1627` frames) — absorbed into the PR description!
Author
Owner

@⁠pickles976 on GitHub · 2026-11-25 18:41 UTC · original · edited 2026-11-25 19:04 UTC

Tested an adapted integration of this PR on Linux/Wine with vkd3d-proton and an RTX 4060 Laptop GPU (8 GiB), using the GTA VI Xbox 1.0.2.1 title through its initial world-load path. The integration also contains #877 and the Wine native-vtable changes from closed #1395, which this title currently needs to boot with stock assert-enabled vkd3d-proton.

Build/tests:

  • hle::d3d12x::list_x::tests::resolve_readable_source_accepts_direct_and_rejects_unmapped: passed
  • hle::d3d12x::real::map_tests::newer_cl1_slots_shift_older_cl1_remaps_by_two: passed
  • release MSVC cross-build: passed

Runtime result: the title reached illustrated loading screens and sustained 29.8 fps over the last 300 presents before my 7.5 GiB VRAM safety guard terminated it. DirectStorage reported 0 failed requests and there was no crash/device removal. However, the real 16 KiB operation this was intended to cover still took the fallback, not the new staging path:

kernelx: reservation 0x74d14bfe0000 (0x400000000 bytes, no CPU access) is the GPU view of 0x74d54bff0000
...
D3D12.X: CopyMemoryToMemoryX: 0x74d1a7b50000 → 0x3d5be890 (0x4000 bytes) is not in unified memory – not done

Correction after source review: the absence of a staged-copy log does not prove resolve_readable_source returned None. Staging is gated by dst_uma.is_some() first. The destination 0x3d5be890 is below the logged UMA base 0x400000000, so this observed call does not establish coverage of the PR’s GPU-source resolver. The failing copy also needs a non-UMA destination path; my earlier inference blaming source readability was unsupported.

The control also reached this fallback. These results verify build/unit tests and boot/loading regression only, not successful GPU-view staging or playable gameplay. AI-assisted test and source review.

**@⁠pickles976** on GitHub · 2026-11-25 18:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7171265090) · edited 2026-11-25 19:04 UTC Tested an adapted integration of this PR on Linux/Wine with vkd3d-proton and an RTX 4060 Laptop GPU (8 GiB), using the GTA VI Xbox 1.0.2.1 title through its initial world-load path. The integration also contains #877 and the Wine native-vtable changes from closed #1395, which this title currently needs to boot with stock assert-enabled vkd3d-proton. Build/tests: - `hle::d3d12x::list_x::tests::resolve_readable_source_accepts_direct_and_rejects_unmapped`: passed - `hle::d3d12x::real::map_tests::newer_cl1_slots_shift_older_cl1_remaps_by_two`: passed - release MSVC cross-build: passed Runtime result: the title reached illustrated loading screens and sustained 29.8 fps over the last 300 presents before my 7.5 GiB VRAM safety guard terminated it. DirectStorage reported 0 failed requests and there was no crash/device removal. However, the real 16 KiB operation this was intended to cover still took the fallback, not the new staging path: ``` kernelx: reservation 0x74d14bfe0000 (0x400000000 bytes, no CPU access) is the GPU view of 0x74d54bff0000 ... D3D12.X: CopyMemoryToMemoryX: 0x74d1a7b50000 → 0x3d5be890 (0x4000 bytes) is not in unified memory – not done ``` **Correction after source review:** the absence of a staged-copy log does not prove `resolve_readable_source` returned `None`. Staging is gated by `dst_uma.is_some()` first. The destination `0x3d5be890` is below the logged UMA base `0x400000000`, so this observed call does not establish coverage of the PR’s GPU-source resolver. The failing copy also needs a non-UMA destination path; my earlier inference blaming source readability was unsupported. The control also reached this fallback. These results verify build/unit tests and boot/loading regression only, not successful GPU-view staging or playable gameplay. AI-assisted test and source review.
Author
Owner

@⁠Oliwettoo on GitHub · 2026-11-25 22:15 UTC · original

Review on bdfb2fb (read from the diff, not built or run). The end-of-range fix and the (title, cpu_src, len, mirror) re-keying look right to me; two points not raised above:

  1. The staged source is a snapshot taken at record time. copy_memory_x runs while the title records the list, and copies src_cpu into upload memory right then; on the console, CopyMemoryToMemoryX reads its source when the GPU executes it. If the title (or earlier GPU work in the same submission) writes that source between CopyMemoryToMemoryX and ExecuteCommandLists, the destination gets the old bytes. gpu_va already binds "a copy made now", so there is precedent, but for an explicit copy command it's a semantic change worth stating in the description, or the CPU copy could be deferred to submit (the way sync_title_buffers refreshes mirrors before a draw).
  2. Two unrelated changes in one PR. The GPU-view staging and the newer-layout CL1 remap (apply_newer_cl1_remaps) can be reviewed, tested and reverted independently; CONTRIBUTING asks for one logical change per PR.
**@⁠Oliwettoo** on GitHub · 2026-11-25 22:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7176138973) Review on bdfb2fb (read from the diff, not built or run). The end-of-range fix and the `(title, cpu_src, len, mirror)` re-keying look right to me; two points not raised above: 1. **The staged source is a snapshot taken at record time.** `copy_memory_x` runs while the title records the list, and copies `src_cpu` into upload memory right then; on the console, `CopyMemoryToMemoryX` reads its source when the GPU executes it. If the title (or earlier GPU work in the same submission) writes that source between `CopyMemoryToMemoryX` and `ExecuteCommandLists`, the destination gets the old bytes. `gpu_va` already binds "a copy made now", so there is precedent, but for an explicit copy command it's a semantic change worth stating in the description, or the CPU copy could be deferred to submit (the way `sync_title_buffers` refreshes mirrors before a draw). 2. **Two unrelated changes in one PR.** The GPU-view staging and the newer-layout CL1 remap (`apply_newer_cl1_remaps`) can be reviewed, tested and reverted independently; CONTRIBUTING asks for one logical change per PR.
Author
Owner

@⁠Oliwettoo on GitHub · 2026-11-25 22:34 UTC · original

Heads-up for whichever of these merges second: #1995 and #2478 (stacked on #2437) both rewrite the per-draw mirror sync in list_x.rs, and git merge-tree reports a conflict between their heads. Beyond the text conflict:

  • #1995 makes MIRRORS (title_start, cpu_src_start, len, mirror), so a mirror of a GPU-view address copies from its CPU backing.
  • #2478's page tracking (mirror_sources, the GetWriteWatch in written_pages, MIRROR_STALE) works on the title address.

Combined as they are, a GPU-view mirror's GetWriteWatch fails, so the draw copies the whole range every time. That stays correct, but it loses #2478's saving for exactly the buffers #1995 adds. Switching the write-watch and stale-page lookups to cpu_src_start when resolving would keep both. (Read from the diffs a6ec51e / bdfb2fb, not run.)

**@⁠Oliwettoo** on GitHub · 2026-11-25 22:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7176525078) Heads-up for whichever of these merges second: #1995 and #2478 (stacked on #2437) both rewrite the per-draw mirror sync in `list_x.rs`, and `git merge-tree` reports a conflict between their heads. Beyond the text conflict: - #1995 makes `MIRRORS` `(title_start, cpu_src_start, len, mirror)`, so a mirror of a GPU-view address copies from its CPU backing. - #2478's page tracking (`mirror_sources`, the `GetWriteWatch` in `written_pages`, `MIRROR_STALE`) works on the title address. Combined as they are, a GPU-view mirror's `GetWriteWatch` fails, so the draw copies the whole range every time. That stays correct, but it loses #2478's saving for exactly the buffers #1995 adds. Switching the write-watch and stale-page lookups to `cpu_src_start` when resolving would keep both. (Read from the diffs a6ec51e / bdfb2fb, not run.)
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 06:51 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: 1 failure under parallel scheduling; clean on --test-threads=1 rerun (1307 passed, 0 failed, 27 ignored, 78s). Intermittent single-test flake — tracked in #1978.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 06:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#issuecomment-7184851887) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: 1 failure under parallel scheduling; clean on `--test-threads=1` rerun (**1307 passed, 0 failed, 27 ignored**, 78s). Intermittent single-test flake — tracked in #1978. Thanks! — Devin
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 09:03 UTC · original · reviewed

On bdfb2fb, a GPU-view address can retain the wrong CPU backing after release and reuse. gpu_va returns an existing mirrored(va, bytes) entry before calling resolve_readable_source; MIRRORS records the original (title_start, cpu_src_start, ...) and is not invalidated by kernelx::mirrors::released, which only removes the reservation mapping.

For example, reserve GPU view B paired with CPU view A1, bind B once, release B, then reserve B again paired with a newer CPU view A2. A subsequent bind of B finds the old mirror, and sync_title_buffers refreshes it from A1 (or leaves prior bytes if A1 is no longer readable), rather than A2. The new title address is valid but draws can use stale vertex/index data. The fresh reservation lookup used by CopyMemoryToMemoryX does not prevent this draw path.

Could the cached entry be checked against the current reservation identity before reuse, or invalidated/replaced when the GPU-view mapping changes? A focused release-and-rebind fixture with different bytes in A1 and A2 would cover it. I reviewed source only; I did not run a title or GPU repro.

**@⁠luckyteagirl** on GitHub · 2026-11-26 09:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/1995#pullrequestreview-6071148756) · **reviewed** On `bdfb2fb`, a GPU-view address can retain the wrong CPU backing after release and reuse. `gpu_va` returns an existing `mirrored(va, bytes)` entry before calling `resolve_readable_source`; `MIRRORS` records the original `(title_start, cpu_src_start, ...)` and is not invalidated by `kernelx::mirrors::released`, which only removes the reservation mapping. For example, reserve GPU view B paired with CPU view A1, bind B once, release B, then reserve B again paired with a newer CPU view A2. A subsequent bind of B finds the old mirror, and `sync_title_buffers` refreshes it from A1 (or leaves prior bytes if A1 is no longer readable), rather than A2. The new title address is valid but draws can use stale vertex/index data. The fresh reservation lookup used by `CopyMemoryToMemoryX` does not prevent this draw path. Could the cached entry be checked against the current reservation identity before reuse, or invalidated/replaced when the GPU-view mapping changes? A focused release-and-rebind fixture with different bytes in A1 and A2 would cover it. I reviewed source only; I did not run a title or GPU repro.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1995/head:github-bot/gh-1995'
git switch 'github-bot/gh-1995'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1995'
git switch 'github-bot/gh-1995'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1995'
git switch 'github-bot/gh-1995'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1995'
git switch 'main'
git merge --squash 'github-bot/gh-1995'
git switch 'main'
git merge --ff-only 'github-bot/gh-1995'
git switch 'main'
git merge 'github-bot/gh-1995'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.