Game: built-in Insert menu dies in Russian: "help is at most 1024 bytes" (Game frame rate cap help + frame generation hint) #3101
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#3101
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Longshot version
nightly-1039-1c91b18f (source 481c7a03)
Channel
Nightly
What kind of problem
Something else
What happened
With the UI/menu language set to Russian (game_language=ru, Menu language=Auto), the built-in Insert menu (system/menu 1.0.0) faults while it builds its rows and is stopped after three faults. The fallback "Меню Longshot остановлено" appears; English is fine. Saves are not involved. Only Longshot's built-in mods are enabled (no third-party mods).
Steps:
Expected: the menu opens in Russian, as it does in English.
Actual: the menu does not open; after three faults it is stopped for the session.
Root cause: helpOf() in game/mods/menu/src/view.ts joins d.help + s.hint + s.locked with "\n\n". The UI caps the help prop at 1024 UTF-8 bytes (game/crates/ui/src/ops.rs, text(v, k, 1024)). For Graphics -> Game frame rate cap the Russian help alone is 918 bytes; its hintWhen from framegen.capHint (settings/facts.rs framegen_ux_hint) adds 153 bytes for "60 -> 180 FPS (3x)", so the joined text is 1073 bytes and create fails. English is 430 + 92 = 524 bytes, under the cap. Other Russian rows are close too (Shadows -> Shadow resolution is 957 bytes with its hint). The byte cap also penalizes non-Latin scripts (Russian 2 bytes/char, CJK 3).
Suggested fix: in helpOf, keep d.help + s.locked, add s.hint only if the UTF-8 total fits, and cut on a code-point boundary as a last resort:
A regression test with the Russian frame_rate_cap row + framegen.capHint would catch it. The same unbounded join exists in game/mods/mods-tab/src/view.ts and main.tsx.
Where in the game
The Insert menu, anywhere in the game (it fails as the menu opens)
How often
Every time
Graphics card and driver version
AMD Radeon RX 6800, AMD 26.11.2 (driver 32.0.21045.29003)
CPU, RAM and operating system
Intel Core i5-12600KF, 32 GB, Windows 11 IoT Enterprise LTSC (26100)
Changes from the defaults
game_language=ru, menu_language=0 (Auto), frame_generation=1 (On), frame_generation_by=1 (Auto), frame_rate_cap=0 (60), upscaling=2. Display 2560x1440 @ 180 Hz. No overlays, ReShade, shader-cache tools, frame-generation injectors or longshot_env.txt.
longshot_log.txt
Longshot nightly-1039-1c91b18f (source 481c7a03), Windows x64
Excerpt from diagnostics/logs/longshot_log.1.txt (full run log attached):
[hos host] oe: language ru (game_language in the settings)
[hos host] vk: device 0: AMD Radeon RX 6800, Vulkan 1.4, driver 0x800161
[hos host] vk: frame interpolation ready: Auto, a frame for each of the display's refreshes (180 Hz; up to 4 a game frame)
[hos sead::MainThread] [error] script runtime: the built-in mod system/menu faulted, a bug in Longshot (please report it with this log): fault in longshot/ui commit: op 4 (create): help is at most 1024 bytes
[hos sead::MainThread] [error] script runtime: the built-in mod system/menu faulted, a bug in Longshot (please report it with this log): fault in longshot/ui commit: op 166 (create): help is at most 1024 bytes
[hos sead::MainThread] [error] script runtime: the built-in mod system/menu faulted, a bug in Longshot (please report it with this log): fault in longshot/ui commit: op 166 (create): help is at most 1024 bytes
[hos sead::MainThread] [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/ui commit: op 166 (create): help is at most 1024 bytes
Screenshots or video
No response
Before you send it
Checked: this looks like a valid bug, and its cause is visible in the code.
The menu combines a row’s help and hint without checking their length, while the UI rejects help longer than 1024 UTF-8 bytes. The Russian frame-rate-cap text and the frame-generation hint follow that path, consistent with the reported fault. I could not independently verify the exact byte counts or reproduce the session from the attached logs.
For maintainers
Attachment confirms repeated
help is at most 1024 byteserrors followed by the built-in system/menu being stopped after three faults. The reporter provides specific candidate path/function and UTF-8 byte counts, but these have not been independently verified against code in this run.Blame attributes the unbounded join and UI limit to
d984fd704; the Russian frame-rate-cap help was added in133b3ba2b. The reported nightly tag exists. Since that tag,313178e5dchanged some related files, but the join and UI limit remain on main. The report’s exact byte counts were not independently checked.Seen in the code:
Automated triage by BeanBot (gpt-6-luna). Nothing was run; a maintainer decides.
Verified on nightly-1040-1a86a938, with the exact bytes
The fault reproduces on the next nightly with the same settings.
diagnostics/logs/longshot_log.1.txton 1040 has 5 occurrences and ends the same way:Byte counts, from
maintodayI fetched the current
mainfiles and measured the strings withTextEncoder(UTF-8 bytes), so these are not estimates:game/mods/menu/src/view.ts(helpOf, line 275) still does[d.help, s.hint, s.locked].filter(...).join("\n\n")with no cap.game/crates/ui/src/ops.rs:483comparess.len()(UTF-8 bytes) to the cap;:648-650appliestext(v, k, 1024)tohelp.game/mods/menu/strings/ru.json:325): 918 bytes.framegen.capHintfilled for 60 -> 180 FPS (3x) (ru.json:28): 153 bytes.918 + 2 + 153 = 1073 > 1024, socreatefails at op 166. English is430 + 2 + 92 = 524, which is why only the Russian row trips it.This matches the triage: a plain UTF-8 byte-cap overflow, not a settings or save problem. It will also hit any language where the same text is longer in bytes (Cyrillic 2 bytes/char, CJK 3), and other Russian rows are close (Shadows -> Shadow resolution is 957 bytes with its hint).
Confirmed by a local fix
For verification, I patched the compiled
helpOfinlongshot-game.exelocally (keepd.help+s.locked; adds.hintonly if it fits; otherwise truncate on a code-point boundary). With that, the Insert menu opens and works in Russian on both 1039 and 1040, and the builder'sverifypasses (58 files). Saves and settings were not touched. The auto-update from 1039 to 1040 reverted the patch, which is why an upstream fix matters.Suggestion
A regression test with the Russian
frame_rate_caprow +framegen.capHintwould catch this and the next long translation. The same join helper is ingame/mods/mods-tab/src/view.ts:52. I can open a PR with thehelpOfchange and the test if that helps.@user3324 wrote in #3101 (comment):
Hello, could you let me know how to fix this? It’s really bugging me. I’m holding off on updating until this gets sorted out.
HumanBean referenced this issue2026-12-04 18:31:32 +00:00