faultbook: the window's end writes the book once #2569

Open
github-bot wants to merge 1 commit from github-bot/gh-2569 into main AGit
Owner

@⁠sh3nw4ld on GitHub · 2026-11-29 14:26 UTC · original
sh3nw4ld:fix-faultbook-final-race → main · +63 −1 · 1 files · 1 commits · open

What this fixes

The gate of a window's end let two frames write the book for one window: the count's last two fetch_sub results are 1 and 0, and both fail the > 1 check. A frame past the end that came through on() before the first writer turned the switch off wrote again — MADE then counted two, and the next scheduled time (VICTORY_FAULT_BOOK_AT) was read one slot on and skipped. The swap of the on switch is now the one writer's decision, under every interleave: whoever comes first writes, the other goes back.

Tests

the_window_end_writes_the_book_once runs a window's last two frames on two threads released together (a barrier after a 39-frame drain, LEFT at 1) and asserts one file (<file>.0.bin, no .1.bin) after the writes land. It passes deterministically with the change; on the pre-change gate the double write needs the two frames' on() reads to fall before the first writer's store, which the test's release does not force — the interleave is provable by inspection, and the test pins the contract. Runs under --features diagnostics; note the diagnostics build needs the copystat/host fix of the "diagnostics: the build compiles again" PR to compile on main.

cargo test -p victory-gpu --lib --locked --features diagnostics the_window_end: 1 passed, 0 failed.

Environment

Windows 11, RTX 4060 Ti, Rust 1.98.1 (pinned).

**@⁠sh3nw4ld** on GitHub · 2026-11-29 14:26 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2569) `sh3nw4ld:fix-faultbook-final-race` → `main` · +63 −1 · 1 files · 1 commits · open ## What this fixes The gate of a window's end let two frames write the book for one window: the count's last two `fetch_sub` results are 1 and 0, and both fail the `> 1` check. A frame past the end that came through `on()` before the first writer turned the switch off wrote again — `MADE` then counted two, and the next scheduled time (`VICTORY_FAULT_BOOK_AT`) was read one slot on and skipped. The swap of the on switch is now the one writer's decision, under every interleave: whoever comes first writes, the other goes back. ## Tests `the_window_end_writes_the_book_once` runs a window's last two frames on two threads released together (a barrier after a 39-frame drain, `LEFT` at 1) and asserts one file (`<file>.0.bin`, no `.1.bin`) after the writes land. It passes deterministically with the change; on the pre-change gate the double write needs the two frames' `on()` reads to fall before the first writer's store, which the test's release does not force — the interleave is provable by inspection, and the test pins the contract. Runs under `--features diagnostics`; note the diagnostics build needs the copystat/host fix of the "diagnostics: the build compiles again" PR to compile on main. `cargo test -p victory-gpu --lib --locked --features diagnostics the_window_end`: 1 passed, 0 failed. ## Environment Windows 11, RTX 4060 Ti, Rust 1.98.1 (pinned).
The gate let two frames write the book for one window: the count's
last two fetch results, 1 and 0, both fail the > 1, and a frame past
the end that came through on() before the first writer turned it off
wrote again — MADE then counts two, and the next scheduled time is
read one slot on and skipped. The swap of the on switch is the one
writer's decision, under every interleave. The test runs a window's
last two frames on two threads together.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 14:28:16 +00:00
github-bot force-pushed github-bot/gh-2569 from 8cd7275b9b to 109e0d8177 2026-11-29 15:36:00 +00:00 Compare
github-bot force-pushed github-bot/gh-2569 from 109e0d8177 to 1aac27461b 2026-11-29 15:47:15 +00:00 Compare
github-bot force-pushed github-bot/gh-2569 from 1aac27461b to 7a853a212f 2026-11-29 16:04:23 +00:00 Compare
github-bot force-pushed github-bot/gh-2569 from 7a853a212f to 828e416f67 2026-11-29 16:21:20 +00:00 Compare
github-bot force-pushed github-bot/gh-2569 from 828e416f67 to 5b62091b74 2026-11-29 16:26:57 +00:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2569/head:github-bot/gh-2569'
git switch 'github-bot/gh-2569'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2569'
git switch 'github-bot/gh-2569'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2569'
git switch 'github-bot/gh-2569'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2569'
git switch 'main'
git merge --squash 'github-bot/gh-2569'
git switch 'main'
git merge --ff-only 'github-bot/gh-2569'
git switch 'main'
git merge 'github-bot/gh-2569'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2569
No description provided.