mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 15:19:58 -04:00
Put away the boot prebuild's crash marker and journal when the cheats rebuild ends the process.
cheats.c rebuild_if_needed runs in rt_boot after the prewarm thread has started, and ended the process with only prof_write and rtss_limit_restore. By then vk_pipeline.c may have written pipeline-prewarm-running.txt (pm_set) and opened the boot's journal of library builds; left in place, the next start took the rebuild's end for a driver crash in the boot's builds (pm_skipped counts it as a quiet end; three of them skip the prebuild). The rebuild.skip file keeps it to one quiet end per rebuild. The rebuild's end now takes the orderly end's guard (rt_exit_begin), puts RTSS's profile back, clears the prewarm marker, closes the boot's journal through the new vk_pipeline.c vk_pipeline_boot_abandon (journal_close, as vk_pipeline_save_exit does), writes the summary and ends. No save is mounted and no menu has run yet, so the saves and nx2navi.ini have nothing to write. A narrow race stays: pm_set writes the marker and then sets pm_on, so a clear in between leaves the file; the window's close has the same one. tests/exit_order_check.py checks that order in rebuild_if_needed. Not reproduced before the change; exit_order_check and the compile checks of every runtime file pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
"""The orderly end of the process (runtime/gfx_present.c rt_exit_begin and rt_exit_steps): the steps run in one order,
|
||||
with what a kill of the process must not lose (a save Commit in flight, RivaTuner Statistics Server's profile, the
|
||||
controller's rumble, the settings, the frame-time summary) before the slow pipeline save and the final save flush
|
||||
last; it runs once, and a second caller on another thread stays where it is. The frame-time summary of the exit
|
||||
last; it runs once, and a second caller on another thread stays where it is. The cheats rebuild's end, before the
|
||||
guest runs, puts away the boot prebuild's crash marker and journal (runtime/cheats.c rebuild_if_needed). The frame-time summary of the exit
|
||||
(runtime/perf.c ft_stop) waits for a present thread's update under way and keeps later ones out. Builds those
|
||||
functions into a test program against stand-ins, and checks statically that every orderly end goes through them.
|
||||
No game files.
|
||||
@@ -150,6 +151,16 @@ def static_checks():
|
||||
print(f'{name}: {"rt_exit_begin, then " + steps + ", then plat_exit" if ok else "FAIL"}'
|
||||
+ (f'; calls exit steps of its own: {", ".join(own)}' if own else ''), flush=True)
|
||||
bad += not ok
|
||||
# the cheats rebuild's end, before the guest runs: the guard, RTSS, the boot's marker and journal, the summary
|
||||
cheats = (RT / 'cheats.c').read_text(encoding='utf-8')
|
||||
body = strip_comments(function(cheats, 'static void rebuild_if_needed(const char *dir)'))
|
||||
tail = body[body.rfind('plat_spawn('):]
|
||||
want = ['rt_exit_begin', 'rtss_limit_restore', 'vk_pipeline_prewarm_marker_clear', 'vk_pipeline_boot_abandon',
|
||||
'prof_write', 'plat_exit']
|
||||
pos = calls_in_order(tail, want[:-1]) + [tail.rfind('plat_exit(')] # the last plat_exit is the end's
|
||||
ok = None not in pos and pos == sorted(pos)
|
||||
print(f'cheats.c rebuild_if_needed: {", ".join(want)} in that order: {"ok" if ok else "FAIL " + str(pos)}', flush=True)
|
||||
bad += not ok
|
||||
steps = function(gp, 'void rt_exit_steps(unsigned what)')
|
||||
pos = calls_in_order(steps, ['rtss_limit_restore', 'vk_pipeline_save_exit'])
|
||||
ok = None not in pos and pos[0] < pos[1]
|
||||
|
||||
Reference in New Issue
Block a user