XG: fix CopyFromSubresource 7-argument ABI and guard destination span #684

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

@⁠JGonzalezRodriguez on GitHub · 2026-11-24 03:28 UTC · original
JGonzalezRodriguez:fix/xg-copy-from-subresource-abi → main · +149 −8 · 2 files · 1 commits · open

Fix XGTextureAddressComputer::CopyFromSubresource (vtable slot #9) taking 7 arguments instead of 6, and validate the destination span before writing rows.

CopyFromSubresource receives an extra u32 parameter before src (dst, plane, sub, arg4, src, row_pitch, slice_pitch). With the previous 6-argument signature, src was read as row_pitch, causing copy_nonoverlapping to stride rows by the low 32 bits of the source pointer and trigger access violations (#477, first crash in #662).

Supersedes #539 (the other parts of #539 have either landed on main in #435 / #451 / #486 / #574 / #602 / #634 / #636, are covered by focused open PRs, or need a separate single-purpose PR).

Fixes #477
Part of #662

What is in it

  • crates/xcl/src/hle/xg.rs:
    • Update copy_from (vtable slot #9) and the module doc comment to the 7-argument signature (dst, plane, sub, arg4, src, row_pitch, slice_pitch).
    • Validate row_pitch, 3D slice_pitch, and destination span readability (gpu::shader::readable) before copying, logging a bounded warning and returning E_INVALIDARG on invalid spans.
    • Add unit tests copy_into_and_copy_from_round_trip, copy_from_3d_round_trip, and copy_from_rejects_invalid_dst_span.
  • crates/xcl/tests/xg_oracle.rs:
    • Update the CopyFromSubresource call in subresource_copies_match_the_console_library to the 7-argument signature.

Tested

  • Cross-compile check on Linux (rustc 1.98.1, debug, x86_64-pc-windows-msvc via clang-cl + lld-link + xwin):
    • cargo check --workspace --target x86_64-pc-windows-msvc --tests: passed (0 errors, 0 warnings).
  • Targeted tests run under Proton Experimental (wine-11.0) on AMD Ryzen 9 7950X3D + NVIDIA GeForce RTX 4090 (driver 610.57.04), debug:
    • xcl --lib hle::xg::tests: 6 passed, 0 failed, 0 ignored (rgba8_64kb_s_layout, d16s8_is_planar_depth_and_stencil, console_floats_are_32_bits, copy_into_and_copy_from_round_trip, copy_from_3d_round_trip, copy_from_rejects_invalid_dst_span).
    • xg_oracle: 6 passed, 0 failed, 12 ignored (oracle tests return early without XCL_SAMPLE_XG).
  • Note: the two original xg commits from #539 were also independently tested against a retail title by @⁠ddm-j in https://github.com/ivall/xcl/pull/539#issuecomment-7120523111 (confirmed valid row_pitch/slice_pitch and no access violation).

Regression run

  • Pending native Windows scripts/smoke.ps1 runs (opened as draft until native Windows scripts/test.ps1 and main + PR xcl-smoke blocks are attached).

Not tested

  • Native Windows scripts/test.ps1 (full workspace suite) and scripts/smoke.ps1 regression runs (author builds on Linux/Wine).
  • tests/xg_oracle.rs with XCL_SAMPLE_XG set against the console xg_xs.dll.
  • AMD and Intel GPUs.

AI use

  • Antigravity with Gemini (audited #539 against origin/main, refined the 2D/3D destination span check, wrote unit tests, ran cross-compile + Proton Wine checks, and drafted the PR description; reviewed by author).
**@⁠JGonzalezRodriguez** on GitHub · 2026-11-24 03:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/684) `JGonzalezRodriguez:fix/xg-copy-from-subresource-abi` → `main` · +149 −8 · 2 files · 1 commits · open Fix `XGTextureAddressComputer::CopyFromSubresource` (vtable slot #9) taking 7 arguments instead of 6, and validate the destination span before writing rows. `CopyFromSubresource` receives an extra `u32` parameter before `src` (`dst, plane, sub, arg4, src, row_pitch, slice_pitch`). With the previous 6-argument signature, `src` was read as `row_pitch`, causing `copy_nonoverlapping` to stride rows by the low 32 bits of the source pointer and trigger access violations (#477, first crash in #662). Supersedes #539 (the other parts of #539 have either landed on `main` in #435 / #451 / #486 / #574 / #602 / #634 / #636, are covered by focused open PRs, or need a separate single-purpose PR). Fixes #477 Part of #662 **What is in it** - `crates/xcl/src/hle/xg.rs`: - Update `copy_from` (vtable slot #9) and the module doc comment to the 7-argument signature `(dst, plane, sub, arg4, src, row_pitch, slice_pitch)`. - Validate `row_pitch`, 3D `slice_pitch`, and destination span readability (`gpu::shader::readable`) before copying, logging a bounded warning and returning `E_INVALIDARG` on invalid spans. - Add unit tests `copy_into_and_copy_from_round_trip`, `copy_from_3d_round_trip`, and `copy_from_rejects_invalid_dst_span`. - `crates/xcl/tests/xg_oracle.rs`: - Update the `CopyFromSubresource` call in `subresource_copies_match_the_console_library` to the 7-argument signature. **Tested** - Cross-compile check on Linux (`rustc 1.98.1`, debug, `x86_64-pc-windows-msvc` via `clang-cl` + `lld-link` + `xwin`): - `cargo check --workspace --target x86_64-pc-windows-msvc --tests`: passed (0 errors, 0 warnings). - Targeted tests run under Proton Experimental (`wine-11.0`) on AMD Ryzen 9 7950X3D + NVIDIA GeForce RTX 4090 (driver `610.57.04`), debug: - `xcl --lib hle::xg::tests`: 6 passed, 0 failed, 0 ignored (`rgba8_64kb_s_layout`, `d16s8_is_planar_depth_and_stencil`, `console_floats_are_32_bits`, `copy_into_and_copy_from_round_trip`, `copy_from_3d_round_trip`, `copy_from_rejects_invalid_dst_span`). - `xg_oracle`: 6 passed, 0 failed, 12 ignored (oracle tests return early without `XCL_SAMPLE_XG`). - Note: the two original `xg` commits from #539 were also independently tested against a retail title by @⁠ddm-j in https://github.com/ivall/xcl/pull/539#issuecomment-7120523111 (confirmed valid `row_pitch`/`slice_pitch` and no access violation). **Regression run** - Pending native Windows `scripts/smoke.ps1` runs (opened as draft until native Windows `scripts/test.ps1` and `main` + PR `xcl-smoke` blocks are attached). **Not tested** - Native Windows `scripts/test.ps1` (full workspace suite) and `scripts/smoke.ps1` regression runs (author builds on Linux/Wine). - `tests/xg_oracle.rs` with `XCL_SAMPLE_XG` set against the console `xg_xs.dll`. - AMD and Intel GPUs. **AI use** - Antigravity with Gemini (audited #539 against `origin/main`, refined the 2D/3D destination span check, wrote unit tests, ran cross-compile + Proton Wine checks, and drafted the PR description; reviewed by author).
CopyFromSubresource (vtable slot #9) takes an extra u32 argument before
src: (dst, plane, sub, arg4, src, row_pitch, slice_pitch). With the old
6-argument signature, src was decoded as row_pitch and rows were copied
far outside dst, causing access violations (#477, #662).

Update copy_from and xg_oracle to the 7-argument ABI, validate row_pitch,
3D slice_pitch, and destination span readability before writing (logging
a bounded warning and returning E_INVALIDARG on invalid spans), and add
2D, 3D, and invalid-span unit tests.

Fixes #477
Part of #662
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:29:19 +00:00
Author
Owner

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

This branch seems to fix #477 on Linux!

**@⁠jvyden** on GitHub · 2026-11-24 03:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7121267609) This branch seems to fix #477 on Linux!
Author
Owner

@⁠eizispark on GitHub · 2026-11-24 03:43 UTC · original

Hardware check of e56dbc3f4313e6950730ba4129c14b530b3e7e40 (verified clean merge with main 91f9a5e): pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profile
  • cargo test --workspace -- --test-threads=4: 695 passed, 0 failed, 41 ignored (GPU tests skipped on this adapter: none)
  • cargo test -p xcl --lib hle::xg::tests: 6 passed, 0 failed; cargo test -p xcl --test xg_oracle: 6 passed, 0 failed, 12 ignored (XCL_SAMPLE_* unset)

Regression run
main (dd2ae9a):

xcl-smoke v1
commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1666 (PresentX 1666)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14851 MB

PR (e56dbc3):

xcl-smoke v1
commit: e56dbc3f4313e6950730ba4129c14b530b3e7e40
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1662 (PresentX 1662)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14848 MB

Not tested

  • wave32-only GPUs (NVIDIA / Intel); xg_oracle with XCL_SAMPLE_XG set; gameplay past the menus

AI use

  • Antigravity (Gemini 4 Carbon) ran the build, test suite, and scripts/smoke.ps1 harness on this machine and formatted this report.
**@⁠eizispark** on GitHub · 2026-11-24 03:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7121355912) Hardware check of `e56dbc3f4313e6950730ba4129c14b530b3e7e40` (verified clean merge with `main` `91f9a5e`): **pass**. **Tested** - Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, release + test profile - `cargo test --workspace -- --test-threads=4`: `695 passed, 0 failed, 41 ignored` (GPU tests skipped on this adapter: `none`) - `cargo test -p xcl --lib hle::xg::tests`: `6 passed, 0 failed`; `cargo test -p xcl --test xg_oracle`: `6 passed, 0 failed, 12 ignored` (`XCL_SAMPLE_*` unset) **Regression run** `main` (`dd2ae9a`): ``` xcl-smoke v1 commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1666 (PresentX 1666) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14851 MB ``` PR (`e56dbc3`): ``` xcl-smoke v1 commit: e56dbc3f4313e6950730ba4129c14b530b3e7e40 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1662 (PresentX 1662) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14848 MB ``` **Not tested** - wave32-only GPUs (NVIDIA / Intel); `xg_oracle` with `XCL_SAMPLE_XG` set; gameplay past the menus **AI use** - Antigravity (Gemini 4 Carbon) ran the build, test suite, and `scripts/smoke.ps1` harness on this machine and formatted this report.
Author
Owner

@⁠imnicho on GitHub · 2026-11-24 03:46 UTC · original

A retail run that reaches the call, on native Windows – the reports above cover the suite and the 60 s regression pair, which stay on the title's first screens.

Tested

  • Intel Core i7-7700K (4 cores / 8 threads), 16 GB RAM, NVIDIA GeForce RTX 5080 16 GB (driver 610.47, 32-lane waves), Windows 10 22H2 (19045), DXC 1.9.2602.17, rustc 1.100.0; release. The newer retail title of the README, XCL_NETWORK=0, a pad script (XCL_PRESS_AT), 240 s asked for, one run each:
main 63cdc25 (this PR's base less its README commit) e56dbc3
the title starts setting up its world's graphics at 170.4 s 138.1 s
then access violation 0.4 s later: memcpy writing past the end of the unified memory's windows, with the same title frames on the stack as in #662 no access violation; the title goes on for 32 s
"invalid span" warnings of the new guard – 0: it refused none of the title's calls
the run ends at 170.8 s, 0xc0000005 170.3 s, the title's own null write of #232 (it stood still while compute pipelines were built – the next thing in the way here, not this PR's)
  • The same reading of the call from a local diagnostics build of mine, made before #539 existed: seven arguments, 0 in the low half of the one before the source, row pitch 2048 and slice pitch 262 144 (2048 × 128 rows) for a 512×512 level of 16-byte elements, 256 and 8192 for the next texture; CopyIntoSubresource fits its six arguments in all 50 calls logged (24 of them on six-slice textures).
  • Also here: cargo build --workspace && cargo test --workspace -- --test-threads=4 on e56dbc3 (debug): 695 passed, 0 failed, 41 ignored (SKIPPED: the two wave64 tests); scripts/smoke.ps1 60 s, two rounds in turn: main 91f9a5e 1316 and 1381 frames, e56dbc3 1413 and 1373, exit 0 and no crash in all four.

Not tested: AMD and Intel GPUs; tests/xg_oracle.rs against the console's library (none on this PC); what the extra argument selects when it is not 0.

One thing you may want: I had the same fix with a test of the title's own first call – BC7 512×512 with its full mip chain through both methods, level by level, nothing written between or after the rows; on main that test process ends with STATUS_ACCESS_VIOLATION, as the title does. It is at imnicho/xcl, branch xg-copy-from-args (00b384c), if you want to take it; I did not open a PR for it since yours covers the fix.

AI use: Claude Code with Claude Fable 5.2 ran the builds, tests and runs and wrote this report; every number is from a run on the machine named. No game files are attached.

**@⁠imnicho** on GitHub · 2026-11-24 03:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7121408824) A retail run that reaches the call, on native Windows – the reports above cover the suite and the 60 s regression pair, which stay on the title's first screens. **Tested** - Intel Core i7-7700K (4 cores / 8 threads), 16 GB RAM, NVIDIA GeForce RTX 5080 16 GB (driver 610.47, 32-lane waves), Windows 10 22H2 (19045), DXC 1.9.2602.17, rustc 1.100.0; release. The newer retail title of the README, `XCL_NETWORK=0`, a pad script (`XCL_PRESS_AT`), 240 s asked for, one run each: | | `main` `63cdc25` (this PR's base less its README commit) | `e56dbc3` | |---|---|---| | the title starts setting up its world's graphics at | 170.4 s | 138.1 s | | then | access violation 0.4 s later: `memcpy` writing past the end of the unified memory's windows, with the same title frames on the stack as in #662 | no access violation; the title goes on for 32 s | | "invalid span" warnings of the new guard | – | 0: it refused none of the title's calls | | the run ends at | 170.8 s, `0xc0000005` | 170.3 s, the title's own null write of #232 (it stood still while compute pipelines were built – the next thing in the way here, not this PR's) | - The same reading of the call from a local diagnostics build of mine, made before #539 existed: seven arguments, 0 in the low half of the one before the source, row pitch 2048 and slice pitch 262 144 (2048 × 128 rows) for a 512×512 level of 16-byte elements, 256 and 8192 for the next texture; `CopyIntoSubresource` fits its six arguments in all 50 calls logged (24 of them on six-slice textures). - Also here: `cargo build --workspace && cargo test --workspace -- --test-threads=4` on `e56dbc3` (debug): 695 passed, 0 failed, 41 ignored (SKIPPED: the two wave64 tests); `scripts/smoke.ps1` 60 s, two rounds in turn: `main` `91f9a5e` 1316 and 1381 frames, `e56dbc3` 1413 and 1373, exit 0 and no crash in all four. **Not tested:** AMD and Intel GPUs; `tests/xg_oracle.rs` against the console's library (none on this PC); what the extra argument selects when it is not 0. One thing you may want: I had the same fix with a test of the title's own first call – BC7 512×512 with its full mip chain through both methods, level by level, nothing written between or after the rows; on `main` that test process ends with `STATUS_ACCESS_VIOLATION`, as the title does. It is at `imnicho/xcl`, branch `xg-copy-from-args` (`00b384c`), if you want to take it; I did not open a PR for it since yours covers the fix. AI use: Claude Code with Claude Fable 5.2 ran the builds, tests and runs and wrote this report; every number is from a run on the machine named. No game files are attached.
Author
Owner

@⁠MonkeyPython on GitHub · 2026-11-24 03:43 UTC · original · edited 2026-11-24 03:52 UTC

@⁠odd/tasks/draft-pr684-comment.md

**@⁠MonkeyPython** on GitHub · 2026-11-24 03:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7121362731) · edited 2026-11-24 03:52 UTC @⁠odd/tasks/draft-pr684-comment.md
Author
Owner

@⁠itsd-effex on GitHub · 2026-11-24 03:53 UTC · original

Linux (Wine) run that reaches the call, with details for the one-line Linux report above.

Tested

  • RTX 3080 Ti 12 GB (NVIDIA 620.73.04), i7-11700KF, 32 GB RAM, Arch-based Linux. Wine from Proton Experimental and patched vkd3d-proton 3.1 (the #257 kit). Release build, cross-compiled with cargo-xwin.
  • Build: this PR's head e56dbc3 with #273 (ce8839b, BC1) merged on top, merge 53fcb50, no conflicts. Without BC1 this title doesn't reach the call on this machine: it stays on refused BC1 loads.
  • Our test title under Wine: 48 PASS / 2 FAIL (the uncloaked window and the XMA2 GetState, the same as on main).
  • Retail 1.0.2.1, XCL_NETWORK=0: no AV in copy_from. main dd2ae9a + #273, without this PR, faults there at ~184 s (ucrtbase.dll+0x171d9, rax=0x45999000 = the source pointer read as the row pitch). With it, the run went on past that point.

What came after

  • With 32 GB RAM and 4 GB of swap, the process was OOM-killed at ~183 s: anon-rss 19.6 GB plus shmem 4.0 GB (the 4095 MB coherent window). An earlier run with a local guard, which only skipped the two copies, was OOM-killed the same way at ~195 s. So this is not from this PR.
  • With 32 GB of swap added: no OOM. The CommandList10::#101 stub was first called at 159 s. At 200 s the title's GPU watchdog fired (GPU Loc Sig 7333478d in its Breakpad log), followed by its null write at game+0x23cf683. That's the #505 stop. Its crash reporter then tried to upload to submit.backtrace.io, and XCL_NETWORK=0 refused it (WinHttpConnect fails).

Not tested: Windows. The workspace suite: XCL doesn't build or run tests on Linux, so only the cross-built binaries ran. This PR without #273 on a run that reaches the call.

AI use: Claude Code (Claude Opus 5.5) built the branches, read the logs and the kernel journal, and drafted this comment. The runs are mine, on the hardware above.

**@⁠itsd-effex** on GitHub · 2026-11-24 03:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7121518455) Linux (Wine) run that reaches the call, with details for the one-line Linux report above. **Tested** - RTX 3080 Ti 12 GB (NVIDIA 620.73.04), i7-11700KF, 32 GB RAM, Arch-based Linux. Wine from Proton Experimental and patched vkd3d-proton 3.1 (the #257 kit). Release build, cross-compiled with cargo-xwin. - Build: this PR's head `e56dbc3` with #273 (`ce8839b`, BC1) merged on top, merge `53fcb50`, no conflicts. Without BC1 this title doesn't reach the call on this machine: it stays on refused BC1 loads. - Our test title under Wine: 48 PASS / 2 FAIL (the uncloaked window and the XMA2 `GetState`, the same as on `main`). - Retail 1.0.2.1, `XCL_NETWORK=0`: **no AV in `copy_from`**. `main` `dd2ae9a` + #273, without this PR, faults there at ~184 s (`ucrtbase.dll+0x171d9`, `rax=0x45999000` = the source pointer read as the row pitch). With it, the run went on past that point. **What came after** - With 32 GB RAM and 4 GB of swap, the process was OOM-killed at ~183 s: anon-rss 19.6 GB plus shmem 4.0 GB (the 4095 MB coherent window). An earlier run with a local guard, which only skipped the two copies, was OOM-killed the same way at ~195 s. So this is not from this PR. - With 32 GB of swap added: no OOM. The `CommandList10::#101` stub was first called at 159 s. At 200 s the title's GPU watchdog fired (`GPU Loc Sig` `7333478d` in its Breakpad log), followed by its null write at `game+0x23cf683`. That's the #505 stop. Its crash reporter then tried to upload to `submit.backtrace.io`, and `XCL_NETWORK=0` refused it (`WinHttpConnect fails`). **Not tested:** Windows. The workspace suite: XCL doesn't build or run tests on Linux, so only the cross-built binaries ran. This PR without #273 on a run that reaches the call. **AI use:** Claude Code (Claude Opus 5.5) built the branches, read the logs and the kernel journal, and drafted this comment. The runs are mine, on the hardware above.
Author
Owner

@⁠theaustinayers on GitHub · 2026-11-24 03:57 UTC · original

Test report on native Windows for e56dbc3 (this PR's head), since the description has no Windows run yet. Written with Claude Code (Claude Fable 5.2) from runs on my machine; the blocks below are the unedited output of scripts/smoke.ps1.

Tested

  • RTX 5090 (driver 621.14), Ryzen 9 9950X3D, 128 GB, Windows 11 build 26300, rustc 1.100.0.
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4: 695 passed, 0 failed, 41 ignored.
  • SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • cargo test -p xcl --lib hle::xg: copy_into_and_copy_from_round_trip, copy_from_3d_round_trip, copy_from_rejects_invalid_dst_span and the three older xg tests pass.
  • cargo test -p xcl --test xg_oracle: 6 passed, 12 ignored (subresource_copies_match_the_console_library among the passed).

Regression run (a retail title, 60 s, no input)

main (91f9a5e, this PR's merge base):

xcl-smoke v1
commit: 91f9a5e9f03156ea82dc55a18f7704862da7a5db
gpu: NVIDIA GeForce RTX 5090
title: NYCMain
seconds: 60
exit: 0x0
frames shown: 1611 (PresentX 1611)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14485 MB

this PR (e56dbc3):

xcl-smoke v1
commit: e56dbc3f4313e6950730ba4129c14b530b3e7e40
gpu: NVIDIA GeForce RTX 5090
title: NYCMain
seconds: 60
exit: 0x0
frames shown: 1604 (PresentX 1604)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14495 MB

Not tested

  • Whether this title calls CopyFromSubresource at all in those 60 s: the run stays at its first menu, and the new warning for an invalid span was not logged. So this is a regression check, not a confirmation of the 7-argument layout on a retail title.
  • The crash of #477 / #662 itself: I did not reproduce it before or after.
**@⁠theaustinayers** on GitHub · 2026-11-24 03:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7121572515) Test report on native Windows for e56dbc3 (this PR's head), since the description has no Windows run yet. Written with Claude Code (Claude Fable 5.2) from runs on my machine; the blocks below are the unedited output of `scripts/smoke.ps1`. **Tested** - RTX 5090 (driver 621.14), Ryzen 9 9950X3D, 128 GB, Windows 11 build 26300, rustc 1.100.0. - `cargo build --workspace`, then `cargo test --workspace -- --test-threads=4`: 695 passed, 0 failed, 41 ignored. - SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - `cargo test -p xcl --lib hle::xg`: `copy_into_and_copy_from_round_trip`, `copy_from_3d_round_trip`, `copy_from_rejects_invalid_dst_span` and the three older `xg` tests pass. - `cargo test -p xcl --test xg_oracle`: 6 passed, 12 ignored (`subresource_copies_match_the_console_library` among the passed). **Regression run** (a retail title, 60 s, no input) main (91f9a5e, this PR's merge base): ``` xcl-smoke v1 commit: 91f9a5e9f03156ea82dc55a18f7704862da7a5db gpu: NVIDIA GeForce RTX 5090 title: NYCMain seconds: 60 exit: 0x0 frames shown: 1611 (PresentX 1611) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14485 MB ``` this PR (e56dbc3): ``` xcl-smoke v1 commit: e56dbc3f4313e6950730ba4129c14b530b3e7e40 gpu: NVIDIA GeForce RTX 5090 title: NYCMain seconds: 60 exit: 0x0 frames shown: 1604 (PresentX 1604) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14495 MB ``` **Not tested** - Whether this title calls `CopyFromSubresource` at all in those 60 s: the run stays at its first menu, and the new warning for an invalid span was not logged. So this is a regression check, not a confirmation of the 7-argument layout on a retail title. - The crash of #477 / #662 itself: I did not reproduce it before or after.
Author
Owner

@⁠mastrr9 on GitHub · 2026-11-24 04:10 UTC · original

Code audit + NVIDIA RTX 5080 test run on e56dbc3f4313e6950730ba4129c14b530b3e7e40:

Review

  • The 7-argument CopyFromSubresource signature and checked_mul/checked_add span overflow guards cleanly fix the stride crash in #662 / #477.
  • One small hardening note on xg.rs:731: gpu::shader::readable(dst as usize, span) only rejects PAGE_NOACCESS | PAGE_GUARD, so a PAGE_READONLY destination would still pass and fault on write (and src is not checked for readable(src + at, t.size()) before slice::from_raw_parts). Checking writability for dst and readability for src would make the guard complete.

Tested

  • Hardware / OS / toolchain: NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 25H2 (build 26200.9711), rustc 1.100.0 (MSVC), debug build.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4: 695 passed, 0 failed, 41 ignored.
  • New tests copy_into_and_copy_from_round_trip, copy_from_3d_round_trip, copy_from_rejects_invalid_dst_span: all passed.
  • SKIPPED GPU/D3D12 tests: gpu_geometry_wave32_prefix_count_over_a_mask / gpu_wave32_program_in_wave64_hardware (no wave64), plus 2 D3D12 debug-layer tests (no d3d12SDKLayers.dll).

Not tested

  • Retail title / scripts/smoke.ps1 run (test suite only).
  • AMD / Intel GPUs.

AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.

**@⁠mastrr9** on GitHub · 2026-11-24 04:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7121777334) Code audit + NVIDIA RTX 5080 test run on `e56dbc3f4313e6950730ba4129c14b530b3e7e40`: ### Review - The 7-argument `CopyFromSubresource` signature and `checked_mul`/`checked_add` span overflow guards cleanly fix the stride crash in #662 / #477. - One small hardening note on `xg.rs:731`: `gpu::shader::readable(dst as usize, span)` only rejects `PAGE_NOACCESS | PAGE_GUARD`, so a `PAGE_READONLY` destination would still pass and fault on write (and `src` is not checked for `readable(src + at, t.size())` before `slice::from_raw_parts`). Checking writability for `dst` and readability for `src` would make the guard complete. ### Tested - Hardware / OS / toolchain: NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 25H2 (build 26200.9711), `rustc 1.100.0` (MSVC), debug build. - `cargo build --workspace && cargo test --workspace -- --test-threads=4`: **695 passed, 0 failed, 41 ignored**. - New tests `copy_into_and_copy_from_round_trip`, `copy_from_3d_round_trip`, `copy_from_rejects_invalid_dst_span`: **all passed**. - `SKIPPED` GPU/D3D12 tests: `gpu_geometry_wave32_prefix_count_over_a_mask` / `gpu_wave32_program_in_wave64_hardware` (`no wave64`), plus 2 D3D12 debug-layer tests (`no d3d12SDKLayers.dll`). ### Not tested - Retail title / `scripts/smoke.ps1` run (test suite only). - AMD / Intel GPUs. *AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.*
Author
Owner

@⁠Royalflamejlh on GitHub · 2026-11-24 06:10 UTC · original

Linux + NVIDIA run that reaches the call: main e50836b faulted in copy_from at 85.9 s, and e50836b merged with this PR's head e56dbc3 (no conflicts) did not fault and logged the new invalid span warning 0 times.

Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (X11), vkd3d-proton 3.1 with the relaxed-vtable patch from #175 and a local dxil-spirv patch, VKD3D_CONFIG=ignore_shared_fence. RTX 4060 Ti 16 GB (driver 615.71.09, 32-lane waves), Ryzen 9 9950X3D, 64 GB RAM. Release, cross-compiled to x86_64-pc-windows-gnu (rustc 1.98.0), DXC 1.9.2609.5, XCL_NETWORK=0. The title of #662, first boot (no save), one A press at 44.8 s through XCL_PRESS_AT, 130 s asked for, 1 run each.

main e50836b e50836b + e56dbc3
copy_from access violation at 85.9 s no access violation
CopyFromSubresource invalid span warnings – 0
last presents 85.9 s between 98.4 and 100.4 s
the run ended at 85.9 s, 0xc0000005 in msvcrt.dll+0xa4f9 129.7 s, the title's null write at game+0x23cf683
frames presented 1789 1766

The fault on main:

[85.850] unhandled exception 0xc0000005 in msvcrt.dll+0xa4f9 (write at address 0xc14787a90)
r8=0x800 r12=0x1000 r15=0x40000 …; on the stack: xcl.exe+0x11fcd8, game+0x4daa2c8, game+0x979f5b, game+0x4fb0c2f, game+0x50bb3f0, game+0x979db0

xcl.exe+0x11fcd8 is inside xcl::hle::xg::copy_from (nm on this build). These are the title frames of #662.

With the PR, the title presented for about 14 s more and then stopped, and its watchdog ended it 29 s later. Wait64BitValueX timed out after 2000 ms was logged 15 times from 101.3 s to the end of that run. That is the stall of #662, not this PR's.

Not tested: the cargo test suite and the three new xg tests; native Windows; AMD and Intel; a second run of either tree; main after e50836b (now beaa245, which does not touch the two files of this PR).

AI use: Claude Code (Claude Fable 5.2) read the diff, ran both builds of the title on my machine with XCL_PRESS_AT, compared the logs and drafted this report.

**@⁠Royalflamejlh** on GitHub · 2026-11-24 06:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7123666283) Linux + NVIDIA run that reaches the call: `main` `e50836b` faulted in `copy_from` at 85.9 s, and `e50836b` merged with this PR's head `e56dbc3` (no conflicts) did not fault and logged the new `invalid span` warning 0 times. **Setup:** Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (X11), vkd3d-proton 3.1 with the relaxed-vtable patch from #175 and a local dxil-spirv patch, `VKD3D_CONFIG=ignore_shared_fence`. RTX 4060 Ti 16 GB (driver 615.71.09, 32-lane waves), Ryzen 9 9950X3D, 64 GB RAM. Release, cross-compiled to `x86_64-pc-windows-gnu` (rustc 1.98.0), DXC 1.9.2609.5, `XCL_NETWORK=0`. The title of #662, first boot (no save), one A press at 44.8 s through `XCL_PRESS_AT`, 130 s asked for, 1 run each. | | `main` `e50836b` | `e50836b` + `e56dbc3` | |---|---|---| | `copy_from` | access violation at 85.9 s | no access violation | | `CopyFromSubresource invalid span` warnings | – | 0 | | last presents | 85.9 s | between 98.4 and 100.4 s | | the run ended at | 85.9 s, `0xc0000005` in `msvcrt.dll+0xa4f9` | 129.7 s, the title's null write at `game+0x23cf683` | | frames presented | 1789 | 1766 | The fault on `main`: ``` [85.850] unhandled exception 0xc0000005 in msvcrt.dll+0xa4f9 (write at address 0xc14787a90) r8=0x800 r12=0x1000 r15=0x40000 …; on the stack: xcl.exe+0x11fcd8, game+0x4daa2c8, game+0x979f5b, game+0x4fb0c2f, game+0x50bb3f0, game+0x979db0 ``` `xcl.exe+0x11fcd8` is inside `xcl::hle::xg::copy_from` (`nm` on this build). These are the title frames of #662. With the PR, the title presented for about 14 s more and then stopped, and its watchdog ended it 29 s later. `Wait64BitValueX timed out after 2000 ms` was logged 15 times from 101.3 s to the end of that run. That is the stall of #662, not this PR's. **Not tested:** the `cargo test` suite and the three new `xg` tests; native Windows; AMD and Intel; a second run of either tree; `main` after `e50836b` (now `beaa245`, which does not touch the two files of this PR). **AI use:** Claude Code (Claude Fable 5.2) read the diff, ran both builds of the title on my machine with `XCL_PRESS_AT`, compared the logs and drafted this report.
Author
Owner

@⁠jvyden on GitHub · 2026-11-24 10:11 UTC · original

@⁠ivall, this is missing the regression run in the main body but this has other people running them. It's critical to get Linux working - I've been using this patch for a few hours now and it's stable. This is a good merge, so I figured I'd ping incase it dropped under your radar

**@⁠jvyden** on GitHub · 2026-11-24 10:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7128444784) @⁠ivall, this is missing the regression run in the main body but this has other people running them. It's critical to get Linux working - I've been using this patch for a few hours now and it's stable. This is a good merge, so I figured I'd ping incase it dropped under your radar
Author
Owner

@⁠sander110419 on GitHub · 2026-11-24 10:22 UTC · original

Test report on Linux (Wine), the newer retail game in the README table:

  • NVIDIA GeForce RTX 5070 Laptop GPU (8 GB, 32-lane waves), driver 595.104.02; AMD Ryzen 9 9955HX; GE-Proton11-11 (its wine and vkd3d-proton); release build for x86_64-pc-windows-gnu; DXC 1.9.2609.5
  • Base: a local Wine branch, main of today plus several open PRs (among them the vtable part of #867, without which the title does not start under vkd3d-proton)

Without this PR, Series X mode, 105 s into world loading:
unhandled exception 0xc0000005 in msvcrt.dll+0xa4c9 (write at address 0x7fef77990) in xg::copy_from (xg.rs:713, xcl.exe+0x3f7405). The write address is dst + 0x395ce990, which is the low 32 bits of the tiled source pointer (0x7395ce990): the pointer is read as the row pitch, as this PR describes. The title's two call sites of slot #9 (game+0x979e96 and game+0x979f57) both pass (dst, 0, sub, 0 as a 32-bit store, tiled src, row pitch, slice pitch).

With this PR (3ae0841) merged on that base: Series X ran to 163 s, Series S runs to 142 s and 113 s. None crashed in copy_from; they ended in GPU device loss and the +0x23cf683 stop from #505.

A side note in case someone extends this to slot #8: CopyIntoSubresource did not change in this title. It calls #8 about 10 s in with a heap pointer (0x48d7390) in the 5th argument, the old place. When I tried the 7-argument form for #8 too, it crashed 20 s in, reading through the argument that was then taken for the source. So the change to #9 only, as here, matches what the title does.

Not tested: Windows, AMD, cargo test of this PR on its own base.

AI use: Hermes agent with Claude Opus 5.5 (claude-opus-5-5) ran the builds and the game, and wrote this report; I checked it.

**@⁠sander110419** on GitHub · 2026-11-24 10:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7128692255) Test report on Linux (Wine), the newer retail game in the README table: - NVIDIA GeForce RTX 5070 Laptop GPU (8 GB, 32-lane waves), driver 595.104.02; AMD Ryzen 9 9955HX; GE-Proton11-11 (its wine and vkd3d-proton); release build for `x86_64-pc-windows-gnu`; DXC 1.9.2609.5 - Base: a local Wine branch, `main` of today plus several open PRs (among them the vtable part of #867, without which the title does not start under vkd3d-proton) Without this PR, Series X mode, 105 s into world loading: `unhandled exception 0xc0000005 in msvcrt.dll+0xa4c9 (write at address 0x7fef77990)` in `xg::copy_from` (xg.rs:713, `xcl.exe+0x3f7405`). The write address is `dst` + 0x395ce990, which is the low 32 bits of the tiled source pointer (0x7395ce990): the pointer is read as the row pitch, as this PR describes. The title's two call sites of slot #9 (`game+0x979e96` and `game+0x979f57`) both pass `(dst, 0, sub, 0 as a 32-bit store, tiled src, row pitch, slice pitch)`. With this PR (3ae0841) merged on that base: Series X ran to 163 s, Series S runs to 142 s and 113 s. None crashed in `copy_from`; they ended in GPU device loss and the `+0x23cf683` stop from #505. A side note in case someone extends this to slot #8: `CopyIntoSubresource` did not change in this title. It calls #8 about 10 s in with a heap pointer (`0x48d7390`) in the 5th argument, the old place. When I tried the 7-argument form for #8 too, it crashed 20 s in, reading through the argument that was then taken for the source. So the change to #9 only, as here, matches what the title does. Not tested: Windows, AMD, `cargo test` of this PR on its own base. AI use: Hermes agent with Claude Opus 5.5 (`claude-opus-5-5`) ran the builds and the game, and wrote this report; I checked it.
Author
Owner

@⁠frozht on GitHub · 2026-11-24 10:23 UTC · original

Test report: this fixes a crash on retail GTA6 under Wine.

  • Head tested: e56dbc3, on main 077ce40 plus open PRs, RX 7900 XT RADV (Mesa 26.2.6), Wine 11.22 Staging, release build.
  • Without it: at 822 s, the render thread hits an access violation in hle::xg::copy_from (xg.rs:713), writing a 0x800-byte row to 0x83a0f6110, which is neither committed nor lazy (caller game+0x979f5b).
  • With it: no crash, and 0 CopyFromSubresource invalid span warnings over a 1131 s run. The game gets to the fade into its intro cutscene (1096 s).
  • hle::xg tests under Wine: 79 passed, 0 failed (6 of them hle::xg::tests, including copy_from_rejects_invalid_dst_span). xg_oracle: 6 passed, 12 ignored. Those 6 do nothing without XCL_SAMPLE_XG.
  • Not tested: Windows smoke runs, xg_oracle against the console DLL.
  • Report written with Claude Code (Claude Opus 5.5) from our runs' logs.
**@⁠frozht** on GitHub · 2026-11-24 10:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7128702714) Test report: this fixes a crash on retail GTA6 under Wine. - Head tested: e56dbc3, on main 077ce40 plus open PRs, RX 7900 XT RADV (Mesa 26.2.6), Wine 11.22 Staging, release build. - Without it: at 822 s, the render thread hits an access violation in `hle::xg::copy_from` (xg.rs:713), writing a 0x800-byte row to 0x83a0f6110, which is neither committed nor lazy (caller `game+0x979f5b`). - With it: no crash, and 0 `CopyFromSubresource invalid span` warnings over a 1131 s run. The game gets to the fade into its intro cutscene (1096 s). - `hle::xg` tests under Wine: 79 passed, 0 failed (6 of them `hle::xg::tests`, including `copy_from_rejects_invalid_dst_span`). `xg_oracle`: 6 passed, 12 ignored. Those 6 do nothing without `XCL_SAMPLE_XG`. - Not tested: Windows smoke runs, `xg_oracle` against the console DLL. - Report written with Claude Code (Claude Opus 5.5) from our runs' logs.
Author
Owner

@⁠NicolaiVdS on GitHub · 2026-11-24 11:04 UTC · original

Linux (Wine) report on NVIDIA, with runs that reach the call.

Tested

  • AMD Ryzen 9 9950X, NVIDIA GeForce RTX 5070 Ti (driver 620.73.04), 30 GB RAM + 7 GB swap, Arch Linux (kernel 7.3.5), GE-Proton11-5 (wine-11.0 Staging). xcl.exe cross-built in release for x86_64-pc-windows-gnu (MinGW), rustc 1.99.0.
  • Build: main 09940bb + #867 at dfe1aaa + a small local change on top of #867 (XCL's own fences go through its unwrap_fence) + #684's e56dbc3 and #794's bee31d5 cherry-picked. Not this PR's head on its own.
  • cargo test --release --target x86_64-pc-windows-gnu -p xcl --lib -- hle::xg::tests hle::user::tests, run under that Wine: 10 passed, 0 failed, 0 ignored.
  • Retail title 1.0.2.1 (TitleID 7952987A):
    • Without this PR and #794 (the same build otherwise), two runs played by hand: access violation in copy_from at 105 s and 132 s, ucrtbase.dll+0x171d9, a write at 0x803b29640 / 0x84c248e80, rax=0x45999000 (the low half of the source pointer, used as the row pitch). The title calls slot 9 from game+0x979e96 and game+0x979f57 with r8d = 0, r9d from the caller's object ([rdi+0x18]), a DWORD 0 at [rsp+0x20], the source at [rsp+0x28] and the two pitches at [rsp+0x30] / [rsp+0x38]. A scan of the exe for calls through slot 8 or 9 with that argument shape finds only these two, both with the extra argument 0.
    • With it (XCL_NETWORK=0, XCL_PRESS_A_AT=25,40,55): the CommandList10::#101 stub at 82 s, then no access violation in copy_from and no "invalid span" warning. 10 s later GE-Proton's own vkd3d-proton crashed in d3d12core.dll (one frame repeating on the stack; it looks like #611). With #775's vkd3d-proton instead, the run went on to the #505 watchdog at 115 s (GPU Loc Sig 7333478d).

Not tested: Windows; the whole workspace suite (only the two modules above, under Wine); xg_oracle with XCL_SAMPLE_XG; scripts/smoke.ps1; this PR without #794 and #867.

AI use: Claude Code (Claude Opus 5.5) read the logs and the title's call site, built the branches, ran the tests and the scripted runs, and wrote this report. The runs are on my machine, on the hardware above.

**@⁠NicolaiVdS** on GitHub · 2026-11-24 11:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7129628409) Linux (Wine) report on NVIDIA, with runs that reach the call. **Tested** - AMD Ryzen 9 9950X, NVIDIA GeForce RTX 5070 Ti (driver 620.73.04), 30 GB RAM + 7 GB swap, Arch Linux (kernel 7.3.5), GE-Proton11-5 (wine-11.0 Staging). `xcl.exe` cross-built in release for `x86_64-pc-windows-gnu` (MinGW), rustc 1.99.0. - Build: `main` `09940bb` + #867 at `dfe1aaa` + a small local change on top of #867 (XCL's own fences go through its `unwrap_fence`) + #684's `e56dbc3` and #794's `bee31d5` cherry-picked. Not this PR's head on its own. - `cargo test --release --target x86_64-pc-windows-gnu -p xcl --lib -- hle::xg::tests hle::user::tests`, run under that Wine: 10 passed, 0 failed, 0 ignored. - Retail title 1.0.2.1 (TitleID 7952987A): - Without this PR and #794 (the same build otherwise), two runs played by hand: access violation in `copy_from` at 105 s and 132 s, `ucrtbase.dll+0x171d9`, a write at `0x803b29640` / `0x84c248e80`, `rax=0x45999000` (the low half of the source pointer, used as the row pitch). The title calls slot 9 from `game+0x979e96` and `game+0x979f57` with `r8d = 0`, `r9d` from the caller's object (`[rdi+0x18]`), a `DWORD 0` at `[rsp+0x20]`, the source at `[rsp+0x28]` and the two pitches at `[rsp+0x30]` / `[rsp+0x38]`. A scan of the exe for calls through slot 8 or 9 with that argument shape finds only these two, both with the extra argument 0. - With it (`XCL_NETWORK=0`, `XCL_PRESS_A_AT=25,40,55`): the `CommandList10::#101` stub at 82 s, then no access violation in `copy_from` and no "invalid span" warning. 10 s later GE-Proton's own vkd3d-proton crashed in `d3d12core.dll` (one frame repeating on the stack; it looks like #611). With #775's vkd3d-proton instead, the run went on to the #505 watchdog at 115 s (`GPU Loc Sig` `7333478d`). **Not tested:** Windows; the whole workspace suite (only the two modules above, under Wine); `xg_oracle` with `XCL_SAMPLE_XG`; `scripts/smoke.ps1`; this PR without #794 and #867. **AI use:** Claude Code (Claude Opus 5.5) read the logs and the title's call site, built the branches, ran the tests and the scripted runs, and wrote this report. The runs are on my machine, on the hardware above.
Author
Owner

@⁠madaraXor on GitHub · 2026-11-24 11:16 UTC · original

Tested on RDNA2: this removes the copy_from AV at the end of the retail title's loading

Setup: AMD Radeon RX 6700 XT 12 GB (driver 32.0.21045.29003), Ryzen 5 5600X, 16 GB RAM, Windows 10 Pro 22H2 (19045.6466) with the Agility SDK 1.620.2, Rust 1.90.0 MSVC, release, DXC 1.8.2502.11. Retail 1.0.2.1, XCL_NETWORK=0, XCL_ACTIVITY=1, menus passed with XCL_PRESS_AT, warm caches, a save past the first-run setup.

build ends
main 6efdabc, run 1 0xc0000005 in VCRUNTIME140.dll+0x1dcf3 (write at address 0x808314860) at 537.9 s
main 6efdabc + #488 (to rule out #467) the same AV at 532.8 s (0x8086fae80); no lazy commit failure in the crash line
main 6efdabc + this PR's diff (e56dbc3) no AV; the loading goes on to 622 s, then the title's watchdog (+0x23cf683)
  • The AV's first XCL frame symbolizes (cdb + the build's PDB) to xcl::hle::xg::copy_from+0x168, xg.rs:712: the case this PR fixes. The faulting address is inside the title's 24 GB reservation (0x7ffff0000, 0x600000000 bytes).
  • What stops the run with this PR, from XCL's thread dump at the watchdog (symbolized the same way): three title threads wait in bind::set_pipeline_state → pso_async::resolve_for_bind → resolve_wait (no XCL_PSO_WAIT_MS), and two unnamed threads are inside amdxc64.dll. The last compute PSO logged took 18 512 ms in the driver (299992 B DXIL). Presents stopped at ~593 s, the watchdog fired at 622 s. That is the pipeline-wait stop from #505, not something in this PR.

Not tested: the full suite with this PR; NVIDIA; #976 / #992.

AI use: Claude Code, Claude Opus 5.5 ran the builds and runs on my PC, symbolized the stacks and wrote this comment. Counts, offsets and timings only.

**@⁠madaraXor** on GitHub · 2026-11-24 11:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7129892682) **Tested on RDNA2: this removes the `copy_from` AV at the end of the retail title's loading** **Setup:** AMD Radeon RX 6700 XT 12 GB (driver 32.0.21045.29003), Ryzen 5 5600X, 16 GB RAM, Windows 10 Pro 22H2 (19045.6466) with the Agility SDK 1.620.2, Rust 1.90.0 MSVC, release, DXC 1.8.2502.11. Retail 1.0.2.1, `XCL_NETWORK=0`, `XCL_ACTIVITY=1`, menus passed with `XCL_PRESS_AT`, warm caches, a save past the first-run setup. | build | ends | |---|---| | `main` `6efdabc`, run 1 | `0xc0000005 in VCRUNTIME140.dll+0x1dcf3 (write at address 0x808314860)` at 537.9 s | | `main` `6efdabc` + #488 (to rule out #467) | the same AV at 532.8 s (`0x8086fae80`); no lazy commit failure in the crash line | | `main` `6efdabc` + this PR's diff (`e56dbc3`) | no AV; the loading goes on to 622 s, then the title's watchdog (`+0x23cf683`) | - The AV's first XCL frame symbolizes (cdb + the build's PDB) to `xcl::hle::xg::copy_from+0x168`, `xg.rs:712`: the case this PR fixes. The faulting address is inside the title's 24 GB reservation (`0x7ffff0000`, `0x600000000` bytes). - What stops the run with this PR, from XCL's thread dump at the watchdog (symbolized the same way): three title threads wait in `bind::set_pipeline_state` → `pso_async::resolve_for_bind` → `resolve_wait` (no `XCL_PSO_WAIT_MS`), and two unnamed threads are inside `amdxc64.dll`. The last compute PSO logged took 18 512 ms in the driver (`299992 B DXIL`). Presents stopped at ~593 s, the watchdog fired at 622 s. That is the pipeline-wait stop from #505, not something in this PR. **Not tested:** the full suite with this PR; NVIDIA; #976 / #992. AI use: Claude Code, Claude Opus 5.5 ran the builds and runs on my PC, symbolized the stacks and wrote this comment. Counts, offsets and timings only.
Author
Owner

@⁠tiagonleal on GitHub · 2026-11-24 13:25 UTC · original · edited 2026-11-24 14:34 UTC

Windows / NVIDIA retail test of e56dbc3f43 merged onto main 47efa2e (clean merge, merged tree 535a139).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (32-lane waves), driver 32.0.16.1742; Ryzen 7 9800X3D, 32 GB RAM; Windows 11 Pro 26300; rustc 1.100.0 MSVC.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 (debug) on the merged tree: 744 passed, 0 failed, 41 ignored. SKIPPED: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64).
  • Retail title 1.0.2.1, release, 300 s runs with XCL_NETWORK=0 XCL_PSO_WAIT_MS=50 XCL_PRESS_AT=30:A, into world loading. All four runs below with warm DXIL and driver-blob caches (only 1–5 compute builds over 5 s per run):
build presents end how the run ends dispatches (skipped) peak commit
main 110 s +0x23cf683 write at 0x0, 146.7 s 24,939 (594) 30.4 GB
main 122 s +0x23cf683, 177.0 s 25,834 (324) 30.1 GB
this PR 130 s D3D12 device removed: 0x887a0006, 135.9 s 65,536 (3,809) 31.2 GB
this PR 210 s +0x23cf683, 239.5 s 81,324 (6,132) 31.5 GB
  • Earlier the same day, on main with the same settings, one of three runs ended at 108.7 s in VCRUNTIME140.dll+0x1c45a (0xc0000005, read at 0x825210000); it did not happen in these runs, so I cannot say whether this PR is what removes it (the log has no CopyFromSubresource line in any run).

  • Edit: two later runs with this PR (same tree, same settings) had presents end at 120 and 116 s, ending in +0x23cf683 at 172.7 s and in D3D12 device removed: 0x887a0006 at 163.6 s. Runs of one build vary a lot here, so the 210 s run above is not a reliable gain; the VCRUNTIME140 fault did not appear in any of the four runs with this PR.

Not tested: more runs (two per build is a small sample; the main runs had an Idle-priority shader precompile running alongside); AMD / Intel; Windows 10.

Run and written with Claude Code (Claude Opus 5.5).

**@⁠tiagonleal** on GitHub · 2026-11-24 13:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7132802690) · edited 2026-11-24 14:34 UTC Windows / NVIDIA retail test of `e56dbc3f43` merged onto `main` `47efa2e` (clean merge, merged tree `535a139`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (32-lane waves), driver 32.0.16.1742; Ryzen 7 9800X3D, 32 GB RAM; Windows 11 Pro 26300; rustc 1.100.0 MSVC. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` (debug) on the merged tree: 744 passed, 0 failed, 41 ignored. SKIPPED: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (no wave64). - Retail title 1.0.2.1, release, 300 s runs with `XCL_NETWORK=0 XCL_PSO_WAIT_MS=50 XCL_PRESS_AT=30:A`, into world loading. All four runs below with warm DXIL and driver-blob caches (only 1–5 compute builds over 5 s per run): | build | presents end | how the run ends | dispatches (skipped) | peak commit | |---|---|---|---|---| | `main` | 110 s | `+0x23cf683` write at 0x0, 146.7 s | 24,939 (594) | 30.4 GB | | `main` | 122 s | `+0x23cf683`, 177.0 s | 25,834 (324) | 30.1 GB | | this PR | 130 s | `D3D12 device removed: 0x887a0006`, 135.9 s | 65,536 (3,809) | 31.2 GB | | this PR | 210 s | `+0x23cf683`, 239.5 s | 81,324 (6,132) | 31.5 GB | - Earlier the same day, on `main` with the same settings, one of three runs ended at 108.7 s in `VCRUNTIME140.dll+0x1c45a` (`0xc0000005`, read at `0x825210000`); it did not happen in these runs, so I cannot say whether this PR is what removes it (the log has no `CopyFromSubresource` line in any run). - **Edit:** two later runs with this PR (same tree, same settings) had presents end at 120 and 116 s, ending in `+0x23cf683` at 172.7 s and in `D3D12 device removed: 0x887a0006` at 163.6 s. Runs of one build vary a lot here, so the 210 s run above is not a reliable gain; the `VCRUNTIME140` fault did not appear in any of the four runs with this PR. **Not tested:** more runs (two per build is a small sample; the `main` runs had an Idle-priority shader precompile running alongside); AMD / Intel; Windows 10. Run and written with Claude Code (Claude Opus 5.5).
Author
Owner

@⁠vitor127wt on GitHub · 2026-11-24 22:58 UTC · original

The #684 diff 91f9a5e9f031..e56dbc3f4313 prevented the xg::copy_from access violation in a matched 150 s retail A/B on #1798 head 55e7beb6de9f plus the same #899 wait instrumentation. The control hit 0xc0000005 at 122.140 s, symbolized to xg.rs:713. With #684 the timer ended the title at 150.000 s, exit 0, with 1,701 PresentX calls and zero crashes. The activity interval ending at 118.129 s and each later interval recorded zero presents. Both Linux scopes had zero OOM kills.

RTX 5070 Ti (driver 620.73.04), Ryzen 7 9700X, 32 GB DDR5, CachyOS 7.3.5-2-cachyos, Proton Experimental experimental-11.0-20261112-x86_64, vkd3d-proton ec20719452e9, DXC 1.9.2609.5. The exact build and run commands, commits and wait counts are in the full A/B report on #1798.

AI use — OpenAI Codex (GPT-6, exact variant unavailable) ran the tests, symbolized the failure, and drafted this report.

**@⁠vitor127wt** on GitHub · 2026-11-24 22:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7146858226) The #684 diff `91f9a5e9f031..e56dbc3f4313` prevented the `xg::copy_from` access violation in a matched 150 s retail A/B on #1798 head `55e7beb6de9f` plus the same #899 wait instrumentation. The control hit `0xc0000005` at 122.140 s, symbolized to `xg.rs:713`. With #684 the timer ended the title at 150.000 s, exit 0, with 1,701 PresentX calls and zero crashes. The activity interval ending at 118.129 s and each later interval recorded zero presents. Both Linux scopes had zero OOM kills. RTX 5070 Ti (driver 620.73.04), Ryzen 7 9700X, 32 GB DDR5, CachyOS 7.3.5-2-cachyos, Proton Experimental `experimental-11.0-20261112-x86_64`, vkd3d-proton `ec20719452e9`, DXC 1.9.2609.5. The exact build and run commands, commits and wait counts are in the [full A/B report on #1798](https://git.gtahub.st/github/xcl-dev--xcl/pulls/1798). **AI use** — OpenAI Codex (GPT-6, exact variant unavailable) ran the tests, symbolized the failure, and drafted this report.
Author
Owner

@⁠relativespace2K on GitHub · 2026-11-24 03:53 UTC · original · edited 2026-11-25 04:10 UTC

Tested - e56dbc3 on main 3da2abb, retail GTA6 1.0.2.1

Tool: OpenCode with DeepSeek V4.1 Flash 1017

  • 240 s: exit 0, 2,739 frames, peak 35,380 MB, 0 failed pipelines, 0 DXIL failures.
  • A first 360 s run crashed at 143 s inside dxcompiler.dll (xcl-dxc-2 thread, deep
    recursion in the DXC stack) - it did not reproduce at 240 s, so it looks like a DXC
    stack overflow on a large shader under memory pressure, not the XG ABI path.
  • No CopyFromSubresource-related failures observed.

Tested - native Windows, AMD RDNA2

  • Exact PR head e56dbc3f4313e6950730ba4129c14b530b3e7e40 (based on 91f9a5e;
    main has since advanced to f4ce27c).
  • AMD Radeon RX 6800 XT (16338 MiB), driver 32.0.21045.29003; Ryzen 5 5600, 31.9 GB;
    Windows 11 IoT Enterprise LTSC 26100 (native D3D12, no Wine/Proton);
    Rust 1.100.0 stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug; no XCL_SAMPLE_*.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4:
    692 passed, 3 failed, 41 ignored, 0 SKIPPED.
  • The three failures are the known RDNA2 ones, identical on main 91f9a5e
    (689 passed, 3 failed, 41 ignored) and untouched by this PR: the packed-mip
    3D 64x64x64 4 mips: subresource 2 mismatch (#470) and the two PoisonError
    follow-ons (#673). This PR adds the three new XG tests and no new failure.
  • cargo test -p xcl --lib hle::xg::tests: 6 passed, 0 failed, 0 ignored
    copy_into_and_copy_from_round_trip, copy_from_3d_round_trip and
    copy_from_rejects_invalid_dst_span pass, and the invalid-span guard logs the
    expected refusals (row_pitch=0x40000000, and a 4-deep 3D span).
  • cargo test -p xcl --test xg_oracle: 6 passed, 0 failed, 12 ignored.

Not tested: the #477 crash through a retail title (XCL_SAMPLE_XG unset),
release build, NVIDIA / Intel.

AI use: OpenCode with DeepSeek V4.1 Flash 1017 ran the tests and drafted this report.

**@⁠relativespace2K** on GitHub · 2026-11-24 03:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7121510100) · edited 2026-11-25 04:10 UTC **Tested** - `e56dbc3` on `main` `3da2abb`, retail GTA6 1.0.2.1 Tool: OpenCode with DeepSeek V4.1 Flash 1017 - 240 s: exit 0, 2,739 frames, peak 35,380 MB, 0 failed pipelines, 0 DXIL failures. - A first 360 s run crashed at 143 s inside `dxcompiler.dll` (`xcl-dxc-2` thread, deep recursion in the DXC stack) - it did not reproduce at 240 s, so it looks like a DXC stack overflow on a large shader under memory pressure, not the XG ABI path. - No `CopyFromSubresource`-related failures observed. --- **Tested** - native Windows, AMD RDNA2 - Exact PR head `e56dbc3f4313e6950730ba4129c14b530b3e7e40` (based on `91f9a5e`; `main` has since advanced to `f4ce27c`). - AMD Radeon RX 6800 XT (16338 MiB), driver 32.0.21045.29003; Ryzen 5 5600, 31.9 GB; Windows 11 IoT Enterprise LTSC 26100 (native D3D12, no Wine/Proton); Rust 1.100.0 `stable-x86_64-pc-windows-msvc`; DXC 1.9.2602.17; debug; no `XCL_SAMPLE_*`. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **692 passed, 3 failed, 41 ignored, 0 SKIPPED**. - The three failures are the known RDNA2 ones, identical on `main` `91f9a5e` (689 passed, 3 failed, 41 ignored) and untouched by this PR: the packed-mip `3D 64x64x64 4 mips: subresource 2 mismatch` (#470) and the two `PoisonError` follow-ons (#673). This PR adds the three new XG tests and no new failure. - `cargo test -p xcl --lib hle::xg::tests`: 6 passed, 0 failed, 0 ignored `copy_into_and_copy_from_round_trip`, `copy_from_3d_round_trip` and `copy_from_rejects_invalid_dst_span` pass, and the invalid-span guard logs the expected refusals (`row_pitch=0x40000000`, and a 4-deep 3D span). - `cargo test -p xcl --test xg_oracle`: 6 passed, 0 failed, 12 ignored. **Not tested**: the #477 crash through a retail title (`XCL_SAMPLE_XG` unset), release build, NVIDIA / Intel. **AI use**: OpenCode with DeepSeek V4.1 Flash 1017 ran the tests and drafted this report.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 06:24 UTC · original

Empirical test report (e56dbc3f)

Hardware / environment

  • Commit e56dbc3f4313e6950730ba4129c14b530b3e7e40 (PR #684), verified after detached checkout.
  • Windows x64 build 10.0.26200.9974, AMD Ryzen 7 3800X 8-Core Processor.
  • Rust 1.100.0 (0ef1bc386 2026-11-09), host x86_64-pc-windows-msvc, Cargo 1.100.0. DXC 1.9.2609.5 (01b62ad47).
  • Unoptimized test profile with incremental compilation and debug info disabled. Both commands ran outside Invoke-ArcTest.ps1.

Commands and results

  • cargo test --workspace --no-run exited 0 and compiled all workspace test binaries, including xg_oracle. This was a build-only command.
  • cargo test -p xcl --lib hle::xg::tests::copy_ ran with XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1. Exit 0, 3 passed, 0 failed, 0 ignored, 0 skipped, 673 filtered out. The skip count comes from case-sensitive ^SKIPPED lines in the captured output.

Observed behavior

  • The 2D round trip recovered every payload row with a padded row pitch and a nonzero fourth explicit argument to CopyFromSubresource.
  • The 3D round trip recovered every payload row across four slices with padded row and slice pitches.
  • The guard test observed E_INVALIDARG for an undersized row pitch, an oversized destination span, null source and destination pointers, and an undersized 3D slice pitch.

Not tested

  • Full GPU workspace suite, game smoke runs, and execution of the console-library oracle comparison subresource_copies_match_the_console_library.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr684-focused.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 06:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7154760550) ### Empirical test report (e56dbc3f) **Hardware / environment** - Commit `e56dbc3f4313e6950730ba4129c14b530b3e7e40` (PR #684), verified after detached checkout. - Windows x64 build `10.0.26200.9974`, AMD Ryzen 7 3800X 8-Core Processor. - Rust `1.100.0 (0ef1bc386 2026-11-09)`, host `x86_64-pc-windows-msvc`, Cargo `1.100.0`. DXC `1.9.2609.5 (01b62ad47)`. - Unoptimized test profile with incremental compilation and debug info disabled. Both commands ran outside `Invoke-ArcTest.ps1`. **Commands and results** - `cargo test --workspace --no-run` exited `0` and compiled all workspace test binaries, including `xg_oracle`. This was a build-only command. - `cargo test -p xcl --lib hle::xg::tests::copy_` ran with `XCL_ADAPTER=NONE_CPU_ONLY` and `RUST_TEST_NOCAPTURE=1`. Exit `0`, 3 passed, 0 failed, 0 ignored, 0 skipped, 673 filtered out. The skip count comes from case-sensitive `^SKIPPED ` lines in the captured output. **Observed behavior** - The 2D round trip recovered every payload row with a padded row pitch and a nonzero fourth explicit argument to `CopyFromSubresource`. - The 3D round trip recovered every payload row across four slices with padded row and slice pitches. - The guard test observed `E_INVALIDARG` for an undersized row pitch, an oversized destination span, null source and destination pointers, and an undersized 3D slice pitch. **Not tested** - Full GPU workspace suite, game smoke runs, and execution of the console-library oracle comparison `subresource_copies_match_the_console_library`. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr684-focused.log and published.
Author
Owner

@⁠ozimchuk on GitHub · 2026-11-25 09:41 UTC · original · edited 2026-11-25 10:03 UTC

Test report: this PR gets the retail title past its world load on Linux, where main crashes in copy_from every time.

Tested – NVIDIA (32-lane waves), Linux, Wine + vkd3d-proton (VKD3D_CONFIG=ignore_shared_fence), release build for x86_64-pc-windows-gnu, the newer retail title of #662, 300 s runs, A pressed every 8 s:

  • main 568e7db: two runs crash at the world load (80.7 s, 88.6 s) with 0xc0000005 in xg::copy_from (hle/xg.rs:713), a write to an unmapped page (0x80a293410, 0x80a10b260) – the first crash of #662.
  • 568e7db + this PR (e56dbc3, merges cleanly): the world loads at 77.7 s and the title runs on past it; no fault in copy_from. It stops 54 s later on a different, known crash in the title's own code (0x80000003), which this PR does not touch.
  • A larger tree with this PR merged (main c4d37be + several open PRs) got past the world load in all 18 of its 300 s runs today, with no fault in copy_from; 17 ran the full 300 s, one ended later when the GPU driver ran out of system memory. (Corrected: this said "with no crash".)

Not tested: Windows, AMD; the destination-span guard on its own (no run hit it).

AI-assisted. Claude Code, Claude Opus 5.5.

**@⁠ozimchuk** on GitHub · 2026-11-25 09:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7158667514) · edited 2026-11-25 10:03 UTC Test report: this PR gets the retail title past its world load on Linux, where `main` crashes in `copy_from` every time. **Tested** – NVIDIA (32-lane waves), Linux, Wine + vkd3d-proton (`VKD3D_CONFIG=ignore_shared_fence`), release build for `x86_64-pc-windows-gnu`, the newer retail title of #662, 300 s runs, A pressed every 8 s: - `main` `568e7db`: two runs crash at the world load (80.7 s, 88.6 s) with `0xc0000005` in `xg::copy_from` (`hle/xg.rs:713`), a write to an unmapped page (`0x80a293410`, `0x80a10b260`) – the first crash of #662. - `568e7db` + this PR (`e56dbc3`, merges cleanly): the world loads at 77.7 s and the title runs on past it; no fault in `copy_from`. It stops 54 s later on a different, known crash in the title's own code (`0x80000003`), which this PR does not touch. - A larger tree with this PR merged (`main` `c4d37be` + several open PRs) got past the world load in all 18 of its 300 s runs today, with no fault in `copy_from`; 17 ran the full 300 s, one ended later when the GPU driver ran out of system memory. *(Corrected: this said "with no crash".)* **Not tested:** Windows, AMD; the destination-span guard on its own (no run hit it). AI-assisted. Claude Code, Claude Opus 5.5.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 12:06 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 12:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7161922758) 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

@⁠7yww8j5hyb-web on GitHub · 2026-11-25 20:46 UTC · original

Confirmed on a second retail title, GTA (Xbox Series, gta5.exe), native Windows, RTX 3050 8 GB, 32 GB RAM, xcl main 0829441.

Without the extra argument, CopyFromSubresource reads the source pointer as the row pitch (0x458a9000). The copy is refused (destination span 0x227fbd7800 is not committed), and the game then crashes: read of 0xffffffffffffffff at gta5.exe+0x5228010.

With slot 9 as (dst, plane, sub, flags, src, row_pitch, slice_pitch), row pitch is 0x800 or 0x100, the copy succeeds, and that crash is gone. The title gets into shader compilation.

**@⁠7yww8j5hyb-web** on GitHub · 2026-11-25 20:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7174158883) Confirmed on a second retail title, GTA (Xbox Series, gta5.exe), native Windows, RTX 3050 8 GB, 32 GB RAM, xcl main 0829441. Without the extra argument, CopyFromSubresource reads the source pointer as the row pitch (0x458a9000). The copy is refused (destination span 0x227fbd7800 is not committed), and the game then crashes: read of 0xffffffffffffffff at gta5.exe+0x5228010. With slot 9 as (dst, plane, sub, flags, src, row_pitch, slice_pitch), row pitch is 0x800 or 0x100, the copy succeeds, and that crash is gone. The title gets into shader compilation.
Author
Owner

@⁠itsSio on GitHub · 2026-11-26 04:22 UTC · original

Independent dual-PC NVIDIA full-workspace test report on clean head e56dbc3f4313e6950730ba4129c14b530b3e7e40.

Tested

  • Machine 1: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200, rustc 1.97.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug build (XCL_ADAPTER=NVIDIA)
    • cargo build --workspace: exit 0
    • cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 695 passed, 0 failed, 41 ignored (xg::tests::copy_into_and_copy_from_round_trip, copy_from_3d_round_trip, copy_from_rejects_invalid_dst_span, and xg_oracle 6 passed / 12 ignored all pass)
    • SKIPPED: 2 (wave64-only GPU tests)
  • Machine 2: NVIDIA GeForce RTX 2080 SUPER (driver 32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200, rustc 1.99.1 (stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC 1.8.2502.11, debug build (XCL_ADAPTER=NVIDIA)
    • cargo build --workspace: exit 0
    • cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 695 passed, 0 failed, 41 ignored (all xg copy_from tests and xg_oracle pass)
    • SKIPPED: 4 (same 2 wave64 tests plus 2 requiring d3d12SDKLayers.dll)

Not tested

  • Retail title / scripts/smoke.ps1 runs
  • Release builds (--release)
  • AMD / Intel GPUs, native wave64, Linux / Wine / vkd3d-proton

AI use
Ran via Samaritan:

  • Google Antigravity CLI (Claude Opus 5.5 (High)): built the branch and ran the workspace test suite on both NVIDIA machines.
  • Google Antigravity CLI (Gemini 4 Neon (High)): coordinated the runs and wrote this test report.
**@⁠itsSio** on GitHub · 2026-11-26 04:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7182537569) Independent dual-PC NVIDIA full-workspace test report on clean head `e56dbc3f4313e6950730ba4129c14b530b3e7e40`. **Tested** - **Machine 1:** NVIDIA GeForce RTX 5080 (driver `32.0.16.1088`), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200, `rustc 1.97.0` (`stable-x86_64-pc-windows-msvc`), DXC `1.9.2609.5`, debug build (`XCL_ADAPTER=NVIDIA`) - `cargo build --workspace`: exit 0 - `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture`: **695 passed, 0 failed, 41 ignored** (`xg::tests::copy_into_and_copy_from_round_trip`, `copy_from_3d_round_trip`, `copy_from_rejects_invalid_dst_span`, and `xg_oracle` 6 passed / 12 ignored all pass) - `SKIPPED`: 2 (wave64-only GPU tests) - **Machine 2:** NVIDIA GeForce RTX 2080 SUPER (driver `32.0.16.1088`), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200, `rustc 1.99.1` (`stable-x86_64-pc-windows-msvc`), Windows SDK 10.0.26100 DXC `1.8.2502.11`, debug build (`XCL_ADAPTER=NVIDIA`) - `cargo build --workspace`: exit 0 - `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture`: **695 passed, 0 failed, 41 ignored** (all `xg` `copy_from` tests and `xg_oracle` pass) - `SKIPPED`: 4 (same 2 wave64 tests plus 2 requiring `d3d12SDKLayers.dll`) **Not tested** - Retail title / `scripts/smoke.ps1` runs - Release builds (`--release`) - AMD / Intel GPUs, native wave64, Linux / Wine / vkd3d-proton **AI use** Ran via Samaritan: - Google Antigravity CLI (Claude Opus 5.5 (High)): built the branch and ran the workspace test suite on both NVIDIA machines. - Google Antigravity CLI (Gemini 4 Neon (High)): coordinated the runs and wrote this test report.
Author
Owner

@⁠throny on GitHub · 2026-11-26 06:10 UTC · original

Two contributors checked independently and found that #1435 solves the same problem (for #662) in a different way: #1607, group D124. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

**@⁠throny** on GitHub · 2026-11-26 06:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7184165291) <!-- xcl-1607-hint:D124 --> Two contributors checked independently and found that #1435 solves the same problem (for #662) in a different way: #1607, group D124. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Author
Owner

@⁠ClosetPie107 on GitHub · 2026-11-26 06:06 UTC · original · edited 2026-11-26 06:17 UTC

Tested on AMD RDNA4 / Linux (Proton Experimental), merged cleanly onto main (b49be183) alongside #871 (8f08d7cd), confirming @⁠St5sz2Jk's report on #871:

Hardware & environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton master ec207194 (3.2.0) + dxil-spirv b540c8a2 + relaxed-vtable patch (-Db_ndebug=true), DXVK v3.1.1-209, DXC 1.9.2609.5, Rust x86_64-pc-windows-gnu

Targeted unit tests (head e56dbc3f merged onto main b49be183 + #871 8f08d7cd, debug, --test-threads=1):

  • xcl.exe hle::xg::tests -- --test-threads=1: 6 passed, 0 failed, 0 ignored (0 skipped).

Retail title verification (1.0.2.1, pressing A past menus, 300 s, release)
Flags: XCL_DIRECT_DXIL=1, XCL_TEXTURE_LEVEL_PAGES=1, XCL_PSO_WAIT_MS=50, XCL_SPLIT_MIDLIST_WAIT=0, XCL_COHERENT_MB=1024, VKD3D_CONFIG=ignore_shared_fence, XCL_PSO_PRELOAD=0, XCL_NETWORK=0.

  • Without #684 (on #871 alone): deterministic 0xc0000005 crash at 76.600 s reading 0x400016000 in xcl::hle::xg::copy_from (xg.rs:712) → tiling::Chain::detile_level (tiling.rs:464).
  • With #684 (e56dbc3f): sailed right past 76.6 s and completed the full 300 s (exit=0, 0 crashes, 0 xg: warnings, 0 device removals) both on main + #871 + #684 and on main + #871 + #684 + #1993 (16,384 translated draws, 22,268 dispatches, 1,620 PresentX frames).

Not tested

  • Native Windows, tests/xg_oracle.rs with XCL_SAMPLE_XG, or full workspace test suite.

AI use

  • T3 Code / Antigravity (Gemini 4 Neon) merged #684 onto main, ran the Proton unit tests and retail runs on this machine, and drafted this report.
**@⁠ClosetPie107** on GitHub · 2026-11-26 06:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#issuecomment-7184091876) · edited 2026-11-26 06:17 UTC Tested on AMD RDNA4 / Linux (Proton Experimental), merged cleanly onto `main` (`b49be183`) alongside #871 (`8f08d7cd`), confirming @⁠St5sz2Jk's report on #871: **Hardware & environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux - Proton Experimental (`experimental-11.0-20261112`), `vkd3d-proton` `master` `ec207194` (3.2.0) + `dxil-spirv` `b540c8a2` + relaxed-vtable patch (`-Db_ndebug=true`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, Rust `x86_64-pc-windows-gnu` **Targeted unit tests** (head `e56dbc3f` merged onto `main` `b49be183` + #871 `8f08d7cd`, debug, `--test-threads=1`): - `xcl.exe hle::xg::tests -- --test-threads=1`: **6 passed, 0 failed, 0 ignored** (0 skipped). **Retail title verification (1.0.2.1, pressing `A` past menus, 300 s, release)** Flags: `XCL_DIRECT_DXIL=1`, `XCL_TEXTURE_LEVEL_PAGES=1`, `XCL_PSO_WAIT_MS=50`, `XCL_SPLIT_MIDLIST_WAIT=0`, `XCL_COHERENT_MB=1024`, `VKD3D_CONFIG=ignore_shared_fence`, `XCL_PSO_PRELOAD=0`, `XCL_NETWORK=0`. - Without #684 (on #871 alone): deterministic `0xc0000005` crash at `76.600 s` reading `0x400016000` in `xcl::hle::xg::copy_from (xg.rs:712)` → `tiling::Chain::detile_level (tiling.rs:464)`. - With #684 (`e56dbc3f`): sailed right past `76.6 s` and completed the full **300 s** (`exit=0`, **0 crashes**, **0 `xg:` warnings**, **0 device removals**) both on `main + #871 + #684` and on `main + #871 + #684 + #1993` (`16,384` translated draws, `22,268` dispatches, `1,620` `PresentX` frames). **Not tested** - Native Windows, `tests/xg_oracle.rs` with `XCL_SAMPLE_XG`, or full workspace test suite. **AI use** - T3 Code / Antigravity (Gemini 4 Neon) merged #684 onto `main`, ran the Proton unit tests and retail runs on this machine, and drafted this report.
Author
Owner

@⁠bmjask on GitHub · 2026-11-25 21:15 UTC · original · reviewed

P1: copy_from validates dst with gpu::shader::readable, which accepts committed PAGE_READONLY pages, then raw copy_nonoverlapping writes and can AV. Validate writability or use a fault-safe process write; validate src before raw slice/detile too. P2: readable rejects spans >256 MiB, but valid XG 16,384x16,384 4-Bpp subresources reach 1 GiB, so valid calls become E_INVALIDARG. Use a destination-specific region validator without this cap/iterate regions. Add read-only dst, invalid src, and >256 MiB valid-span tests.

**@⁠bmjask** on GitHub · 2026-11-25 21:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/684#pullrequestreview-6065082211) · **reviewed** P1: copy_from validates dst with gpu::shader::readable, which accepts committed PAGE_READONLY pages, then raw copy_nonoverlapping writes and can AV. Validate writability or use a fault-safe process write; validate src before raw slice/detile too. P2: readable rejects spans >256 MiB, but valid XG 16,384x16,384 4-Bpp subresources reach 1 GiB, so valid calls become E_INVALIDARG. Use a destination-specific region validator without this cap/iterate regions. Add read-only dst, invalid src, and >256 MiB valid-span tests.
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/684/head:github-bot/gh-684'
git switch 'github-bot/gh-684'

Merge

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