A block just written rests 0.5 ms, not 3 #138

Closed
github-bot wants to merge 0 commits from github-bot/gh-138 into main AGit
Owner

@⁠mgrein on GitHub · 2026-11-30 17:21 UTC · original
mgrein:guard-rest-500 → main · +0 −0 · 0 files · 48 commits · closed without merging

watch::rest() decides how long a guarded block the title just opened by a write stays open (VICTORY_GUARD_REST, 3,000 µs until now). While it rests, the block counts as written at every asking, so every refresh that takes it copies it again. In the world of a new retail game there are ~17 askings a frame, so at 3 ms a resting block was copied many times over.

This changes the default to 500 µs and adds VICTORY_GUARD_REST_AB=<a>:<b>, which switches between two values every 20 seconds and logs each switch (guard-rest switch <unix ms> on|off), for an A/B inside one run. VICTORY_GUARD_REST=<µs> and =0 work as before.

Measured

RTX 4070, Ryzen 5 5600X, Series S profile, DLSS quality + frame generation, VICTORY_SUBMIT_SPLIT=1, VICTORY_ASK_FIRST=1, VICTORY_OFF_LINE=1. 15-minute idle runs in the world, pairing neighbouring 20 s windows (an A/A run with the same method came out at 13 of 25, so the pairing is unbiased):

A/B frame median copies (the frame line's "copies … MB")
3000 → 500 µs −1.0 ms, 31 of 41 pairs faster 62.9 → 53.0 MB a frame, 39 of 44 lower
500 → 0 µs +0.2 ms, 14 of 40 pairs faster 55.1 → 52.8 MB, 38 of 43 lower

So 500 µs is about the sweet spot. Shorter rests copy less but fault more, and with no rest at all the extra faults cancel the smaller copies. A longer "hot" rest (VICTORY_GUARD_HOT=50) went the other way: copies 62 → 109 MB, frame +5 ms.

cargo test -p victory-gpu --lib passes (a_block_just_written_rests sets its own rest).

🤖 Generated with Claude Code

**@⁠mgrein** on GitHub · 2026-11-30 17:21 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/138) `mgrein:guard-rest-500` → `main` · +0 −0 · 0 files · 48 commits · closed without merging `watch::rest()` decides how long a guarded block the title just opened by a write stays open (`VICTORY_GUARD_REST`, 3,000 µs until now). While it rests, the block counts as written at every asking, so every refresh that takes it copies it again. In the world of a new retail game there are ~17 askings a frame, so at 3 ms a resting block was copied many times over. This changes the default to 500 µs and adds `VICTORY_GUARD_REST_AB=<a>:<b>`, which switches between two values every 20 seconds and logs each switch (`guard-rest switch <unix ms> on|off`), for an A/B inside one run. `VICTORY_GUARD_REST=<µs>` and `=0` work as before. ## Measured RTX 4070, Ryzen 5 5600X, Series S profile, DLSS quality + frame generation, `VICTORY_SUBMIT_SPLIT=1`, `VICTORY_ASK_FIRST=1`, `VICTORY_OFF_LINE=1`. 15-minute idle runs in the world, pairing neighbouring 20 s windows (an A/A run with the same method came out at 13 of 25, so the pairing is unbiased): | A/B | frame median | copies (the frame line's "copies … MB") | |---|---|---| | 3000 → 500 µs | −1.0 ms, 31 of 41 pairs faster | 62.9 → 53.0 MB a frame, 39 of 44 lower | | 500 → 0 µs | +0.2 ms, 14 of 40 pairs faster | 55.1 → 52.8 MB, 38 of 43 lower | So 500 µs is about the sweet spot. Shorter rests copy less but fault more, and with no rest at all the extra faults cancel the smaller copies. A longer "hot" rest (`VICTORY_GUARD_HOT=50`) went the other way: copies 62 → 109 MB, frame +5 ms. `cargo test -p victory-gpu --lib` passes (`a_block_just_written_rests` sets its own rest). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A guarded block the title has just opened by a write is left open for a
while (VICTORY_GUARD_REST), and counts as written at every asking that
takes it meanwhile, so it is copied each time: some 17 askings a frame
in the world. At 3 ms that was ~10 MB a frame more of copies than at
0.5 ms. The default is now 500 microseconds.

VICTORY_GUARD_REST=<us> still sets it; VICTORY_GUARD_REST_AB=<a>:<b>
switches between two values every 20 seconds and says so in the log.

Measured that way (41 neighbouring 20 s windows in the world, SUBMIT_SPLIT,
ASK_FIRST, OFF_LINE on; RTX 4070, Ryzen 5 5600X): 3000 -> 500 us, frame
median 1.0 ms less (31 of 41 pairs), copies 62.9 -> 53.0 MB a frame (39 of
44). No rest at all copied a little less again (55 -> 53 MB the other
way) but faulted more: no better than 500 (14 of 40 faster at 0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 17:21:52 +00:00
The last run failed in a test this change does not touch (a crash of the
victory-shader test binary, or a watch test that also fails now and then
on main); this runs the checks again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot closed this pull request 2026-12-01 01:10:25 +00:00
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-12-01 01:36 UTC · original

A note on why this shows as closed: GitHub closed every open pull request by itself when main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), and they cannot be reopened. This is not a rejection.

Your change is in the batch being tested for the next release, carried over as one commit with you as its author. Nothing is needed from you now; the result will be posted here.

**@⁠readmet3xt-lab** on GitHub · 2026-12-01 01:36 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/138#issuecomment-7297691675) A note on why this shows as closed: GitHub closed every open pull request by itself when main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), and they cannot be reopened. This is not a rejection. Your change is in the batch being tested for the next release, carried over as one commit with you as its author. Nothing is needed from you now; the result will be posted here.

Pull request closed

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