Skip to content

CLI bootstrap fast-path: skip hardware probe + uv sync + re-exec on provisioned envs (design options) #329

Description

@stanlrt

From /simplify codebase sweep (2026-06-10). Framed as design options -- the always-sync behaviour is a deliberate consistency guarantee (stale-lockfile protection), so this needs a decision, not a drop-in fix.

Observed (deps/bootstrap.py:573-712 maybe_bootstrap; deps/probe.py:31-90): before the sentinel re-exec, every raitap run

  1. composes the Hydra config (Hydra composes it again in the pipeline),
  2. runs detect_hardware() -- spawns nvidia-smi, and on Windows without it a powershell Get-CimInstance Win32_VideoController query that typically takes 1-3s,
  3. in the dev-with-uv case unconditionally runs uv sync and re-execs the interpreter -- even when the environment already satisfies every inferred extra.

Cost: several seconds of fixed startup latency per CLI run on an already-provisioned machine; config parsed twice.

Options (each with a counterpoint, needs discussion):

  1. Fast-path: check inferred extras' distributions via importlib.metadata first; skip probe + sync + re-exec when everything is importable. Hardware probe only when an install command must be rendered. Counterpoint: loses the stale-lockfile auto-heal in dev; a lockfile-mtime check or --no-sync escape hatch could preserve it.
  2. Cache the hardware probe result (keyed by lockfile hash + platform) instead of skipping it.
  3. Minimal: keep behaviour, only deduplicate the double Hydra composition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions