Repository navigation
fix: self_host_full takes gen0 from the checked-in bootstrap C - #1435
Merged
Merged
Conversation
Contributor
Author
|
Gates on branch head 58f4ad5, macOS arm64, FLOW_GATE_JOBS=2:
|
self_host_full picked the first executable among the roundtrip.flow drivers and compiler/build/flowc_bootstrap, with no check against compiler/bootstrap/flowc_stage_a.c. A flowc_bootstrap built before #1363 made gen1.c != gen2.c locally (missing vector_size preamble, TOK_* lines moved), while CI, building from a clean checkout, passed. The checked-in bootstrap C is at the fixed point. gen0 now comes from gl_flowc_cached: compiler/build/flowc_bootstrap, rebuilt when missing or older than the bootstrap C. FLOWC_BOOTSTRAP still overrides it. tests/scripts/self_host_gen0.flow runs the real gate against a scratch root with a stale flowc_bootstrap and a stale roundtrip driver; both checks fail on the old selection.
godofecht
force-pushed
the
fix/self-host-fixed-point
branch
from
October 7, 2026 14:35
58f4ad5 to
b93fc82
Compare
godofecht
added a commit
that referenced
this pull request
Oct 7, 2026
selfcompile_audit.flow and package_flowc.flow picked the first executable among the roundtrip.flow drivers (stage_a_driver_flow_self and friends) and compiler/build/flowc_bootstrap, with no check against compiler/bootstrap/flowc_stage_a.c. The audit then checked, and the package shipped, whatever stale binary was left in compiler/build. #1435 fixed the same selection in self_host_full.flow. Both now use gl_flowc_cached: flowc_bootstrap, rebuilt when missing or older than the bootstrap C. FLOWC_AUDIT_BIN still overrides the audit; the package honours FLOWC_BOOTSTRAP, as self_host_full does. The package ships the binary as bin/flowc-core behind the bin/flowc wrapper that build.sh writes, so the prebuilt bin/flowc keeps the `flowc <in.flow> <out.c>` interface. corpus_parity, fmt_check, parse_coverage and mlir_vs_c carried inline copies of the helper and now call it. The helper builds to a temporary file and renames it, as mlir_vs_c did, so concurrent gates never run a half-written binary. tests/scripts/self_host_gen0.flow runs the real audit and packaging against a scratch root with a stale flowc_bootstrap, a stale roundtrip driver and the env override. Five of the six new checks fail on the old selection.
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.
Report
./flow tool compiler/scripts/self_host_full.flowfailed locally on main after #1363: gen1.c != gen2.c, differing in thevector_sizepreamble and someTOK_*lines. CI's required "flowc self-host (no Python)" job passed on the same commit.Root cause
The checked-in
compiler/bootstrap/flowc_stage_a.cis at the fixed point. The local failure came from gen0 selection inself_host_full.flow: it took the first executable among the roundtrip drivers (compiler/build/stage_a_driver_flow_self, ...) andcompiler/build/flowc_bootstrap, and never checked any of them against the bootstrap C. Aflowc_bootstrapbuilt before #1363 merged (the one in a long-lived checkout) emits gen1.c without the #739 vector preamble, gen1 then emits it in gen2.c, and the fixed point fails.CI was green because each job starts from a clean checkout and
bootstrap_from_c.shbuildsflowc_bootstrapfresh right before the gate. The CI check already covers this:flowc-selfhostrunsself_host_fullfor every change undercompiler/**, which includescompiler/srcandcompiler/bootstrap, and it is a required check. No ci.yml change is needed.Fix
gen0 is now
gl_flowc_cached("FLOWC_BOOTSTRAP", root), the helper the parity gates already use:compiler/build/flowc_bootstrap, rebuilt when missing or older than the bootstrap C.FLOWC_BOOTSTRAPstill overrides it. The roundtrip call to self_host_full now checks the checked-in bootstrap as well, where before it compared compiler/src against a driver compiled from compiler/src.tests/scripts/self_host_gen0.flow(run by./flow test-scriptsin the required "Native tools" job) runs the real gate against a scratch root whose compiler is a small C program, with a staleflowc_bootstrapand a stale roundtrip driver in place, and checks that a stale gen0 forced throughFLOWC_BOOTSTRAPstill fails the fixed point.Baseline and proof
self_host_fullALL PASS (gen0 = fresh flowc_bootstrap).FLOWC_BOOTSTRAP= the pre-cgen: remaining SIMD lowering for hot C loops (#739) #1363flowc_bootstrapfrom a long-lived checkout:FAIL fixed point: gen1.c != gen2.c, diff> typedef float flowc_v4f32 __attribute__((vector_size(16)));... and< const int32_t TOK_PLUS_EQ = 42;..., matching the report.Gates
See the comment below for the gate run on this branch.
Risk
Low. Script and test only; no compiler/src or bootstrap C change. roundtrip now spends one extra
cc -O2of the bootstrap C whenflowc_bootstrapis missing.