image+0x1330a44 is reached on a 66%-downloaded folder (shaders.rpf reads as zeros), and the "written" test asks a static object #632

Open
opened 2026-11-28 17:45:36 +00:00 by AnastasisKon · 7 comments
AnastasisKon commented 2026-11-28 17:45:36 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T17:45:36Z.


What

The int3 at image+0x1330a44 (the boot shader-database write) is reached on a game folder that is 66% downloaded, and the archives it needs read as zeros. Recording the measurement so the next person does not spend a run on it, plus two facts from the image about who answers "not written".

Measured (torrent resume, not file sizes)

pieces in ~/Library/Application Support/qBittorrent/BT_backup/<hash>.fastresume is one byte per piece (non-zero = have); against info.piece length (16 MiB) and info.files in the matching .torrent: 8,829 of 13,345 pieces = 148.1 GB of 223.9 GB.

  • shaders.rpf: pieces 0, 12 and 24 of 25 only — header, one middle piece, last piece (the client's first/last-piece priority). dd at 100 MiB returns zeros. The file is preallocated to its full 411,695,600 bytes, so its size, its header and its last piece all look valid.
  • Also partial: packs.rpf 29/287, levels.rpf 2,095/4,540, story000.rpf 171/1,195, core_bvh4.rpf 188/495, navmeshes.rpf 205/401, core_restofworld.rpf 12/78.
  • Complete: anim, audio, data, common, script, textures, appdata0.

From the image, no run

  • 0x1331110 is xor eax,eax; cmp cl,3; lea image+0x6dd5b08; cmove rax,rdx; ret, and 0x13310f0 is kind == 3. So the destination whose +0x30 answers false is the singleton at image+0x6dd5b08 in .data, with vtable image+0x66fdd40 in .rdata (a .data file offset misaligns that dump): +0x30 = image+0x1331210, +0x38 = image+0x1331100, +0x28 = image+0x1331660 (a source of the -1/-3 sentinels in the notes).

Not claimed

That the missing shader pieces are the cause of the missing state. It is a second, independent way to reach "a shader database that references a state the loaded data does not have", and it means no run on this folder can settle what the write needs until the download finishes.

Docs PR follows and only touches the image+0x1330a44 section of docs/native-host.md.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6669144735 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/632). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T17:45:36Z. --- ## What The int3 at `image+0x1330a44` (the boot shader-database write) is reached on a game folder that is **66% downloaded**, and the archives it needs read as zeros. Recording the measurement so the next person does not spend a run on it, plus two facts from the image about who answers "not written". ## Measured (torrent resume, not file sizes) `pieces` in `~/Library/Application Support/qBittorrent/BT_backup/<hash>.fastresume` is one byte per piece (non-zero = have); against `info.piece length` (16 MiB) and `info.files` in the matching `.torrent`: **8,829 of 13,345 pieces = 148.1 GB of 223.9 GB**. - `shaders.rpf`: pieces 0, 12 and 24 of 25 only — header, one middle piece, last piece (the client's first/last-piece priority). `dd` at 100 MiB returns zeros. The file is preallocated to its full 411,695,600 bytes, so its size, its header and its last piece all look valid. - Also partial: `packs.rpf` 29/287, `levels.rpf` 2,095/4,540, `story000.rpf` 171/1,195, `core_bvh4.rpf` 188/495, `navmeshes.rpf` 205/401, `core_restofworld.rpf` 12/78. - Complete: `anim`, `audio`, `data`, `common`, `script`, `textures`, `appdata0`. ## From the image, no run - `0x1331110` is `xor eax,eax; cmp cl,3; lea image+0x6dd5b08; cmove rax,rdx; ret`, and `0x13310f0` is `kind == 3`. So the destination whose `+0x30` answers false is the singleton at `image+0x6dd5b08` in `.data`, with vtable `image+0x66fdd40` in `.rdata` (a `.data` file offset misaligns that dump): `+0x30` = `image+0x1331210`, `+0x38` = `image+0x1331100`, `+0x28` = `image+0x1331660` (a source of the `-1`/`-3` sentinels in the notes). ## Not claimed That the missing shader pieces are *the* cause of the missing state. It is a second, independent way to reach "a shader database that references a state the loaded data does not have", and it means no run on this folder can settle what the write needs until the download finishes. Docs PR follows and only touches the `image+0x1330a44` section of `docs/native-host.md`.
AnastasisKon commented 2026-11-28 20:04:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T20:04:18Z.


Static read of the writer state's producer and its entry point, on game_scarlett_master.exe (SHA-256 e95020b2…d5a08993, the release's own !File Hash.txt value). Analysis only, nothing from the game is in this comment.

Command that produced it:

/opt/homebrew/opt/llvm/bin/llvm-objdump -d --no-show-raw-insn --x86-asm-syntax=intel \
  "…/GTA6.Xbox.v1.0.2.1-CYBERLEEK/game_scarlett_master.exe" \
  --start-address=0x1418bc320 --stop-address=0x1418bc460

1. [S+0x38] and [S+0x40] are filled, and by this function: 0x1418bc320. It allocates the 0x78-byte state, zeroes all of it, then installs the two lanes:

1418bc325  mov ecx, 0x78 ; call 0x144f97130        ; S = alloc(0x78)
1418bc33d  vmovups [rax+0x40], ymm0                 ; zero S+0x40..0x5f
1418bc342  vmovups [rax], ymm0                      ; zero S+0x00..0x1f
1418bc346  vmovups [rax+0x20], ymm0                 ; zero S+0x20..0x3f
1418bc34b  vmovups [rax+0x50], ymm0                 ; zero S+0x50..0x6f
1418bc35a  call qword [0x146dd5b08]                 ; the static singleton this repo already names
1418bc361  mov [rsi+0x40], rax                      ; lane 1
1418bc365  call 0x144f97130 (0x38) ; zero it
1418bc37c  mov [rsi+0x38], rax                      ; lane 0
1418bc388  mov [rsi+0x70], rax (from 0x1418bc395)

Its caller is 0x1428cd98c (mov [rbx+0x10020], rax, the S = [rsi+0x10020] this repo measures), and it hands S straight to the writer entry:

1428cd98c  mov [rbx+0x10020], rax
1428cd996  mov r8d, [rbx+0x10008]        ; size
1428cd99d  mov rdx, [rbx+0x10000]        ; data
1428cd9a4  call 0x1413315f0              ; (S, data, size)

So the two pointers are not "never set": they are a zero-filled 0x38-byte object and an object taken from singleton slot 0, which is why 0x18171e400 reads as zeros and 0x18181f0a0 reads {0x1478f6a50, 0x47bf, 0} — a request-shaped object, not a table.

2. [S+0x60] is cleared by the writer entry itself, on purpose: 0x1413315f0.

1413315f5  test rdx,rdx ; je exit          ; data null -> nothing set
141331605  mov [rcx+0x58], r8d             ; S+0x58 = size
141331609  mov [rcx+0x50], rdx             ; S+0x50 = data
14133160d  mov byte [rcx+0x30], 0
141331611  mov qword [rcx+0x68], 0
141331649  mov dword [rsi+0x5c], 0         ; element index
141331650  mov qword [rsi+0x60], 0         ; destination = null

That reframes the open item: the null destination at the trap is not a step that failed to run. 0x1330d69's [S+0x60] == 0 is the state the entry deliberately leaves, and the destination is installed later — inside 0x1330cd0, from the record's stream. Which is exactly the stream that measures as closed for this record: flag 3 at [result+0x10] picks the lane, and that lane's device reads kind 0x1b, whose handler at 0x55330d6 returns 0xfffffffd without copying (the kind 0x16 device on the other lane answers 0).

So the question worth asking next is not "what setup is missing to fill S+0x60" but "who installs [S+0x60] inside 0x1330cd0, and why not for a record whose flag is 3" — with 0x1331110 (the object [rsp+0x38] that refuses, per the existing note) still the thing to read. Also note 0x1331650 gives a stable instrument: break at 0x133165b/0x1331650 and [S+0x60] is known-zero, so any non-zero value observed later in the same state came from the completion test.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7245013324 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/632#issuecomment-7245013324). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T20:04:18Z. --- Static read of the writer state's producer and its entry point, on `game_scarlett_master.exe` (SHA-256 `e95020b2…d5a08993`, the release's own `!File Hash.txt` value). Analysis only, nothing from the game is in this comment. Command that produced it: ``` /opt/homebrew/opt/llvm/bin/llvm-objdump -d --no-show-raw-insn --x86-asm-syntax=intel \ "…/GTA6.Xbox.v1.0.2.1-CYBERLEEK/game_scarlett_master.exe" \ --start-address=0x1418bc320 --stop-address=0x1418bc460 ``` **1. `[S+0x38]` and `[S+0x40]` are filled, and by this function: `0x1418bc320`.** It allocates the 0x78-byte state, zeroes all of it, then installs the two lanes: ``` 1418bc325 mov ecx, 0x78 ; call 0x144f97130 ; S = alloc(0x78) 1418bc33d vmovups [rax+0x40], ymm0 ; zero S+0x40..0x5f 1418bc342 vmovups [rax], ymm0 ; zero S+0x00..0x1f 1418bc346 vmovups [rax+0x20], ymm0 ; zero S+0x20..0x3f 1418bc34b vmovups [rax+0x50], ymm0 ; zero S+0x50..0x6f 1418bc35a call qword [0x146dd5b08] ; the static singleton this repo already names 1418bc361 mov [rsi+0x40], rax ; lane 1 1418bc365 call 0x144f97130 (0x38) ; zero it 1418bc37c mov [rsi+0x38], rax ; lane 0 1418bc388 mov [rsi+0x70], rax (from 0x1418bc395) ``` Its caller is `0x1428cd98c` (`mov [rbx+0x10020], rax`, the `S = [rsi+0x10020]` this repo measures), and it hands `S` straight to the writer entry: ``` 1428cd98c mov [rbx+0x10020], rax 1428cd996 mov r8d, [rbx+0x10008] ; size 1428cd99d mov rdx, [rbx+0x10000] ; data 1428cd9a4 call 0x1413315f0 ; (S, data, size) ``` So the two pointers are not "never set": they are a zero-filled 0x38-byte object and an object taken from singleton slot 0, which is why `0x18171e400` reads as zeros and `0x18181f0a0` reads `{0x1478f6a50, 0x47bf, 0}` — a request-shaped object, not a table. **2. `[S+0x60]` is cleared by the writer entry itself, on purpose: `0x1413315f0`.** ``` 1413315f5 test rdx,rdx ; je exit ; data null -> nothing set 141331605 mov [rcx+0x58], r8d ; S+0x58 = size 141331609 mov [rcx+0x50], rdx ; S+0x50 = data 14133160d mov byte [rcx+0x30], 0 141331611 mov qword [rcx+0x68], 0 141331649 mov dword [rsi+0x5c], 0 ; element index 141331650 mov qword [rsi+0x60], 0 ; destination = null ``` That reframes the open item: the null destination at the trap is not a step that failed to run. `0x1330d69`'s `[S+0x60] == 0` is the state the entry deliberately leaves, and the destination is installed later — inside `0x1330cd0`, from the record's stream. Which is exactly the stream that measures as closed for this record: flag `3` at `[result+0x10]` picks the lane, and that lane's device reads kind `0x1b`, whose handler at `0x55330d6` returns `0xfffffffd` without copying (the kind `0x16` device on the other lane answers `0`). So the question worth asking next is not "what setup is missing to fill `S+0x60`" but "who installs `[S+0x60]` inside `0x1330cd0`, and why not for a record whose flag is 3" — with `0x1331110` (the object `[rsp+0x38]` that refuses, per the existing note) still the thing to read. Also note `0x1331650` gives a stable instrument: break at `0x133165b`/`0x1331650` and `[S+0x60]` is known-zero, so any non-zero value observed later in the same state came from the completion test.
AnastasisKon commented 2026-11-28 20:04:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T20:04:48Z.


Read off the image with llvm-objdump -d --no-show-raw-insn -j .text "/Volumes/Anastasis' SSD/GTA VI v1.0.2.1/game_scarlett_master.exe" > /tmp/scarlett.asm (a static read; no run needed), the completion test at image+0x1330d69 is not a pointer test at all — it is a two-bit field in a decoded descriptor, and that field is what sends the writer down the livelock instead of the copy.

The whole tail of 0x1330cd0, from the lane choice:

141330d1a: movq  (%rax,%rbp,8), %rcx      ; the packed descriptor, from a table
141330d23: movq  %rdi, %r8
141330d2e: callq 0x14550db40              ; decode(rcx = packed, dl = kind, r8 = &scratch)
141330d33: movb  0x10(%rdi), %r12b        ; flag = scratch+0x10   <- the 2-bit field
141330d3a: callq 0x1413310f0              ; eax = (flag == 3)
141330d4c: movq  0x38(%rsi,%rax,8), %rdi  ; lane = [S + 0x38 + (flag==3)*8]
141330d51: callq 0x141331110              ; (cl == 3) ? &0x146dd5b08 : NULL
141330d56: testq %rax,%rax ; setne %al    ; al = (flag == 3)
141330d61: testq %rbx,%rbx ; sete  %cl    ; cl = ([S+0x60] == 0)
141330d67: testb %cl,%al
141330d69: jne   0x141330ff9              ; taken iff  flag == 3  AND  [S+0x60] == 0
141330d6f: ...                            ; otherwise: fall through into the copy path

So, precisely: the livelock at 0x1330ff9 is entered exactly when the descriptor's flag field is 3 and the destination is null; a flag other than 3 copies even with a null destination, and a non-null destination copies even with flag 3. [S+0x60] is zero by the initialiser's own store (the movq $0,0x60(%rcx) at image+0x1331650 recorded on PR #75), so on this run the deciding term is the flag alone.

flag is not a byte of the object and not a "kind": 0x14550db40 also writes it into the scratch's +0x10, and it is taken from the packed value's high bits, by kind — packed >> 0x3e for kind 2 (0x14550db69), (packed >> 0x3c) & 3 for kind 3 (0x14550dbbc), (packed >> 0x38) & 3 for kind 4 (via 0x14550dbf9 → 0x14550dbb8), and zero for any other kind, where the whole scratch is zeroed (0x14550dbfb: vxorps + movl $0,0x10(%r8)). So a descriptor whose kind is not 2, 3 or 4 can never reach flag 3, and the writer would copy; something is handing it a kind 2/3/4 descriptor with that field set to all ones.

Two things follow for the hunt, and they narrow it a lot:

  1. The +0x38/+0x40 lane is indexed by the same term, not chosen by [lane+0x10] == 3: index 1 ([S+0x40]) is read only when flag == 3, which is why the failing chunk's lane is [S+0x40] and [S+0x38] reads 0 — consistent with the VICTORY_BREAK_AT=13310b0 capture already recorded, and the two are the same fact, not two.
  2. What is left to find is the table entry (%rax + rbp*8) and its kind byte dl: rax is [S+0x08] + rcx (from 0x141330d07/0x141330d13) and rbp is the element index the loop carries. The kind is what selects which bits are the flag, so the question "why flag 3" is "which descriptor did it pick, and what kind is it".

This does not touch the earlier conclusion (the id is found; has answers true; the refusal is on the write path); it replaces "the setup that fills [S+0x38]/[S+0x40]/[S+0x60]/[S+0x68] is the missing piece" with a predicate the run can be made to print: read (%rax + rbp*8) and dl at 0x141330d1a with VICTORY_BREAK_AT=1330d1a and the two questions become one VICTORY_DUMP_MEM of that qword.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7245019621 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/632#issuecomment-7245019621). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T20:04:48Z. --- Read off the image with `llvm-objdump -d --no-show-raw-insn -j .text "/Volumes/Anastasis' SSD/GTA VI v1.0.2.1/game_scarlett_master.exe" > /tmp/scarlett.asm` (a static read; no run needed), the completion test at `image+0x1330d69` is not a pointer test at all — it is a **two-bit field** in a decoded descriptor, and that field is what sends the writer down the livelock instead of the copy. The whole tail of `0x1330cd0`, from the lane choice: ``` 141330d1a: movq (%rax,%rbp,8), %rcx ; the packed descriptor, from a table 141330d23: movq %rdi, %r8 141330d2e: callq 0x14550db40 ; decode(rcx = packed, dl = kind, r8 = &scratch) 141330d33: movb 0x10(%rdi), %r12b ; flag = scratch+0x10 <- the 2-bit field 141330d3a: callq 0x1413310f0 ; eax = (flag == 3) 141330d4c: movq 0x38(%rsi,%rax,8), %rdi ; lane = [S + 0x38 + (flag==3)*8] 141330d51: callq 0x141331110 ; (cl == 3) ? &0x146dd5b08 : NULL 141330d56: testq %rax,%rax ; setne %al ; al = (flag == 3) 141330d61: testq %rbx,%rbx ; sete %cl ; cl = ([S+0x60] == 0) 141330d67: testb %cl,%al 141330d69: jne 0x141330ff9 ; taken iff flag == 3 AND [S+0x60] == 0 141330d6f: ... ; otherwise: fall through into the copy path ``` So, precisely: **the livelock at `0x1330ff9` is entered exactly when the descriptor's flag field is `3` and the destination is null; a flag other than 3 copies even with a null destination, and a non-null destination copies even with flag 3.** `[S+0x60]` is zero by the initialiser's own store (the `movq $0,0x60(%rcx)` at `image+0x1331650` recorded on PR #75), so on this run the deciding term is the flag alone. `flag` is not a byte of the object and not a "kind": `0x14550db40` also writes it into the scratch's `+0x10`, and it is taken from the packed value's high bits, by kind — `packed >> 0x3e` for kind 2 (`0x14550db69`), `(packed >> 0x3c) & 3` for kind 3 (`0x14550dbbc`), `(packed >> 0x38) & 3` for kind 4 (via `0x14550dbf9` → `0x14550dbb8`), and **zero for any other kind**, where the whole scratch is zeroed (`0x14550dbfb`: `vxorps` + `movl $0,0x10(%r8)`). So a descriptor whose kind is not 2, 3 or 4 can never reach flag 3, and the writer would copy; something is handing it a kind 2/3/4 descriptor with that field set to all ones. Two things follow for the hunt, and they narrow it a lot: 1. The `+0x38`/`+0x40` lane is *indexed by the same term*, not chosen by `[lane+0x10] == 3`: index 1 (`[S+0x40]`) is read only when flag == 3, which is why the failing chunk's lane is `[S+0x40]` and `[S+0x38]` reads 0 — consistent with the `VICTORY_BREAK_AT=13310b0` capture already recorded, and the two are the same fact, not two. 2. What is left to find is the **table entry `(%rax + rbp*8)` and its kind byte `dl`**: `rax` is `[S+0x08] + rcx` (from `0x141330d07`/`0x141330d13`) and `rbp` is the element index the loop carries. The kind is what selects which bits are the flag, so the question "why flag 3" is "which descriptor did it pick, and what kind is it". This does not touch the earlier conclusion (the id is found; `has` answers true; the refusal is on the write path); it replaces "the setup that fills `[S+0x38]`/`[S+0x40]`/`[S+0x60]`/`[S+0x68]` is the missing piece" with a predicate the run can be made to print: read `(%rax + rbp*8)` and `dl` at `0x141330d1a` with `VICTORY_BREAK_AT=1330d1a` and the two questions become one `VICTORY_DUMP_MEM` of that qword.
AnastasisKon commented 2026-11-28 20:25:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T20:25:35Z.


A measurement that bears on whether the trap is code or data, taken while the folder is still downloading. Archive check at 22:25, 32 samples per archive, on "/Volumes/Anastasis' SSD/GTA6.Xbox.v1.0.2.1-CYBERLEEK" (tools/macos/check-game-data.sh from #635):

shaders.rpf    392.6 MiB  32 samples, 29 holes (90%)   mtime 12:59
packs.rpf        4.5 GiB  32 samples, 28 holes (87%)   mtime 21:55
navmeshes.rpf    6.2 GiB  32 samples, 10 holes (31%)   mtime 21:42
levels.rpf      70.9 GiB  32 samples,  4 holes (12%)   mtime 21:56
movies.rpf       8.2 GiB  32 samples,  3 holes (9%)    mtime 21:03
anim, audio, common, data, script, textures            ok

shaders.rpf is the archive this boot database is written from, it is 90% zeros, and it has not been touched since 12:59 while the downloader works through packs/levels/movies. That is exactly the condition this issue's title describes.

Two notes on how that sits with docs/native-host.md:

  • The "the data is not what is missing here" bullet (the 2026-11-26 8c20f83b comparison) rules out missing archives — the root set is complete and the world's sit under pack/. It does not address holes inside shaders.rpf, which is a different claim and is the one this measurement speaks to.
  • The closed-stream chain measured at 0x13310b0 (lane flag 3 -> kind 0x1b device -> -3) is consistent with a database being assembled from records that read as zeros, so the two readings are not mutually exclusive either.

So the cheap experiment, before any more analysis of [S+0x60]: let the downloader fill shaders.rpf, re-run check-game-data.sh, then run once. If the trap is gone, no code change was needed and this issue can be closed on the data. If it survives a clean shaders.rpf, the trap is the host or the title state and the addresses in the comment above are the place to continue — in particular 0x1330fc4 (mov [rsi+0x60], rbx, the store that records the destination, taken only on the success path just before mov al,1 at 0x1330fe3) and 0x1331110 (which returns the singleton at 0x146dd5b08 only when the lane's flag byte is 3, else NULL).

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7245277189 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/632#issuecomment-7245277189). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T20:25:35Z. --- A measurement that bears on whether the trap is code or data, taken while the folder is still downloading. Archive check at **22:25**, 32 samples per archive, on `"/Volumes/Anastasis' SSD/GTA6.Xbox.v1.0.2.1-CYBERLEEK"` (`tools/macos/check-game-data.sh` from #635): ``` shaders.rpf 392.6 MiB 32 samples, 29 holes (90%) mtime 12:59 packs.rpf 4.5 GiB 32 samples, 28 holes (87%) mtime 21:55 navmeshes.rpf 6.2 GiB 32 samples, 10 holes (31%) mtime 21:42 levels.rpf 70.9 GiB 32 samples, 4 holes (12%) mtime 21:56 movies.rpf 8.2 GiB 32 samples, 3 holes (9%) mtime 21:03 anim, audio, common, data, script, textures ok ``` `shaders.rpf` is the archive this boot database is written from, it is 90% zeros, and it has not been touched since 12:59 while the downloader works through `packs`/`levels`/`movies`. That is exactly the condition this issue's title describes. Two notes on how that sits with `docs/native-host.md`: - The "**the data is not what is missing here**" bullet (the `2026-11-26 8c20f83b` comparison) rules out *missing archives* — the root set is complete and the world's sit under `pack/`. It does not address holes *inside* `shaders.rpf`, which is a different claim and is the one this measurement speaks to. - The closed-stream chain measured at `0x13310b0` (lane flag `3` -> kind `0x1b` device -> `-3`) is consistent with a database being assembled from records that read as zeros, so the two readings are not mutually exclusive either. So the cheap experiment, before any more analysis of `[S+0x60]`: let the downloader fill `shaders.rpf`, re-run `check-game-data.sh`, then run once. If the trap is gone, no code change was needed and this issue can be closed on the data. If it survives a clean `shaders.rpf`, the trap is the host or the title state and the addresses in the comment above are the place to continue — in particular `0x1330fc4` (`mov [rsi+0x60], rbx`, the store that records the destination, taken only on the success path just before `mov al,1` at `0x1330fe3`) and `0x1331110` (which returns the singleton at `0x146dd5b08` only when the lane's flag byte is `3`, else `NULL`).
AnastasisKon commented 2026-11-28 20:28:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T20:28:45Z.


Measured at the writer's own decision point, VICTORY_BREAK_AT=1330cea (the cmpl %eax,%ebp right after the record and the index are loaded) with VICTORY_PEEK=rcx,rdx+0x5c,rdx+0x50,rdx+0x8,rdx+0x38,rdx+0x40, on the 163 GB partial folder, release build of 95d9caa1:

peek rdx+0x5c = 0x0            ; [S+0x5c], the element index
peek rdx+0x50 = 0x181796800    ; [S+0x50], the container
peek rdx+0x8  = 0x1f0          ; [S+0x08], 496 bytes remaining
peek rdx+0x38 = 0x18171d480    ; lane 0   -- NOT null in this run
peek rdx+0x40 = 0x1817abf70    ; lane 1   -- the lane the chunk goes through
[rcx] 308000100000018 308000100000018 0 30000000fe12fc30 30000000ed98b440 100 d9f50b2b90e3e108 6caa6e0bafeb3c2b
call chain image+ [1330cea, 133096e, 51d2319, 59febb9, 59fea77, 223762c, 2236f78, 2236dae, 2240eab, 81b253, ...]

Read against the code, that rcx is the record 0x1330cd0(rcx = record, rdx = S) works on, and it is a 0x40-byte object whose qword at +0 is 0308000100000018 = u32 +0x00 = 0x18 (the descriptor table's offset from the record), u16 +0x04 = 1 (its bound), u8 +0x07 = 3 (the kind); its descriptor table at +0x18 holds 0x30000000fe12fc30 and 0x30000000ed98b440, and the entry the writer takes is index [S+0x5c] = 0.

Three things follow, and two of them correct what is written above the line.

  1. Flag 3 is not an anomaly, it is this record's normal state. (0x30000000fe12fc30 >> 0x3c) & 3 == 3, and the second descriptor carries 3 in the same bits: every entry of this record decodes to flag 3, so the jne 0x1330ff9 path (hand the chunk to the interface, vtable+0x38) is the path this record is supposed to take, not a wrong turn. What makes it look like a dead end is only that the interface's own write then refuses.
  2. The write is not on a spin because of the index/bound check. u16 +0x04 = 1 against index 0: had the index been 1, 0x1330cea would have taken the je 0x1330fe3 success return. It is 0, so the one element this record has goes to the interface — the same conclusion as the kind-3/0x1b refusal, reached from the other side.
  3. "The setup that fills [S+0x38]/[S+0x40]/[S+0x60]/[S+0x68] is the missing piece" is not supported by this run. Both lanes are non-null here (0x18171d480, 0x1817abf70), [S+0x08] = 0x1f0 (where the earlier capture had 0x10000), and the container is 0x181796800. So the state is populated; what fails is further down, in the interface's per-chunk write with the lane's device of kind 0x1b. The [S+0x38] == 0 of the older capture is a different moment or a different lane count, not a state that was never set.

So the boot blocker stands as: this record (kind 3, one element, flag 3) is handed to the interface, whose write for the lane's device of kind 0x1b answers -3, and the caller's completion test then answers false, which is the assert. The next question is the device, not the writer state: where the lane 0x1817abf70 gets the device it passes at +0x60 as 0x1842d1cb0 with [device] = 0x1b, and whether a complete folder's shader database gives it a kind-0x16 device instead (the first chunk's device answers 0, per the existing VICTORY_BREAK_AT=13310b0 capture).

Two caveats on the method, so the numbers are reproducible: VICTORY_BREAK_AT leaves the run to die (exit 3, the title's own crash reporter), so the log after the break says nothing about the title's progress; and the addresses are stable run to run (the lane is 0x1817abf70 in two runs), which is why peeking an absolute address works here at all.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7245315120 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/632#issuecomment-7245315120). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T20:28:45Z. --- Measured at the writer's own decision point, `VICTORY_BREAK_AT=1330cea` (the `cmpl %eax,%ebp` right after the record and the index are loaded) with `VICTORY_PEEK=rcx,rdx+0x5c,rdx+0x50,rdx+0x8,rdx+0x38,rdx+0x40`, on the 163 GB partial folder, release build of `95d9caa1`: ``` peek rdx+0x5c = 0x0 ; [S+0x5c], the element index peek rdx+0x50 = 0x181796800 ; [S+0x50], the container peek rdx+0x8 = 0x1f0 ; [S+0x08], 496 bytes remaining peek rdx+0x38 = 0x18171d480 ; lane 0 -- NOT null in this run peek rdx+0x40 = 0x1817abf70 ; lane 1 -- the lane the chunk goes through [rcx] 308000100000018 308000100000018 0 30000000fe12fc30 30000000ed98b440 100 d9f50b2b90e3e108 6caa6e0bafeb3c2b call chain image+ [1330cea, 133096e, 51d2319, 59febb9, 59fea77, 223762c, 2236f78, 2236dae, 2240eab, 81b253, ...] ``` Read against the code, that `rcx` is the record `0x1330cd0(rcx = record, rdx = S)` works on, and it is a 0x40-byte object whose qword at `+0` is `0308000100000018` = `u32 +0x00 = 0x18` (the descriptor table's offset from the record), `u16 +0x04 = 1` (its bound), `u8 +0x07 = 3` (**the kind**); its descriptor table at `+0x18` holds `0x30000000fe12fc30` and `0x30000000ed98b440`, and the entry the writer takes is index `[S+0x5c] = 0`. Three things follow, and two of them correct what is written above the line. 1. **Flag 3 is not an anomaly, it is this record's normal state.** `(0x30000000fe12fc30 >> 0x3c) & 3 == 3`, and the second descriptor carries 3 in the same bits: every entry of this record decodes to flag 3, so the `jne 0x1330ff9` path (hand the chunk to the interface, `vtable+0x38`) is the path this record is *supposed* to take, not a wrong turn. What makes it look like a dead end is only that the interface's own write then refuses. 2. **The write is not on a spin because of the index/bound check.** `u16 +0x04 = 1` against index `0`: had the index been 1, `0x1330cea` would have taken the `je 0x1330fe3` **success** return. It is 0, so the one element this record has goes to the interface — the same conclusion as the kind-3/`0x1b` refusal, reached from the other side. 3. **"The setup that fills `[S+0x38]`/`[S+0x40]`/`[S+0x60]`/`[S+0x68]` is the missing piece" is not supported by this run.** Both lanes are non-null here (`0x18171d480`, `0x1817abf70`), `[S+0x08] = 0x1f0` (where the earlier capture had `0x10000`), and the container is `0x181796800`. So the state is populated; what fails is further down, in the interface's per-chunk write with the lane's device of kind `0x1b`. The `[S+0x38] == 0` of the older capture is a different moment or a different lane count, not a state that was never set. So the boot blocker stands as: this record (kind 3, one element, flag 3) is handed to the interface, whose write for the lane's device of kind `0x1b` answers `-3`, and the caller's completion test then answers false, which is the assert. The next question is the device, not the writer state: where the lane `0x1817abf70` gets the device it passes at `+0x60` as `0x1842d1cb0` with `[device] = 0x1b`, and whether a complete folder's shader database gives it a kind-`0x16` device instead (the first chunk's device answers `0`, per the existing `VICTORY_BREAK_AT=13310b0` capture). Two caveats on the method, so the numbers are reproducible: `VICTORY_BREAK_AT` leaves the run to die (exit 3, the title's own crash reporter), so the log after the break says nothing about the title's progress; and the addresses are stable run to run (the lane is `0x1817abf70` in two runs), which is why peeking an absolute address works here at all.
AnastasisKon commented 2026-11-29 11:18:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-29T11:18:59Z.


Confirmation of the data-incompleteness thesis, from a run today (2026-11-29):

The SGD5 int3 boot blocker is GONE. Earlier today, with shaders.rpf still filling in, the title died at ~3.4 s on the same image+0x141330a44 int3 as always. After shaders.rpf completed, an identical run sailed straight past it: the title now runs ~56 s, reaches frame 1344 (4,720 recorded draws), streams 15,000+ DirectStorage reads from levels.rpf / anim.rpf / textures.rpf / packs.rpf with WASAPI audio flowing, and dies later on a new, unrelated wall — a first-chance 0xc0000005 (WRITE to 0xe) at image+0x14056edab.

So the int3 was never host code: it was the title tripping over a partially-downloaded pack, exactly as this issue suspected. Anyone still reproducing it should check their data completeness before debugging further (levels.rpf itself is still incomplete here, and the new wall may also move on fuller data).

Run details: headless, release build, log at runs/20261129-131718-XvmCKt/victory.log — first-chance line 'first-chance exception code=0xc0000005 at=0x14056edab'. Will file the new wall as its own issue.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7255027579 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/632#issuecomment-7255027579). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-29T11:18:59Z. --- Confirmation of the data-incompleteness thesis, from a run today (2026-11-29): The SGD5 int3 boot blocker is GONE. Earlier today, with shaders.rpf still filling in, the title died at ~3.4 s on the same image+0x141330a44 int3 as always. After shaders.rpf completed, an identical run sailed straight past it: the title now runs ~56 s, reaches frame 1344 (4,720 recorded draws), streams 15,000+ DirectStorage reads from levels.rpf / anim.rpf / textures.rpf / packs.rpf with WASAPI audio flowing, and dies later on a new, unrelated wall — a first-chance 0xc0000005 (WRITE to 0xe) at image+0x14056edab. So the int3 was never host code: it was the title tripping over a partially-downloaded pack, exactly as this issue suspected. Anyone still reproducing it should check their data completeness before debugging further (levels.rpf itself is still incomplete here, and the new wall may also move on fuller data). Run details: headless, release build, log at runs/20261129-131718-XvmCKt/victory.log — first-chance line 'first-chance exception code=0xc0000005 at=0x14056edab'. Will file the new wall as its own issue.
AnastasisKon commented 2026-11-29 11:28:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-29T11:28:52Z.


The lane's flag is a 2-bit class at the top of the element key, which is what the flag == 3 split and the "why is the writer's id different from the submit's" asymmetry actually are. Read off the image:

0x14550db40(rcx = the 64-bit element key, dl = the container's width code, r8 = a 0x14-byte result) unpacks the key and writes a flag byte at [r8+0x10]:

width code dl flag at [r8+0x10] comes from
2 key >> 0x3e bits 63-62
3 (key >> 0x3c) & 3 bits 61-60
4 (key >> 0x38) & 3 bits 57-56
anything else 0 (result zeroed) —

0x1331110 then returns the singleton at 0x146dd5b08 only when that byte is 3, else NULL:

141331110  xor eax,eax ; cmp cl,3 ; lea rdx,[0x146dd5b08] ; cmove rax,rdx ; ret

Checked against the five keys this repo already carries:

key top bits (class)
33f70dfaf2c50989 0
73bcb72dce74f11f 1
b7076b6245d35fb5 2
e0c12d7a5d4884c5 (the writer's) 3
b6f5bdb2c66da2e9 2
286030a358a789fb (the submit's, not in the table) 0

So the five entries are classes 0,1,2,3,2: the writer's record is the only class-3 element of the five, it therefore takes the singleton path, and the submit's request is class 0 — the two ids are not interchangeable and the asymmetry is a class difference, not a missing lookup.

And the destination store, now named: 0x1330fc4 (mov [rsi+0x60], rbx), on the success path only, immediately before mov al,1 at 0x1330fe3. So [S+0x60] == 0 at the trap is simply "no chunk of this element has gone out yet", and the false is the completion test of the first one.

Sequence that follows, on this image: key class 3 -> singleton 0x146dd5b08 -> its +0x30 (0x141331210) copies the request and calls the generic IO write 0x145532220 per chunk -> the request's device reads kind 0x1b -> 0x55330d6 stores 0xfffffffd and returns -> bl stays 0 -> 0x1330e5e takes je to the failure exit 0x13310b0 -> the retry. The open question is therefore what built that request's device with kind 0x1b, since class-0..2 elements go through the normal path with a device whose kind is 0x16.

Commands: llvm-objdump -d --no-show-raw-insn --x86-asm-syntax=intel "<exe>" --start-address=0x14550db40 --stop-address=0x14550dc80, and the same around 0x141331110, 0x141330fc4, 0x141331210.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7255140195 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/632#issuecomment-7255140195). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-29T11:28:52Z. --- **The lane's flag is a 2-bit class at the top of the element key**, which is what the `flag == 3` split and the "why is the writer's id different from the submit's" asymmetry actually are. Read off the image: `0x14550db40(rcx = the 64-bit element key, dl = the container's width code, r8 = a 0x14-byte result)` unpacks the key and writes a flag byte at `[r8+0x10]`: | width code `dl` | flag at `[r8+0x10]` | comes from | |---|---|---| | 2 | `key >> 0x3e` | bits 63-62 | | 3 | `(key >> 0x3c) & 3` | bits 61-60 | | 4 | `(key >> 0x38) & 3` | bits 57-56 | | anything else | `0` (result zeroed) | — | `0x1331110` then returns the singleton at `0x146dd5b08` only when that byte is `3`, else `NULL`: ``` 141331110 xor eax,eax ; cmp cl,3 ; lea rdx,[0x146dd5b08] ; cmove rax,rdx ; ret ``` Checked against the five keys this repo already carries: | key | top bits (class) | |---|---| | `33f70dfaf2c50989` | 0 | | `73bcb72dce74f11f` | 1 | | `b7076b6245d35fb5` | 2 | | `e0c12d7a5d4884c5` (the writer's) | **3** | | `b6f5bdb2c66da2e9` | 2 | | `286030a358a789fb` (the submit's, not in the table) | 0 | So the five entries are classes `0,1,2,3,2`: the writer's record is the only class-3 element of the five, it therefore takes the singleton path, and the submit's request is class 0 — the two ids are not interchangeable and the asymmetry is a class difference, not a missing lookup. And the destination store, now named: `0x1330fc4` (`mov [rsi+0x60], rbx`), on the success path only, immediately before `mov al,1` at `0x1330fe3`. So `[S+0x60] == 0` at the trap is simply "no chunk of this element has gone out yet", and the false is the completion test of the first one. Sequence that follows, on this image: key class 3 -> singleton `0x146dd5b08` -> its `+0x30` (`0x141331210`) copies the request and calls the generic IO write `0x145532220` per chunk -> the request's device reads kind `0x1b` -> `0x55330d6` stores `0xfffffffd` and returns -> `bl` stays 0 -> `0x1330e5e` takes `je` to the failure exit `0x13310b0` -> the retry. The open question is therefore **what built that request's device with kind `0x1b`**, since class-0..2 elements go through the normal path with a device whose kind is `0x16`. Commands: `llvm-objdump -d --no-show-raw-insn --x86-asm-syntax=intel "<exe>" --start-address=0x14550db40 --stop-address=0x14550dc80`, and the same around `0x141331110`, `0x141330fc4`, `0x141331210`.
AnastasisKon commented 2026-11-29 11:39:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-29T11:39:04Z.


The dispatch, named — this closes "which lane and which handler" and leaves one question.

0x13310f0 maps the flag to a lane index (cmp cl,3 ; sete al), so the lane is [S+0x38 + 8*index]: [S+0x40] when the flag is 3, [S+0x38] otherwise. [S+0x40] is the request-shaped object these notes measure as {source, size, 0} — the object the singleton's first slot returns at 0x1418bc35a, not a table.

The spin condition at 0x1330d69 is then exactly

141330d51  call 0x1331110            ; flag == 3 ? singleton : NULL
141330d59  mov [rsp+0x38], rax
141330d5e  setne al                  ; a handler exists
141330d61  test rbx, rbx             ; rbx = [S+0x60], the recorded destination
141330d64  sete cl                   ; and none is recorded yet
141330d67  test al, cl
141330d69  jne  0x1330ff9            ; both -> the singleton path, which spins

So a class-3 element spins while class 0-2 elements write: same code, different lane and handler, and the difference is the key's top bits, not a missing table entry.

What is left is the device: the request is [S+0x40] and its +0x60 reads kind 0x1b at the failure exit, while the class 0-2 path's device reads 0x16. Nothing in 0x141331210 writes the request's +0x60 (it fills +0x38, +0x40, +0x48, +0x50, +0x30), so that field is set by whoever builds the request, and the clean way to name it is VICTORY_TRAP_WRITES on that object's page once #75/#78 land — a silent trap is not a negative.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7255256377 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/632#issuecomment-7255256377). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-29T11:39:04Z. --- The dispatch, named — this closes "which lane and which handler" and leaves one question. `0x13310f0` maps the flag to a lane index (`cmp cl,3 ; sete al`), so the lane is `[S+0x38 + 8*index]`: `[S+0x40]` when the flag is `3`, `[S+0x38]` otherwise. `[S+0x40]` is the request-shaped object these notes measure as `{source, size, 0}` — the object the singleton's first slot returns at `0x1418bc35a`, not a table. The spin condition at `0x1330d69` is then exactly ``` 141330d51 call 0x1331110 ; flag == 3 ? singleton : NULL 141330d59 mov [rsp+0x38], rax 141330d5e setne al ; a handler exists 141330d61 test rbx, rbx ; rbx = [S+0x60], the recorded destination 141330d64 sete cl ; and none is recorded yet 141330d67 test al, cl 141330d69 jne 0x1330ff9 ; both -> the singleton path, which spins ``` So a class-3 element spins while class 0-2 elements write: same code, different lane and handler, and the difference is the key's top bits, not a missing table entry. What is left is the device: the request is `[S+0x40]` and its `+0x60` reads kind `0x1b` at the failure exit, while the class 0-2 path's device reads `0x16`. Nothing in `0x141331210` writes the request's `+0x60` (it fills `+0x38`, `+0x40`, `+0x48`, `+0x50`, `+0x30`), so that field is set by whoever builds the request, and the clean way to name it is `VICTORY_TRAP_WRITES` on that object's page once #75/#78 land — a silent trap is not a negative.
Sign in to join this conversation.
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
LakshanSivakumar/Native-Victory-macOS#632
No description provided.