You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compiled build graph: build.w compiles to a cached native runner; the evaluator leaves the build path (#679 arc, promoted) #921
Ruled direction (Eric, 2026-09-02, after the reference pause): every reference build system executes build logic as NATIVE code evaluated at most once per build — Zig compiles build.zig into a cached build-runner binary; Go compiles the logic into the go tool; Cargo compiles build.rs once per package; SwiftPM compiles Package.swift once into a data manifest. None interprets build logic, and none re-executes it per step.
With today: build.w is comptime-INTERPRETED per invocation (~2.5s floor even for an error), and every worker child re-evaluates it in full — pooled lanes, serial action workers, all of them. Measured: the test-green worker spent its first ~35-70s in re-evaluation; each of #680's 19 pooled lane workers pays the same tax (why cli-selfhost-project went 28.6s->88.1s pooled and the lane-pooling win capped at 16%).
Tactical fixes banked first (e41bd55/0ce5b23c/e5e19578: decl-index memoization, same-file context skip, bulk push_str — test-green 79->35s); the remaining evaluator cost is intrinsic per-step interpretation (rt_payload_start_is_owned churn from per-step str traffic — sampled), which this campaign deletes wholesale.
Design (Zig's shape, With's advantage: build.w IS a With program)
with build compiles build.w + build/*.w + std.build into a native build-runner binary, cached by (compiler fingerprint, build-source hash) — the same keying discipline as the graph cache. Cache hit = zero build-logic cost; miss = one native compile (~seconds at -O1 for the build tree).
The runner constructs the graph and executes targets natively: actions run at native speed in-process or in cheap workers (a worker child of the RUNNER re-enters natively — no evaluator anywhere).
The comptime evaluator remains for comptime-in-user-code; it simply exits the build path.
Invariants: no cache-format changes beyond the new runner cache entry; -O1; fixpoint discipline (the runner is compiler output — determinism applies); no external deps.
Prereq check: build.w actions use ActionCtx/ToolFs capability machinery — the native runner must provide the same surface (std.build already defines it; today the evaluator implements the backing — inventory which ctx entry points have evaluator-only implementations and give them native ones).
Expected effect at the battery level: removes ~30-70s x N_workers from :test, the 2.5s per-invocation floor everywhere, and the whole class of evaluator budgets/step limits from build actions.
Phase 0 + phase 1 are implemented and verified locally (batteries in flight):
Phase 0 (a4b61c6): pooled Test lanes admitted to the D19 graph cache — lane worker graph load 2.08s → 0.84s ×9 lanes.
Honest pool timing (c4c2a40, prerequisite): deaths stamp wall/RSS at true child exit via a new nonblocking reap probe; the "three cli-selfhost lanes at an identical 88.9s" was FIFO-retire inheritance, not measurement.
Phase 1 (3aba555): Action workers exec a compiled native runner (cached by build-sources × compiler fingerprint; 18.3s one-time for this repo). std.build carries the native effect-record twin (format parity with the evaluator, tool-identity sha included) and the exit-97 evaluator-fallback protocol for the Workspace surface; the driver validates outputs and records cache verdicts parent-side. Measured: forced action 2.6s → 1.1s; worker peak RSS 223M → 2M.
Remaining in this arc: Workspace-surface native design (subprocess compile + message-stream protocol) so the selfhost/LSP lanes leave the evaluator; then the endgame where the parent's own graph evaluation moves into the runner and the 2.5s invocation floor goes to ~0.2s cache-load + native dispatch.
What exists already (changes the cost of this phase substantially): D24/#729 made every workspace compile process-isolated — the evaluator serializes a ComptimeWorkspaceCompilePlan (sources incl. in-memory texts, options, migrate options, link libs) and spawns with __workspace-compile <plan> <result>. The compile itself already runs out of process; only the orchestration (plan construction, message interception, link-command staging) is evaluator-hosted.
Usage census (build/*.w): ~21 plain create_workspace → add_file/add_string → set_options → compile() uses across sdk, seed, emit_c, zlib, pcre2, selfhost; the intercept surface (begin_intercept/wait_for_message/end_intercept) is concentrated in selfhost.w (38 uses) + pcre2.w (4) — i.e. exactly the cli-selfhost trio that is now the honest critical path (~90s×3, co-terminal).
Design:
Plain compiles (the easy 80%): native Workspace.compile in std.build builds the same plan and spawns the same with __workspace-compile child. Decision fork: (a) a std.build twin of the plan serializer (the effect-records parity precedent — second format duplication), or (b) a v2 std-authored plan format the child also reads. I lean (b): the child already owns deserialization; one reader with two versions beats two writers of one fragile format.
Intercepts: messages appear observational (script asserts on compiler envelopes; set_link_command stages before the link step). If that holds — verify before building — the child streams envelopes to a file/pipe, wait_for_message reads sequentially, and the link command rides in the plan. No bidirectional control channel needed. If a suite genuinely steers mid-compile, that suite stays on the evaluator (97-fallback already handles it per-target).
parallel() becomes native process fan-out over the same children — strictly simpler than the evaluator's version.
Mission fit: completes the reference-language shape (build logic native, evaluated once); deletes the last evaluator dependency from the hot path; selfhost lanes get native orchestration glue around their (already-subprocess) compiles.
Prediction: proceed as sketched, with (b) for the plan format — the runner is already the ruled direction and this is implementation architecture, not surface. Flagging it anyway because the intercept suites change execution model (no same-process Sema access); anything secretly relying on that breaks loudly under the 97-fallback rather than silently.
C1 landed and reseeded (6cd878d): plain (non-migrate, non-intercept) Workspace flows run natively — file-backed state, plan format canonical in std.build, same D24 child via WITH_BUILD_COMPILER. sdk/seed/emit_c workspace actions now run native inside the battery (green). Found+filed #929 (silent unknown string escapes) en route. Next: post-reseed serializer-twin cleanup in ComptimeEval, then C2 (intercept surface — compile-to-prelink/execute-link child modes + envelope replay) for the selfhost trio.
Triage 2026-10-25, with v0.15.3.0 (main a261b65): still open. C1 runs Workspace flows natively, and the runner compiles in a ready tree ("[build] runner compiled 5.9s"), but the evaluator has not left the build path: in a fresh worktree the driver reports "build runner compile failed …; actions fall back to comptime evaluation by the driver" and runs actions in the evaluator (a doc-path-check took 48 s that way against 0.9 s compiled). C2 (the intercept surface) is the open step.
Activity
ehartford commentedon Sep 1, 2026
Phase 0 + phase 1 are implemented and verified locally (batteries in flight):
fn get(self: &Self) -> &T: stmt(); self.fieldblanked the borrowed field through the receiver. Also filed en route: Vec[str].iter() element view passes garbage to &str parameters (binding holds pointer, call site marshals by-value pair) #925 (iterator view marshalling), Compiler-source into_iter() specializations undefined at stage1 link (cross-unit generic emission; check passes) #926 (compiler-source into_iter link), std.build audit:all reports use-after-kill in seven move-self builder fns (reset-on-move blank ordering) #927 (audit findings on std.build's move-self builders).Remaining in this arc: Workspace-surface native design (subprocess compile + message-stream protocol) so the selfhost/LSP lanes leave the evaluator; then the endgame where the parent's own graph evaluation moves into the runner and the 2.5s invocation floor goes to ~0.2s cache-load + native dispatch.
build: admit Test-kind pooled workers to the graph cache (#921 phase 0)
build: stamp pooled-worker wall/RSS at true child exit (#921)
MirLower: borrow-adjusted return tails must cancel the move's reset b…
build: native build runner — Action workers exec compiled build.w (#921…
build: runner parity fixes — minted-token trust, graph-effect suppres…
ehartford commentedon Sep 1, 2026
Phase 2 design brief: native Workspace surface
What exists already (changes the cost of this phase substantially): D24/#729 made every workspace compile process-isolated — the evaluator serializes a
ComptimeWorkspaceCompilePlan(sources incl. in-memory texts, options, migrate options, link libs) and spawnswith __workspace-compile <plan> <result>. The compile itself already runs out of process; only the orchestration (plan construction, message interception, link-command staging) is evaluator-hosted.Usage census (build/*.w): ~21 plain
create_workspace → add_file/add_string → set_options → compile()uses across sdk, seed, emit_c, zlib, pcre2, selfhost; the intercept surface (begin_intercept/wait_for_message/end_intercept) is concentrated in selfhost.w (38 uses) + pcre2.w (4) — i.e. exactly the cli-selfhost trio that is now the honest critical path (~90s×3, co-terminal).Design:
Workspace.compilein std.build builds the same plan and spawns the samewith __workspace-compilechild. Decision fork: (a) a std.build twin of the plan serializer (the effect-records parity precedent — second format duplication), or (b) a v2 std-authored plan format the child also reads. I lean (b): the child already owns deserialization; one reader with two versions beats two writers of one fragile format.set_link_commandstages before the link step). If that holds — verify before building — the child streams envelopes to a file/pipe,wait_for_messagereads sequentially, and the link command rides in the plan. No bidirectional control channel needed. If a suite genuinely steers mid-compile, that suite stays on the evaluator (97-fallback already handles it per-target).parallel()becomes native process fan-out over the same children — strictly simpler than the evaluator's version.Mission fit: completes the reference-language shape (build logic native, evaluated once); deletes the last evaluator dependency from the hot path; selfhost lanes get native orchestration glue around their (already-subprocess) compiles.
Prediction: proceed as sketched, with (b) for the plan format — the runner is already the ruled direction and this is implementation architecture, not surface. Flagging it anyway because the intercept suites change execution model (no same-process Sema access); anything secretly relying on that breaks loudly under the 97-fallback rather than silently.
build: native Workspace for plain compiles — the runner stops falling…
ehartford commentedon Sep 1, 2026
C1 landed and reseeded (6cd878d): plain (non-migrate, non-intercept) Workspace flows run natively — file-backed state, plan format canonical in std.build, same D24 child via WITH_BUILD_COMPILER. sdk/seed/emit_c workspace actions now run native inside the battery (green). Found+filed #929 (silent unknown string escapes) en route. Next: post-reseed serializer-twin cleanup in ComptimeEval, then C2 (intercept surface — compile-to-prelink/execute-link child modes + envelope replay) for the selfhost trio.
ehartford commentedon Oct 25, 2026
Triage 2026-10-25,
with v0.15.3.0(main a261b65): still open. C1 runs Workspace flows natively, and the runner compiles in a ready tree ("[build] runner compiled 5.9s"), but the evaluator has not left the build path: in a fresh worktree the driver reports "build runner compile failed …; actions fall back to comptime evaluation by the driver" and runs actions in the evaluator (adoc-path-checktook 48 s that way against 0.9 s compiled). C2 (the intercept surface) is the open step.post-release: build-system campaign.