Skip to content

probe(boot): boot.construct attributes the 14 s construct_modules phase to the modules that own it - #3735

Merged
joelteply merged 1 commit into
canaryfrom
probe/boot-construct-per-module
Sep 5, 2026
Merged

joelteply merged 1 commit into
canaryfrom
probe/boot-construct-per-module

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

boot.phase on a02fb6c (M5): construct_modules 14054 ms, initialize 514 ms, bind 0 ms. The row is a total. Boot constructs and registers serially, so one probe in ModuleRegistry::register — boot.construct {module, since_prev_ms} — attributes the phase per module with no constructor changes.

cargo check -p continuum-core --features metal,accelerate green. No unit test: the change is one probe emission; its receipt is the next boot's rows (which name the constructors to move behind the bind for card 83c99d62).

Review requested; no auto-merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… the modules that own it

The first a02fb6c boot on the M5 named the pre-bind cost: boot.phase construct_modules
14054 ms against initialize 514 ms and bind 0. That row is a total; nothing says which
constructors spent it (on BigMama's host that stretch held an unbounded nvidia-smi, #3733).
Boot constructs and registers modules serially, so the gap between two registrations is the
later module's constructor. One probe at the one site — ModuleRegistry::register — emits
boot.construct {module, since_prev_ms}; no constructor changes. The first registration reports 0.

Receipt: the next boot's boot.construct rows, sorted by since_prev_ms, name the constructors
to move behind the bind (card 83c99d62's reorder).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 95c70f9 into canary Sep 5, 2026
5 checks passed
@joelteply
joelteply deleted the probe/boot-construct-per-module branch September 5, 2026 06:47
joelteply added a commit that referenced this pull request Sep 5, 2026
…registrations names its own cost (#3743)

* probe(boot): the 209-second dark span between the system and serving registrations names its own cost

`boot.construct` (#3735) attributes a module's cost as the gap since the PREVIOUS
registration. That is exact only when nothing happens between two registrations.
In ipc/mod.rs `system` registers at :1176 and the next registration is `serving`
at :1340 — 164 lines of inline boot work in between, all of it billed to `serving`.

Measured on BigMama (windows-msvc, 5090), canary 485cde6:

    serving            209,170 ms      <- the span, not the constructor
    genome              11,619 ms
    construct_modules  232,429 ms      vs 14,270 ms on the M5 (16.3x)
    sum of 59 rows     222,813 ms      -> 9,616 ms residue

and the span emits NOTHING: between `system` at 07:28:13.490 and `serving` at
07:31:42.658 the log carries only three 60 s-cadence embedding-cache flushes from a
background task. 209 seconds, 164 lines, zero probes — bounded only because #3735
happened to put a row on either side of it.

Three `time_sync!` seams, no behaviour change:

    boot.model_catalog        ModelCatalog::from_registry
    boot.gpu_monitor_detect   gpu::monitor::detect()
    boot.serving_daemon_new   ServingDaemonModule::new()

`boot.gpu_monitor_detect` is the load-bearing one. #3733 bounded nvidia-smi in
gpu/memory_manager.rs::detect_cuda ONLY; gpu/backends/nvidia.rs still spawns it four
times (:215, :228, :243, :257) with `.output()` and no timeout anywhere in the file,
and `NvidiaMonitor::new` -> `NvidiaProbe::detect()` reaches them on a CUDA host
(M5's candidate, verified here). If that is the 209 s, this says so in one boot.

Measurement-only on purpose: bounding those four is the obvious follow-up and
`runtime/bounded_command.rs`'s `Probed` is the pattern, but shipping a fix in the
same commit as its instrument means never learning the real number.

Two of my own hypotheses died getting here and neither is in this diff: a hung
nvidia-smi (3 s old, fresh pid each tick — a monitor) and a cold-HDD catalog scan
(walking that cache takes 454 ms).

cargo check -p continuum-core --lib: clean.

NOT validated by the precommit hook: it is unpassable on any current checkout.
`git-precommit.sh:5` does `cd "$(dirname $0)/.."`, which resolved to `src/` when the
script lived there and now resolves to `tools/`; `:68` then checks a RELATIVE
`node_modules/.bin/tsx` against a directory with no package.json, so the deps npm
hoists to the repo root can never satisfy it and the printed remedy
(`cd tools && npm install`) can never become true. `:144 cd src` waits behind it.
Diagnosed, not bypassed with --no-verify; carded with all three sites.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

* fix(probe): the boot seams emit EVENTS — the first cut used spans and observed nothing

Caught by deploying it. Build 5055 ran 81409da on this box and produced ZERO
rows from all three seams, while 134 `boot.construct` events landed in the same
log from the same boot.

`time_sync!` opens a `tracing::info_span!`. Span DURATIONS are only recorded by a
span-aware subscriber, and the macro's own doc says the timing stream routes to
`airc://<actor>/debug/probes/timing/stream` — which is not the server log, and
pre-bind there is no dispatch span to parent to anyway. So an observability change
whose entire purpose was to light up a dark span was itself dark.

Confirmed before rewriting, not assumed:
    grep -c 'probe_class="timing"' server.log  ->  0
    grep -c 'boot.construct'       server.log  ->  134

Rewritten as explicit `Instant` + `probe!` events, which is the shape #3742 used
and the reason M5's marks work. Reusing #3742's exact class and fields
(`boot.stretch` / `stretch` / `step` / `ms`) rather than inventing a parallel
`boot.*` class per seam, so one query covers both stretches:

    boot.stretch stretch="serving_span" step="model_catalog"
    boot.stretch stretch="serving_span" step="gpu_monitor_detect"
    boot.stretch stretch="serving_span" step="serving_daemon_new"

Also recorded in the gpu seam's comment: boot cost on this host swings from 18 s
to over 300 s between runs (the 300 s bind watchdog has fired twice, at 05:28:28
and 08:02:54, each time reporting "a pre-bind panic or a hung module init" when
the boot was merely slow). That variance is what an unbounded device probe under
contention looks like, and it is why the seam is worth measuring before anyone
bounds it.

cargo check -p continuum-core --lib: clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant