Kaynağa Gözat

docs: decoupling complete — every removable inline emit is gone

Eric Streit 3 gün önce
ebeveyn
işleme
d6c9534c44
1 değiştirilmiş dosya ile 32 ekleme ve 11 silme
  1. 32 11
      docs/summary_lower_l7_flip.md

+ 32 - 11
docs/summary_lower_l7_flip.md

@@ -93,19 +93,39 @@ Constant-producing builtins (fixed-array `HIGH`/`LEN`, `SIZE`/`TSIZE`,
 ## The remaining coupled change
 
 `Design` → `Fact` → `ArgList` → `ActParam` plus the `NoteAddr`/
-`AddrOfVal` chain must move **as one unit**: `Fact` records
-`NoteAddr(q, qd)`/`AddrOf(qn, qa)` and `ActParam` recovers the VAR-actual
-address with `AddrOfVal(qe, qa)`, and the note key is the actual's
-*emitted* value.  Verified: dropping `ArgList`'s `CallBegin` alone (fewer
-`NewTemp`s) shifts the keys and breaks calls (75 suite failures).  To
-finish: `Design` emits nothing (literal for a constant, `"@"` otherwise),
-`Fact` drops the notes, `ActParam` replaces `AddrOfVal` with an
-AST-kind addressability check and drops `CallArg`, then `ArgList` drops
-`CallBegin`/`CallEnd`; afterwards `NoteAddr`/`AddrOfVal`/`AddrOf` in
-`QbeGen` are dead.
+`AddrOfVal` chain moved **as one unit** (commit `90d2529`): `Fact`
+records no notes, `ActParam` checks VAR-actual addressability by AST
+kind (`NkDesignator`, or `NkStrLit`), and `ArgList` drops
+`CallBegin`/`CallEnd`.  `Design`/`ResultComp` (`0667290`), assignment
+(`0ebe92e`), the remaining runtime value ops (`f59b784`) and the
+`ProcHeading` output (`02f2526`) followed.
+
+## Completion (2026-10-08)
+
+The inline emit is gone from every production where it could be removed
+cleanly: statements, control flow, declarations, `SimExpr`/`Term`/
+`Expr`/`Fact`, `Design`/`ResultComp`, `ArgList`/`ActParam`, assignment,
+the runtime builtins, and `ProcHeading`'s output.  A runtime value is the
+non-constant sentinel `"@"`.
+
+What intentionally remains in the grammar is the **value layer**
+(`CopyOp`, `IsImm`, `IntStr`, `Fold2`, `NormInt`/`NormReal`/`NormLit`,
+`Conv*`, `CharVal`, `StrFold`/`StrEq`, `CapQ`/`AbsQ`/`NotQ`, `UStrLen`)
+that computes constants and the `q` `Lower.NoteConstVal` consumes, plus
+the **value/parser-state API** the checks depend on: the `ProcHeading`
+lifecycle (`BeginFunc` resets `nPar`/opens the scope, `FuncParam` is a
+check, `EndFunc`/`AbortFunc` close it), `PushWith`/`PopWith` (`WITH`
+field resolution), `PushLoop`/`PopLoop` (`EXIT` validity), and
+`TopWith`/`TopLoop`/`LocFull`.
+
+One trap worth remembering: an empty `(. .)` action in `ProcDecl`
+generated a bare `;` empty statement that **gm2 accepts but the V3
+self-host grammar rejects** — the suite passed while the fixpoint
+failed.
 
 Then: retire the `-lower` test flag and the now-degenerate byte-compare
-tests, and delete `SaveSession`/`RestoreSession`/`SetNoEmit`.
+tests, and delete `SaveSession`/`RestoreSession`/`SetNoEmit` (still used
+by the per-unit flow).
 
 ## Fixpoint sizes across the session
 
@@ -115,6 +135,7 @@ tests, and delete `SaveSession`/`RestoreSession`/`SetNoEmit`.
 | statements + declarations + bug fix | 3,538,557 |
 | dead-code sweep | 3,420,733 |
 | value/emit decoupling (expr layer) | 3,406,951 |
+| decoupling complete (Design/Fact/calls/assignment/ProcHeading) | 3,377,935 |
 
 The functional goal — **`Lower` is the only emitter** — is met.  The rest
 is architecture/cleanliness.