Repository navigation
Build: with build :gate, live-red battery, seed-change runtime cleanup, and the native runner linked from this seed's bootstrap root (#1797) - #1795
Merged
Conversation
added 5 commits
September 27, 2026 10:29
…plus every test target the last battery measured under 60 s (Eric, 2026-09-27) A 6-layer stack took hours to land because the pre-battery gate was a checklist an agent remembered, and an 18 s target (deep-debug-tool-tests) was only ever run by the 25-minute battery. The gate is now one target: build, selfcheck (the stage2 self-check of src/main.w; no stage1 variant exists), reseed-check-build-w (which checks build.w and, through the fresh release binary's embedded stdlib, lib/std/build.w), abi-hash-check, unit-return-review, spec-inventory-check, examples-tests, c-migrator-basic-tests, deep-debug-tool-tests, user-programs-safe, plus every test lane the last battery measured under 60 s, then a gate-shape line naming the measured members. Test lanes are the non-Group targets reached from `test` through Group targets only, minus test-green and seed-driver; a lane's own deps are prerequisites, never tests. The measurements are the ledger out/.build-state/battery-times.tsv that tools/battery.w merges from its gate and checks runs (the driver's build-times.tsv is per invocation, so a :dev in between would erase the battery's numbers). build.w is evaluated once per build-source hash, so the battery deletes the evaluated-graph cache when it rewrites the ledger. A fresh worktree has no ledger and runs the fixed list. The fixed list is built by push, not a collection literal: the pinned seed's evaluator cannot take .len() of a literal (the #1122 class).
…ast (Eric, 2026-09-27) A red known at minute 1 was read at minute 20: the battery wrote its verdict only at the end, and the pre-battery gate was a checklist. Now the battery runs `src/main build :gate` (the release build plus the fixed gate and every lane the last battery measured under 60 s) before the 25-minute checks; a red gate writes `RED (gate): <targets>` and stops. Both steps run the child on an OS thread (std.thread; std.process has no non-blocking wait) while the main thread polls the log once a second and appends `RED: <target>` to out/battery/status.txt the moment a target fails; the run still collects every red. `--fail-fast` is passed through to the driver for the repair loop. The final RED/GREEN, BATTERY_DONE, logs and wall-time lines are unchanged. failed_targets now reads every failure spelling the driver has (test target failed:, '<x>' failed, survey: skipping, the closing failed: list); it used to match only the quoted build.w form. After each step the driver's per-invocation build-times.tsv is merged into out/.build-state/battery-times.tsv, the ledger build.w's gate reads (latest measurement per target wins), and the evaluated-graph cache is removed so the next build re-reads it. Verified in a scratch git rig with fake gate/checks scripts: the RED line was in status.txt while the child still ran; the ledger merged and sorted; the flag reached the child. `with check` cannot verify the file: it rejects every implicit-main script (filed separately).
…per-file-class checks for stack layers; the battery reports its first red live (Eric, 2026-09-27) The gate was a checklist in an agent's memory, so steps were skipped and a 6-layer stack took hours to land. It is now one line — `src/main build :gate`, the fixed list plus every test target the last battery measured under 60 s — and every stack layer runs it before it reports done. A change under src/Mir*.w, src/MirLower.w, src/MirValidate*.w or any validator runs :deep-debug-tool-tests --no-deps and :drop-audit first; a change under build/ or to build.w checks build.w and lib/std/build.w with the fresh release binary. Agents read one existing behaviour test before writing a fixture. The battery paragraph says the battery runs :gate first and writes RED: <target> to status.txt live, with --fail-fast for repair loops. The agents section no longer forbids :drop-audit and a full src/main build: the gate is a full build, and the MIR rule requires the drop audit.
…ows is the VM on eric-5090 then `ssh win10` (Eric, 2026-09-27)
…t is this seed's generation; a seed change clears the checkout's runtime objects; the runner-compile fallback is loud (#1797) The pinned darwin seed (nightly-20260925, 607a52f) predates #1720's D30 check, so in a checkout whose out/lib held 2026-09-22 objects it linked the native build runner against that stale runtime, died on the undefined with_vec_free_buffer_drop_origin, printed a warning, fell back to comptime evaluation, could not evaluate embedded-clang-resource-source there, and was red before stage1 — while the 09-22 out/release/bin/with stayed in place. Reproduced in a scratch worktree from the 09-22 tree and its seed. - src/main.w: the runner is compiled only once out/bootstrap-lib is this compiler's generation — prepare-bootstrap-link-root completed in this run, or its rt_core.o byte for byte the embedded one (Link.w's D30 check, now pub) — and with WITH_OUT_DIR naming the build's root, exactly as stage1 links. File existence said nothing about which generation built them. The fallback message is an error naming the cause and the cure. - build.w: embedded-clang-resource-source runs in the runner (the seed's evaluator cannot run it), so it is ordered after the root is prepared. - tools/battery.w: the driving seed's digest is recorded (out/.build-state/battery-seed.sha256); when it changed, out/lib, out/bootstrap-lib and out/tmp/with_runtime are removed before :gate. Verified with stage1 as the driver: `:abi-hash-check --no-deps` compiles the runner (root already this generation), `:stage2` is green with the runner compiled after the root is prepared (a first cut that waited only for completion went red: the resource action ran before the root).
with build :gate is the pre-battery gate; the battery runs it first and reports its first red livewith build :gate, live-red battery, seed-change runtime cleanup, and the native runner linked from this seed's bootstrap root (#1797)
…er generation's — an absent out/lib or out/bootstrap-lib is nothing to mistrust (#1797 follow-up) The first cut waited for prepare-bootstrap-link-root or a byte-identical out/bootstrap-lib, so a project with neither (behav_build_early_cutoff's two-target build, every user project) never compiled the runner and its actions fell to the evaluator: behavior-tests red on the branch battery. Readiness is now: the root was prepared in this run, or no complete out/lib / out/bootstrap-lib (Link.w's cimport_stubs.o probe) holds another generation's rt_core.o. Verified: the test passes against a stage2 built from this rule; :abi-hash-check --no-deps compiles the runner; :stage2 green with the resource action after the prepared root.
Contributor
Author
|
Battery GREEN on |
ehartford
marked this pull request as ready for review
September 27, 2026 18:13
This was referenced Sep 27, 2026
ehartford
pushed a commit
that referenced
this pull request
Sep 27, 2026
… carries #1720 and #1797 (Fixes #1797) Cut from main 9993935 after #1795 merged: that tree's seed-driven battery is green, :install-user verified the binary against last-green, and its reseed gate compiled the native build runner natively. The previous seed (nightly-20260925, 607a52f) predates #1720's D30 rule and linked the runner against whatever out/lib a checkout held; in one with 2026-09-22 objects it died on an undefined runtime symbol and fell back to comptime evaluation, which cannot run this tree's actions (#1797). Workflow pins by `with run tools/bump_seed_pins.w`; the old seed fetched and verified the asset (`src/main build :seed`, digest cffa4a40…). This branch's battery runs driven by the new seed.
ehartford
pushed a commit
that referenced
this pull request
Sep 27, 2026
… carries #1720 and #1797 (Fixes #1797) Cut from main 9993935 after #1795 merged: that tree's seed-driven battery is green, :install-user verified the binary against last-green, and its reseed gate compiled the native build runner natively. The previous seed (nightly-20260925, 607a52f) predates #1720's D30 rule and linked the runner against whatever out/lib a checkout held; in one with 2026-09-22 objects it died on an undefined runtime symbol and fell back to comptime evaluation, which cannot run this tree's actions (#1797). Workflow pins by `with run tools/bump_seed_pins.w`; the old seed fetched and verified the asset (`src/main build :seed`, digest cffa4a40…). This branch's battery runs driven by the new seed.
ehartford
pushed a commit
that referenced
this pull request
Sep 28, 2026
… carries #1720 and #1797 (Fixes #1797) Cut from main 9993935 after #1795 merged: that tree's seed-driven battery is green, :install-user verified the binary against last-green, and its reseed gate compiled the native build runner natively. The previous seed (nightly-20260925, 607a52f) predates #1720's D30 rule and linked the runner against whatever out/lib a checkout held; in one with 2026-09-22 objects it died on an undefined runtime symbol and fell back to comptime evaluation, which cannot run this tree's actions (#1797). Workflow pins by `with run tools/bump_seed_pins.w`; the old seed fetched and verified the asset (`src/main build :seed`, digest cffa4a40…). This branch's battery runs driven by the new seed.
ehartford
added a commit
that referenced
this pull request
Sep 28, 2026
… carries #1720 and #1797 (Fixes #1797) (#1801) Cut from main 9993935 after #1795 merged: that tree's seed-driven battery is green, :install-user verified the binary against last-green, and its reseed gate compiled the native build runner natively. The previous seed (nightly-20260925, 607a52f) predates #1720's D30 rule and linked the runner against whatever out/lib a checkout held; in one with 2026-09-22 objects it died on an undefined runtime symbol and fell back to comptime evaluation, which cannot run this tree's actions (#1797). Workflow pins by `with run tools/bump_seed_pins.w`; the old seed fetched and verified the asset (`src/main build :seed`, digest cffa4a40…). This branch's battery runs driven by the new seed. Co-authored-by: Eric Hartford <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Eric (2026-09-27): "how can we prevent this from happening for future agents" / "fix it" (#1797).
with build :gate: the fixed pre-battery list plus every test target the last battery measured under 60 s (ledgerout/.build-state/battery-times.tsv; a fresh worktree runs the fixed list).--explain gateshows the shape.tools/battery.w: runs:gatefirst (a red gate never starts the checks), appendsRED: <target>to status.txt the moment a target fails,--fail-fast, recognises every failure spelling the driver emits; records the driving seed's digest and, when it changed, removesout/lib,out/bootstrap-lib,out/tmp/with_runtimebefore the gate (Pinned darwin seed (607a52f5, 09-25) predates #1720: it links the native build runner against a stale out/lib, the runner fails, and the driver's silent comptime fallback then fails the build (no stage1 ever ran) #1797).out/bootstrap-libis this compiler's generation (prepare-bootstrap-link-rootcompleted in this run, or itsrt_core.obyte-identical to the embedded one) and withWITH_OUT_DIRnaming the build's root, exactly as stage1 links;embedded-clang-resource-source(runner-only) is ordered after that root; the runner-compile fallback is an error naming cause and cure. Root cause on the issue: the pinned darwin seed (nightly-20260925, 607a52f) predates Link: an out/lib under the cwd is linked only when it is this compiler's runtime byte for byte (D30, #761 class) #1720 and linked a 09-22out/lib.ssh eric-5090, Windows: VM on eric-5090 on, thenssh win10.Verified:
:gategreen (549.7 s); live-red/fail-fast in a scratch rig; #1797 fix with stage1 as driver (:abi-hash-check --no-depscompiles the runner;:stage2green with the runner compiled after the root is prepared); the battery's seed-change path executed for real on this branch's battery (a wrong digest pre-written). Battery verdict posted below when done. Still needed after merge: cut and pin a darwin seed after #1720 (the 0926 local nightly has no darwin asset).