mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:05:54 +01:00
[PR #2156] runtime: say so when the title's hang watchdog ends the run (RT-WATCHDOG-FIRED-NOTE) #2159
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2159
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2156
Author: @quartz-heron-58
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:watchdog-fired-note📝 Commits (1)
9a013f6runtime: say so when the title's hang watchdog ends the run (RT-WATCHDOG-FIRED-NOTE)📊 Changes
4 files changed (+215 additions, -16 deletions)
View changed files
📝
runtime/CMakeLists.txt(+6 -0)📝
runtime/src/main.cpp(+53 -16)➕
runtime/src/title_watchdog.h(+64 -0)➕
runtime/test/title_watchdog_test.cpp(+92 -0)📄 Description
Claimed in the coordination issue as: RT-WATCHDOG-FIRED-NOTE (#1608)
What and why
The retail title runs a hang watchdog: when its main loop has not reported progress for 30 one-second ticks, it calls a crash callback and writes to address 0 on purpose (the comment at the top of
runtime/src/main.cpphas described this sinceLEONIDA_TITLE_WATCHDOGwas added). Under the runtime the main loop can stall that long for ordinary reasons, a pipeline build for instance. The log then showed only an access violation writing address 0 in title code, and people take it for a fault of the layer or of whatever happened just before it: #2019 (read as a consequence of two DirectStorage errors), #1915, and my own first boots with input. Each time someone had to explain it by hand.Now the runtime says it. When the unhandled-exception filter sees that write, it prints once:
How it is recognised, with nothing main.cpp did not already know:
LEONIDA_TITLE_WATCHDOG=0already made; any other build is left alone);The constants and the recognition move from main.cpp to
runtime/src/title_watchdog.has pure functions (trap_present,fired), so they can be tested without Windows or a game file. No new addresses, no behaviour change: the exception goes on to the cache write and the title's filter exactly as before, andLEONIDA_TITLE_WATCHDOG=0works as it did.Tested
Windows 11 (26300), MSVC Build Tools 2022, RelWithDebInfo,
scripts\build_runtime.ps1 -FetchSdl3on mainc50ed94b3plus this commit: build exit 0.title_watchdog_test(new, CPU only, a zeroed buffer stands in for the image): 19 checks, 0 failures. ctesttitle_watchdogandarena_blockspass.LEONIDA_TITLE_WATCHDOGunset: the last submission report is at 200 s, the title's exception (write to address 0, three title frames, the second one the trap's address) is at 228.8 s, and the log has the new line exactly once, directly before "unhandled exception 0xc0000005: writing the session pipeline cache". No device-loss report in that run. One run.scripts/check_no_game_data.pyon the four changed files: clean.Not run: the whole ctest set; a run with
LEONIDA_TITLE_WATCHDOG=0on this branch (the kick path only changed in where it gets its constants and its build check); Linux/Wine and clang-cl; a build withoutLEONIDA_VULKAN_DEVICE(the filter does not exist there, so the note does not either).Seen while testing, not from this change: ctest
gameinput_scriptfails on mainc50ed94b3in an SDL3 build (reported in #1608; it comes from #2098's change to how long a scripted press is held).GPUs tested: NVIDIA GeForce RTX 4080, driver 621.24, Windows 11 (the real boot above; the unit test needs no GPU)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator rule)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.