leonida-gpu: a stall before any best leaves the followed frame limit free to climb back (D3D12-FG-FOLLOW-COLD-STALL) #3387

Code

Clone this repository

Checkout

From your project repository, check out a new branch and test the changes.

git fetch -u  "fg-follow-cold-stall:pastel-fg-follow-cold-stall"
git switch "pastel-fg-follow-cold-stall"
Open
leonida/mandy
pastel wants to merge 6 commits from pastel/mandy:fg-follow-cold-stall into main

This branch is out-of-date with the base branch

Conversation
Reviewers 0 approvals
  • No reviewers
Details
This pull request is blocked because it's outdated.
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 'fg-follow-cold-stall:pastel-fg-follow-cold-stall'
git switch 'pastel-fg-follow-cold-stall'
First-time contributor

Claimed in the coordination issue as: D3D12-FG-FOLLOW-COLD-STALL (claim comment on #3312; this was ProjectLeonida/mandy#3278 on GitHub, the same commits cherry-picked onto this repository's main)

What and why

A window that settles at the slowest bound is a stall, not a rate the frames settled at: it is left out of Follow::best, as the menus' near the fastest bound already are. With no best yet nothing says how fast the machine renders, so the faster tries grow. Before, a cold stall set best to 100 ms (or left none), far stayed false and the limit came back 5 % every 3 windows: more than 40 windows instead of 6 or fewer.

Also here, from the review and the in-game runs reported on the GitHub PR:

  • a faster try the bounds left out does not count as a try;
  • a stall is not a faster try failing, and it ends the wait of an earlier failed try;
  • a start screen just under the slowest bound is not a best either.

Tested

  • cargo test -p leonida-gpu --locked (from d3d12/): 731 passed, 0 failed, on this branch on top of current main.
  • python -I scripts/check_no_game_data.py on the changed files: clean.
  • No new in-game run on this repository yet.

GPUs tested: n/a (unit tests only)

AI-assisted: yes, Claude Opus 5.5 for the code and for the separate read-only reviewer agent (the commits marked (review) address its findings).

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

Claimed in the coordination issue as: D3D12-FG-FOLLOW-COLD-STALL (claim comment on #3312; this was ProjectLeonida/mandy#3278 on GitHub, the same commits cherry-picked onto this repository's main) ### What and why A window that settles at the slowest bound is a stall, not a rate the frames settled at: it is left out of `Follow::best`, as the menus' near the fastest bound already are. With no best yet nothing says how fast the machine renders, so the faster tries grow. Before, a cold stall set best to 100 ms (or left none), `far` stayed false and the limit came back 5 % every 3 windows: more than 40 windows instead of 6 or fewer. Also here, from the review and the in-game runs reported on the GitHub PR: - a faster try the bounds left out does not count as a try; - a stall is not a faster try failing, and it ends the wait of an earlier failed try; - a start screen just under the slowest bound is not a best either. ### Tested - `cargo test -p leonida-gpu --locked` (from `d3d12/`): 731 passed, 0 failed, on this branch on top of current main. - `python -I scripts/check_no_game_data.py` on the changed files: clean. - No new in-game run on this repository yet. GPUs tested: n/a (unit tests only) AI-assisted: yes, Claude Opus 5.5 for the code and for the separate read-only reviewer agent (the commits marked `(review)` address its findings). ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A window that settles at the slowest bound is a stall, not a rate the frames settled at: it is left out of
Follow::best, as the menus' near the fastest bound already are. With no best yet nothing says how fast the
machine renders, so the faster tries grow. Before, a cold stall set best to 100 ms (or left none), far stayed
false and the limit came back 5 % every 3 windows, more than 40 windows instead of 6 or less.
In the menus at the 60 fps clamp the tries do not move the limit, yet probed stayed set, so a load's stall then
armed BACKOFF and the limit waited 10 windows at the slowest bound (13 windows to climb back after 4 or more menu
windows). The test now starts with five menu windows too.
A stall right after a real faster try (the fourth menu window tries 18 020 -> 17 119) armed BACKOFF and kept the
limit at the slowest bound for 10 windows: 13 windows to climb back. A window that settles at the slowest bound
no longer counts as the try failing. The test now starts after 0 to 10 menu windows.
Six menu windows at 18 ms make a try that fails and waits BACKOFF while no best is known; the stall after them
left that wait in place, and the limit took 13 windows to climb back instead of 6 (merzleckeier's review). A
stall at the slowest bound now ends the wait: the limit is far from the try that failed. The test also starts
after menus at 18 ms.
First-time contributor

Verified natively on Windows 11 (MSVC, no game files): python -I scripts/red_green.py against main (0043b8d33, PR head 4f0e947ef) — verdict: red then green (2 red→green: fg::follow_tests::a_slow_start_screen_and_its_loads_do_not_leave_the_limit_crawling and a_stall_before_any_best_does_not_leave_the_limit_crawling; 729 pass on both). AI-assisted: Gemini 4 Neon (Antigravity).

Verified natively on Windows 11 (MSVC, no game files): `python -I scripts/red_green.py` against `main` (`0043b8d33`, PR head `4f0e947ef`) — **`verdict: red then green`** (**2** red→green: `fg::follow_tests::a_slow_start_screen_and_its_loads_do_not_leave_the_limit_crawling` and `a_stall_before_any_best_does_not_leave_the_limit_crawling`; **729** pass on both). AI-assisted: Gemini 4 Neon (Antigravity).
Author
First-time contributor

In-game test (RTX 5060 8 GB, driver 621.01, Windows 11; diag build with DLSS; -SeriesS -FrameGen 2 -Resolution 540, LEONIDA_FG_LIMIT_FPS=auto). On this card the Series X profile and the default Series S output give eWarnOutOfVRAM and no generated frame, so 540 lines was the setting where DLSS-G generates (per=2).

  • The cold stall climbs back. After the start the followed limit sat at the slowest bound (10.0 rendered fps), then: 10.0 -> 10.5 -> 11.7 -> 14.6 -> 24.4 fps in four windows (about 8 s). 24.4 failed, and it settled at 16.1-17.0.
  • A later stall back to 10.0 lasted: Reflex's own report showed 60-200 ms between frame starts then (the card out of video memory, eWarnOutOfVRAM in the log), so the frames really came slower than the slowest bound, and keeping the limit there is right.
  • No panic. cargo test -p leonida-gpu --locked: 731 passed.
In-game test (RTX 5060 8 GB, driver 621.01, Windows 11; diag build with DLSS; `-SeriesS -FrameGen 2 -Resolution 540`, `LEONIDA_FG_LIMIT_FPS=auto`). On this card the Series X profile and the default Series S output give `eWarnOutOfVRAM` and no generated frame, so 540 lines was the setting where DLSS-G generates (`per=2`). - **The cold stall climbs back.** After the start the followed limit sat at the slowest bound (10.0 rendered fps), then: 10.0 -> 10.5 -> 11.7 -> 14.6 -> 24.4 fps in four windows (about 8 s). 24.4 failed, and it settled at 16.1-17.0. - A later stall back to 10.0 lasted: Reflex's own report showed 60-200 ms between frame starts then (the card out of video memory, `eWarnOutOfVRAM` in the log), so the frames really came slower than the slowest bound, and keeping the limit there is right. - No panic. `cargo test -p leonida-gpu --locked`: 731 passed.
Collaborator

Gate run on an RTX 3090 (NVIDIA 621.40, Windows 11 Pro build 26300) for #3387 and #3389 together: #3387 head 4f0e947ef merged into main 04a838fc4, then #3389 head d401fce3d on top (both current heads, no conflict), diag profile with diagnostics,dlss,mimalloc, msvc target. Reference: main 04a838fc4 built the same way. Series X output 2560x1440, DLSS quality, DLSS frame generation on (the 3090 runs it through a frame-generation unlocker), frame limit in auto mode, 300 s standing at the save, fresh data.

  • 0 device lost, 0 crash, 0 ERROR lines. Frame generation active from 72 s, one generated frame per rendered frame on both sides.
  • Rendered 26.6 frames/s over 150-300 s against 26.7 for main (-0.2); generated 28.0 against 28.6 per second.
  • The followed frame limit climbs back the same way as on main after reaching the world (about 18 to 29 rendered frames/s on both), mean 26.5 against 27.8.
  • Not shown by this run: whether the cases these two PRs target (a stall before any best, a limit Reflex refuses) happened in it. Nothing in the run counts them.

Indicative, one run each: p99 61.7 against 56.2 ms (+5.5 ms), and the climb from about 20 to 29 frames/s is a little slower; process CPU time per frame is higher too. A frame-timing capture tool was recording during this run and not during the reference, and other processes differ by 4.7 points of CPU, so take these as something to watch, not as a measured cost.

Verdict: PASS (no loss, frame rate within tolerance).

GPUs tested: NVIDIA GeForce RTX 3090, driver 621.40.
AI-assisted: run and report by Claude Code (Claude Opus 5.5).

Gate run on an RTX 3090 (NVIDIA 621.40, Windows 11 Pro build 26300) for #3387 and #3389 together: #3387 head `4f0e947ef` merged into `main` `04a838fc4`, then #3389 head `d401fce3d` on top (both current heads, no conflict), diag profile with `diagnostics,dlss,mimalloc`, msvc target. Reference: `main` `04a838fc4` built the same way. Series X output 2560x1440, DLSS quality, DLSS frame generation on (the 3090 runs it through a frame-generation unlocker), frame limit in auto mode, 300 s standing at the save, fresh data. - 0 device lost, 0 crash, 0 ERROR lines. Frame generation active from 72 s, one generated frame per rendered frame on both sides. - Rendered 26.6 frames/s over 150-300 s against 26.7 for `main` (-0.2); generated 28.0 against 28.6 per second. - The followed frame limit climbs back the same way as on `main` after reaching the world (about 18 to 29 rendered frames/s on both), mean 26.5 against 27.8. - Not shown by this run: whether the cases these two PRs target (a stall before any best, a limit Reflex refuses) happened in it. Nothing in the run counts them. Indicative, one run each: p99 61.7 against 56.2 ms (+5.5 ms), and the climb from about 20 to 29 frames/s is a little slower; process CPU time per frame is higher too. A frame-timing capture tool was recording during this run and not during the reference, and other processes differ by 4.7 points of CPU, so take these as something to watch, not as a measured cost. Verdict: PASS (no loss, frame rate within tolerance). GPUs tested: NVIDIA GeForce RTX 3090, driver 621.40. AI-assisted: run and report by Claude Code (Claude Opus 5.5).
Author
First-time contributor

@underlight3d thank you for the gate run on the 3090, for both #3387 and #3389. Good to know they hold together on top of main with no loss and the frame rate within tolerance; I will keep an eye on the p99 you noted.

@underlight3d thank you for the gate run on the 3090, for both #3387 and #3389. Good to know they hold together on top of `main` with no loss and the frame rate within tolerance; I will keep an eye on the p99 you noted.
pastel force-pushed fg-follow-cold-stall from 4f0e947efe to 925cb7174c 2026-12-04 12:20:09 +00:00 Compare
pastel force-pushed fg-follow-cold-stall from 925cb7174c to d4caa7c21e 2026-12-04 14:03:27 +00:00 Compare
Collaborator

Same fix as #3278, on the newer base: keep this one and close #3278. Note that #3458 rewrites SHOWN (mutex and debounce) in the same file; this patch does not touch it, but the rebase after #3458 lands will show whether anything else moved.

Same fix as #3278, on the newer base: keep this one and close #3278. Note that #3458 rewrites `SHOWN` (mutex and debounce) in the same file; this patch does not touch it, but the rebase after #3458 lands will show whether anything else moved.
pastel force-pushed fg-follow-cold-stall from d4caa7c21e to b9109282ae 2026-12-04 15:13:48 +00:00 Compare
Author
First-time contributor

@vayko thank you for the review. Agreed on keeping this one over #3278: it is the same fix on the newer base, and #3278 sits under a deleted account, so closing it needs a maintainer. I'll rebase again once #3458 lands and check that nothing else moved in that file. Head is now b9109282ae, rebased on main ebbb84048c with no code change (cargo test -p leonida-gpu --locked: 760 passed; clean-room check passes).

AI-assisted: yes

@vayko thank you for the review. Agreed on keeping this one over #3278: it is the same fix on the newer base, and #3278 sits under a deleted account, so closing it needs a maintainer. I'll rebase again once #3458 lands and check that nothing else moved in that file. Head is now `b9109282ae`, rebased on `main` `ebbb84048c` with no code change (`cargo test -p leonida-gpu --locked`: 760 passed; clean-room check passes). AI-assisted: yes
pastel force-pushed fg-follow-cold-stall from b9109282ae to b638215d81 2026-12-04 16:12:39 +00:00 Compare
pastel force-pushed fg-follow-cold-stall from b638215d81 to b5534dec12 2026-12-05 06:11:19 +00:00 Compare
Sign in to join this conversation.
No description provided.