Skip to content

Make the engine wait for a ladder that started ahead of it, and mark the hand-over to the main loop - #71

Merged
PatrickSt1991 merged 1 commit into
mainfrom
q80-wait-for-walk
Sep 5, 2026
Merged

PatrickSt1991 merged 1 commit into
mainfrom
q80-wait-for-walk

Conversation

@PatrickSt1991

Copy link
Copy Markdown
Contributor

What the Q80 said on build-1933ad8

Two launches on a fresh install, three pages (issue 17, 2026-09-05 15:05). The first ran the ordinary order and ended on the ladder's first rung. The second found the ledger, walked ahead of the engine, and answered seven rungs — control:anon-exec = ok (the rung the launch before had "ended" on), the data/ copy, the engine header, and res/ open/header/read/exec (EPERM, fourth time) — before ending on the /proc/self/fd retry. trail write: was healthy on every page.

Both launches went silent within a second of ENGINE FAILURE, with the probe thread, the permission probe's thread and the heartbeat stopping in the same second. The early walk's head start was the half-second the engine took to fail.

Changes (all src/elm + Program.cs)

  • The engine waits for the walk. When StartEarlyIfUnfinished started it, OnCreate waits on NativeProbe.WaitForWalk (90 s at most) before TryStartEngine, and writes what happened either way.
  • Two markers around the hand-over: failure screen drawn — OnCreate returns, the main loop starts, and main loop: first iteration ran via EcoreMainloop.Post. A trail ending between them ends in the loop's first iteration.
  • AppDomain.UnhandledException handler in Main: thread name, type, message, stack. Drop waits for the disk, so the line lands before the abort.

Verified

  • tools/probeladder/run.sh — 10 shapes pass (early now uses WaitForWalk).
  • ./build.sh all — all five packages build.

docs/INTERNALS.md: new section Whatever ends the launch is a second behind the engine; build-<next> placeholders filled by the follow-up.

…the hand-over to the main loop

build-1933ad8's two launches both went silent within a second of ENGINE FAILURE —
the first on the ladder's first rung, the second, walking ahead of the engine,
seven rungs in — with the probe thread, the permission probe's thread and the
failure screen's heartbeat stopping together and the trail writer healthy at the
last page load. Whatever ends these launches is timed off the engine's failure,
not off any rung, and the early walk's head start was the half-second the engine
took to fail.

- On an install where the walk started ahead of the engine, OnCreate waits for it
  (NativeProbe.WaitForWalk, 90 s at most) before TryStartEngine, and says so.
- Two trail markers around the hand-over: the last line OnCreate writes after the
  failure screen, and an EcoreMainloop.Post that writes when the loop first runs.
- AppDomain.UnhandledException in Program.Main writes thread, type, message and
  stack before the abort; Main's catch only ever saw its own thread.

Issue 17. docs/INTERNALS.md has the reading of the report.
@PatrickSt1991
PatrickSt1991 merged commit 9f4a87a into main Sep 5, 2026
7 checks passed
@PatrickSt1991
PatrickSt1991 deleted the q80-wait-for-walk branch September 5, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant