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

Open
github-bot wants to merge 2 commits from github-bot/gh-1233 into main AGit
Owner

@⁠Lum7nt on GitHub · 2026-11-24 13:27 UTC · original
Lum7nt:fix/retail-thread-stream-assert → main · +137 −3 · 3 files · 2 commits · open

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.
**@⁠Lum7nt** on GitHub · 2026-11-24 13:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/1233) `Lum7nt:fix/retail-thread-stream-assert` → `main` · +137 −3 · 3 files · 2 commits · open 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.
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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:47:57 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 13:47 UTC · original

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.

**@⁠DavidM1911** on GitHub · 2026-11-24 13:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/1233#issuecomment-7133340543) 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.
Author
Owner

@⁠NWProgramming00 on GitHub · 2026-11-25 13:53 UTC · original

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).

  • cargo test --release -p xcl --lib eh::tests on the merged tree: 7 passed, 0 failed, including thread_stream_assert_growth_ceiling_and_unaligned_slot.
  • scripts/smoke.ps1 -Seconds 60, same title, same card. On main the run ends with the 0x80000003 assert at the address from #695, as every run on this machine has since yesterday. With this PR merged, it reaches the end:

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.
**@⁠NWProgramming00** on GitHub · 2026-11-25 13:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/1233#issuecomment-7164436490) 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). - `cargo test --release -p xcl --lib eh::tests` on the merged tree: 7 passed, 0 failed, including `thread_stream_assert_growth_ceiling_and_unaligned_slot`. - `scripts/smoke.ps1 -Seconds 60`, same title, same card. On `main` the run ends with the `0x80000003` assert at the address from #695, as every run on this machine has since yesterday. With this PR merged, it reaches the end: `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.
Author
Owner

@⁠throny on GitHub · 2026-11-25 16:35 UTC · original

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.

**@⁠throny** on GitHub · 2026-11-25 16:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/1233#issuecomment-7168220964) <!-- xcl-1607-hint:D83 --> 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.
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 21:03 UTC · original

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.

**@⁠upipibi** on GitHub · 2026-11-25 21:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/1233#issuecomment-7174558766) 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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 04:17 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 04:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/1233#issuecomment-7182463040) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
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/1233/head:github-bot/gh-1233'
git switch 'github-bot/gh-1233'

Merge

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