Check removedBranch resolve-check, HEAD a89a1c0, tree clean. Suite
201/201; fixpoint OK (3,555,791 bytes).
Tags added this session: v3-two-phase-m2a, m2b, m2c,
m2-summary, v3-two-phase-flip, v3-forward-machinery-deleted,
v3-two-phase-m2d-summary, v3-check-removed.
-twophase then flipped on by default). Two bugs found and fixed:
the re-parse loop clobbered the unit's astDecl/astStmt, and
PopPos restored errors, wiping every diagnostic from repassed
bodies. Details in docs/summary_two-phase-m2-2026-10-16.md.ident expected (a DeferSkip
snapshot leak: PushPos without PopPos on the success path, fixed
with scanner.DropPos) and flipped deferral on by default
(-notwophase restores the old inline parse).SymTab.FwdVarRef/FwdVarName/FwdVarResolve (+ tables),
Check.NoteForward/FlushForward, the Design forward branch, the
dead Check.SelType/LeafName. New semantics: a module-level body
may call a procedure declared later (no FORWARD); a nested-local
forward is a plain 201 instead of a broken image. (Nested
deferral was tried and reverted — it regressed nested-proc codegen.)Check entirely after proving it vestigial: gutting
Resolve left the .ssa byte-identical across all 141 suite files
and emitted no diagnostics. Deleted Check.def/Check.mod, its
driver calls, the -noresolve option, and the atg import; dropped
build.sh's Check. Also removed the unused procNest and the
always-true L7 flag twoPhase.per unit:
Parse -> AST + declarations (procedure bodies are skipped and
re-parsed at unit end, so forward references bind normally)
Lower -> walk the AST, emit QBE (unchanged)
Emit -> buffered image, EndModule
No separate resolve/check pass: binding is late by construction.
compiler/src is M2.atg (grammar+scanner+parser+driver frames),
FileIO, AST, SymTab, QbeGen, Lower.
t_fwdproc -> 7, t_bad_nestfwd 201);
twophase_same gate compares the default (deferral) against
-notwophase for forward-free files; forward tests run to 42.-notwophase — +7 files, 0 regressions, 0 crashes..ssa byte-identical to pre-cleanup on spot-checks and the 141-file
set.GENERIC … M(T,U) + X = M(INTEGER,CHAR)
compiles but fails to link (undefined First_4; the .ssa has the
call but no body). Repro in docs/summary_generics-2026-10-15.md.GENERIC
CLASS, instance dedup.M2 exit codes, weak recovery); the
latent size-sensitive V3 miscompile.cd .../m2compiler-V3
git checkout resolve-check # HEAD a89a1c0
cd compiler && ./build.sh && ./run_tests.sh # 201/201
cd .. && ./bootstrap/fixpoint.sh # FIXPOINT OK
./M2 -notwophase tests/foo.mod # legacy inline parse (debug)