session-2026-09-20.md 2.9 KB

Session save — 2026-09-20 (m2compiler-V3, step 3 composites)

Where we are

HEAD: de18bdc — v3-step3.6, suite 64/64 (30 run — incl. 3 trap-aborts — + 34 reject). Repo has no remote (push recipe in untracked git.txt). Tree clean except git.txt.

Tag lineage today (all green at every tag)

  • v3-step3.1 — arrays: bounded/open, strings as descriptors, whole-assign with count check + memcpy, index traps (42/42)
  • v3-step3.2 — showcase6 array tour → 34
  • v3-step3.3 — sets: multi-word masks, full expressions, all four ops + IN, word-wise = (51/51) + showcase7 → 219
  • 0ed2862 (untagged docs) — strings/UTF-8 research notes
  • v3-step3.4 — records + WITH, deep copies, pointer-fields amendment (56/56); v3-step3.5 — showcase8 everything-tour → 170
  • 641a9b7 + v3-blaise-sync — Blaise phase map + plan refresh
  • v3-step3.6 — pointers: FNil upgrade, deref chains, NEW/ DISPOSE via malloc/free (64/64)

Prior: v3-step1→1.11 substeps, v3-step2 (REALs), 1.12 TopSpeed grammar sidecar (parallel track, TopSpeed-V3-M2.atg).

Locked decisions (do not relitigate without cause)

  • Arrays: LONGCARD-count headers, per-level nested objects, open formals as bare pointers, blit rejected (needs const length) → memcpy, string data flushed at EndModule.
  • Sets: memory addresses, no header, literals SET OF [0..255], lenient cross-base (masks decide), static 222s + runtime traps.
  • Records: flat blobs, array fields as pointers (amended lock), declaration-order offsets+ranks, deep copy, WITH stacks.
  • Pointers: NIL is a real type; DISPOSE nils (deviates Wirth) and is shallow; nil-deref raw; no-underscore/classic idents stay.
  • Traps: $abort+hlt interim (rc=134), runtime/syslib/Trap later.
  • QBE facts (probed, not guessed): extern calls need arg classes, immediates valid as stored values, %tN only (bare %p mislinks), blit/alloc8 semantics, strict width checking.

Open threads / next

  1. Hardening pass (Blaise v0.12.0 lesson, recorded in docs/blaise-phases-map.md): thin-on-features, fuzz bounds/ copies/traps/narrowing over the 64-suite before step 4.
  2. Step 4 calls: call emission, C-ABI frames, value/VAR params, nested/display, DEFINITION/IMPLEMENTATION + opaque completion, HIGH/LEN, procedure-type vars. Biggest remaining phase.
  3. Then: step 5 stdlib, 6 unicode/hardening, 7 syslib port (grep gate), 8 fixpoint (needs rolling-bootstrap design, not just 3-stage diff — see map).
  4. Deferred everywhere: enum lowering/ordinals, CHAR arith policy, LONGINT quads, recursive DISPOSE, class lowering (vtable/THIS), WITH-field VAR actuals, LSP.

Resume commands

cd /home/eric/Projets/Projets-Modula2/MyWork/m2compiler-V3/compiler
./build.sh && ./run_tests.sh   # expect 64/64

Then: hardening pass or step 4 design (ask which first).