You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
embedded runtime: intermittent startup spin (window never renders) and packaged-app orderly-exit semantics contradict the docs #329
Payback save-lifecycle journey under #314 (real product #2, PR turinglambdaai/payback#29, 2026-10-26). Both findings reproduce on CI runners as well as a local macOS 26 machine; the second contradicts shipped documentation.
Finding 1 — intermittent startup spin (heisenbug)
Occasionally, after launch the embedded backend reports started but the window never renders, with dozens of Racket threads spinning at full CPU. Observed: locally on macOS 26 (twice, including one self-unrecoverable orphan instance that survived the suite), and on CI mac legs (the same signature during the PR's iteration). Suspected startup race inside the embedded runtime. The journey's e2e driver ships a mitigation (spin-signature detection → one bounded relaunch), but the root cause is upstream of any product.
Requested: diagnose the runtime startup path (backend-started → first render) for a race; the journey log (machine-local ~/Codes/payback-journey/journey-log.md, §5.2.5) has process/thread evidence and the detection signature.
Finding 2 — orderly exit: the documented paths do not work; only the quit Apple Event does
native-ui-testing.md states "native window close or SIGTERM completes the orderly backend shutdown". In reality, on a packaged app: SIGTERM, NSApplication.terminate-adjacent programmatic paths, and the AX close button all fail to exit (signals swallowed, main thread idle); only the quit Apple Event (what Cmd+Q delivers) reliably completes orderly shutdown. Also observed: a second instance of the same app reports a false-positive frontmost while keyboard event routing is entirely broken (not even a title-bar click recovers it) — suites that launch a second instance must not attempt keyboard phases on it.
Requested:
Fix or re-document the exit contract for packaged apps; if the quit Apple Event is the only supported orderly-exit path, say so and make the reference driver use it (the payback journey's driver now does, with a frontmost verification before every posted key).
State the second-instance keyboard caveat where launch orchestration is documented.
Related: #328 (real-desktop keyboard/AX recipe gaps from the regexmate journey) — these two are runtime/exit semantics rather than driver recipes, filed separately.
2026-10-27 follow-up: opened #335 to capture the missing exact wedged PID evidence on a packaged macOS native UI failure. The CI-only AX driver records ps information on first-window timeout and, when the same process remains >=200% CPU, attempts a bounded three-second sample for its runtime/main/UI thread stacks. The root cause of the intermittent spin is still unknown: do not close this issue or infer Chez GC causality solely from CPU. Finding 2 (orderly SIGTERM exit) was already fixed by #330. Next root-cause fix must be grounded in an actual failure artifact and validated by a regression/stress test.
Activity
Merge pull request #330 from turinglambdaai/fix/native-ui-recipes-328…
turinglambdaai commentedon Oct 26, 2026
PR #330 落地(main @ 4383203,CI 23/23 绿)
Finding 2(有序退出)已解决
racket收 SIGTERM 打印 "user break" 后退出),GUI 宿主把 break 吞掉——打包 app 被 TERM 后永不退出。这是健康 app 的确定性问题,不只是 wedged 态。NSApplication.terminate→ 既有applicationShouldTerminate有序关闭钩子。启动时装一次、backend 启动完成后重装(runtime boot 会覆盖 handler,最后一次安装必须赢)。kill -TERM后存活(红,已实测);新模板打包 app ~1 秒内有序退出(绿,已实测)。Finding 1(启动 spin heisenbug)保持开放
静态诊断结论(无法按需复现,未做修复):症状组合(backend 已应答 hello、主线程冻结不渲染、数十 runtime 线程满载、永不自愈)指向 Chez GC 停栈会合类竞态——某个 runtime 内部线程未到达 GC safepoint,GC 线程永久自旋,宿主主线程随之冻结。定位需要 wedge 实例的 spindump/sample(payback 演练留了检测签名:
ps -o %cpu=数百百分比超出 ready 窗口且无 AX window)。防御指引已写入 native-ui-testing.md:检测签名 + 一次有界重启(payback/regexmate 套件都在用);wedge 必须按精确 pid kill、连诊断包一起上报 runtime 缺陷。
处理建议:本 issue 保持开放跟踪 spin 根因(需要真实 wedge 实例的 spindump 才能推进);SIGTERM 与退出语义两项已由 #330 解决完毕。
turinglambdaai commentedon Oct 27, 2026
2026-10-27 follow-up: opened #335 to capture the missing exact wedged PID evidence on a packaged macOS native UI failure. The CI-only AX driver records
psinformation on first-window timeout and, when the same process remains >=200% CPU, attempts a bounded three-secondsamplefor its runtime/main/UI thread stacks. The root cause of the intermittent spin is still unknown: do not close this issue or infer Chez GC causality solely from CPU. Finding 2 (orderly SIGTERM exit) was already fixed by #330. Next root-cause fix must be grounded in an actual failure artifact and validated by a regression/stress test.