Skip to content

Restore local account before publishing the root UI - #109

Merged
RCmerci merged 1 commit into
mainfrom
fix/startup-account-barrier
Oct 22, 2026
Merged

RCmerci merged 1 commit into
mainfrom
fix/startup-account-barrier

Conversation

@RCmerci

@RCmerci RCmerci commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Startup published the LUI root immediately after native admission, allowing SwiftUI initialization to delay local account restoration. Buffer admission-time callbacks, deliver them after native start/connect, and publish the root after the initial platform tasks finish. Generation checks fence cancellation and stale responses; the host retains the starting runtime until cleanup completes.

Validation on 6684ce28e094753d1579511fc230d47581f75862:

  • New startup boundary tests: 10 scenarios, including owned C bytes, worker callbacks, repeated start, stop/cancel, stale cancellation, rejected admission and nil responses; the pre-change baseline fails the root-publication assertion. Existing runtime failure tests: 11 scenarios. Both runners are now in CI.
  • Full local dune build @all app/native_embed.exe.o, dune runtest --force, and Swift platform/account recovery tests passed. Independent exact-head review found no blocking new defect.
  • Fresh process restarts, same synthetic fixture, alternating order, equal untimed prewarm after each install: 10 pairs. From production prepare.begin to the first actual row onAppear, medians 519.255 → 380.803 ms (10/10 pairs faster); Loading visibility proxy 266.525 → 191.478 ms. A separate 10-pair install-transition batch is retained; results are not pooled. Screenshots/profiler are excluded from timing.
  • Real native cancellation, startup-time leave/return, absent account and binding-error/restart recovery passed. UIKit Timeline → detail → back passed (controller/path counts 1/0 → 2/1 → 1/0).

Limits: Simulator iPhone 13/iOS 26.1, Swift Debug/OCaml dev, experimental-host-restamp, cross_abi_validated=false. These are lifecycle proxies, not GPU presentation or device Release results; the paired iPhone is unavailable.

Known baseline boundary: immediate synchronous stop/start can reject the second native admission (reproduced with original main Runtime, 1/3 attempts). Asynchronous worker disposal is a supported explanation but its internal state was not captured. The final candidate stop comparison passed 3/3, while two earlier unlocalized stop failures remain recorded. This PR does not claim to fix that existing native restart race. Five pre-existing agent-document format errors also remain unchanged.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-22T03:03:29.656958Z 6684ce2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@RCmerci
RCmerci merged commit b6c1c77 into main Oct 22, 2026
2 checks passed
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