Repository navigation
The build refuses a symlinked out/gen; generated compiler modules are stage inputs (the stack's 'self-miscompile' was cross-worktree contamination) - #1971
Merged
Conversation
… stage inputs A stage2 built on 2026-10-02 in a worktree whose out/gen was a symlink to ~/with/out/gen embedded a sibling worktree's std/task.w: that tree's build rewrote out/gen/compiler/EmbeddedStdlibData.w while the stage2 compile ran. The compiler so built failed `ns(3).pull()` with "cannot infer type parameter 'T'" (the sibling spells gen_pull `[T, G: Gen[T]](g: G)`, which this Sema cannot bind T from), stage3 embedded yet another text, every unit differed at fixpoint-compare, and the afternoon went to a 12-line ComptimeEval change (b2b9145) that was innocent: a stage2 built from the same commit with its own out/gen checks the program ok. Two silent tools, fixed: - The build driver refuses an out/gen that is a symlink, names where it points and says to copy the directory instead (generated sources are per tree, D50). build/selfhost.w's build.w suite pins it: a project whose out/gen links elsewhere fails `with build` with that message; the pre-fix compiler built it green. - target_with_compiler_source_inputs declares the four generated modules (EmbeddedStdlibData, EmbeddedRuntimeData, EmbeddedBundlesData, EmbeddedClangResourceData) as inputs of every compiler build, not only as dep outputs, so the #1654 mid-run guard and the freshness check cover a rewrite under the compile. test/behavior/behav_gen_pull_infers_from_generator_arg.w pins the rejected program as a user program: it fails on the contaminated stage2 and passes on a clean one. (cherry picked from commit 9167a3e9195cca08f2394708ecc540f15cf01ba4)
This was referenced Oct 2, 2026
Merged
Contributor
Author
|
Battery GREEN on stack top 7bdd704 (seed-driven, |
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.
Layer 6 of stack #1969. The 'self-miscompile' the stack battery hit was not the compiler: every scratch worktree symlinked
out/gento the main checkout's;compat-runtime-sourcewritesout/gen/compiler/EmbeddedStdlibData.wthere and the stage compiles read it, so a stage2 in one worktree embedded ANOTHER worktree's stdlib mid-build. Proof: lldb showed different AST node ids forgen_pull's parameter type between the good and bad stage2; theEMBEDDED_STD_*text dumped from the bad binary was batch-b's (agen_pull[T, G: Gen[T]]present in no commit of that tree); a clean control build of the exact commit is fine. Fixpoint caught it because stage2 and stage3 were built minutes apart while the shared file changed; the per-layer gates each used one self-consistent binary; the #1654 mid-run guard was blind because the Embedded*Data.w modules were deps, not inputs. b2b9145 (reverted during the bisect) was innocent and is back in layer 4.Fix:
build_graph_refuse_shared_gen_dir(src/main.w) refuses a symlinkedout/gen, naming its target; build.w declares the four generated modules as inputs of the stage targets (in:lines in stage2.state); selfhost gen_link case red-first;behav_gen_pull_infers_from_generator_arg.wfails on the contaminated binary, passes clean. Full build 347 s, :fixpoint 16/16, :gate rc=0 (on the fix branch's tree).