WIP: feat(runtime): keep local crash and unclean-end records #75
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
needs measurements
question
testing wanted
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!75
Loading…
Reference in a new issue
No description provided.
Delete branch "mooki/Longshot:feat/crash-record"
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?
Why
Keep a small local record when the game crashes, and distinguish that from a run ended by power loss or forced termination. Nothing is sent, no browser opens, and an optional private Windows dump stays outside ordinary attachments.
Draft: the new Longshot lifecycle proof works, but overhead and two interleaved comparisons are not measured. The ordinary branch control also took longer than main under different shared load: 40.6 versus 37.6 seconds, including startup. This is not a controlled performance result. Early captures on both builds show incomplete world geometry while shaders compile; they are not rendering-quality proof.
What changed
host/hos_crash_record.c: prepare the file, marker, privacy snapshot and bounded storage at startup; finish the independent text before the existing best-effort crash logging. Keep the existing CRASH lines and flush sites unchanged.host/mkw_glue.c,host/posix/win32_posix.candhost/hos_thread.c: collect fatal exceptions/signals and host/renderer fatal exits. Real hardware faults re-fault with their original information; externally delivered signals are re-raised. No product core-dump setting changes.Flags and settings
HOS_CRASH_MINIDUMPThe text record and running marker are always enabled when their local folder is writable; no text-recorder off switch is added. No menu row or saved option changes. Test crashes are external signals, not a new shareable-setting switch.
Measurements
Branch state: on main
77f605a25f175fbda9ad131ac6be96bbde85d9c2; head6987a643e8a8ce70ae4226790105320016b7737a; whole game-free suite on this head:513 passed, 0 failed, 19 skipped(main77f605a25f175fbda9ad131ac6be96bbde85d9c2:509 passed, 0 failed, 19 skipped); rebasing also removes the obsolete updater hooks and updates the exit inventory as described above; the remaining commits are unchanged apart from the results table.main:
d4a69456c9(2026-11-12)this PR: feat/crash-record @ d3374133aa2f38c457feb6f72cabb8add1c1e95e
Hardware: RTX 4090 24 GB, NVIDIA 615.78.08, Core i9-13900K, 93 GB visible RAM, Arch Linux 7.2.15-1-omarchy
Scene: copied child save in Kokiri Forest; 1920x1080 output, 1280x720 capture, cap 60, DLSS off, shader precompile off; windowless
Method: one ordinary main run, one ordinary branch run and exactly one deliberate branch SIGSEGV, 2026-11-13 UTC. Wait for known non-loading, non-event gameplay and 30 further presents; capture, then quit or signal the verified original game thread. The crash was authorized, launched when no other test game was running or waiting, and sent at 01:11:51 UTC. These are local-record correctness checks under shared CPU load, not timing measurements.
How to reproduce: on a disposable copy, load a copied save with precompile off; quit normally and check that no pending record or running marker remains. For a deliberate-crash test only, obtain local operator approval before sending SIGSEGV to that copy's verified game thread; inspect the newly completed text and match its run id to the log. Never do this to a player's live game.
d4a69456Since the measured run, main gained script/document/test changes and then the DLSS preset-settling fix. The retained game proof used
RX_VK_DLSS=0, so it does not enter the changed DLSS path. The crash writer and signal paths are unchanged; the later release-tooling merge removed the in-game updater and therefore its now-unused clean-exit hooks. Both independent results rows were kept. The measured binaries/commits remain labelled above, not relabelled as newly run builds. No second deliberate crash or main build was run.Inspected record excerpt, with run id, process id and guest diagnostics omitted from this public excerpt:
Both host offsets match the existing CRASH log. The complete local text passed checks for the username, home, hostname, Windows paths and IPv4 addresses; no save, environment value, memory-near-register row or raw stack-byte file is included. A text record still needs human inspection before sharing. The operating system may keep its own core; no core was extracted or uploaded.
The whole strict suite passes on the exact head in Branch state, after the rebase and exit-inventory adaptation. The old updater digest test was removed by main together with the old updater; its earlier missing-.NET failure is not a failure of the current suite. No surviving test was weakened and no package was installed.
For the Windows target, 8 translation units compile, 0 fail, 0 drivers are unjudged. Windows execution remains not tested.
Historical Hookshot evidence: the local source branch had 509 passing tests, the same one .NET prerequisite failure and 20 declared skips. Combined GitHub fork checkpoint
68f1769d9included crash checkpointd15927fdand passed both systems; it did not cover the later ELF-offset/thread-label corrections or this Longshot head. Those later corrections passed the retained native and Windows-target fixtures, not a new native Windows game run.Testing
Tested: the whole game-free suite passes on the exact head. Eight translation units compile for the Windows target, with no failures or unjudged drivers; not run on Windows. On Linux/NVIDIA, ordinary startup/gameplay/control quit produced no record, and one deliberate fatal signal produced a complete record with privacy/legacy-log agreement. These functional checks were not performance measurements.
Not tested: Longshot Windows execution/full host build, real Windows exception/minidump behavior, typical game-dump size, corrupted loader/heap outcomes, AMD/Intel game runs, a real window, complete optimized unwinding, new SIGKILL/restart proof, or overhead. This machine's available runtime proof is Linux/NVIDIA. Earlier SIGKILL/restart evidence is historical Hookshot, not relabelled as a Longshot run. One run per condition is not the required two interleaved pairs. The normal text path has no off toggle; a future cost comparison needs main versus this branch, with the private dump disabled.
Needs other testers:
Screenshots
Nothing on screen: the record is a text file; an excerpt is under Measurements. The capture taken just before the deliberate fault is kept with the run, not shown: it was taken while shaders were still compiling and shows incomplete scenery on both builds, which says nothing about this change.
Risk and rollback
A damaged process can still fail to write a record; checked frame-pointer traces may stop early. Disk errors or a read-only directory disable the record without stopping play. A renamed renderer fatal-prefix line could stop its classification. SIGTERM, logout and timeouts deliberately count only as an unclean end, not a crash. Windows dump filters do not guarantee privacy. Leave
HOS_CRASH_MINIDUMPunset; reverting this topic removes text recording and lifecycle hooks.Reviewer notes
Read the bounded writer and its startup-owned storage first, then the explicit exit inventory and Linux signal adapter. Existing log flushing is intentionally not replaced by a try-lock drain. The later freeze branch is stacked on this shared support; launcher import, pending-record menu integration and any sending/consent UI are separate work.
Issues
See #44
Checklist
For everyone
type(scope): description).main. — The tested base is named in Branch state; a later refresh is deferred to opening time.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.docs/tested-configurations.mdfor each measured run.tests/that reads changed source updated in this PR, not weakened.New on this forge; not opened on GitHub.
Assisted-by: GPT-6 Astra
Co-Authored-By: GPT-6 Astra [email protected]
Wording only: removed sentences about how my local test tooling ran the suite; they were of no use to a reviewer. The results are unchanged.
Rebased onto the release-tooling change that removed the in-game updater, so its two clean-exit hooks were removed with it. The test still inventories every remaining host exit and now rejects accidentally restoring the removed updater. The Linux crash proof remains labelled with the build actually run; this is still work in progress pending overhead measurements and other-platform testing.
a4bd549f21to6987a643e8View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.