Retail 1.0.2.1: queue-capacity assert at title+0x4dcbc9d on a complete package (VIctory reproduces it identically) #723

Closed
opened 2026-11-26 04:30:35 +00:00 by github-bot · 5 comments
Owner

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

Summary

Retail title (Series 1.0.2.1, complete package) reaches the menus and then dies on a queue-capacity assert inside the title at game_scarlett_master.exe+0x4dcbc9d. Marvisak/VIctory reproduces the identical assert on the same package, so this is a title expectation the port has to satisfy rather than one emulator's bug — and it blocks world entry in both.

Setup

  • Windows 11 Pro 26300, RTX 3080 Ti 12 GB (driver 610.60 / 32.0.16.1060), i7-12700KF.
  • Package <game folder>, all 111 files SHA-256-verified against the reference (an earlier corrupted copy caused a different assert at +0x1330a44; that is resolved).
  • xcl built at 4017f8f, XCL_NETWORK=0, XCL_ACTIVITY=1, XCL_FRAME_DUMP=2, run in the interactive console session (presents need it).

Result

The run gets to the menus: 28 presents, 19 draws, 3 dispatches, 6 background pipelines (report.json), frame dumps written. Then:

unhandled exception 0x80000003 in game_scarlett_master.exe+0x4dcbc9d
  rax=0x17fb0 rbx=0x50 rcx=0x704d114b8 rdx=0x1ec49f78f0 rsi=0x6c0 rdi=0x704d114b8
  rbp=0x1ec49ff930 r8=0x6c0 r9=0x20 ...

r8 = rsi = 0x6c0 — the call is trying to enqueue 1728 bytes.

What the site is

+0x4dcbc40 is a queue enqueue under a lock (0x140004b40): it copies [src+0x18] bytes from [src+8] into a destination object and asserts when [dest+0x10] - [dest+0x18] < len (capacity − size < requested). The only caller is 0x4e52a40; its only caller is 0x4e529bf (no strings anywhere in the chain).

Cross-runtime evidence

  • VIctory 97c78d1 (main) and its PR #346 head both die at the same +0x4dcbc9d on this package; with a diagnostic that skips breakpoints, the title retries the same RIP ~8×/s for minutes (2,106 skips in 4 min, no progress), i.e. the destination queue is genuinely full and skipping cannot help.
  • So the question is what the port must provide for that queue: which allocation backs the destination (XMem/heap/PLS), what its console size is, and whether the emulator's consumer should drain it.

Happy to instrument whatever you want (traces, dumps of the destination object at the assert, per-call sizes).

AI-assisted (Claude Code CLI via a model proxy; logs and addresses only, no game data).

**@⁠vladbondarenko97** on GitHub · 2026-11-24 04:06 UTC · [original](https://github.com/xcl-dev/xcl/issues/723) ## Summary Retail title (Series 1.0.2.1, complete package) reaches the menus and then dies on a **queue-capacity assert inside the title** at `game_scarlett_master.exe+0x4dcbc9d`. **Marvisak/VIctory reproduces the identical assert on the same package**, so this is a title expectation the port has to satisfy rather than one emulator's bug — and it blocks world entry in both. ## Setup - Windows 11 Pro 26300, RTX 3080 Ti 12 GB (driver 610.60 / `32.0.16.1060`), i7-12700KF. - Package `<game folder>`, all **111 files SHA-256-verified** against the reference (an earlier corrupted copy caused a different assert at `+0x1330a44`; that is resolved). - xcl built at **`4017f8f`**, `XCL_NETWORK=0`, `XCL_ACTIVITY=1`, `XCL_FRAME_DUMP=2`, run in the interactive console session (presents need it). ## Result The run gets to the menus: **28 presents, 19 draws, 3 dispatches, 6 background pipelines** (`report.json`), frame dumps written. Then: ``` unhandled exception 0x80000003 in game_scarlett_master.exe+0x4dcbc9d rax=0x17fb0 rbx=0x50 rcx=0x704d114b8 rdx=0x1ec49f78f0 rsi=0x6c0 rdi=0x704d114b8 rbp=0x1ec49ff930 r8=0x6c0 r9=0x20 ... ``` `r8 = rsi = 0x6c0` — the call is trying to enqueue **1728 bytes**. ## What the site is `+0x4dcbc40` is a queue enqueue under a lock (`0x140004b40`): it copies `[src+0x18]` bytes from `[src+8]` into a destination object and asserts when `[dest+0x10] - [dest+0x18] < len` (capacity − size < requested). The only caller is `0x4e52a40`; its only caller is `0x4e529bf` (no strings anywhere in the chain). ## Cross-runtime evidence - **VIctory `97c78d1` (main)** and **its PR #346 head** both die at the same `+0x4dcbc9d` on this package; with a diagnostic that skips breakpoints, the title **retries the same RIP ~8×/s for minutes** (2,106 skips in 4 min, no progress), i.e. the destination queue is genuinely full and skipping cannot help. - So the question is what the port must provide for that queue: which allocation backs the destination (XMem/heap/PLS), what its console size is, and whether the emulator's consumer should drain it. Happy to instrument whatever you want (traces, dumps of the destination object at the assert, per-call sizes). AI-assisted (Claude Code CLI via a model proxy; logs and addresses only, no game data).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:30:36 +00:00
Author
Owner

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

Update — full RE of the assert, and a RIP-targeted skip that unblocks the title

Follow-up to the registers/disassembly above, same title build (game_scarlett_master.exe, 1.0.2.1). At title+0x4dcbc9d, rcx is a 40-byte stream slot, not a GPU command buffer:

slot offset field
+0x00 descriptor pointer
+0x08 data buffer base
+0x10 capacity (dword)
+0x14 flag
+0x18 cursor (dword)
+0x1c watermark (dword)
+0x20 stream id (dword)
+0x24 state

Values at the failing enqueue (r8 = 0x6c0 = 1728 bytes):

  • capacity 0x18000 (98304), cursor = watermark = 0x17fb0 (98224) → 80 bytes left
  • stream id 0xF0A244EF; the same stream's other half sits at cursor 0x114c0 (70848)
  • its descriptor reads ready = 1, arg = 0, seq = 0x50

Structure, in case it is useful to you: registry array @ 0x9AE9950 (u16 count/capacity beside it); registrar 0x1D1B800(id, bytes) allocates a 0xD8 object with id @ +0xC0 holding two 40-byte slots selected by obj+0xC8; the ~297 packet writers go 0x4E52AA0 (reserve) → fill → 0x4E529A0 → 0x4E52A40 → 0x4DCAE80 (16-byte alignment record) → 0x4DCBC40 (this assert) → memcpy to slot->data + cursor. Publisher 0x3E14E0 stamps the descriptor, mfences, sets ready, then flips the half. The per-frame consumer 0x43A6B40 walks the registry, picks the older-seq half, and processes it only when ready & 1 and host+0x1548 >= desc->arg + 3.

Three streams register on this title: 0xC0520AEA (0x48000, per-thread default, index kept in TLS +0x10DC), 0xF0A244EF (0x18000, gated on a flag byte in the .data cluster 0xAA31C4D…0xAA31C56), and a config-driven id read from host+0x1128 (host global @ 0x9F13F20), capacity 0x10000.

A RIP-targeted skip of only this breakpoint unblocks the title. Comparing rip & 0xFFF == 0xC9D is ASLR-proof; advancing Rip by one lands on 0x4DCBC9E (jmp 0x4DCBC8A), i.e. the "enqueue failed / packet dropped" path. With that, a session-1 run on an RTX 3080 Ti holds 30.0 fps, 46 draws/frame, GPU 1.9–9.4 ms, zero WARN/ERROR lines, and renders the whole first-run flow (key art, Brightness calibration, Legal Notices) — previously it died at this breakpoint within a minute, before any of that. The dropped packets are (id, type, float) records (0.55, 0.2, 1000.0, 2000.0 …), i.e. parameter/telemetry-style data, and dropping them has shown no cost so far.

Question: the consumer's gate reads host+0x1548, which is 0 in our runs, so nothing drains and both halves fill. Does xcl advance that counter (and from where), or is the intended port behaviour to treat the channel as unavailable and reset the slot? We would much rather fix the drain than keep skipping the assert.

**@⁠vladbondarenko97** on GitHub · 2026-11-24 07:10 UTC · [original](https://github.com/xcl-dev/xcl/issues/723#issuecomment-7124705382) **Update — full RE of the assert, and a RIP-targeted skip that unblocks the title** Follow-up to the registers/disassembly above, same title build (`game_scarlett_master.exe`, 1.0.2.1). At `title+0x4dcbc9d`, `rcx` is a **40-byte stream slot**, not a GPU command buffer: | slot offset | field | |---|---| | `+0x00` | descriptor pointer | | `+0x08` | data buffer base | | `+0x10` | capacity (dword) | | `+0x14` | flag | | `+0x18` | cursor (dword) | | `+0x1c` | watermark (dword) | | `+0x20` | stream id (dword) | | `+0x24` | state | Values at the failing enqueue (`r8 = 0x6c0` = 1728 bytes): - capacity `0x18000` (98304), **cursor = watermark = `0x17fb0`** (98224) → 80 bytes left - stream id **`0xF0A244EF`**; the same stream's *other* half sits at cursor `0x114c0` (70848) - its descriptor reads `ready = 1`, `arg = 0`, `seq = 0x50` Structure, in case it is useful to you: registry `array @ 0x9AE9950` (u16 count/capacity beside it); registrar `0x1D1B800(id, bytes)` allocates a `0xD8` object with `id @ +0xC0` holding two 40-byte slots selected by `obj+0xC8`; the ~297 packet writers go `0x4E52AA0` (reserve) → fill → `0x4E529A0` → `0x4E52A40` → `0x4DCAE80` (16-byte alignment record) → `0x4DCBC40` (this assert) → memcpy to `slot->data + cursor`. Publisher `0x3E14E0` stamps the descriptor, `mfence`s, sets ready, then flips the half. The per-frame consumer `0x43A6B40` walks the registry, picks the older-`seq` half, and processes it only when `ready & 1` **and** `host+0x1548 >= desc->arg + 3`. Three streams register on this title: `0xC0520AEA` (0x48000, per-thread default, index kept in TLS `+0x10DC`), `0xF0A244EF` (0x18000, gated on a flag byte in the `.data` cluster `0xAA31C4D…0xAA31C56`), and a config-driven id read from `host+0x1128` (host global `@ 0x9F13F20`), capacity 0x10000. **A RIP-targeted skip of only this breakpoint unblocks the title.** Comparing `rip & 0xFFF == 0xC9D` is ASLR-proof; advancing `Rip` by one lands on `0x4DCBC9E` (`jmp 0x4DCBC8A`), i.e. the "enqueue failed / packet dropped" path. With that, a session-1 run on an RTX 3080 Ti holds **30.0 fps, 46 draws/frame, GPU 1.9–9.4 ms, zero WARN/ERROR lines**, and renders the whole first-run flow (key art, Brightness calibration, Legal Notices) — previously it died at this breakpoint within a minute, before any of that. The dropped packets are `(id, type, float)` records (0.55, 0.2, 1000.0, 2000.0 …), i.e. parameter/telemetry-style data, and dropping them has shown no cost so far. **Question:** the consumer's gate reads `host+0x1548`, which is 0 in our runs, so nothing drains and both halves fill. Does xcl advance that counter (and from where), or is the intended port behaviour to treat the channel as unavailable and reset the slot? We would much rather fix the drain than keep skipping the assert.
Author
Owner

@⁠vladbondarenko97 on GitHub · 2026-11-24 08:02 UTC · original

Update: with this assert skipped, xcl renders a non-black UI — and here is the exact patch

Following the RE above, I put the skip into cpp_exception_logger in crates/xcl/src/eh.rs on PR #273's head (ce8839b9), rebuilt, and ran it in an interactive session on an RTX 3080 Ti against the retail 1.0.2.1 package (XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=2):

// XCL_SKIP_QUEUE_ASSERT: the title's packet-stream capacity assert at title+0x4dcbc9d. Skipping the
// int3 lands on `jmp 0x4dcbc8a`, the enqueue's "packet dropped" path. The page offset is ASLR-proof.
if rec.ExceptionCode as u32 == 0x8000_0003 && std::env::var_os("XCL_SKIP_QUEUE_ASSERT").is_some() {
    let ctx = &mut *(*info).ContextRecord;
    if ctx.Rip as usize & 0xfff == 0xc9d {
        ctx.Rip += 1;
        return -1; // EXCEPTION_CONTINUE_EXECUTION
    }
}

The log then shows queue assert at game_scarlett_master.exe+0x4dcbc9d skipped (packet dropped), and instead of ending at ~28 presents the title keeps running:

xcl: D3D12.X: 4500 frames presented, 30.0 fps over the last 300
xcl: activity (2 s): 60 presents, 240 submits, 1260 draws, 60 dispatches,
     120 frame-event waits (0 timed out), 60 frame statistics (0 not flipped)
xcl: present: frame 1993 (3840x2160, format 28) written to ...\frame_1993.bmp
     – 517542 of 518400 samples not black
     raw texels (most common): 0xff2c2020×515565 0xfff9f9f9×1318 0xff000000×798 ...

That frame is the title screen — "ACCOUNT PICKER (Y) / SCREEN NARRATION (OFF) (X) / PLAYER (A)" over a dark background with white text, i.e. the same screen VIctory shows at this stage. Before this patch xcl's first menu was a black image and the process ended at the breakpoint about a minute in, so this assert was masking the whole UI path.

Two caveats stay true:

  • The packets are dropped, not consumed. The real fix is still whatever should be draining that stream (the host+0x1548 vs desc->0x2c + 3 gate above, and the ready-half selection in 0x43A6B40).
  • No BCPack request appears in this run — every logged DirectStorage request is options 0x1 (zlib), so #208/#273 are not exercised by it. In our runs the title only starts requesting BCPack once it gets further (its first-run flow stalls here on a static screen even with key injection reaching the window).

Happy to hand the patch over in whatever form is useful (snippet above, or a human-authored PR — AI-assisted investigation, Claude Code; all values come from our own retail runs).

**@⁠vladbondarenko97** on GitHub · 2026-11-24 08:02 UTC · [original](https://github.com/xcl-dev/xcl/issues/723#issuecomment-7125651616) **Update: with this assert skipped, xcl renders a non-black UI — and here is the exact patch** Following the RE above, I put the skip into `cpp_exception_logger` in `crates/xcl/src/eh.rs` on PR #273's head (`ce8839b9`), rebuilt, and ran it in an interactive session on an RTX 3080 Ti against the retail 1.0.2.1 package (`XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=2`): ```rust // XCL_SKIP_QUEUE_ASSERT: the title's packet-stream capacity assert at title+0x4dcbc9d. Skipping the // int3 lands on `jmp 0x4dcbc8a`, the enqueue's "packet dropped" path. The page offset is ASLR-proof. if rec.ExceptionCode as u32 == 0x8000_0003 && std::env::var_os("XCL_SKIP_QUEUE_ASSERT").is_some() { let ctx = &mut *(*info).ContextRecord; if ctx.Rip as usize & 0xfff == 0xc9d { ctx.Rip += 1; return -1; // EXCEPTION_CONTINUE_EXECUTION } } ``` The log then shows `queue assert at game_scarlett_master.exe+0x4dcbc9d skipped (packet dropped)`, and instead of ending at ~28 presents the title keeps running: ``` xcl: D3D12.X: 4500 frames presented, 30.0 fps over the last 300 xcl: activity (2 s): 60 presents, 240 submits, 1260 draws, 60 dispatches, 120 frame-event waits (0 timed out), 60 frame statistics (0 not flipped) xcl: present: frame 1993 (3840x2160, format 28) written to ...\frame_1993.bmp – 517542 of 518400 samples not black raw texels (most common): 0xff2c2020×515565 0xfff9f9f9×1318 0xff000000×798 ... ``` That frame is the title screen — "ACCOUNT PICKER (Y) / SCREEN NARRATION (OFF) (X) / PLAYER (A)" over a dark background with white text, i.e. the same screen VIctory shows at this stage. Before this patch xcl's first menu was a black image and the process ended at the breakpoint about a minute in, so this assert was masking the whole UI path. Two caveats stay true: - The packets are *dropped*, not consumed. The real fix is still whatever should be draining that stream (the `host+0x1548` vs `desc->0x2c + 3` gate above, and the ready-half selection in `0x43A6B40`). - No BCPack request appears in this run — every logged DirectStorage request is `options 0x1` (zlib), so #208/#273 are not exercised by it. In our runs the title only starts requesting BCPack once it gets further (its first-run flow stalls here on a static screen even with key injection reaching the window). Happy to hand the patch over in whatever form is useful (snippet above, or a human-authored PR — AI-assisted investigation, Claude Code; all values come from our own retail runs).
Author
Owner

@⁠vladbondarenko97 on GitHub · 2026-11-24 08:26 UTC · original

Update: with this assert skipped, xcl renders a non-black UI — and here is the exact patch

Following the RE above, I put the skip into cpp_exception_logger in crates/xcl/src/eh.rs on PR #273's head (ce8839b9), rebuilt, and ran it in an interactive session on an RTX 3080 Ti against the retail 1.0.2.1 package (XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=2):

// XCL_SKIP_QUEUE_ASSERT: the title's packet-stream capacity assert at title+0x4dcbc9d. Skipping the
// int3 lands on `jmp 0x4dcbc8a`, the enqueue's "packet dropped" path. The page offset is ASLR-proof.
if rec.ExceptionCode as u32 == 0x8000_0003 && std::env::var_os("XCL_SKIP_QUEUE_ASSERT").is_some() {
    let ctx = &mut *(*info).ContextRecord;
    if ctx.Rip as usize & 0xfff == 0xc9d {
        ctx.Rip += 1;
        return -1; // EXCEPTION_CONTINUE_EXECUTION
    }
}

The log then shows queue assert at game_scarlett_master.exe+0x4dcbc9d skipped (packet dropped), and instead of ending at ~28 presents the title keeps running:

xcl: D3D12.X: 4500 frames presented, 30.0 fps over the last 300
xcl: activity (2 s): 60 presents, 240 submits, 1260 draws, 60 dispatches,
     120 frame-event waits (0 timed out), 60 frame statistics (0 not flipped)
xcl: present: frame 1993 (3840x2160, format 28) written to ...\frame_1993.bmp
     – 517542 of 518400 samples not black
     raw texels (most common): 0xff2c2020×515565 0xfff9f9f9×1318 0xff000000×798 ...

That frame is the title screen — "ACCOUNT PICKER (Y) / SCREEN NARRATION (OFF) (X) / PLAYER (A)" over a dark background with white text, i.e. the same screen VIctory shows at this stage. Before this patch xcl's first menu was a black image and the process ended at the breakpoint about a minute in, so this assert was masking the whole UI path.

Two caveats stay true:

  • The packets are dropped, not consumed. The real fix is still whatever should be draining that stream (the host+0x1548 vs desc->0x2c + 3 gate above, and the ready-half selection in 0x43A6B40).
  • No BCPack request appears in this run — every logged DirectStorage request is options 0x1 (zlib), so #208/#273 are not exercised by it. In our runs the title only starts requesting BCPack once it gets further (its first-run flow stalls here on a static screen even with key injection reaching the window).

Happy to hand the patch over in whatever form is useful (snippet above, or a human-authored PR — AI-assisted investigation, Claude Code; all values come from our own retail runs).


Follow-up — the stream ids are per-thread names (joaat), and the stream we drop is the game thread's

tarekmania/gta6-namehash resolves the ids exactly:

id name registered size
0xF0A244EF GameThread 0x18000 (the stream that fills and asserts)
0xC0520AEA AudioThread 0x48000 (per-thread default, index kept in TLS +0x10DC)
0x7585D45D Unspecified —
0xE0122065 not in the dictionary 0x10000, id read from host+0x1128

So these are per-thread record streams (the id is the joaat of the thread's name), each with its own capacity and a 32 KB stack staging buffer per packet, and the one that fills is the game thread's. With the packets being (id, type, float) records (0.55, 0.2, 1000.0, 2000.0 …), a per-thread recorder whose consumer never runs reads like profiling/parameter tracing rather than a graphics queue — which is consistent with the title running normally here for 11,000+ frames with those packets dropped.

Either way the open question stands, and it is sharper now: why does the game thread's stream have no consumer in our runs? If it is a recorder, the port may simply want to treat it as unavailable (reset the slot); if the records carry per-frame state someone downstream reads, then dropping them is wrong and the drain has to be fixed.

**@⁠vladbondarenko97** on GitHub · 2026-11-24 08:26 UTC · [original](https://github.com/xcl-dev/xcl/issues/723#issuecomment-7126135324) **Update: with this assert skipped, xcl renders a non-black UI — and here is the exact patch** Following the RE above, I put the skip into `cpp_exception_logger` in `crates/xcl/src/eh.rs` on PR #273's head (`ce8839b9`), rebuilt, and ran it in an interactive session on an RTX 3080 Ti against the retail 1.0.2.1 package (`XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=2`): ```rust // XCL_SKIP_QUEUE_ASSERT: the title's packet-stream capacity assert at title+0x4dcbc9d. Skipping the // int3 lands on `jmp 0x4dcbc8a`, the enqueue's "packet dropped" path. The page offset is ASLR-proof. if rec.ExceptionCode as u32 == 0x8000_0003 && std::env::var_os("XCL_SKIP_QUEUE_ASSERT").is_some() { let ctx = &mut *(*info).ContextRecord; if ctx.Rip as usize & 0xfff == 0xc9d { ctx.Rip += 1; return -1; // EXCEPTION_CONTINUE_EXECUTION } } ``` The log then shows `queue assert at game_scarlett_master.exe+0x4dcbc9d skipped (packet dropped)`, and instead of ending at ~28 presents the title keeps running: ``` xcl: D3D12.X: 4500 frames presented, 30.0 fps over the last 300 xcl: activity (2 s): 60 presents, 240 submits, 1260 draws, 60 dispatches, 120 frame-event waits (0 timed out), 60 frame statistics (0 not flipped) xcl: present: frame 1993 (3840x2160, format 28) written to ...\frame_1993.bmp – 517542 of 518400 samples not black raw texels (most common): 0xff2c2020×515565 0xfff9f9f9×1318 0xff000000×798 ... ``` That frame is the title screen — "ACCOUNT PICKER (Y) / SCREEN NARRATION (OFF) (X) / PLAYER (A)" over a dark background with white text, i.e. the same screen VIctory shows at this stage. Before this patch xcl's first menu was a black image and the process ended at the breakpoint about a minute in, so this assert was masking the whole UI path. Two caveats stay true: - The packets are *dropped*, not consumed. The real fix is still whatever should be draining that stream (the `host+0x1548` vs `desc->0x2c + 3` gate above, and the ready-half selection in `0x43A6B40`). - No BCPack request appears in this run — every logged DirectStorage request is `options 0x1` (zlib), so #208/#273 are not exercised by it. In our runs the title only starts requesting BCPack once it gets further (its first-run flow stalls here on a static screen even with key injection reaching the window). Happy to hand the patch over in whatever form is useful (snippet above, or a human-authored PR — AI-assisted investigation, Claude Code; all values come from our own retail runs). --- **Follow-up — the stream ids are per-thread names (joaat), and the stream we drop is the game thread's** `tarekmania/gta6-namehash` resolves the ids exactly: | id | name | registered size | |---|---|---| | `0xF0A244EF` | **`GameThread`** | `0x18000` (the stream that fills and asserts) | | `0xC0520AEA` | **`AudioThread`** | `0x48000` (per-thread default, index kept in TLS `+0x10DC`) | | `0x7585D45D` | `Unspecified` | — | | `0xE0122065` | not in the dictionary | `0x10000`, id read from `host+0x1128` | So these are **per-thread record streams** (the id is the joaat of the thread's name), each with its own capacity and a 32 KB stack staging buffer per packet, and the one that fills is the *game thread's*. With the packets being `(id, type, float)` records (0.55, 0.2, 1000.0, 2000.0 …), a per-thread recorder whose consumer never runs reads like profiling/parameter tracing rather than a graphics queue — which is consistent with the title running normally here for 11,000+ frames with those packets dropped. Either way the open question stands, and it is sharper now: **why does the game thread's stream have no consumer in our runs?** If it is a recorder, the port may simply want to treat it as unavailable (reset the slot); if the records carry per-frame state someone downstream reads, then dropping them is wrong and the drain has to be fixed.
Author
Owner

@⁠vladbondarenko97 on GitHub · 2026-11-24 08:43 UTC · original

Better than dropping: grow the stream on the assert (validated, ~20 lines)

Follow-up to the workaround above. Instead of skipping the int3 and losing the packet, the VEH can grow the slot's buffer and then let the enqueue succeed:

// XCL_GROW_THREAD_STREAM: rcx is the 40-byte slot; +0x08 dataBase, +0x10 capacity, +0x18 cursor.
if rec.ExceptionCode as u32 == 0x8000_0003 && std::env::var_os("XCL_GROW_THREAD_STREAM").is_some() {
    let ctx = &mut *(*info).ContextRecord;
    if ctx.Rip as usize & 0xfff == 0xc9d {
        // VirtualAlloc(8 x capacity, min 1 MiB); copy the used bytes; write back base and capacity;
        // then re-run the capacity check at title+0x4dcbc47 so the memcpy happens normally.
        // (Full snippet in our bench log; ~20 lines, no per-packet exception afterwards.)
        ...
    }
}

On the retail title it fires exactly twice — once per half — and then never again:

xcl: thread-record stream at game_scarlett_master.exe+0x4dcbc9d: grown 98304 -> 1048576 bytes (cursor 98224), retrying
xcl: thread-record stream at game_scarlett_master.exe+0x4dcbc9d: grown 98304 -> 1048576 bytes (cursor 96768), retrying

and the rest of an 11,000-frame run has zero asserts and zero dropped packets. That is strictly better than the skip: nothing is silently discarded (so if anything downstream does read these records we are not corrupting it), and there is no exception per packet.

Combined with the naming result (0xF0A244EF = GameThread, 0xC0520AEA = AudioThread), the open question is unchanged and now very concrete: what should consume the game thread's records? Growing the buffer is a safe placeholder until that is answered; resetting the slot on "full" would also work if the records are pure tracing.

Outcome of the A/B test: with growing (zero drops, zero asserts) the title walks the same first-run flow — title screen → loading artwork → "ROCKSTAR GAMES LEGAL TERMS & POLICIES — Confirm setup and start the game" — and then sits there, exactly as it does with the skip. So dropping the game thread's records is not what stalls the frontend; the stall is downstream of this stream, which supports treating these records as tracing rather than as data something consumes.

(For completeness, a third party has also now reported BCPack BC1 requests filling in xcl#878 — 2,096 requests / 149,528,576 bytes — so the texture side is moving on several machines.)

**@⁠vladbondarenko97** on GitHub · 2026-11-24 08:43 UTC · [original](https://github.com/xcl-dev/xcl/issues/723#issuecomment-7126487282) **Better than dropping: grow the stream on the assert (validated, ~20 lines)** Follow-up to the workaround above. Instead of skipping the int3 and losing the packet, the VEH can grow the slot's buffer and then let the enqueue succeed: ```rust // XCL_GROW_THREAD_STREAM: rcx is the 40-byte slot; +0x08 dataBase, +0x10 capacity, +0x18 cursor. if rec.ExceptionCode as u32 == 0x8000_0003 && std::env::var_os("XCL_GROW_THREAD_STREAM").is_some() { let ctx = &mut *(*info).ContextRecord; if ctx.Rip as usize & 0xfff == 0xc9d { // VirtualAlloc(8 x capacity, min 1 MiB); copy the used bytes; write back base and capacity; // then re-run the capacity check at title+0x4dcbc47 so the memcpy happens normally. // (Full snippet in our bench log; ~20 lines, no per-packet exception afterwards.) ... } } ``` On the retail title it fires exactly twice — once per half — and then never again: ``` xcl: thread-record stream at game_scarlett_master.exe+0x4dcbc9d: grown 98304 -> 1048576 bytes (cursor 98224), retrying xcl: thread-record stream at game_scarlett_master.exe+0x4dcbc9d: grown 98304 -> 1048576 bytes (cursor 96768), retrying ``` and the rest of an 11,000-frame run has **zero asserts and zero dropped packets**. That is strictly better than the skip: nothing is silently discarded (so if anything downstream does read these records we are not corrupting it), and there is no exception per packet. Combined with the naming result (`0xF0A244EF` = `GameThread`, `0xC0520AEA` = `AudioThread`), the open question is unchanged and now very concrete: **what should consume the game thread's records?** Growing the buffer is a safe placeholder until that is answered; resetting the slot on "full" would also work if the records are pure tracing. **Outcome of the A/B test**: with growing (zero drops, zero asserts) the title walks the same first-run flow — title screen → loading artwork → **"ROCKSTAR GAMES LEGAL TERMS & POLICIES — Confirm setup and start the game"** — and then sits there, exactly as it does with the skip. So **dropping the game thread's records is not what stalls the frontend**; the stall is downstream of this stream, which supports treating these records as tracing rather than as data something consumes. (For completeness, a third party has also now reported BCPack BC1 requests filling in xcl#878 — 2,096 requests / 149,528,576 bytes — so the texture side is moving on several machines.)
Author
Owner

@⁠vladbondarenko97 on GitHub · 2026-11-24 13:03 UTC · original

Root cause found elsewhere, closing as a duplicate of #695. This PC has no active audio playback device (every render endpoint is Unknown). As @⁠Placebola showed in #695, the title's audio setup then returns with a lock still held, and the audio thread never drains the per-thread 96 KiB command streams. The "GameThread stream" I named above is one of them. The skip/grow VEH workarounds above only hide that.

#887 (silent spatial endpoint) removes the trap on this machine on the retail title: main 47efa2e traps at 27.6 s, the #887 head runs on with spatial audio: using XCL's silent renderer. Details in https://github.com/ivall/xcl/pull/887#issuecomment-7132280693. Workaround without #887: turn on any playback device before starting the title.

AI use: Claude Code (Claude Opus 5.5) did the test runs and drafted this; I reviewed it.

**@⁠vladbondarenko97** on GitHub · 2026-11-24 13:03 UTC · [original](https://github.com/xcl-dev/xcl/issues/723#issuecomment-7132287658) **Root cause found elsewhere, closing as a duplicate of #695.** This PC has no active audio playback device (every render endpoint is `Unknown`). As @⁠Placebola showed in #695, the title's audio setup then returns with a lock still held, and the audio thread never drains the per-thread 96 KiB command streams. The "GameThread stream" I named above is one of them. The skip/grow VEH workarounds above only hide that. #887 (silent spatial endpoint) removes the trap on this machine on the retail title: `main` `47efa2e` traps at 27.6 s, the #887 head runs on with `spatial audio: using XCL's silent renderer`. Details in https://github.com/ivall/xcl/pull/887#issuecomment-7132280693. Workaround without #887: turn on any playback device before starting the title. *AI use: Claude Code (Claude Opus 5.5) did the test runs and drafted this; I reviewed it.*
This discussion has been locked. Commenting is limited to contributors.
No description provided.