Skip to content

fix(ax/simax): prevent 80ms st.stuck spiral on live cold-launching apps and bind simax socket before .fg - #12

Merged
Apdelrahman1911 merged 5 commits into
mainfrom
fix/ax-stuck-spiral-and-simax-startup
Dec 6, 2026
Merged

Apdelrahman1911 merged 5 commits into
mainfrom
fix/ax-stuck-spiral-and-simax-startup

Conversation

@Apdelrahman1911

Copy link
Copy Markdown

Fixes a deterministic cold-launch AX timeout death spiral identified during KiraBot UITA investigation ( and 4 prior occurrences):

  1. Keep live non-wallpaper foreground apps out of the 80 ms st.stuck fast-fail set (ax.rs):

    • Previously, a single cold-launch snapshot timeout (or startup .fg race) persisted the app's PID into st.stuck, slashing every subsequent snapshot timeout from 6000 ms to 80 ms while still sending a 200 ms guest timeout ((0.08 - 0.3).max(0.2)). Since first-launch Compose AX tree walks take ~2.6s (and subsequent walks ~100ms), a live app that entered st.stuck once could never answer within 80 ms and stayed permanently masked behind com.apple.springboard.
    • Keep live (R/S/D) non-wallpaper foreground apps out of st.stuck, and ensure guest_timeout_secs() always stays strictly below the host socket SO_RCVTIMEO.
    • Adds regression test ax::tests::live_slow_foreground_app_recovers_after_timeout.
  2. Eliminate simax.m startup .fg-before-listen() race and main-queue overdue request pileup (host/simax/simax.m):

    • Create, bind(), and listen() the Unix socket synchronously in start() before spawning listen_thread and writing <pid>.fg, removing the ENOENT window during app launch.
    • Drop ANY overdue queued main-queue request in serve() (not only insert_bound) so timed-out tree/info polls cannot accumulate stale walks on a busy cold-launching app's main thread.

@Apdelrahman1911
Apdelrahman1911 merged commit 1da0fc1 into main Dec 6, 2026
2 checks passed
@Apdelrahman1911
Apdelrahman1911 deleted the fix/ax-stuck-spiral-and-simax-startup branch December 6, 2026 07:17
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