d3d12: give the narrowed-write check a readback buffer of its own #468

Merged
NickStallman merged 1 commit from upstream-pr/468 into main 2026-11-29 16:09:41 +00:00
NickStallman commented 2026-11-29 11:56:53 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T11:56:53Z.


Summary

The narrowed-write check (TUXBOX_CHECK_NARROWED, #460) records its copy through the queue's shared readback buffer (#439). That buffer is handed out "in use or not", because the queue waits for each publication; nothing waits for the check's copy to be read, so a later copy, including the same batch's publication, can overwrite it. The check can then report a change that didn't happen, or miss one.

The check now takes a buffer of its own (Readback::record_alone). Normal play doesn't reach this: it is off unless the variable is set.

Tested

  • python tuxbox.py check --no-gpu: passed on the version before the rebase onto 62fc10c1 (65c4a631); the GPU checks below are queued for 65c4a631.
  • Found by reading; I didn't reproduce the collision, and the fault is in which buffer submit picks, which needs a device, so there's no failing test. A build with the same change (and others) ran the check mode in ProjectScarlett on an RTX 5090 (about 50 s of the world): changed=0 over 7,966 mips in 11 batches.
  • Full tuxbox.py check on 65c4a631: RTX 5090 (620.70.10) 187 pass, 0 fail (a first attempt on the 5090 timed out in translated-mesh while the machine was at load 40 from a cold shader compile; the rerun passed); AMD iGPU (RADV) 186 pass, 0 fail, guest-present-4k-splash skipped.
  • Not run: Windows; nothing reproduces the collision.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:issue:5550466735 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/468). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T11:56:53Z. --- ## Summary The narrowed-write check (`TUXBOX_CHECK_NARROWED`, #460) records its copy through the queue's shared readback buffer (#439). That buffer is handed out "in use or not", because the queue waits for each publication; nothing waits for the check's copy to be read, so a later copy, including the same batch's publication, can overwrite it. The check can then report a change that didn't happen, or miss one. The check now takes a buffer of its own (`Readback::record_alone`). Normal play doesn't reach this: it is off unless the variable is set. ## Tested - `python tuxbox.py check --no-gpu`: passed on the version before the rebase onto 62fc10c1 (65c4a631); the GPU checks below are queued for 65c4a631. - Found by reading; I didn't reproduce the collision, and the fault is in which buffer `submit` picks, which needs a device, so there's no failing test. A build with the same change (and others) ran the check mode in ProjectScarlett on an RTX 5090 (about 50 s of the world): `changed=0` over 7,966 mips in 11 batches. - Full `tuxbox.py check` on 65c4a631: RTX 5090 (620.70.10) 187 pass, 0 fail (a first attempt on the 5090 timed out in `translated-mesh` while the machine was at load 40 from a cold shader compile; the rerun passed); AMD iGPU (RADV) 186 pass, 0 fail, guest-present-4k-splash skipped. - **Not run:** Windows; nothing reproduces the collision. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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
brcly/TuxBox!468
No description provided.