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

Closed
Sr-0w wants to merge 1 commit from upstream-pr/218 into main
Sr-0w commented 2026-11-23 21:14:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Sr-0w on 2026-11-23T21:14:24Z.


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

<!-- greyfinch-sync:ivall/xcl:issue:6568967800 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/218). Originally posted by [Sr-0w](https://github.com/Sr-0w) on 2026-11-23T21:14:24Z. --- ## 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)
upstream-sync closed this pull request 2026-11-24 06:57:42 +00:00
ivall commented 2026-11-24 07:04:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T21:24:29Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7114419722 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/218#issuecomment-7114419722). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T21:24:29Z. --- 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

Sign in to join this conversation.
No reviewers
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
xcl-dev/xcl!215
No description provided.