D3D12.X: XG CopyInto/FromSubresource take the newer library's added argument #1425

Closed
lukastaro wants to merge 1 commit from upstream-pr/1435 into main
lukastaro commented 2026-11-24 15:54:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lukastaro on 2026-11-24T15:54:48Z.


A retail game crashed during its world loading, every run: an access violation in a memcpy writing to title memory that was never reserved, mapped or committed. The writer was XCL's XGTextureAddressComputer::CopyFromSubresource (vtable #9), which the game calls as (linear dst, plane, subresource, 0, tiled src, row pitch, slice pitch): its XG library has a 32-bit argument before the source pointer, which the library the oracle test uses does not have. Read the 6-argument way, the source was the 0 dword with the stack slot's old upper half, and the row pitch the low half of the real source pointer, so the second row went gigabytes past the destination.

The game calls both forms, so they are told apart per call: a value of 16 bits or less in the fourth slot with address space in use at the fifth is the newer form (address space, not readable memory: a title's pages are committed on first use). A nonzero added argument is logged once and ignored; its meaning is not known (the game passes 0).

What is in it

  • copy_args and the two copy methods taking either form (hle/xg.rs).
  • A unit test: both forms tile the same bytes and read them back, with garbage in the upper half of the added argument's slot (hle/xg.rs).

Tested

  • NVIDIA GeForce RTX 5060 Ti (driver 617.42, Agility SDK 1.620.2), Intel Core i7-14700K, Windows 10 22H2 (19045), Rust 1.100.0; tests in debug, smoke and game runs in release.
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored (SKIPPED GPU tests: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware – no wave64 on this GPU).
  • The retail game: the crash was in every run before (8 runs, 60 – 112 s into the run); with the change the newer form is logged at that point and none of the runs since (more than 10) crashed there. They stop later for other reasons.

Regression run

main:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: NVIDIA GeForce RTX 5060 Ti
title: Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1371 (PresentX 1371)
presents per 2 s (last 3): 1 3 12
device removals: 0
crashes: 0
peak commit: 25566 MB

PR:

xcl-smoke v1
commit: 14c8a2d11a7b975bc7a0e98468cfeb705244af8b
gpu: NVIDIA GeForce RTX 5060 Ti
title: Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1620 (PresentX 1620)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17179 MB

An offline shader precompile ran on the same machine during the main run (and less of it during the PR's), so the frame and commit numbers differ more than the change does; the 60 s stay in the game's menus, before the copy this changes.

Not tested

  • AMD and Intel GPUs (the change is CPU-side).
  • The console library itself: no copy of the newer XG library is at hand, so the newer form is inferred from the game's call sites (game code calling vtable #9 with the seven arguments above), not checked against it like xg_oracle.
  • What the added argument means when it is not 0.
  • Other titles with the newer library.

AI use

  • Claude Code (Claude Opus 5.5): found the crash (disassembly of the game's call site, XCL's logs), wrote the change, the test and this description; the runs above were made on the hardware named.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5475624268 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435). Originally posted by [lukastaro](https://github.com/lukastaro) on 2026-11-24T15:54:48Z. --- A retail game crashed during its world loading, every run: an access violation in a `memcpy` writing to title memory that was never reserved, mapped or committed. The writer was XCL's `XGTextureAddressComputer::CopyFromSubresource` (vtable #9), which the game calls as `(linear dst, plane, subresource, 0, tiled src, row pitch, slice pitch)`: its XG library has a 32-bit argument before the source pointer, which the library the oracle test uses does not have. Read the 6-argument way, the source was the 0 dword with the stack slot's old upper half, and the row pitch the low half of the real source pointer, so the second row went gigabytes past the destination. The game calls both forms, so they are told apart per call: a value of 16 bits or less in the fourth slot with address space in use at the fifth is the newer form (address space, not readable memory: a title's pages are committed on first use). A nonzero added argument is logged once and ignored; its meaning is not known (the game passes 0). **What is in it** - `copy_args` and the two copy methods taking either form (`hle/xg.rs`). - A unit test: both forms tile the same bytes and read them back, with garbage in the upper half of the added argument's slot (`hle/xg.rs`). **Tested** - NVIDIA GeForce RTX 5060 Ti (driver 617.42, Agility SDK 1.620.2), Intel Core i7-14700K, Windows 10 22H2 (19045), Rust 1.100.0; tests in debug, smoke and game runs in release. - `cargo build --workspace`, then `cargo test --workspace -- --test-threads=4`: 752 passed, 0 failed, 41 ignored (SKIPPED GPU tests: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` – no wave64 on this GPU). - The retail game: the crash was in every run before (8 runs, 60 – 112 s into the run); with the change the newer form is logged at that point and none of the runs since (more than 10) crashed there. They stop later for other reasons. **Regression run** main: ``` xcl-smoke v1 commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56 gpu: NVIDIA GeForce RTX 5060 Ti title: Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1371 (PresentX 1371) presents per 2 s (last 3): 1 3 12 device removals: 0 crashes: 0 peak commit: 25566 MB ``` PR: ``` xcl-smoke v1 commit: 14c8a2d11a7b975bc7a0e98468cfeb705244af8b gpu: NVIDIA GeForce RTX 5060 Ti title: Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1620 (PresentX 1620) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17179 MB ``` An offline shader precompile ran on the same machine during the main run (and less of it during the PR's), so the frame and commit numbers differ more than the change does; the 60 s stay in the game's menus, before the copy this changes. **Not tested** - AMD and Intel GPUs (the change is CPU-side). - The console library itself: no copy of the newer XG library is at hand, so the newer form is inferred from the game's call sites (game code calling vtable #9 with the seven arguments above), not checked against it like `xg_oracle`. - What the added argument means when it is not 0. - Other titles with the newer library. **AI use** - Claude Code (Claude Opus 5.5): found the crash (disassembly of the game's call site, XCL's logs), wrote the change, the test and this description; the runs above were made on the hardware named. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
futurepro62 commented 2026-11-24 17:06:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T16:53:12Z.


Full-suite run, since this PR has no test report yet. Tested exact head 14c8a2d (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: subresource_copies_take_both_argument_forms.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.

Not tested

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

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7138359335 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7138359335). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T16:53:12Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `14c8a2d` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `subresource_copies_take_both_argument_forms`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**, no skips. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
pvfreis commented 2026-11-24 18:19:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-24T18:19:50Z.

Review: COMMENTED


Read at 14c8a2d (merge base 930e8b4; merges into main 9e3831e without conflicts) by reading the code; nothing of this PR was built or run here. A local logging patch on main 9e3831e was run on a retail title (below, one run). The crash and the reading of slot #9 match #662. The test goes through the real vtable slots, and its 7-argument calls cannot pass on main.

Overlap: #684 (open since 03:28 UTC, not named here) fixes the same crash by giving slot #9 seven arguments and leaving #8 alone; #976 and #992 build on it. The two conflict in xg.rs (git merge-tree), so only one can go in as it is. #684's PR checks is red (no regression run in its description; retail runs that reach the call are in its comments), this one's is green.

  1. CONFIRMED: every caller we could find splits the two forms by method (#8 six arguments, #9 seven), so copy_into should not guess (xg.rs:708-709).

    • Microsoft's public DirectXTex (MIT), built for xg_xs, passes the added 0u only to CopyFromSubresource. Its CopyIntoSubresource call has six arguments, with no Scarlett case.
    • The retail reports agree: #662 ("only slot 9 differs"), 50 logged CopyInto calls with six arguments, and a crash when #8 was read with seven. One run here of that logging patch (RTX 3060, 155 s, until the #505 null write): #8 was called at least 129 times; the 66 logged calls all fit six arguments, and each has a non-zero upper half in the pitch slot. #9 was called twice, and both calls fit seven (a zero before the source pointer). So in this run the forms split by method, as #662 says.
    • On #8 the guess can only do harm. A valid call with src = 0x8_0000_0000 (low dword 0) and a pitch slot of 0x7_00000100 (a dword under a stale upper half, as in #662's dump), with title memory at that address, is taken as the newer form: it tiles from 0x7_00000100 with the slice pitch as row pitch (wrong bytes, or a fault). This is traced in the code; none of the 66 logged calls had a source with a low dword of at most 0xFFFF, so the run did not hit it.
    • Fix, unless you saw a 6-argument call on #9 (question below): leave copy_into as on main and give copy_from a plain u32 before src. copy_args and its VirtualQuery go away, and so do two cases still misread on #9: an added value above 0xFFFF, and a null src (today a4, if its upper half is stale, becomes the source instead of E_INVALIDARG).
  2. CONFIRMED: the oracle does not show a 6-argument CopyFromSubresource (description; xg.rs:675-677). subresource_copies_match_the_console_library calls the console's slot #8 (xg_oracle.rs:400), but slot #9 only on XCL's own object (:403-405). It supports six arguments for CopyInto only. With the fix above, the from type in the oracle test, and from6 / into7 in the new one, change too.

Questions for the author

  • SEEN is shared by both methods, so the "6-argument" log line does not say which one was called. Did you see a 6-argument call on #9? (Here: none in two calls.)

Verdict: correct for the calls reported; copy_into should not guess, copy_from should be a fixed 7-argument method unless a 6-argument call on #9 was seen, and it needs a decision between this and #684.

Review by Claude Code (written by Claude Opus 5.5, checked with Claude Fable 5.2 and Claude Opus 5.5); each point checked by a person before posting.

<!-- greyfinch-sync:ivall/xcl:review:6044930917 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#pullrequestreview-6044930917). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-24T18:19:50Z. **Review:** COMMENTED --- Read at `14c8a2d` (merge base `930e8b4`; merges into `main` `9e3831e` without conflicts) by reading the code; nothing of this PR was built or run here. A local logging patch on `main` `9e3831e` was run on a retail title (below, one run). The crash and the reading of slot #9 match #662. The test goes through the real vtable slots, and its 7-argument calls cannot pass on `main`. **Overlap:** #684 (open since 03:28 UTC, not named here) fixes the same crash by giving slot #9 seven arguments and leaving #8 alone; #976 and #992 build on it. The two conflict in `xg.rs` (`git merge-tree`), so only one can go in as it is. #684's `PR checks` is red (no regression run in its description; retail runs that reach the call are in its comments), this one's is green. 1. **CONFIRMED: every caller we could find splits the two forms by method (#8 six arguments, #9 seven), so `copy_into` should not guess (`xg.rs:708-709`).** - Microsoft's public DirectXTex (MIT), built for `xg_xs`, passes the added `0u` only to [`CopyFromSubresource`](https://github.com/microsoft/DirectXTex/blob/a8e5dbf42909aeeb9fcf9c2ae399ae3c06737379/Auxiliary/DirectXTexXboxDetile.cpp#L229-L237). Its [`CopyIntoSubresource`](https://github.com/microsoft/DirectXTex/blob/a8e5dbf42909aeeb9fcf9c2ae399ae3c06737379/Auxiliary/DirectXTexXboxTile.cpp#L357-L362) call has six arguments, with no Scarlett case. - The retail reports agree: #662 ("only slot 9 differs"), [50 logged `CopyInto` calls with six arguments](https://github.com/ivall/xcl/pull/684#issuecomment-7121408824), and [a crash when #8 was read with seven](https://github.com/ivall/xcl/pull/684#issuecomment-7128692255). One run here of that logging patch (RTX 3060, 155 s, until the #505 null write): #8 was called at least 129 times; the 66 logged calls all fit six arguments, and each has a non-zero upper half in the pitch slot. #9 was called twice, and both calls fit seven (a zero before the source pointer). So in this run the forms split by method, as #662 says. - On #8 the guess can only do harm. A valid call with `src` = `0x8_0000_0000` (low dword 0) and a pitch slot of `0x7_00000100` (a dword under a stale upper half, as in #662's dump), with title memory at that address, is taken as the newer form: it tiles from `0x7_00000100` with the slice pitch as row pitch (wrong bytes, or a fault). This is traced in the code; none of the 66 logged calls had a source with a low dword of at most 0xFFFF, so the run did not hit it. - Fix, unless you saw a 6-argument call on #9 (question below): leave `copy_into` as on `main` and give `copy_from` a plain `u32` before `src`. `copy_args` and its `VirtualQuery` go away, and so do two cases still misread on #9: an added value above 0xFFFF, and a null `src` (today `a4`, if its upper half is stale, becomes the source instead of `E_INVALIDARG`). 2. **CONFIRMED: the oracle does not show a 6-argument `CopyFromSubresource` (description; `xg.rs:675-677`).** `subresource_copies_match_the_console_library` calls the console's slot #8 (`xg_oracle.rs:400`), but slot #9 only on XCL's own object (`:403-405`). It supports six arguments for `CopyInto` only. With the fix above, the `from` type in the oracle test, and `from6` / `into7` in the new one, change too. **Questions for the author** - `SEEN` is shared by both methods, so the "6-argument" log line does not say which one was called. Did you see a 6-argument call on #9? (Here: none in two calls.) Verdict: correct for the calls reported; `copy_into` should not guess, `copy_from` should be a fixed 7-argument method unless a 6-argument call on #9 was seen, and it needs a decision between this and #684. Review by Claude Code (written by Claude Opus 5.5, checked with Claude Fable 5.2 and Claude Opus 5.5); each point checked by a person before posting.
DavidM1911 commented 2026-11-24 19:07:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:52:27Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7141272114 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7141272114). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T18:52:27Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
iggyvilla commented 2026-11-25 08:08:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by iggyvilla on 2026-11-25T08:03:09Z.


Test report on 14c8a2d (merged with #2120 on main cbc296a as b5c481f;
cargo build --release -p xcl), 2 world-load walks on RX 6650 XT 8 GB (RDNA2)
/ Adrenalin 32.0.21045.29003 / 32 GB RAM (PRELOAD=0, XCL_PSO_WAIT_MS=2000,
-FromSave, commit stop at 37.8 GB).

Tested: same tree and runs as the #2120 report on this machine
(b5c481f, walks auto-20261125-154354 and auto-20261125-155228).

What was measured: the PR's per-form logging fires once per copy form in
both walks — in the 6-argument form at 2.5 s / 2.7 s and in the newer 7-argument form at 125.5 s / 126.9 s (during world load). No 0x80000003
and no +0x4dcbc9d in either log: the packet-stream assert did not fire here.

Not tested: a run that reaches the account-prompt assert itself (these runs
come from a save); suite run on this tree; other GPUs.

AI use: Measured by an omp agent running DeepSeek v4.1 Flash; text drafted
by Muse Spark 1.3; checked and posted by Claude Code (Claude Opus 5.5) on my
behalf; I did not run the tests or write the text.

<!-- greyfinch-sync:ivall/xcl:comment:7156550184 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7156550184). Originally posted by [iggyvilla](https://github.com/iggyvilla) on 2026-11-25T08:03:09Z. --- Test report on `14c8a2d` (merged with #2120 on `main cbc296a` as `b5c481f`; `cargo build --release -p xcl`), 2 world-load walks on RX 6650 XT 8 GB (RDNA2) / Adrenalin 32.0.21045.29003 / 32 GB RAM (`PRELOAD=0`, `XCL_PSO_WAIT_MS=2000`, `-FromSave`, commit stop at 37.8 GB). **Tested:** same tree and runs as the #2120 report on this machine (`b5c481f`, walks `auto-20261125-154354` and `auto-20261125-155228`). **What was measured:** the PR's per-form logging fires once per copy form in both walks — `in the 6-argument form` at 2.5 s / 2.7 s and `in the newer 7-argument form` at 125.5 s / 126.9 s (during world load). No `0x80000003` and no `+0x4dcbc9d` in either log: the packet-stream assert did not fire here. **Not tested:** a run that reaches the account-prompt assert itself (these runs come from a save); suite run on this tree; other GPUs. **AI use:** Measured by an omp agent running DeepSeek v4.1 Flash; text drafted by Muse Spark 1.3; checked and posted by Claude Code (Claude Opus 5.5) on my behalf; I did not run the tests or write the text.
xpatfussy69x commented 2026-11-25 12:06:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-25T11:57:27Z.


Test report for head 14c8a2d as pushed (not merged onto current main) – NVIDIA, wave32.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.2124; AMD Ryzen 5 7500F; 32 GB RAM; Windows NT 10.0.26300; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.2609.5
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 752 passed, 0 failed, 41 ignored
  • SKIPPED GPU tests on this adapter: 2 (no wave64)
  • this PR's test subresource_copies_take_both_argument_forms ran and passed
  • no XCL_SAMPLE_* data set (game-data tests not run, so not with the title's real xg library)

Not tested

  • a smoke run on a title; AMD / native wave64; release build; the head merged onto current main

AI use

  • Claude (Claude Opus 5.5) wrote the script that ran the suite on my PC, read the log and wrote and posted this report with my approval; the run is mine.
<!-- greyfinch-sync:ivall/xcl:comment:7161729583 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7161729583). Originally posted by [xpatfussy69x](https://github.com/xpatfussy69x) on 2026-11-25T11:57:27Z. --- Test report for head `14c8a2d` as pushed (not merged onto current `main`) – NVIDIA, wave32. **Tested** - NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.2124; AMD Ryzen 5 7500F; 32 GB RAM; Windows NT 10.0.26300; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.2609.5 - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 752 passed, 0 failed, 41 ignored - SKIPPED GPU tests on this adapter: 2 (no wave64) - this PR's test `subresource_copies_take_both_argument_forms` ran and passed - no `XCL_SAMPLE_*` data set (game-data tests not run, so not with the title's real `xg` library) **Not tested** - a smoke run on a title; AMD / native wave64; release build; the head merged onto current `main` **AI use** - Claude (Claude Opus 5.5) wrote the script that ran the suite on my PC, read the log and wrote and posted this report with my approval; the run is mine.
ClosetPie107 commented 2026-11-25 13:05:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-25T12:28:17Z.


Linux / AMD RDNA4 (RADV) test report for head 14c8a2d merged locally onto main 1a0bbe3 (clean merge).

Environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, 30 GiB RAM, CachyOS
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton v3.1 (#257 + dxil-spirv 53aac418), DXVK v3.1.1-209, DXC 1.9.2609.5, x86_64-pc-windows-gnu cross-compile

Tested (debug test binary under Wine, --test-threads=1 --nocapture)

  • hle::xg::tests: 4 passed, 0 failed, 0 ignored, 0 skipped (0.00 s), including subresource_copies_take_both_argument_forms.

Not tested: full workspace suite, retail title run, native Windows.

AI use: T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran the tests on this machine, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7162417040 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7162417040). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-25T12:28:17Z. --- Linux / AMD RDNA4 (RADV) test report for head `14c8a2d` merged locally onto `main` `1a0bbe3` (clean merge). **Environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, 30 GiB RAM, CachyOS - Proton Experimental (`experimental-11.0-20261112`), vkd3d-proton v3.1 (`#257` + `dxil-spirv` `53aac418`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, `x86_64-pc-windows-gnu` cross-compile **Tested** (debug test binary under Wine, `--test-threads=1 --nocapture`) - `hle::xg::tests`: **4 passed, 0 failed, 0 ignored, 0 skipped** (0.00 s), including `subresource_copies_take_both_argument_forms`. **Not tested:** full workspace suite, retail title run, native Windows. **AI use:** T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran the tests on this machine, and drafted this report.
Placebola commented 2026-11-25 18:04:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Placebola on 2026-11-25T17:07:45Z.


Test report on 14c8a2d merged onto main 06c9f55 (clean merge, release build): it removes the memcpy access violation during the retail title's world load on this machine.

Tested

  • NVIDIA GeForce RTX 4060 Ti 8 GB, driver 621.40 (32.0.16.2140), Intel Core i7-7700, 32 GB RAM, Windows 10 22H2 (19045), release build.
  • xcl run on the retail title, XCL_NETWORK=0, XCL_RUN_SECONDS=200, A pressed every 4 s from 20 s, warm DXIL cache.
  • main 06c9f55 alone: 2 runs out of 2 end with 0xc0000005 in VCRUNTIME140!memcpy (write past the destination, at 130 s and 138 s), called from xcl::hle::xg::copy_from. One of my own manual runs on main ended the same way.
  • main 06c9f55 + this PR: 3 runs out of 3 reach 200 s with no crash and no device removal (2191 – 2466 frames shown). Each run logs both forms: called in the 6-argument form at about 3 s, then called in the newer 7-argument form at 133 – 161 s, which is when main alone crashes.

This title calls both forms in the same run. #684 fixes the same crash, and an older tree of mine with it (main 9633138 + #684) got past this point too. But #684 reads CopyFromSubresource in the 7-argument form only and leaves CopyIntoSubresource as it is. This PR tells the two forms apart on every call, for both methods, so it covers more of what this title does.

Not tested

  • cargo test, scripts/smoke.ps1; AMD; #684 on 06c9f55.

AI use

  • Claude Code (Claude Opus 5.5) ran the runs, read the crash dumps and logs, and wrote this comment.
<!-- greyfinch-sync:ivall/xcl:comment:7169047055 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7169047055). Originally posted by [Placebola](https://github.com/Placebola) on 2026-11-25T17:07:45Z. --- Test report on `14c8a2d` merged onto `main` `06c9f55` (clean merge, release build): **it removes the `memcpy` access violation during the retail title's world load on this machine.** **Tested** - NVIDIA GeForce RTX 4060 Ti 8 GB, driver 621.40 (32.0.16.2140), Intel Core i7-7700, 32 GB RAM, Windows 10 22H2 (19045), release build. - `xcl run` on the retail title, `XCL_NETWORK=0`, `XCL_RUN_SECONDS=200`, A pressed every 4 s from 20 s, warm DXIL cache. - `main` `06c9f55` alone: 2 runs out of 2 end with `0xc0000005` in `VCRUNTIME140!memcpy` (write past the destination, at 130 s and 138 s), called from `xcl::hle::xg::copy_from`. One of my own manual runs on `main` ended the same way. - `main` `06c9f55` + this PR: 3 runs out of 3 reach 200 s with no crash and no device removal (2191 – 2466 frames shown). Each run logs both forms: `called in the 6-argument form` at about 3 s, then `called in the newer 7-argument form` at 133 – 161 s, which is when `main` alone crashes. This title calls both forms in the same run. #684 fixes the same crash, and an older tree of mine with it (`main` `9633138` + #684) got past this point too. But #684 reads `CopyFromSubresource` in the 7-argument form only and leaves `CopyIntoSubresource` as it is. This PR tells the two forms apart on every call, for both methods, so it covers more of what this title does. **Not tested** - `cargo test`, `scripts/smoke.ps1`; AMD; #684 on `06c9f55`. **AI use** - Claude Code (Claude Opus 5.5) ran the runs, read the crash dumps and logs, and wrote this comment.
DLampos commented 2026-11-25 19:09:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DLampos on 2026-11-25T19:06:45Z.


Independent confirmation on Linux. This is not a run of this PR's commit: I hit the same crash on a retail title (build 1.0.2.1) and made the same change locally, on main at c160d86. In that change, copy_from takes the extra u32 between the subresource and the source pointer. I did not build this PR's branch.

Tested

  • Fedora 45 (kernel 7.3), AMD Ryzen 7 9700X, 30 GB RAM, NVIDIA RTX 4070 SUPER 12 GB, driver 620.70 (open kernel module).
  • XCL cross-built for x86_64-pc-windows-gnu (release), running under Proton Experimental's Wine 11 with DXVK's dxgi and vkd3d-proton. vkd3d-proton was built from Proton's commit 2576c0b4 with two local patches for XCL's vtable swap.
  • Before the change: 4 runs, with VKD3D_CONFIG=no_upload_hvv to get past an unrelated vkd3d-proton abort.
    • All 4 ended at 62.9–66.1 s with an access violation in memcpy called from xcl::hle::xg::copy_from. The writes went to 0x8_070c_c5f0 – 0x8_4fe0_74a0, outside anything mapped.
    • At the title's call site (+0x979f31), dword 0 is at [rsp+0x20], the source at [rsp+0x28] and the pitches at [rsp+0x30] / [rsp+0x38]. Read as six arguments, the row pitch became the low half of the source pointer.
  • After the change: 2 runs, one with the default config and one with no_upload_hvv.
    • Both passed that point and kept presenting frames until 92–94 s.
    • The title's own watchdog then ended them during long compute pipeline builds, which is unrelated to XG.

Not tested

  • This PR's own commit.
  • Windows and AMD GPUs.
  • The test suite with this change.

AI use

  • Claude Code with Claude Opus 5.5 did the investigation and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7171834912 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7171834912). Originally posted by [DLampos](https://github.com/DLampos) on 2026-11-25T19:06:45Z. --- Independent confirmation on Linux. This is not a run of this PR's commit: I hit the same crash on a retail title (build 1.0.2.1) and made the same change locally, on `main` at c160d86. In that change, `copy_from` takes the extra `u32` between the subresource and the source pointer. I did not build this PR's branch. **Tested** - Fedora 45 (kernel 7.3), AMD Ryzen 7 9700X, 30 GB RAM, NVIDIA RTX 4070 SUPER 12 GB, driver 620.70 (open kernel module). - XCL cross-built for `x86_64-pc-windows-gnu` (release), running under Proton Experimental's Wine 11 with DXVK's dxgi and vkd3d-proton. vkd3d-proton was built from Proton's commit 2576c0b4 with two local patches for XCL's vtable swap. - Before the change: 4 runs, with `VKD3D_CONFIG=no_upload_hvv` to get past an unrelated vkd3d-proton abort. - All 4 ended at 62.9–66.1 s with an access violation in `memcpy` called from `xcl::hle::xg::copy_from`. The writes went to 0x8_070c_c5f0 – 0x8_4fe0_74a0, outside anything mapped. - At the title's call site (`+0x979f31`), dword 0 is at `[rsp+0x20]`, the source at `[rsp+0x28]` and the pitches at `[rsp+0x30]` / `[rsp+0x38]`. Read as six arguments, the row pitch became the low half of the source pointer. - After the change: 2 runs, one with the default config and one with `no_upload_hvv`. - Both passed that point and kept presenting frames until 92–94 s. - The title's own watchdog then ended them during long compute pipeline builds, which is unrelated to XG. **Not tested** - This PR's own commit. - Windows and AMD GPUs. - The test suite with this change. **AI use** - Claude Code with Claude Opus 5.5 did the investigation and wrote this report.
anes66 commented 2026-11-25 20:08:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by anes66 on 2026-11-25T20:01:41Z.


Native Windows reproduction on unmodified main 2898511, followed by CPU checks of this PR.

A manual loading-screen run on Windows 10 22H2 / RTX 3060 12 GB ended at 612.097 s with a write AV in VCRUNTIME140.dll+0x1cc83, destination 0x808a1c840. The stack scan includes:

xcl.exe+0x9d180
game_scarlett_master.exe+0x979f5b
game_scarlett_master.exe+0x4fb0c2f
game_scarlett_master.exe+0x50bb3f0
game_scarlett_master.exe+0x979db0

Using the matching release PDB offline, Windows SDK dbh resolves xcl.exe+0x9d180 to xcl::hle::xg::copy_from+0x2d0, hle/xg.rs:713, the row-copy call. This matches the first failure in #662. The run logged no 0x8007000E, device-removal or GPU-wait-timeout message; that does not establish a general absence of memory pressure.

Unmodified head 14c8a2d passes all four hle::xg::tests here. I added CPU coverage for pitched mips, array slices, depth/stencil planes, BC formats, volumes and reserved source addresses in #2483: six tests pass both on your head and when carried onto main e0d93c8. The additional tests are authored under anes66; their dependency retains your original commit author.

Not tested: a title run with this PR on this machine, GPU tests or the full workspace suite. A separate build is being prepared for a manual before/after check; there is no claim yet that it removes our crash.


Manual A/B follow-up, 25 November

The separate release build is now tested manually: main 2898511 + your exact runtime change (14c8a2d, cherry-picked as cb9041c) + the test-only commit, head aec6fa1. Same machine, title and launcher settings as the baseline. Existing caches and saves were retained, so this is not a cold-cache comparison.

  • Baseline above: write AV in xg::copy_from at 612.097 s.
  • Patched run: the 6-argument form is logged at 3.899 s and the newer 7-argument form at 592.175 s. No access violation was recorded. The user closed the game window at 1203.425 s; the launcher and XCL report both record exit 0 and the report has crash: null.
  • The user saw loading finish and then a black window. The last activity interval with nonzero presents is at 592.175 s; no further presents were recorded before manual closure, although occasional dispatches continued. This is not a successful world-rendering result.
  • Final report: 17,292 presents, 1,844 translated pipelines, 40 translation errors (including the existing MS-in-AS-slot refusals); 123 DXIL compilations with 0 compilation failures.
  • Host-process sampling every two seconds: peak private bytes 31,386 MiB, peak working set 17,648 MiB. The final activity memory line reports 28,117 MB process commit, 12,552 MB local video memory and 4,759 MB non-local. These measurements do not identify the cause of the black screen.

This one run gets past the previous copy_from AV and remains alive until manual closure. It does not establish a general fix for the remaining loading/rendering stall. No title binaries, dumps or complete local logs are uploaded.

<!-- greyfinch-sync:ivall/xcl:comment:7173085675 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7173085675). Originally posted by [anes66](https://github.com/anes66) on 2026-11-25T20:01:41Z. --- Native Windows reproduction on unmodified `main` `2898511`, followed by CPU checks of this PR. A manual loading-screen run on Windows 10 22H2 / RTX 3060 12 GB ended at 612.097 s with a write AV in `VCRUNTIME140.dll+0x1cc83`, destination `0x808a1c840`. The stack scan includes: ```text xcl.exe+0x9d180 game_scarlett_master.exe+0x979f5b game_scarlett_master.exe+0x4fb0c2f game_scarlett_master.exe+0x50bb3f0 game_scarlett_master.exe+0x979db0 ``` Using the matching release PDB offline, Windows SDK `dbh` resolves `xcl.exe+0x9d180` to `xcl::hle::xg::copy_from+0x2d0`, `hle/xg.rs:713`, the row-copy call. This matches the first failure in #662. The run logged no `0x8007000E`, device-removal or GPU-wait-timeout message; that does not establish a general absence of memory pressure. Unmodified head `14c8a2d` passes all four `hle::xg::tests` here. I added CPU coverage for pitched mips, array slices, depth/stencil planes, BC formats, volumes and reserved source addresses in #2483: six tests pass both on your head and when carried onto `main` `e0d93c8`. The additional tests are authored under `anes66`; their dependency retains your original commit author. **Not tested:** a title run with this PR on this machine, GPU tests or the full workspace suite. A separate build is being prepared for a manual before/after check; there is no claim yet that it removes our crash. --- **Manual A/B follow-up, 25 November** The separate release build is now tested manually: `main` `2898511` + your exact runtime change (`14c8a2d`, cherry-picked as `cb9041c`) + the test-only commit, head `aec6fa1`. Same machine, title and launcher settings as the baseline. Existing caches and saves were retained, so this is not a cold-cache comparison. - Baseline above: write AV in `xg::copy_from` at 612.097 s. - Patched run: the 6-argument form is logged at 3.899 s and the newer 7-argument form at 592.175 s. No access violation was recorded. The user closed the game window at 1203.425 s; the launcher and XCL report both record exit 0 and the report has `crash: null`. - The user saw loading finish and then a black window. The last activity interval with nonzero presents is at 592.175 s; no further presents were recorded before manual closure, although occasional dispatches continued. This is not a successful world-rendering result. - Final report: 17,292 presents, 1,844 translated pipelines, 40 translation errors (including the existing MS-in-AS-slot refusals); 123 DXIL compilations with 0 compilation failures. - Host-process sampling every two seconds: peak private bytes 31,386 MiB, peak working set 17,648 MiB. The final activity memory line reports 28,117 MB process commit, 12,552 MB local video memory and 4,759 MB non-local. These measurements do not identify the cause of the black screen. This one run gets past the previous `copy_from` AV and remains alive until manual closure. It does not establish a general fix for the remaining loading/rendering stall. No title binaries, dumps or complete local logs are uploaded.
bmjask commented 2026-11-25 21:16:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T21:16:55Z.

Review: COMMENTED


P1 ABI-dispatch flaw: copy_args guesses ABI for both vtable methods. DirectXTex/retail evidence shows slot #8 CopyIntoSubresource is six-argument while slot #9 CopyFromSubresource carries the added 32-bit argument. Heuristically applying it to copy_into can misclassify valid calls based on source low bits/stale stack pitch and tile from wrong address; it also mishandles non-small added values/null new-form source. Keep copy_into fixed six-argument and copy_from fixed seven-argument; remove VirtualQuery guessing. Current Windows CI is also absent.

<!-- greyfinch-sync:ivall/xcl:review:6065103365 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#pullrequestreview-6065103365). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T21:16:55Z. **Review:** COMMENTED --- P1 ABI-dispatch flaw: copy_args guesses ABI for both vtable methods. DirectXTex/retail evidence shows slot #8 CopyIntoSubresource is six-argument while slot #9 CopyFromSubresource carries the added 32-bit argument. Heuristically applying it to copy_into can misclassify valid calls based on source low bits/stale stack pitch and tile from wrong address; it also mishandles non-small added values/null new-form source. Keep copy_into fixed six-argument and copy_from fixed seven-argument; remove VirtualQuery guessing. Current Windows CI is also absent.
madaraXor commented 2026-11-25 22:06:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by madaraXor on 2026-11-25T21:55:48Z.


Test report on the retail title: this fixes #646's VCRUNTIME140 memcpy crash here, and shows what the old reading does first. Tested commit: 14c8a2d (this PR's head).

Setup: RX 6700 XT (RDNA2), Windows 10 22H2, release build. Not plain main: main 65fc114 + #1803, #2229, #2384 (with a local fix of its deadlock), #1790, #2385, #1795, #2246, then this PR merged on top (no conflict). XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_GPU_VIEW_BUFFERS=1, same input script in every run.

Without this PR (two runs):

  • Run 1 crashed at 464 s in #646's stack: VCRUNTIME140.dll+0x1dcf3, write, rbx=0x40000 rdi=0x800, title frames +0x979f5b, +0x4fb0c2f, +0x50bb3f0. The return address on the stack is xg::copy_from+0x168, the instruction after its call memcpy (disassembled with the build's PDB).
  • Run 2 checked each destination row for writable memory first (local diagnostic):
    XG: CopyFromSubresource into 0x737700000: row 3 of 128 is not writable memory (level 0 of 10, 128x128 elements of 16 B, row 2048 B, row pitch 1167691776, slice pitch 2048, side 4, mode 5)
    XG: CopyFromSubresource into 0x7375951c0: row 3 of 32 is not writable memory (level 0 of 6, 32x32 elements of 8 B, row 256 B, row pitch 1175744512, slice pitch 256, side 4, mode 5)
    
    The "row pitch" is the low half of a pointer (0x45999000, the same value as r12 in run 1's crash), and the "slice pitch" is the real row pitch. Rows 1 and 2 had already been written ~1.1 GB and ~2.2 GB past the destination, into memory the title owns, before row 3 reached an uncommitted page. Presents stopped 4 s later.
  • So before the crash, this path silently corrupts title memory, and only when the wild row lands on an uncommitted page does it show as #646's crash.

With this PR: the log has called in the 6-argument form at 23 s and called in the newer 7-argument form at 453 s, as the PR says. There is no XG write outside the destination and no crash to the end of the run, which then waits on driver compiles, a separate matter. The PR's subresource_copies_take_both_argument_forms test was not run separately here.

The 464 s run was at 21.5 GB commit and 10 GB local VRAM, so on this machine #646's crash was not the commit wall.

Claude Code (Claude Opus 5.5): wrote this from the runs above (logs, cdb). Counts, times and RVAs only.

<!-- greyfinch-sync:ivall/xcl:comment:7175720197 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7175720197). Originally posted by [madaraXor](https://github.com/madaraXor) on 2026-11-25T21:55:48Z. --- **Test report on the retail title: this fixes #646's `VCRUNTIME140` memcpy crash here, and shows what the old reading does first.** Tested commit: `14c8a2d` (this PR's head). **Setup:** RX 6700 XT (RDNA2), Windows 10 22H2, release build. Not plain `main`: `main 65fc114` + #1803, #2229, #2384 (with a local fix of its deadlock), #1790, #2385, #1795, #2246, then this PR merged on top (no conflict). `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_GPU_VIEW_BUFFERS=1`, same input script in every run. **Without this PR** (two runs): - Run 1 crashed at 464 s in #646's stack: `VCRUNTIME140.dll+0x1dcf3`, write, `rbx=0x40000 rdi=0x800`, title frames `+0x979f5b`, `+0x4fb0c2f`, `+0x50bb3f0`. The return address on the stack is `xg::copy_from+0x168`, the instruction after its `call memcpy` (disassembled with the build's PDB). - Run 2 checked each destination row for writable memory first (local diagnostic): ``` XG: CopyFromSubresource into 0x737700000: row 3 of 128 is not writable memory (level 0 of 10, 128x128 elements of 16 B, row 2048 B, row pitch 1167691776, slice pitch 2048, side 4, mode 5) XG: CopyFromSubresource into 0x7375951c0: row 3 of 32 is not writable memory (level 0 of 6, 32x32 elements of 8 B, row 256 B, row pitch 1175744512, slice pitch 256, side 4, mode 5) ``` The "row pitch" is the low half of a pointer (`0x45999000`, the same value as `r12` in run 1's crash), and the "slice pitch" is the real row pitch. Rows 1 and 2 had already been written ~1.1 GB and ~2.2 GB past the destination, into memory the title owns, before row 3 reached an uncommitted page. Presents stopped 4 s later. - So before the crash, this path silently corrupts title memory, and only when the wild row lands on an uncommitted page does it show as #646's crash. **With this PR:** the log has `called in the 6-argument form` at 23 s and `called in the newer 7-argument form` at 453 s, as the PR says. There is no XG write outside the destination and no crash to the end of the run, which then waits on driver compiles, a separate matter. The PR's `subresource_copies_take_both_argument_forms` test was not run separately here. The 464 s run was at 21.5 GB commit and 10 GB local VRAM, so on this machine #646's crash was not the commit wall. *Claude Code (Claude Opus 5.5): wrote this from the runs above (logs, cdb). Counts, times and RVAs only.*
SergeAx commented 2026-11-26 15:03:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SergeAx on 2026-11-26T14:54:22Z.


Test report: on an RTX 5080 with the retail title, this fixes the 98 s crash in copy_from (#662). Eight runs went past that point, the longest for 4 h 38 min. Tested commit: this PR's head 14c8a2d, merged onto main b49be18 (merge 9336fba, no conflicts).

Setup:

  • RTX 5080 16 GB (driver 621.14), Ryzen 5 3500X, 64 GB RAM, Windows 10 Pro 22H2 (19045.6466), Agility SDK 1.620.2, release.
  • Retail 1.0.2.1 (Series X), xcl run <folder>, XCL_NETWORK=0.

Without this PR: a main build crashed at 98.2 s (built from a checkout at b49be18; its log does not record the commit). That was a write access violation in VCRUNTIME140.dll+0x1dcf3, under XCL's CopyFromSubresource, the crash of #662. The minidump of a second main run shows the same crash. A main smoke run of 60 s ends before that point.

With this PR:

run xg: CopyInto/FromSubresource called in the newer 7-argument form crash in a copy end
1 116.2 s no device removal at 16,698 s
2 96.4 s no device removal at 103 s
3 111.9 s no its 180 s limit
4 138.7 s no device removal at 140 s
5 105.8 s no device removal at 108 s
6 109.1 s no device removal at 146 s
7 109.3 s no device removal at 124 s
8 97.8 s no device removal at 106 s
  • The with … in its added argument (meaning unknown, ignored) warning never came up, so the title always passed 0 there.
  • The device removals are the world-load removal of #1452, not this PR: the debug layer says DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT (details).

Unit tests: cargo test -p xcl --lib hle::xg::tests on the merge (debug): 4 passed, 0 failed, 0 ignored, including subresource_copies_take_both_argument_forms.

Not tested:

  • AMD (see the RX 6700 XT report above), Windows 11.
  • The whole test suite on this merge.
  • A nonzero added argument.

AI use: Claude Code (Claude Opus 5.5) ran the runs and the tests, read the logs and wrote this report. A person drove the title (pressing Space and picking the player).

<!-- greyfinch-sync:ivall/xcl:comment:7195503166 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7195503166). Originally posted by [SergeAx](https://github.com/SergeAx) on 2026-11-26T14:54:22Z. --- **Test report: on an RTX 5080 with the retail title, this fixes the 98 s crash in `copy_from` (#662). Eight runs went past that point, the longest for 4 h 38 min.** Tested commit: this PR's head `14c8a2d`, merged onto `main` `b49be18` (merge `9336fba`, no conflicts). **Setup:** - RTX 5080 16 GB (driver 621.14), Ryzen 5 3500X, 64 GB RAM, Windows 10 Pro 22H2 (19045.6466), Agility SDK 1.620.2, release. - Retail 1.0.2.1 (Series X), `xcl run <folder>`, `XCL_NETWORK=0`. **Without this PR:** a `main` build crashed at 98.2 s (built from a checkout at `b49be18`; its log does not record the commit). That was a write access violation in `VCRUNTIME140.dll+0x1dcf3`, under XCL's `CopyFromSubresource`, the crash of #662. The minidump of a second `main` run shows the same crash. A `main` smoke run of 60 s ends before that point. **With this PR:** | run | `xg: CopyInto/FromSubresource called in the newer 7-argument form` | crash in a copy | end | |---|---|---|---| | 1 | 116.2 s | no | device removal at 16,698 s | | 2 | 96.4 s | no | device removal at 103 s | | 3 | 111.9 s | no | its 180 s limit | | 4 | 138.7 s | no | device removal at 140 s | | 5 | 105.8 s | no | device removal at 108 s | | 6 | 109.1 s | no | device removal at 146 s | | 7 | 109.3 s | no | device removal at 124 s | | 8 | 97.8 s | no | device removal at 106 s | - The `with … in its added argument (meaning unknown, ignored)` warning never came up, so the title always passed 0 there. - The device removals are the world-load removal of #1452, not this PR: the debug layer says `DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT` ([details](https://github.com/xcl-dev/xcl/issues/1452#issuecomment-7194789593)). **Unit tests:** `cargo test -p xcl --lib hle::xg::tests` on the merge (debug): 4 passed, 0 failed, 0 ignored, including `subresource_copies_take_both_argument_forms`. **Not tested:** - AMD (see the RX 6700 XT report above), Windows 11. - The whole test suite on this merge. - A nonzero added argument. AI use: Claude Code (Claude Opus 5.5) ran the runs and the tests, read the logs and wrote this report. A person drove the title (pressing Space and picking the player).
b3IKK commented 2026-11-26 17:46:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-26T17:46:57Z.


In-title confirmation on an RTX 5080 16 GB (driver 32.0.16.1088), retail 1.0.2.1, Windows 11 26300, release. This PR's head 14c8a2d cherry-picked onto #2404 5b9d4ff + #2519's scratch + the 1 GiB shader-heap profile (#2590) + the free_aside patch, with heap windows and the full compute precompile.

  • Without the fix the same stack ended in the VCRUNTIME 0xc0000005 (a 16-byte read at 0xca8a78000 / 0xc4903a000 / 0x859810000) at 50–551 s, with no device removal.
  • With this PR the VCRUNTIME AV is gone: the run presented to 495.4 s and then ended in the title's own int3 at game_scarlett_master.exe+0x63966f (0x80000003, its Breakpad handler), no XCL exception and no device removal. Local video memory 20.8 GB; title textures: 16384 uploads left out was reached.

So copy_from is no longer the end here; +0x63966f is a later, different title assert (no issue mentions that offset). This matches @SergeAx's 5080 result above.

AI use: OpenCode, Claude Fable 5.2 applied the PR, ran the 600 s title and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7199637032 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7199637032). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-26T17:46:57Z. --- In-title confirmation on an RTX 5080 16 GB (driver 32.0.16.1088), retail 1.0.2.1, Windows 11 26300, release. This PR's head `14c8a2d` cherry-picked onto #2404 `5b9d4ff` + #2519's scratch + the 1 GiB shader-heap profile (#2590) + the `free_aside` patch, with heap windows and the full compute precompile. - Without the fix the same stack ended in the VCRUNTIME `0xc0000005` (a 16-byte read at `0xca8a78000` / `0xc4903a000` / `0x859810000`) at 50–551 s, with no device removal. - With this PR the VCRUNTIME AV is **gone**: the run presented to 495.4 s and then ended in the title's own `int3` at `game_scarlett_master.exe+0x63966f` (0x80000003, its Breakpad handler), no XCL exception and no device removal. Local video memory 20.8 GB; `title textures: 16384 uploads left out` was reached. So `copy_from` is no longer the end here; +0x63966f is a later, different title assert (no issue mentions that offset). This matches @SergeAx's 5080 result above. AI use: OpenCode, Claude Fable 5.2 applied the PR, ran the 600 s title and wrote this.
johnbf8x commented 2026-11-27 01:10:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by johnbf8x on 2026-11-27T01:10:54Z.


RTX 3070 Ti 8 GB, Windows 10 22H2 (19045.7846): confirms the copy_from fix.

Tested 14c8a2d merged onto nvidia-dev ecc0bb5 (clean merge, release build). Driver 32.0.16.2140, i7-12700K, 32 GB RAM, Agility SDK 1.620.2, retail 1.0.2.1 (Series X), XCL_NETWORK=0, warm cache.

  • nvidia-dev ecc0bb5 alone: 4 of 4 runs end with 0xc0000005 in VCRUNTIME140.dll+0x122b3 (a write), writer xcl.exe+0x31943f, game stack +0x979f5b, +0x4fb0c2f, +0x50bb3f0. Three at 97-112 s, one at about 3 min (one of the four was Series S).
  • With this PR: 1 run, no crash in 736 s (I closed the window). The log shows xg: CopyInto/FromSubresource called in the 6-argument form, then ... the newer 7-argument form.

Not tested: cargo test, more than one run with the PR, AMD. The run then stalls on graphics pipelines (about 5.9 s per driver compile, 0.0 FPS), which is separate from this PR.

AI use: Claude Code, Claude Sonnet 5.5 ran the builds and recordings and wrote this note; the machine's owner reviewed it.

<!-- greyfinch-sync:ivall/xcl:comment:7207079339 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7207079339). Originally posted by [johnbf8x](https://github.com/johnbf8x) on 2026-11-27T01:10:54Z. --- **RTX 3070 Ti 8 GB, Windows 10 22H2 (19045.7846): confirms the `copy_from` fix.** Tested `14c8a2d` merged onto `nvidia-dev` `ecc0bb5` (clean merge, release build). Driver 32.0.16.2140, i7-12700K, 32 GB RAM, Agility SDK 1.620.2, retail 1.0.2.1 (Series X), `XCL_NETWORK=0`, warm cache. - `nvidia-dev` `ecc0bb5` alone: 4 of 4 runs end with `0xc0000005` in `VCRUNTIME140.dll+0x122b3` (a write), writer `xcl.exe+0x31943f`, game stack `+0x979f5b`, `+0x4fb0c2f`, `+0x50bb3f0`. Three at 97-112 s, one at about 3 min (one of the four was Series S). - With this PR: 1 run, no crash in 736 s (I closed the window). The log shows `xg: CopyInto/FromSubresource called in the 6-argument form`, then `... the newer 7-argument form`. Not tested: `cargo test`, more than one run with the PR, AMD. The run then stalls on graphics pipelines (about 5.9 s per driver compile, 0.0 FPS), which is separate from this PR. AI use: Claude Code, Claude Sonnet 5.5 ran the builds and recordings and wrote this note; the machine's owner reviewed it.
throny commented 2026-11-30 20:10:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-30T20:10:16Z.


Closing: this change is already on main as commit adccb7d8 (brought in by 5eb48388 Merge main (5b711248) into the nvidia-dev merge). This PR's diff applies in reverse cleanly on current main (ff0c364b), so merging it would change nothing. If something here is not on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5) checked this; part of the duplicate sweep on #3041.

<!-- greyfinch-sync:ivall/xcl:comment:7290513451 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1435#issuecomment-7290513451). Originally posted by [throny](https://github.com/throny) on 2026-11-30T20:10:16Z. --- Closing: this change is already on `main` as commit adccb7d8 (brought in by 5eb48388 Merge main (5b711248) into the nvidia-dev merge). This PR's diff applies in reverse cleanly on current `main` (`ff0c364b`), so merging it would change nothing. If something here is not on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5) checked this; part of the duplicate sweep on #3041.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1425
No description provided.