Skip to content

xcl run: recover retail packet stream capacity assert at +0x4dcbc9d (#723, #695) - #1233

Open
Lum7nt wants to merge 2 commits into
xcl-dev:mainfrom
Lum7nt:fix/retail-thread-stream-assert
Open

Lum7nt wants to merge 2 commits into
xcl-dev:mainfrom
Lum7nt:fix/retail-thread-stream-assert

Conversation

@Lum7nt

@Lum7nt Lum7nt commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #579. Fixes #723. Fixes #695.

In retail game, the GameThread packet stream (96 KiB) fills up during the first-run account prompt because nothing on PC drains it. Once full (capacity - cursor < requested), the title hits an unconditional int 3 assert at title+0x4dcbc9d (0x80000003), terminating the process within ~30 s.

What is in it

  • crates/xcl/src/eh.rs:
    • handle_thread_stream_assert: handles 0x8000_0003 in VEH when rip & 0xFFF == 0xC9D within the main module pointing to 0xCC (int 3).
    • Reads the 40-byte stream slot object via safe unaligned access (read_unaligned/write_unaligned) to avoid faults on unaligned slot pointers.
    • Expands buffer capacity up to 16 MiB ((capacity * 8).max(1 MiB).min(16 MiB)), allocates a new buffer via VirtualAlloc, copies active cursor data, updates dataBase and capacity, and rewinds Rip to the capacity check re-entry point at (rip & !0xFFF) | 0xC47 so the enqueue completes normally without dropped packets.
    • Fallback: when growth is disabled (XCL_GROW_THREAD_STREAM=0), when memory allocation fails, or when the 16 MiB ceiling is reached, advances Rip += 1 to land on +0xC9E (jmp +0xC8A, the title's own packet-dropped branch), continuing execution smoothly without crashing.
    • Unit test eh::tests::thread_stream_assert_growth_ceiling_and_unaligned_slot covering initial 4 KiB -> 1 MiB expansion with cursor preservation, retry jump to +0xC47, 16 MiB ceiling boundary enforcement, and unaligned slot pointer handling.

Tested

  • Host: Windows 11 x64 (26100), NVIDIA GeForce RTX 3060 (12115 MiB VRAM), DXC 1.8.2502.11
  • cargo test -p xcl --lib eh::tests: 7 passed, 0 failed
  • python -m unittest discover -s scripts -v: 9 passed, 0 failed

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3060
title: RetailGAME
seconds: 60
exit: 0x0
frames shown: 1184 (PresentX 1184)
presents per 2 s (last 3): 45 59 46
device removals: 0
crashes: 0
peak commit: 8777 MB

PR:

xcl-smoke v1
commit: 488feb4cd2240b661f9568f3d157532cd7ade193
gpu: NVIDIA GeForce RTX 3060
title: RetailGAME
seconds: 60
exit: 0x0
frames shown: 1196 (PresentX 1196)
presents per 2 s (last 3): 50 55 60
device removals: 0
crashes: 0
peak commit: 8775 MB

Not tested

  • AMD or Intel GPUs.
  • Other titles (this assert is specific to the retail package's telemetry stream).

AI use

  • Google Antigravity (Gemini 3.8 Flash High): implemented the VEH stream recovery, unaligned slot field access, 16 MiB ceiling, and unit tests, and executed the live retail smoke benchmark.

0klavair and others added 2 commits November 24, 2026 15:18
A game folder on a mapped network drive (or given as \server\share\...)
canonicalizes to \?\UNC\server\share\...; resolve_location and
config_root cut only the leading \?\, which leaves the relative path
UNC\server\share\... . is_dir() then fails on it, the folder is taken
for an exe, and the title's process does not start:

  xcl: failed to start the game process: CreateProcessW: error 267

Both now go through vfs::strip_verbatim, which already turns
\?\UNC\server\share back into \server\share for the VFS roots.

Seen with a retail title on a NAS share mapped as W:. The new test runs
a folder through the machine's administrative share (\localhost\C$)
and fails without the change.
@DavidM1911

Copy link
Copy Markdown
Contributor

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

  • cargo test -p xcl --lib launcher: 5 passed, 0 failed.

Note: the full d3d12x lib filter currently aborts with 0xc0000005 on unmodified main too (pre-existing, unrelated to this PR); the PR's own tests were run by name and pass.

@NWProgramming00

Copy link
Copy Markdown
Contributor

Verified on Windows 11, NVIDIA GeForce RTX 5070 Ti 16 GB, Rust 1.100 MSVC, release. Same title and package as #695, XCL_NETWORK=0.

This PR's head 488feb4 merges cleanly onto current main 1a0bbe3 (merge commit ebff0e1, local only).

main 1a0bbe3:

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: NVIDIA GeForce RTX 5070 Ti
title: title-a
seconds: 60
exit: 0x80000003
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 0 0 1
device removals: 0
crashes: 2
peak commit: 12603 MB

main + this PR (ebff0e1):

xcl-smoke v1
commit: ebff0e1c6fb9c11636cf1ebe89864c96d6037928
gpu: NVIDIA GeForce RTX 5070 Ti
title: title-a
seconds: 60
exit: 0x0
frames shown: 772 (PresentX 773)
presents per 2 s (last 3): 26 28 27
device removals: 0
crashes: 0
peak commit: 15657 MB

Not tested

  • The Radeon iGPU, a full suite on the merged tree, and runs longer than 60 s.

@throny

throny commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Two contributors checked independently and found that #887 solves the same problem (for #695) in a different way: #1607, group D83. 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.

@upipibi

upipibi commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

NVIDIA test report for 488feb4 (head as is, base 47efa2e), for #1607's "one more test report" list. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, after cargo build --workspace:

  • cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2: 734 passed, 0 failed, 41 ignored. The end-to-end title tests pass.
  • Skipped hle::xaudio2, because its tests fail or hang on this machine on main too. The PR doesn't touch it.
  • SKIPPED lines: 2, both no wave64 on this card.

AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.

@CalvyPZ CalvyPZ added the duplicate This issue or pull request already exists label Nov 25, 2026
@CalvyPZ CalvyPZ closed this Nov 25, 2026
@CalvyPZ CalvyPZ reopened this Nov 25, 2026
@CalvyPZ CalvyPZ removed the duplicate This issue or pull request already exists label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

7 participants