Validate the inputs of the opt-in RAM throttle #147

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

@⁠TaynanGT on GitHub · 2026-11-27 04:16 UTC · original
TaynanGT:review/ram-throttle-inputs-96 → main · +426 −1 · 3 files · 1 commits · draft

Carries the standalone throttle from #96 with checked MiB conversion and bounded waits based on elapsed time. It rejects a configured wait that reaches the reported title watchdog interval.

Four targeted tests and graphics Clippy passed. The original standalone throttle reached the world in zero of six guarded loads on the tested 16 GB laptop. A new hardware run with the watchdog active is still needed.

**@⁠TaynanGT** on GitHub · 2026-11-27 04:16 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/147) `TaynanGT:review/ram-throttle-inputs-96` → `main` · +426 −1 · 3 files · 1 commits · draft Carries the standalone throttle from #96 with checked MiB conversion and bounded waits based on elapsed time. It rejects a configured wait that reaches the reported title watchdog interval. Four targeted tests and graphics Clippy passed. The original standalone throttle reached the world in zero of six guarded loads on the tested 16 GB laptop. A new hardware run with the watchdog active is still needed.
Keep the RAM throttle and its shared wait budget from #96. Check MiB conversion, reject a single wait lasting an entire watchdog interval, and compute every sleep step from elapsed time.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 04:21:14 +00:00
Author
Owner

@⁠nidscode on GitHub · 2026-11-27 08:16 UTC · original

Here are the hardware runs with the watchdog on that this draft asks for, @⁠TaynanGT. They're on the same 16 GB laptop (i7-13700H, RTX 3050 6 GB Laptop GPU, 15.7 GiB usable).

Build: current main (791648b) with this PR's commit cherry-picked (local 1cb7d3c). The one conflict was in shared_buffer, where main now splits create and map. I kept main's version and put ram_gate(size) first.

Settings: -Machine laptop (the #145 preset) with -More @{VICTORY_LIST_POOL='0'; VICTORY_OUTPUT='1280x720'; VICTORY_RENDER_SCALE='0.75'}, Series S, windowed. No keep-alive: the title's watchdog is fully active. Each run is 240 s, with scripted Enter presses reaching the story load at 100–115 s. An outside guard stops the game below 400 MB free for 1 s; it didn't trigger in any of these runs.

The shader cache was re-translated for main before these runs (main no longer sets VICTORY_WAVE_WIDE_ONLY). The first run after the update, with a mostly stale cache, is left out.

Run Build and throttle World load In the world Median frame Least free RAM (world) Average free (world) Throttle line at the end
vt50 main, no throttle passed 164 s, 165 frames 881 ms 5 MB 929 MB –
vt51 main, no throttle passed 164 s, 269 frames 548 ms 220 MB 986 MB –
vt52 main, no throttle ¹ passed 163 s, 184 frames 754 ms 404 MB 965 MB –
vt53 this PR, VICTORY_RAM_FLOOR_MB=600 (wait 250, share 600, no submission wait) passed 147 s, 124 frames 1,059 ms 209 MB 814 MB 627 buffers waited 41.5 s; least free while waiting 14 MB
vt54 the same passed 147 s, 109 frames 1,150 ms 46 MB 548 MB 904 buffers waited 65.3 s; least free while waiting 0 MB
vt55 the same + VICTORY_RAM_FRAME_WAIT_MS=300 passed 169 s, 224 frames 687 ms 433 MB 1,037 MB 142 buffers 8.8 s; 25 submissions held back 6.5 s
vt56 the same + VICTORY_RAM_FRAME_WAIT_MS=300 ended by the watchdog (+0x23cf683, write to 0x0) 9 s after the world started – – 365 MB – 0 buffers waited; 1 submission held back 0.3 s

¹ vt52 was meant as a run of this PR, but my wrapper started main's build: the log has no RAM throttle on line, so it counts as a main run.

What I read from this:

  • Buffer waits alone (vt53/vt54): 2 of 2 loads passed with the watchdog on. Without the list pool, the equivalent #96 setup passed 0 of 6. The world was slower (median 1.06/1.15 s against 0.55–0.88 s on main), and free RAM was no better: it still fell to 46 and 0 MB while buffers waited.
  • With 300 ms submission waits, 1 of 2 loads passed. vt55 was the best throttled run: 687 ms median, never below 433 MB free.
  • vt56 is not evidence against the throttle. Its throttle line shows one 0.3 s submission wait and no buffer waits before the watchdog ended it; the load stalled on paging (up to about 100,000 page reads a second). So the 30 s watchdog can end a world load on 16 GB with the throttle effectively idle. The guarded-load baseline should probably count that too.
  • The list pool off is what makes the difference. With it, main keeps about 1 GB free on average in the world, so the throttle has less to do. The measured cost of the buffer waits is higher than their RAM benefit on this machine; the submission wait looks more useful, but two runs don't settle it.

Logs: nv-vt50 … nv-vt56 (game logs and 1 s memory samples), available locally if you'd like a specific line.

🤖 Generated with Claude Code

**@⁠nidscode** on GitHub · 2026-11-27 08:16 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/147#issuecomment-7213344061) Here are the hardware runs with the watchdog on that this draft asks for, @⁠TaynanGT. They're on the same 16 GB laptop (i7-13700H, RTX 3050 6 GB Laptop GPU, 15.7 GiB usable). **Build:** current `main` (791648b) with this PR's commit cherry-picked (local `1cb7d3c`). The one conflict was in `shared_buffer`, where main now splits create and map. I kept main's version and put `ram_gate(size)` first. **Settings:** `-Machine laptop` (the #145 preset) with `-More @{VICTORY_LIST_POOL='0'; VICTORY_OUTPUT='1280x720'; VICTORY_RENDER_SCALE='0.75'}`, Series S, windowed. No keep-alive: the title's watchdog is fully active. Each run is 240 s, with scripted Enter presses reaching the story load at 100–115 s. An outside guard stops the game below 400 MB free for 1 s; it didn't trigger in any of these runs. The shader cache was re-translated for `main` before these runs (main no longer sets `VICTORY_WAVE_WIDE_ONLY`). The first run after the update, with a mostly stale cache, is left out. | Run | Build and throttle | World load | In the world | Median frame | Least free RAM (world) | Average free (world) | Throttle line at the end | |---|---|---|---|---|---|---|---| | vt50 | `main`, no throttle | passed | 164 s, 165 frames | 881 ms | 5 MB | 929 MB | – | | vt51 | `main`, no throttle | passed | 164 s, 269 frames | 548 ms | 220 MB | 986 MB | – | | vt52 | `main`, no throttle ¹ | passed | 163 s, 184 frames | 754 ms | 404 MB | 965 MB | – | | vt53 | this PR, `VICTORY_RAM_FLOOR_MB=600` (wait 250, share 600, no submission wait) | passed | 147 s, 124 frames | 1,059 ms | 209 MB | 814 MB | 627 buffers waited 41.5 s; least free while waiting 14 MB | | vt54 | the same | passed | 147 s, 109 frames | 1,150 ms | 46 MB | 548 MB | 904 buffers waited 65.3 s; least free while waiting 0 MB | | vt55 | the same + `VICTORY_RAM_FRAME_WAIT_MS=300` | passed | 169 s, 224 frames | 687 ms | 433 MB | 1,037 MB | 142 buffers 8.8 s; 25 submissions held back 6.5 s | | vt56 | the same + `VICTORY_RAM_FRAME_WAIT_MS=300` | **ended by the watchdog** (`+0x23cf683`, write to 0x0) 9 s after the world started | – | – | 365 MB | – | 0 buffers waited; 1 submission held back 0.3 s | ¹ vt52 was meant as a run of this PR, but my wrapper started `main`'s build: the log has no `RAM throttle on` line, so it counts as a `main` run. **What I read from this:** - **Buffer waits alone (vt53/vt54): 2 of 2 loads passed with the watchdog on.** Without the list pool, the equivalent #96 setup passed 0 of 6. The world was slower (median 1.06/1.15 s against 0.55–0.88 s on `main`), and free RAM was no better: it still fell to 46 and 0 MB while buffers waited. - **With 300 ms submission waits, 1 of 2 loads passed.** vt55 was the best throttled run: 687 ms median, never below 433 MB free. - **vt56 is not evidence against the throttle.** Its throttle line shows one 0.3 s submission wait and no buffer waits before the watchdog ended it; the load stalled on paging (up to about 100,000 page reads a second). So the 30 s watchdog can end a world load on 16 GB with the throttle effectively idle. The guarded-load baseline should probably count that too. - **The list pool off is what makes the difference.** With it, `main` keeps about 1 GB free on average in the world, so the throttle has less to do. The measured cost of the buffer waits is higher than their RAM benefit on this machine; the submission wait looks more useful, but two runs don't settle it. **Logs:** `nv-vt50` … `nv-vt56` (game logs and 1 s memory samples), available locally if you'd like a specific line. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 08:20 UTC · original

@⁠nidscode Thanks for the watchdog-on runs and for catching vt52. With the list pool off, all three controls crossed world load. Buffer waits crossed twice at 1,059–1,150 ms per frame, compared with 548–881 ms in the controls. The two submission-wait runs split. I’m keeping the throttle experimental and recording the full setup in the laptop notes. I’m also adding the selected executable and its SHA-256 to the launch log so the next A/B can verify both binaries.

**@⁠TaynanGT** on GitHub · 2026-11-27 08:20 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/147#issuecomment-7213426849) @⁠nidscode Thanks for the watchdog-on runs and for catching vt52. With the list pool off, all three controls crossed world load. Buffer waits crossed twice at 1,059–1,150 ms per frame, compared with 548–881 ms in the controls. The two submission-wait runs split. I’m keeping the throttle experimental and recording the full setup in the laptop notes. I’m also adding the selected executable and its SHA-256 to the launch log so the next A/B can verify both binaries.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-147'
git switch 'github-bot/gh-147'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-147'
git switch 'github-bot/gh-147'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-147'
git switch 'main'
git merge --squash 'github-bot/gh-147'
git switch 'main'
git merge --ff-only 'github-bot/gh-147'
git switch 'main'
git merge 'github-bot/gh-147'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.