FPS reduced to exactly 5 after about 5 minutes of gameplay #3260

Open
opened 2026-12-02 23:08:18 +00:00 by krasnykid · 1 comment
krasnykid commented 2026-12-02 23:08:18 +00:00 (Migrated from github.com)
Contributor

Imported from ubiquitarianism/leonida. Originally posted by krasnykid on 2026-12-02T23:08:18Z.


was running a build from 2 days before with 0 issues

today, after i pulled and built from master, after about 5 minutes of ordinary gameplay frames tank to about half.

more precisely, the fps drop from about 7-16 to a pretty much constant 5 fps indefinitely, i need to rerun the game to get the old framerate back and again, after 5 minutes, i'm met with the fps drop.

commit i built from is 8a9235d, from wed dec 2 20:36:50

log:

play-1202-234222.log

i've conducted some research of my own, output of gemini argon:

Yes, the log (play-1202-234222.log) captures the exact moment and root cause of what happened.

What the log shows

  1. The exact timeline of the drop:

    • From 22:43:56 to 22:46:40 (about 4.5 minutes into the session), the game was rendering at 10–15 FPS (upscaled by 2x DLSS Frame Generation to 20–30 shown FPS).
    • At 22:46:41.58, a single stutter/resolution change caused one frame to miss its G-buffer tag or take over 100 ms, which caused Streamline (dlssg_get_state) to report numFramesActuallyPresented = 1 for that poll (index = 3120).
    • Immediately after that, at 22:46:46.26, the new auto-frame-limiter (LEONIDA_FG_LIMIT_FPS=auto, merged today in PR #3062) logged:
      22:46:41.581288Z INFO leonida_gpu::fg: frame generation: the frame limit follows the rendered rate (LEONIDA_FG_LIMIT_FPS=auto) rendered_fps=13.4 shown_fps=13.4
      22:46:42.849828Z INFO leonida_gpu::fg: frame generation: the frame limit follows the rendered rate (LEONIDA_FG_LIMIT_FPS=auto) rendered_fps=11.6 shown_fps=11.6
      22:46:46.263568Z INFO leonida_gpu::fg: frame generation: the frame limit follows the rendered rate (LEONIDA_FG_LIMIT_FPS=auto) rendered_fps=10.0 shown_fps=10.0
      
    • Starting at 22:46:48 and continuing for the rest of the log until you quit at 22:47:30, every single frame time report locked onto exactly 200.0 ms (5.0 rendered FPS):
      frame times over 5.6 s, 28 frames: median 200.0 ms, 95th percentile 200.0, 99th 200.0, longest 200.0
      
  2. Why it locked at 5 FPS (and why the world slowed down):

    • The 5 FPS lock (New in today's build, PR #3062): Today's build introduced LEONIDA_FG_LIMIT_FPS=auto (d3d12/crates/leonida-gpu/src/fg.rs). It measures your rendered frame rate and sets a Reflex frame limit (frameLimitUs = rendered_us / shown).
      • When a hitch or untagged frame happens on a POLL boundary (every 10 frames), Streamline temporarily reports SHOWN = 1 instead of 2.
      • fg.rs sees SHOWN drop from 2 to 1 and immediately sends frameLimitUs = 100,000 us (10 FPS total) to Reflex.
      • However, on the very next frame, DLSS Frame Generation resumes generating 2 frames per rendered frame, while Reflex is still enforcing a 10 FPS limit on all shown frames (rendered + generated).
      • Because 2 shown frames are produced per rendered frame under a 10 shown-FPS cap, Reflex sleeps the render thread until each rendered frame takes 200.0 ms (5 FPS).
      • And because every frame is now taking 200 ms (> 100 ms), Streamline spams Frame rate over 100.00ms, reseting frame timer on every present, keeping SHOWN = 1 or keeping Follow clamped at its SLOWEST_US (100 ms) floor—creating a permanent 5 FPS deadlock that can never recover!
    • Why the whole world slowed down: As documented in d3d12/crates/leonida-loader/src/hooks.rs, the game's internal simulation clock clamps frame delta-time to a maximum of 1/15 s (66.7 ms, or 15 FPS) by default. When rendered FPS is forced down from ~12 FPS to 5 FPS (200 ms per frame), each frame only advances game time by 66.7 ms instead of 200 ms—making the entire game world run at 1/3rd real-time speed.
    • (Note: Your NVIDIA shader cache setting did not cause this; the pipeline library loaded cleanly at startup with 0 pipeline stalls during the lag).

How to work around it right now (or we can patch it in code)

You can bypass this bug immediately via environment variables / launcher settings:

  1. Disable the broken auto-Reflex limiter:
    Set LEONIDA_FG_LIMIT_FPS=0 (or pass -FgLimitFps 0 / set it in your environment before launching). This disables the new auto Reflex limiter and restores the previous build's behavior.
  2. Optional — Prevent world slow-motion at low FPS:
    Set LEONIDA_SIM_MAX_STEP_MS=200 (or 250). This raises the game timer's maximum simulation step from 66.7 ms (15 FPS) to 200 ms (5 FPS), so even if FPS dips below 15, the game world and physics continue running at real-time speed.

Would you like me to fix this bug in d3d12/crates/leonida-gpu/src/fg.rs (and/or adjust your local launch script)?

prompt was:

C:\Users\krasnykid\AppData\Local\Leonida\logs\play-1202-234222.log

this is my last play log

i had the same issue happen to make thrice on the newest build already.

game runs at 10fps, upscaled by 2x is 20, completetly playable

about 5 minutes in, the game fps reduce to about 5, and whole world seems to literally slow down.

this didn't happen on previous build

i set nvidia shader cache to unlimited for this build

do logs provide any useful information?

the lag began about a minute prior to quitting game, the same issue happened thrice already

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:6756473820 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3260). Originally posted by [krasnykid](https://github.com/krasnykid) on 2026-12-02T23:08:18Z. --- was running a build from 2 days before with 0 issues today, after i pulled and built from master, after about 5 minutes of ordinary gameplay frames tank to about half. more precisely, the fps drop from about 7-16 to a pretty much constant 5 fps indefinitely, i need to rerun the game to get the old framerate back and again, after 5 minutes, i'm met with the fps drop. commit i built from is 8a9235d, from wed dec 2 20:36:50 log: [play-1202-234222.log](https://github.com/user-attachments/files/35770076/play-1202-234222.log) i've conducted some research of my own, output of gemini argon: > Yes, the log (`play-1202-234222.log`) captures the exact moment and root cause of what happened. > > ### What the log shows > > 1. **The exact timeline of the drop:** > * From `22:43:56` to `22:46:40` (about 4.5 minutes into the session), the game was rendering at **10–15 FPS** (upscaled by 2x DLSS Frame Generation to **20–30 shown FPS**). > * At **`22:46:41.58`**, a single stutter/resolution change caused one frame to miss its G-buffer tag or take over 100 ms, which caused Streamline (`dlssg_get_state`) to report `numFramesActuallyPresented = 1` for that poll (`index = 3120`). > * Immediately after that, at **`22:46:46.26`**, the new auto-frame-limiter (`LEONIDA_FG_LIMIT_FPS=auto`, merged today in PR #3062) logged: > ```text > 22:46:41.581288Z INFO leonida_gpu::fg: frame generation: the frame limit follows the rendered rate (LEONIDA_FG_LIMIT_FPS=auto) rendered_fps=13.4 shown_fps=13.4 > 22:46:42.849828Z INFO leonida_gpu::fg: frame generation: the frame limit follows the rendered rate (LEONIDA_FG_LIMIT_FPS=auto) rendered_fps=11.6 shown_fps=11.6 > 22:46:46.263568Z INFO leonida_gpu::fg: frame generation: the frame limit follows the rendered rate (LEONIDA_FG_LIMIT_FPS=auto) rendered_fps=10.0 shown_fps=10.0 > ``` > * Starting at **`22:46:48`** and continuing for the rest of the log until you quit at `22:47:30`, every single frame time report locked onto **exactly 200.0 ms (5.0 rendered FPS)**: > ```text > frame times over 5.6 s, 28 frames: median 200.0 ms, 95th percentile 200.0, 99th 200.0, longest 200.0 > ``` > > 2. **Why it locked at 5 FPS (and why the world slowed down):** > * **The 5 FPS lock (New in today's build, PR #3062):** Today's build introduced `LEONIDA_FG_LIMIT_FPS=auto` (`d3d12/crates/leonida-gpu/src/fg.rs`). It measures your rendered frame rate and sets a Reflex frame limit (`frameLimitUs = rendered_us / shown`). > * When a hitch or untagged frame happens on a `POLL` boundary (every 10 frames), Streamline temporarily reports `SHOWN = 1` instead of `2`. > * `fg.rs` sees `SHOWN` drop from `2` to `1` and immediately sends `frameLimitUs = 100,000 us` (10 FPS total) to Reflex. > * However, on the very next frame, DLSS Frame Generation **resumes generating 2 frames per rendered frame**, while Reflex is still enforcing a 10 FPS limit on *all shown frames* (rendered + generated). > * Because 2 shown frames are produced per rendered frame under a 10 shown-FPS cap, **Reflex sleeps the render thread until each rendered frame takes 200.0 ms (5 FPS)**. > * And because every frame is now taking 200 ms (> 100 ms), Streamline spams `Frame rate over 100.00ms, reseting frame timer` on every present, keeping `SHOWN = 1` or keeping `Follow` clamped at its `SLOWEST_US` (100 ms) floor—creating a permanent **5 FPS deadlock** that can never recover! > * **Why the whole world slowed down:** As documented in `d3d12/crates/leonida-loader/src/hooks.rs`, the game's internal simulation clock clamps frame delta-time to a maximum of `1/15 s` (`66.7 ms`, or 15 FPS) by default. When rendered FPS is forced down from ~12 FPS to 5 FPS (200 ms per frame), each frame only advances game time by 66.7 ms instead of 200 ms—making the entire game world run at **1/3rd real-time speed**. > * *(Note: Your NVIDIA shader cache setting did not cause this; the pipeline library loaded cleanly at startup with 0 pipeline stalls during the lag).* > > --- > > ### How to work around it right now (or we can patch it in code) > > You can bypass this bug immediately via environment variables / launcher settings: > > 1. **Disable the broken auto-Reflex limiter:** > Set `LEONIDA_FG_LIMIT_FPS=0` (or pass `-FgLimitFps 0` / set it in your environment before launching). This disables the new `auto` Reflex limiter and restores the previous build's behavior. > 2. **Optional — Prevent world slow-motion at low FPS:** > Set `LEONIDA_SIM_MAX_STEP_MS=200` (or `250`). This raises the game timer's maximum simulation step from 66.7 ms (15 FPS) to 200 ms (5 FPS), so even if FPS dips below 15, the game world and physics continue running at real-time speed. > > Would you like me to fix this bug in `d3d12/crates/leonida-gpu/src/fg.rs` (and/or adjust your local launch script)? prompt was: > C:\Users\krasnykid\AppData\Local\Leonida\logs\play-1202-234222.log > > this is my last play log > > i had the same issue happen to make thrice on the newest build already. > > game runs at 10fps, upscaled by 2x is 20, completetly playable > > about 5 minutes in, the game fps reduce to about 5, and whole world seems to literally slow down. > > this didn't happen on previous build > > i set nvidia shader cache to unlimited for this build > > do logs provide any useful information? > > the lag began about a minute prior to quitting game, the same issue happened thrice already
boludoz commented 2026-12-02 23:35:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by boludoz on 2026-12-02T23:35:57Z.


image

Performance has worsened significantly over the last 24 hours or so (a little less).

image

RTX 3080, Ryzen 7 9850X3D, 32 GB of RAM.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7362199098 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3260#issuecomment-7362199098). Originally posted by [boludoz](https://github.com/boludoz) on 2026-12-02T23:35:57Z. --- <img width="2460" height="1385" alt="image" src="https://github.com/user-attachments/assets/8900fc66-09c8-4b83-8397-ea719f1ccddd" /> Performance has worsened significantly over the last 24 hours or so (a little less). <img width="708" height="437" alt="image" src="https://github.com/user-attachments/assets/8a7afe7e-f910-45c7-aeb6-9e6a658a9058" /> RTX 3080, Ryzen 7 9850X3D, 32 GB of RAM.
Sign in to join this conversation.
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
ProjectLeonida/mandy#3260
No description provided.