Repository navigation
Conversation
…rgument 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 xcl-dev#9), called by the game as (linear dst, plane, subresource, 0, tiled src, row pitch, slice pitch): its library has a 32-bit argument before the source pointer, which the library the oracle test uses (XDefiant's) does not. 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: title pages are committed on first use). A nonzero added argument is logged once and ignored; its meaning is not known. New test: both forms tile the same bytes and read them back, with garbage in the upper half of the added argument's slot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
pvfreis
left a comment
There was a problem hiding this comment.
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.
-
CONFIRMED: every caller we could find splits the two forms by method (#8 six arguments, #9 seven), so
copy_intoshould not guess (xg.rs:708-709).- Microsoft's public DirectXTex (MIT), built for
xg_xs, passes the added0uonly toCopyFromSubresource. ItsCopyIntoSubresourcecall has six arguments, with no Scarlett case. - The retail reports agree: #662 ("only slot 9 differs"), 50 logged
CopyIntocalls 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 of0x7_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 from0x7_00000100with 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_intoas onmainand givecopy_froma plainu32beforesrc.copy_argsand itsVirtualQuerygo away, and so do two cases still misread on #9: an added value above 0xFFFF, and a nullsrc(todaya4, if its upper half is stale, becomes the source instead ofE_INVALIDARG).
- Microsoft's public DirectXTex (MIT), built for
-
CONFIRMED: the oracle does not show a 6-argument
CopyFromSubresource(description;xg.rs:675-677).subresource_copies_match_the_console_librarycalls the console's slot #8 (xg_oracle.rs:400), but slot #9 only on XCL's own object (:403-405). It supports six arguments forCopyIntoonly. With the fix above, thefromtype in the oracle test, andfrom6/into7in the new one, change too.
Questions for the author
SEENis 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.
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
…(port of xcl-dev#976, xcl-dev#992) xcl-dev#976 and xcl-dev#992 are stacked on xcl-dev#684, which is not merged here: xcl-dev#1435 already fixes the 7-argument ABI another way (copy_args tells the two forms apart). Their checks are ported onto xcl-dev#1435's copy_from: the destination span (row and 3D slice pitch, from xcl-dev#684) must be writable memory (dstorage::writable, xcl-dev#976) and the tiled source range readable (shader::readable_range, xcl-dev#992) before anything is detiled or copied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test report on Tested: same tree and runs as the #2120 report on this machine What was measured: the PR's per-form logging fires once per copy form in Not tested: a run that reaches the account-prompt assert itself (these runs AI use: Measured by an omp agent running DeepSeek v4.1 Flash; text drafted |
|
Test report for head Tested
Not tested
AI use
|
|
Linux / AMD RDNA4 (RADV) test report for head Environment
Tested (debug test binary under Wine,
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. |
A retail game crashed during its world loading, every run: an access violation in a
memcpywriting to title memory that was never reserved, mapped or committed. The writer was XCL'sXGTextureAddressComputer::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_argsand the two copy methods taking either form (hle/xg.rs).hle/xg.rs).Tested
cargo build --workspace, thencargo 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).Regression run
main:
PR:
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
xg_oracle.AI use
🤖 Generated with Claude Code