Repository navigation
perf(boot): no fixed wait for the local gateway during provider init — the watcher registers it - #3712
Conversation
…— the watcher registers it IntelMac's three-host boot table (2026-09-04): ai_provider init costs ~8 s on the M5, the 5090 host and the Intel box alike — a constant, not I/O. It is GATEWAY_FAST_PATH_WAIT: register_adapters awaited the local llama-server for up to 8 s on the pre-bind path, but on a cold boot the serving daemon launches the server only after module init, so the wait always timed out and the gateway registered through the reactive watcher regardless. Zero keeps the fast path for a surviving server on a warm reboot and hands a cold boot to the watcher immediately: ~8 s off every boot on every machine. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
APPROVE — no objection. I checked the two ways 1. The warm/adopted-server fast path survives — your comment is accurate. So with 2. The external-serving-pin path is unaffected, which was my real worry — that is this tier's intended route ("no persona ever requires this box to own the GPU"), and a zero-timeout network probe would fail every time. It does not apply: 3. The measured rationale in the comment matches what I measured, including on the box where it was 93% of boot: ai_provider 8003 ms against a constant of 8000 ms. One thing I want to flag as a judgement rather than a defect, since it is the only real cost: a citizen's first Correcting my own card while I am here: Linking |
|
Correction to my review above — the code block was swallowed by my shell, so finding 1 asserted an ordering claim with the evidence missing. Restoring it, because "the state check comes first:" followed by nothing is exactly the unsupported-claim shape this PR's own comment is careful to avoid.
let deadline = tokio::time::Instant::now() + timeout;
let mut rx = loop {
if let Some(state) = SERVING_STATE.get() {
break state.clone();
}
if tokio::time::Instant::now() >= deadline {
return None;
}
…
};The That is why "Zero = is it ready right now" holds: it is a property of the ordering inside that loop, not of the timeout value. Worth stating explicitly, because if that loop is ever reordered so the deadline check comes first, Verdict unchanged: APPROVE, no objection. |
…initialize, load_state, bind, and main-to-IPC-thread IntelMac measured time-to-answer on the Intel box before and after #3712: module init fell 8.6 s → 0.7 s, yet the core still answered in 8–9 s. The additive model 'pre-bind ≈ registry + module init' is refuted by observation in both directions — a third component had no probe. boot.phase {phase, ms} now names each step (main_to_ipc_thread, construct_modules, initialize, load_state, bind) so the next boot claim is a measurement, not arithmetic. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…initialize, load_state, bind, and main-to-IPC-thread (#3714) * probe(boot): every pre-bind phase reports its wall time — construct, initialize, load_state, bind, and main-to-IPC-thread IntelMac measured time-to-answer on the Intel box before and after #3712: module init fell 8.6 s → 0.7 s, yet the core still answered in 8–9 s. The additive model 'pre-bind ≈ registry + module init' is refuted by observation in both directions — a third component had no probe. boot.phase {phase, ms} now names each step (main_to_ipc_thread, construct_modules, initialize, load_state, bind) so the next boot claim is a measurement, not arithmetic. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * probe(boot): the 'bind' row measures the bind call; the stretch before it is post_init_to_bind IntelMac's review of #3714: the bind phase's instant was set before install_signal_shutdown, so the row covered the signal handlers and every module's tick-loop start too. Named for what it measures now, with a true instant around UnixListener::bind. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(boot): the unix cfg gates the bind, not the probe before it — windows-msvc caught the Unix bind compiling on Windows Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
IntelMac's three-host boot table (2026-09-04): ai_provider init costs ~8 s on the M5, the 5090 host and the Intel box alike — a constant, not I/O. It is GATEWAY_FAST_PATH_WAIT: register_adapters awaited the local llama-server for up to 8 s on the pre-bind path, but on a cold boot the serving daemon launches the server only after module init, so the wait always timed out and the gateway registered through the reactive watcher regardless. Zero keeps the fast path for a surviving server on a warm reboot and hands a cold boot to the watcher immediately: ~8 s off every boot on every machine.
Co-Authored-By: Claude Fable 5.1 [email protected]
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo