D3D12.X: Wait64BitValueX compares the whole value (retail title stood still after its first cinematic) #218

Closed
github-bot wants to merge 1 commit from gh-pr/218/head into gh-pr/218/base
Owner

@⁠Sr-0w on GitHub · 2026-11-23 21:14 UTC · original
Sr-0w:wait64-no-mask → main · +11 −6 · 1 files · 1 commits · closed without merging

What happened

Right after its first cinematic, the retail title dropped to 0 fps. The log showed one timeout per frame:

Wait64BitValueX timed out after 2000 ms at 0x7d2b00000 (op 7, want 0x1, mask 0x23100000001; memory holds Some(2))
Wait64BitValueX timed out after 2000 ms at 0x7d2b00000 (op 7, want 0x2, mask 0x23100000001; memory holds Some(4))
Wait64BitValueX timed out after 2000 ms at 0x7d2b00000 (op 7, want 0x3, mask 0x23100000001; memory holds Some(5))
…

The counter was always ahead of what was asked for (GREATER_EQUAL), but (memory & mask) >= value never held. The "mask" is not a mask: its low half is 1, and its upper half is whatever was left in the stack slot (0x231…, 0x2ef… in another run). The title passes a 32-bit value there, so the argument is not a 64-bit mask, and a mask of 1 would not allow >= 2 anyway.

Change

  • wait64_x compares the whole 64-bit value (mask u64::MAX). The argument after the value is ignored.
  • The timeout warning now also shows what the memory holds, and up to 40 timeouts are logged instead of 4.

Testing

  • cargo test --release -p xcl --lib: 582 passed, 0 failed.
  • Retail title, RX 7800 XT: before, 0 fps after the first cinematic, with a 2 s timeout each frame. After, no timeouts, and the title keeps 20–30 fps there.

🤖 Generated with Claude Code

**@⁠Sr-0w** on GitHub · 2026-11-23 21:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/218) `Sr-0w:wait64-no-mask` → `main` · +11 −6 · 1 files · 1 commits · closed without merging ## What happened Right after its first cinematic, the retail title dropped to 0 fps. The log showed one timeout per frame: ``` Wait64BitValueX timed out after 2000 ms at 0x7d2b00000 (op 7, want 0x1, mask 0x23100000001; memory holds Some(2)) Wait64BitValueX timed out after 2000 ms at 0x7d2b00000 (op 7, want 0x2, mask 0x23100000001; memory holds Some(4)) Wait64BitValueX timed out after 2000 ms at 0x7d2b00000 (op 7, want 0x3, mask 0x23100000001; memory holds Some(5)) … ``` The counter was always ahead of what was asked for (GREATER_EQUAL), but `(memory & mask) >= value` never held. The "mask" is not a mask: its low half is 1, and its upper half is whatever was left in the stack slot (`0x231…`, `0x2ef…` in another run). The title passes a 32-bit value there, so the argument is not a 64-bit mask, and a mask of 1 would not allow `>= 2` anyway. ## Change - `wait64_x` compares the whole 64-bit value (mask `u64::MAX`). The argument after the value is ignored. - The timeout warning now also shows what the memory holds, and up to 40 timeouts are logged instead of 4. ## Testing - `cargo test --release -p xcl --lib`: 582 passed, 0 failed. - Retail title, RX 7800 XT: before, 0 fps after the first cinematic, with a 2 s timeout each frame. After, no timeouts, and the title keeps 20–30 fps there. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
GTA VI waits on a counter with GREATER_EQUAL; the argument after the value is a 32-bit 1 whose
stack slot keeps garbage above it (0x231_0000_0001). Read as a 64-bit mask, its waits on 2 >= 1,
4 >= 2 … never held: every one timed out (2 s a frame) and the game stood still after its first
cinematic. The timeout warning now shows what the memory holds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SKtJseucqXR6iuAE6HBtiA
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:15:53 +00:00
github-bot closed this pull request 2026-11-26 04:15:53 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-23 21:24 UTC · original

Merged as a squash commit (d4f17ca) with the game's name left out of the message and the comment - the repository does not name it. Thanks, a good find. Checked on an RX 9070 (RDNA4) with 11 PRs merged together on main af20b4b: cargo build --workspace && cargo test --workspace -- --test-threads=4 - 605 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed; and the retail game still reaches its first menu at 30 fps (720 draws per 2 s).

**@⁠ivall** on GitHub · 2026-11-23 21:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/218#issuecomment-7114419722) Merged as a squash commit (d4f17ca) with the game's name left out of the message and the comment - the repository does not name it. Thanks, a good find. Checked on an RX 9070 (RDNA4) with 11 PRs merged together on main af20b4b: `cargo build --workspace && cargo test --workspace -- --test-threads=4` - 605 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed; and the retail game still reaches its first menu at 30 fps (720 draws per 2 s).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.