a render3d program's window is opened by its renderer, not by the runtime before main

rt_init opened every windowed program's window before main, and render3d's gvk_open then only
retitled it. win_open makes the window when there is none (cocoa.ll and win32.ll alike), so for a
program that has gvk_open the runtime now leaves it (window_later(), an intrinsic: windowed and
render3d present): a process that never reaches the renderer - Maroon Lake's launcher watcher, which
only spawns the game and waits - never makes a window, an NSApplication or AppKit's heap.

Audited every window native reachable before the renderer opens (settings, telemetry, rescue, the
watcher reach App.* and Input.*): on macOS each that loads W_win / W_app / W_view / W_mtl / W_glctx
checks it for null; win_close, win_running, win_text, win_held, win_cursor_mode, win_gl_scale and the
pad and touch reads load none. On Windows each that loads W_hwnd / W_hdc checks it; the rest load none.

Measured, windowed, R3D_DEV=1 R3D_PLAYTEST=2, both killed after:
- the game straight to play: the window, the Vulkan swapchain (1920x1080) and the valley's models
  come up, alive at 30 s;
- the launcher (R3D_GAME=launcher): the watcher 11 MB -> 3.7 MB, its launcher window alive at 10 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 14:19:10 +03:00
parent 30a641d249
commit 84d754a4e9
4 changed files with 43894 additions and 43785 deletions

View file

@ -85,7 +85,7 @@ function rt_init(rt_core_st: mut RtCoreState, rt_image_st: mut RtImageState, rt_
rt_tt_init(rt_truetype_st)
rt_ui_init(rt_ui_st)
rt_clear(rt_core_st, rt_rng_st, 0)
if is_windowed() {
if is_windowed() and not window_later() {
win_open(rt_fbw, rt_fbh, 3, game_title())
}
}

View file

@ -17,7 +17,7 @@ function is_intrinsic2(name: pointer) -> bool {
if (name == "free") or (name == "fill") { return true }
if (name == "offset") or (name == "read_char") { return true }
if (name == "as_fixed") or (name == "as_int") { return true }
if (name == "is_windowed") or (name == "game_title") { return true }
if (name == "is_windowed") or (name == "game_title") or (name == "window_later") { return true }
if (name == "win_open") or (name == "win_poll") or (name == "win_present") { return true }
if (name == "win_running") or (name == "win_close") { return true }
if (name == "win_held") or (name == "win_mouse") { return true } # #50 device layer
@ -60,6 +60,9 @@ function emit_intrinsic2(name: pointer, e: Node) -> Val {
if (name == "as_fixed") { let a = emit_expr(e.kids[0]); return val(a.code, "fixed") }
if (name == "as_int") { let a = emit_expr(e.kids[0]); return val(a.code, "int") }
if (name == "is_windowed") { if g_windowed { return val("1", "bool") }; return val("0", "bool") }
# a render3d program opens its window when its renderer does (gvk_open): the runtime leaves it till
# then, so a process that never gets that far (the launcher's watcher) never makes one
if (name == "window_later") { if g_windowed and find_fn("gvk_open") != null { return val("1", "bool") }; return val("0", "bool") }
if (name == "game_title") { return val("@.gametitle", "string") }
# windowing hooks — declared external; only reached on the is_windowed() branch
if (name == "win_poll") { return val(emit_bind("call i32 @win_poll()"), "int") }

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff