Skip to content

Android quotes a 70 s boot for a 4 s snapshot restore #778

Closed

Description

@V3RON

What happens

The Android driver quotes 70 s for every boot, including a boot from the clean baseline snapshot, which it measures at about 4 s.

Where

  • src/drivers/android/index.ts:88 COLD_BOOT_ESTIMATE_MS = 70_000; :124 SNAPSHOT_BOOT_ESTIMATE_MS = 4_000.
  • estimate() at src/drivers/android/index.ts:1347-1352 returns COLD_BOOT_ESTIMATE_MS for boot whatever the device's snapshot state; the 4 s figure is used only as a diagnostic threshold (:2038-2039).
  • makeReady boots from simlock_clean_baseline when the stored hash matches (src/drivers/android/AGENTS.md, "Boot" step 1).

What a user sees

A waiting requester is quoted estimatedBootMs: 70000 for a boot that takes seconds, and doctor's stalled-transition threshold for a snapshot boot is sized for a cold one (src/core/doctor.ts:1022), so a stuck snapshot boot is flagged late.

Found

Exploring the warm pool for #771 on 2026-10-20, at commit 97bc8ea.

Written by an agent.

Activity

  1. added
    bug:new
    and removed
    bug:new
    on Oct 20, 2026
  2. self-assigned this
    on Oct 21, 2026
  3. V3RON commented on Oct 21, 2026

    @V3RON
    ContributorAuthor

    Reproduction

    Confirmed the quote mismatch. Per-device estimation is a gap; the reproduction proposes the input shape below.

    Test-only commit, src/drivers/android/index.test.ts, “quotes a 4 s prepare boot for a persisted clean baseline and keeps unknown or recovery boots at 70 s”. It proves the snapshot launch after driver restart and checks both conservative controls before failing.

    pnpm exec vitest run --project unit src/drivers/android/index.test.ts
    expect(estimatedBootMs).toBe(4_000)
    Expected: 4000
    Received: 70000
    289 passed, 1 failed, 1 skipped
    

    Only fake platform ports ran; no hardware lane.

    Root cause

    Gap. src/core/driver.ts:152 defines boot estimation without device or purpose, and src/drivers/android/index.ts:1352 therefore returns the cold estimate unconditionally. The asynchronous baseline check at index.ts:2043 selects the snapshot only inside makeReady. Leasing discards device context when computing timing (src/leasing/lease-acquisition-coordinator.ts:1290) and progress (:1068). The generic cold estimate is conservative; the missing capability is quoting a known device's actual boot path.

    Simplest fix

    Extend boot estimation with optional device and purpose inputs, as proposed by the test. Share a read-only baseline decision with makeReady; resolve asynchronous reads outside serialized decisions and pass the result into lease timing and boot progress. Quote 4,000 ms only for a matching baseline on a prepare boot; retain 70,000 for unknown, cold, invalidated, wipe and recovery boots.

    Alternatives rejected

    • Return 4,000 globally: underquotes cold and recovery boots.
    • Inspect Android metadata in core: violates architecture rules 1–2.

    Risk

    • Check baseline invalidation and full-clean fallback after restart.
    • Keep estimate reads non-destructive and outside decision locks.
    • The reported doctor symptom is unconfirmed: src/core/doctor.ts:986–992 excludes shutdown devices and active claims; do not lower its thresholds globally.

    Written by an agent.

  4. removed their assignment
    on Oct 21, 2026
  5. added
    bug:ready
    on Oct 24, 2026
  6. self-assigned this
    on Oct 24, 2026
  7. V3RON commented on Oct 24, 2026

    @V3RON
    ContributorAuthor

    Decision

    Two gaps from the audit of PR #978, decided in delivery, pending the maintainer.

    • The Android boot estimate stays 70,000 ms for a device whose stored baseline hash does not match, a device with a wipe pending, and a physical spec; only a prepare boot from a matching baseline is quoted 4,000 ms (decided in delivery, pending the maintainer).
      Tests: the 4 s prepare-boot test in src/drivers/android/index.test.ts gets those three cases as rows, each expecting 70,000 ms, at AndroidDriver.estimate.
    • doctor's stalled-transition threshold (src/core/doctor.ts) is left unchanged: it only prices a provisioning device, which has no baseline, and the triage report found the doctor symptom unconfirmed (decided in delivery, pending the maintainer).
      Tests: none; no code change.

    Written by an agent.

  8. V3RON commented on Oct 24, 2026

    @V3RON
    ContributorAuthor

    Delivery run

    Merged: #978 (#778)
    Parked: none
    Waiting: none
    Decided: #778 — what Android quotes for a boot that cannot use the baseline → 70 s for mismatched hash, wipe-pending and physical; doctor threshold left unchanged

    Written by an agent.

  9. V3RON commented on Oct 25, 2026

    @V3RON
    ContributorAuthor

    Maintainer accepted both delivery choices: the 70 s quote stays for a mismatched baseline, a wipe-pending device and a physical spec, and doctor's stall threshold is unchanged.

    Written by an agent.

  10. V3RON commented on Nov 2, 2026

    @V3RON
    ContributorAuthor

    Follow-up: #327 (Named baselines, ADR 0061) replaces the clean-baseline boot. Task #1205 sets the Android estimates for the new path: 1 s to provision a copy when a seed exists (150 s when it must be made first) and 4 s for a boot from the source's snapshot.

    Written by an agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug:ready

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions