The built-in menu mod goes over its 5 ms frame-listener budget while a settings page is built (settingsHost.decls) and is stopped #3185

Closed
opened 2026-12-04 17:58:08 +00:00 by klimovich008 · 1 comment
Member

The built-in system/menu mod goes over the 5 ms CPU budget of its longshot/game frame listener while the menu is in use. After 3 faults in a minute the script runtime stops it: the menu is gone for 5 s, starts again by itself, then faults again. It happened in two play sessions, on a fast desktop CPU, so a slower CPU (the Steam Deck) is likely to hit it more often.

Longshot version

longshot v3.2.0-358-g1bd6276ed (source 0ff03798), a local build: main b77c2f4b3 with #3081, #3117, #2129, #2135, #2029 and #2240 merged on top (a performance test). None of those touch game/ or the mods. Not yet reproduced on plain main.

What happened

Playing normally with the in-game menu open now and then. In one session the log has 5 faults and one stop (the first four shown; the fifth came later, again a 5.0 ms frame):

[error] script runtime: the built-in mod system/menu faulted, a bug in Longshot (please report it with this log): fault in longshot/game frame listener: it ran 5.1 ms of CPU, over the 5 ms a callback may (5.1 ms of CPU, 5.1 ms on the wall clock: the API's calls 1.8 ms, 1.3 ms of CPU (49, the most settingsHost.decls 1.7 ms in 1, 1.2 ms of CPU), the garbage collector 0.0 ms (0 runs), its own JavaScript ~3.3 ms; ...)
[error] script runtime: the built-in mod system/menu faulted, ...: fault in longshot/game frame listener: interrupted: it ran past the 5 ms of CPU it may (5.1 ms of CPU, 5.7 ms on the wall clock: the API's calls 1.8 ms, ... settingsHost.decls 1.7 ms in 1 ..., its own JavaScript ~3.9 ms; ...)
[error] script runtime: the built-in mod system/menu faulted, ...: it ran 5.2 ms of CPU, over the 5 ms a callback may (... settingsHost.decls 1.6 ms in 1 ..., its own JavaScript ~3.5 ms; ...)
[error] script runtime: the built-in mod system/menu stopped, a bug in Longshot (please report it with this log): stopped after 3 faults in a minute; the last, in longshot/game frame listener: it ran 5.2 ms of CPU, over the 5 ms a callback may (...)
[warn] script runtime: system/menu: a built-in mod stopped by its faults: it starts again by itself in 5 s, once this session (...)
script runtime: system/menu: starting again by itself, after its faults' stop
[error] script runtime: the built-in mod system/menu faulted, ...: interrupted: it ran past the 5 ms of CPU it may (5.2 ms of CPU, 5.3 ms on the wall clock: ... settingsHost.decls 1.8 ms in 1 ..., its own JavaScript ~3.4 ms; ...)

An earlier session on the same build had one fault (5.2 ms) and per-frame warnings of 2.2, 3.0 and 4.7 ms.

What the lines show:

  • The slow frames share one shape: about 49 API calls, with one settingsHost.decls call of 1.3-1.8 ms (up to 5.0 ms on the wall clock once), plus 3.2-3.9 ms of the menu's own JavaScript. They look like the frame where a settings page is built.
  • The budgets disagree: the per-frame warning says "more than 2 ms is warned about, more than 8 ms is a fault", but the frame listener's callback faults at 5 ms (game/crates/script/src/runtime.rs:767). A frame of 5.0-5.2 ms is only a warning by the first rule, yet a fault by the second.
  • The garbage collector played no part: 0 runs in every fault.

Expected: opening or paging the built-in menu never faults, and it does not stop.

Where in the game

The in-game menu (Insert), in Hyrule Field, child Link (the session also went through Hyrule Castle, Kakariko Village and the Graveyard).

How often

6 faults in two sessions; the menu was stopped once.

Graphics card and driver version

AMD Radeon RX 9070 XT, Adrenalin 26.11.2.

CPU, RAM and operating system

AMD Ryzen 7 5700X3D (8 cores, 16 threads), 64 GB, Windows 11.

Changes from the defaults

5120x1440 fullscreen (ultrawide), AMD FSR 4 Native AA, Skip Upscaler Wait off. No longshot_env.txt, no overlay or injector.

Possible directions (not tried)

  • Make settingsHost.decls cheaper: cache the declarations or hand them over once.
  • Build a settings page over more than one frame.
  • Give a built-in mod's page build the per-frame budget rather than the 5 ms callback one.

🤖 Generated with Claude Code

The built-in `system/menu` mod goes over the 5 ms CPU budget of its `longshot/game` frame listener while the menu is in use. After 3 faults in a minute the script runtime stops it: the menu is gone for 5 s, starts again by itself, then faults again. It happened in two play sessions, on a fast desktop CPU, so a slower CPU (the Steam Deck) is likely to hit it more often. ### Longshot version `longshot v3.2.0-358-g1bd6276ed (source 0ff03798)`, a local build: main b77c2f4b3 with #3081, #3117, #2129, #2135, #2029 and #2240 merged on top (a performance test). None of those touch `game/` or the mods. Not yet reproduced on plain main. ### What happened Playing normally with the in-game menu open now and then. In one session the log has 5 faults and one stop (the first four shown; the fifth came later, again a 5.0 ms frame): ``` [error] script runtime: the built-in mod system/menu faulted, a bug in Longshot (please report it with this log): fault in longshot/game frame listener: it ran 5.1 ms of CPU, over the 5 ms a callback may (5.1 ms of CPU, 5.1 ms on the wall clock: the API's calls 1.8 ms, 1.3 ms of CPU (49, the most settingsHost.decls 1.7 ms in 1, 1.2 ms of CPU), the garbage collector 0.0 ms (0 runs), its own JavaScript ~3.3 ms; ...) [error] script runtime: the built-in mod system/menu faulted, ...: fault in longshot/game frame listener: interrupted: it ran past the 5 ms of CPU it may (5.1 ms of CPU, 5.7 ms on the wall clock: the API's calls 1.8 ms, ... settingsHost.decls 1.7 ms in 1 ..., its own JavaScript ~3.9 ms; ...) [error] script runtime: the built-in mod system/menu faulted, ...: it ran 5.2 ms of CPU, over the 5 ms a callback may (... settingsHost.decls 1.6 ms in 1 ..., its own JavaScript ~3.5 ms; ...) [error] script runtime: the built-in mod system/menu stopped, a bug in Longshot (please report it with this log): stopped after 3 faults in a minute; the last, in longshot/game frame listener: it ran 5.2 ms of CPU, over the 5 ms a callback may (...) [warn] script runtime: system/menu: a built-in mod stopped by its faults: it starts again by itself in 5 s, once this session (...) script runtime: system/menu: starting again by itself, after its faults' stop [error] script runtime: the built-in mod system/menu faulted, ...: interrupted: it ran past the 5 ms of CPU it may (5.2 ms of CPU, 5.3 ms on the wall clock: ... settingsHost.decls 1.8 ms in 1 ..., its own JavaScript ~3.4 ms; ...) ``` An earlier session on the same build had one fault (5.2 ms) and per-frame warnings of 2.2, 3.0 and 4.7 ms. What the lines show: - **The slow frames share one shape:** about 49 API calls, with one `settingsHost.decls` call of 1.3-1.8 ms (up to 5.0 ms on the wall clock once), plus 3.2-3.9 ms of the menu's own JavaScript. They look like the frame where a settings page is built. - **The budgets disagree:** the per-frame warning says "more than 2 ms is warned about, more than 8 ms is a fault", but the frame listener's callback faults at 5 ms (`game/crates/script/src/runtime.rs:767`). A frame of 5.0-5.2 ms is only a warning by the first rule, yet a fault by the second. - **The garbage collector** played no part: 0 runs in every fault. Expected: opening or paging the built-in menu never faults, and it does not stop. ### Where in the game The in-game menu (Insert), in Hyrule Field, child Link (the session also went through Hyrule Castle, Kakariko Village and the Graveyard). ### How often 6 faults in two sessions; the menu was stopped once. ### Graphics card and driver version AMD Radeon RX 9070 XT, Adrenalin 26.11.2. ### CPU, RAM and operating system AMD Ryzen 7 5700X3D (8 cores, 16 threads), 64 GB, Windows 11. ### Changes from the defaults 5120x1440 fullscreen (ultrawide), AMD FSR 4 Native AA, Skip Upscaler Wait off. No `longshot_env.txt`, no overlay or injector. ### Possible directions (not tried) - Make `settingsHost.decls` cheaper: cache the declarations or hand them over once. - Build a settings page over more than one frame. - Give a built-in mod's page build the per-frame budget rather than the 5 ms callback one. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Member

This exact system/menu frame-budget fault was fixed in PR #3098, which caches settingsHost.decls and other settings-menu work. The fix is in nightly-1047-76092c5e; your build (3.2.0-358) predates it. Please try a build containing that change and check whether the menu still faults. The PR's test specifically opens the Insert menu and visits its tabs and submenus, verifying there are no system/menu fault or stop lines.

If that doesn't solve it, say what happened (and attach your log); a maintainer takes it from there.


For maintainers

PR #3098 directly addresses the reported settingsHost.decls / system/menu 5 ms frame faults. It was merged 2026-12-03 and first appears in nightly-1047-76092c5e; reported local build 3.2.0-358 is older.


Automated triage by BeanBot (gpt-6-luna). Nothing was run; a maintainer decides.

This exact `system/menu` frame-budget fault was fixed in [PR #3098](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/3098), which caches `settingsHost.decls` and other settings-menu work. The fix is in **nightly-1047-76092c5e**; your build (`3.2.0-358`) predates it. Please try a build containing that change and check whether the menu still faults. The PR's test specifically opens the Insert menu and visits its tabs and submenus, verifying there are no `system/menu` fault or stop lines. If that doesn't solve it, say what happened (and attach your log); a maintainer takes it from there. --- **For maintainers** PR #3098 directly addresses the reported `settingsHost.decls` / system/menu 5 ms frame faults. It was merged 2026-12-03 and first appears in nightly-1047-76092c5e; reported local build 3.2.0-358 is older. --- <sub>Automated triage by BeanBot (gpt-6-luna). Nothing was run; a maintainer decides.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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
MagicBeanDev/Longshot#3185
No description provided.