Parcourir la source

docs: triage remaining corpus gaps

Eric Streit il y a 2 jours
Parent
commit
895ee2ed7b

+ 3 - 3
README.md

@@ -47,8 +47,8 @@ docs/              STATUS.md, plan.md, plan-*.md, analysis_*.md, summary_*.md
 
 ## Status (2026-10-23)
 
-- Suite **300/300**; self-hosting **fixpoint OK** (byte-identical
-  stage2/stage3, 3,571,371 bytes); corpus **518/612 compile-OK,
+- Suite **301/301**; self-hosting **fixpoint OK** (byte-identical
+  stage2/stage3, 3,573,487 bytes); corpus **519/612 compile-OK,
   0 crashes** (`tools/v3-corpus`; the corpus is gm2's testsuite, so it
   mixes conforming Modula-2 with gm2 leniencies — see `docs/gaps/`).
   The remaining `except*`/`onebyte*`-style corpus files still hit V3's
@@ -60,7 +60,7 @@ docs/              STATUS.md, plan.md, plan-*.md, analysis_*.md, summary_*.md
   records/chained fields, and multi-dimensional fixed/open arrays
   (M1–M4): flat payloads + per-level views, open-array calls, and
   payload `SIZE`/view `ADR`, flat multi-dimensional record fields and
-  constructors, and pointer-based 1-D open views.
+  constructors, pointer-based 1-D open views, and an `LFLOAT` builtin.
 
 Lowers today: program modules; `CONST`/`VAR`/`TYPE` (scalars,
 subranges, enums, arrays, records incl. variants and self-referential

+ 2 - 0
docs/INDEX.md

@@ -21,6 +21,8 @@ bisecting *why* a decision was made, not for reading end-to-end).
 - **`comparison-PIM4-gm2-V3.md`** — PIM4 / GNU Modula-2 / **M2R10** /
   **TopSpeed V3** / V3 feature comparison (2026-10-23; V3 at
   `v3-open-arrays`; filename kept for link stability).
+- **`triage-corpus-2026-10-24.md`** — final corpus triage after open
+  arrays: policy vs dialect vs implementation vs genuine gaps; `LFLOAT`.
 - **`analysis_gaps.md`** — language gaps + corpus notes.
 - **`gaps/README.md`** — minimal reproducers, one per unsupported gap,
   and the gm2-extension policy.

+ 3 - 3
docs/STATUS.md

@@ -4,10 +4,10 @@ This answers "where are we now?".
 
 ## Numbers
 
-- Suite **300/300** (`compiler/run_tests.sh`).
+- Suite **301/301** (`compiler/run_tests.sh`).
 - Self-hosting **FIXPOINT OK** — stage2 and stage3 images are
-  byte-identical (3,571,371 bytes).
-- Corpus **518 / 612** sources compile with 0 errors, **0 crashes**
+  byte-identical (3,573,487 bytes).
+- Corpus **519 / 612** sources compile with 0 errors, **0 crashes**
   (`tools/v3-corpus/corpus.sh` over the gm2 testsuite; the harness now
   resolves V3's own shipped libraries); the rest are genuine language
   gaps, **gm2 leniencies V3 deliberately rejects**, or unresolved

+ 3 - 3
docs/comparison-PIM4-gm2-V3.md

@@ -1,8 +1,8 @@
 # PIM4 vs GNU Modula-2 vs M2R10 vs TopSpeed V3 vs V3 — feature comparison
 
-**Date:** 2026-10-24 · **V3 state:** `v3-open-arrays` (suite
-300/300, self-hosting fixpoint OK 3,571,371 bytes, corpus 518/612,
-0 crashes).
+**Date:** 2026-10-24 · **V3 state:** open-array milestone + triage
+follow-up (suite 301/301, self-hosting fixpoint OK 3,573,487 bytes,
+corpus 519/612, 0 crashes).
 
 **Scope and sources.**
 

+ 3 - 2
docs/features.md

@@ -1,4 +1,4 @@
-# m2compiler-V3 — feature status (2026-10-24; suite 300/300 green)
+# m2compiler-V3 — feature status (2026-10-24; suite 301/301 green)
 
 Pipeline: Coco/R `M2.atg` (1748 lines, 73 productions) → `gm2`-built
 `M2` → QBE `.ssa` → `qbe` → `cc` → run. `SymTab.mod` 1623 lines,
@@ -149,7 +149,8 @@ Legend: ✅ done · 🔄 partial · ⏸ not started / deferred.
   (`ORD(a > b)` in a `CONST`). UString `+`/`LEN` likewise.
 - ✅ `__FILE__`, `__LINE__`, `__FUNCTION__` predefined literals.
 - ✅ `NIL` comparisons/assignment.
-- ✅ `VAL`/`ADR`/`TSIZE`/`SIZE`/`HIGH`/`LEN` work.  Array
+- ✅ `VAL`/`ADR`/`TSIZE`/`SIZE`/`HIGH`/`LEN` and `FLOAT`/`LFLOAT`
+  work.  Array
   `SIZE`/`TSIZE` use payload bytes (no descriptor header/term slot);
   `ADR` of a multi/open view or row is its payload base, while fixed
   1-D `ADR` keeps descriptor compatibility.  ✅ Result suffixes

+ 2 - 1
docs/gaps/README.md

@@ -1,6 +1,7 @@
 # Unsupported / non-standard cases
 
-One minimal source per known V3 gap (2026-10-18).  Each file's header
+One minimal source per known V3 gap (2026-10-18).  For the current
+post-open-array classification, see `docs/triage-corpus-2026-10-24.md`.  Each file's header
 comment carries its **tag**, its **Modula-2 status**, and the gm2 corpus
 file(s) it stands for.  These are *not* part of the test suite (they are
 expected to fail); they exist so each case has a runnable example.

+ 9 - 2
docs/handoff-2026-10-23-next.md

@@ -1,8 +1,8 @@
 # Next session — plan (from 2026-10-23)
 
 **Branch:** `master`.  **Feature state:** `v3-exceptions` + `v3-ptrchain` + `v3-function-exception` + `v3-finally` + open-array M1/M2/M3/M4.
-**Gates:** suite **300/300**, fixpoint **OK (3,571,371 bytes)**,
-corpus **518/612, 0 crashes**.
+**Gates:** suite **301/301**, fixpoint **OK (3,573,487 bytes)**,
+corpus **519/612, 0 crashes**.
 
 Read first: `docs/STATUS.md`, `docs/features.md`,
 `docs/gaps/README.md`, `docs/summary_session-2026-10-23-exceptions.md`.
@@ -137,6 +137,13 @@ compiler units with `V3_LEGACY_OPEN1D=1`; user programs use views.
 Suite **300/300**, fixpoint **3,571,371 bytes**, corpus **518/612**.
 Final tag **`v3-open-arrays`**; no further M6 work.
 
+**Corpus triage — done (2026-10-24).**  `LFLOAT` was added
+(`testfloat4` now compiles, corpus 518 → 519).  The remaining 66
+`LANG` cases are classified in `docs/triage-corpus-2026-10-24.md`:
+mostly declaration-order policy, lexical/dialect choices and set
+implementation limits; no other genuine standard-language gap.  Next:
+separate compilation/library folders.
+
 ## 4. Runtime range checks — done, follow-ups
 
 `Lower.CheckSub` covers assignment, value actuals, `RETURN` and

+ 5 - 3
docs/summary_session-2026-10-24-open-arrays-m6.md

@@ -75,9 +75,11 @@ constructor and compiler-session tests remain green.
 
 ## Remaining
 
-No open-array milestone work remains.  Possible future language work is
-outside this feature (for example coroutine/protection exceptions and
-the separate-compilation/library-folder plan).
+No open-array milestone work remains.  A follow-up corpus triage added
+`LFLOAT` (suite 301, corpus 519); the remaining cases are classified in
+`triage-corpus-2026-10-24.md`.  Possible future language work is outside
+this feature (for example coroutine/protection exceptions and the
+separate-compilation/library-folder plan).
 
 ---
 

+ 110 - 0
docs/triage-corpus-2026-10-24.md

@@ -0,0 +1,110 @@
+# Corpus triage — 2026-10-24
+
+**State after this pass:** suite **301/301**, fixpoint OK
+**3,573,487 bytes**, corpus **519/612 compile-OK, 0 crashes**,
+**66 LANG**, **27 LIB**.
+
+The corpus is compile-only.  This pass separated the remaining `LANG`
+failures into policy, dialect/lexical choices, implementation limits,
+and genuine language/library gaps.  It also fixed one small genuine
+ISO/gm2 builtin.
+
+---
+
+## Fixed in this pass
+
+- **`LFLOAT(x)`** (`testfloat4`): accepted as the ISO/gm2
+  integer/LONGREAL conversion.  V3 represents all reals as 64-bit, so
+  it shares the `FLOAT` implementation (`VAL(REAL, x)`).
+  Regression: `t_lfloat`.
+
+`testfloat4` now compiles; corpus **518 → 519**.
+
+---
+
+## Declaration-order policy (`decl-order`)
+
+These are not language gaps.  V3 deliberately enforces PIM/ISO
+declaration-before-use for data.  The files use a module variable,
+constant, type or nested-module export before its declaration (often
+to match gm2’s multi-pass behavior).
+
+- `adrunbounded3`, `arrayptr`, `arrayptr6`, `block`, `blockindirect`,
+  `nestedfor`, `param3`, `proc`;
+- `complextypes`, `colour`;
+- `constprocedure`, `conststrarray`, `constvec3`;
+- `constructor1`, `constructor3`;
+- `record7`, `record14.def`, `record15.def`, `record16.def`;
+- `subrange4`, `subrange7`, `subrange11`;
+- `setconst3`, `setoverflow`, `sets2`, `smallset2`, `stressset`,
+  `largeset1`, `largeset2`, `tinyset6`, `tinyset7`;
+- `onebyte`, `onebyte2`, `onebyte3`;
+- `except2`, `except4`, `except5`, `except7`, `except8`, `except9`;
+- `shift3`, `shift4`;
+- `unbounded5`, `unbounded6`, `unbounded7`, `unbounded8`.
+
+`adraddress` also contains a genuine ADDRESS/pointer comparison gap,
+but its `r` reference before declaration means it remains a
+declaration-order case under policy.
+
+No policy relaxation is recommended.
+
+---
+
+## Lexical / dialect choices (not planned as language changes)
+
+- **No octal `B` suffix**: `arrayindirect` (`666B`).
+- **No `H` numeric suffix**: `wordconst` (`012H`).
+- **Inline `ASM`**: `fooasm3` (not in the V3 scope).
+- **Address arithmetic**: `divaddr`, `modaddr`, `multaddr`, `pointer`
+  (`ADDRESS DIV/MOD/*` and pointer arithmetic; gm2 extensions).
+- **CHAR arithmetic**: `timeio2` (`CHAR - CHAR`; not standard).
+- **Structural array/type leniency**: `another` (assigning distinct
+  but structurally identical array types).
+- **`SHORTREAL` vs `WORD` VAR**: `testparam3` (gm2 word-model
+  extension; V3 has 64-bit reals).
+- **Absolute variables** `VAR [addr]: T`: `varaddress`,
+  `varaddress2`, `varaddress3`.
+- **Module named `CHAR`**: `CHAR.mod` collides with the predefined
+  type; gm2-specific test naming.
+
+---
+
+## Implementation limits
+
+- `settest1`, `settest3`: set span beyond the current 65536-bit limit.
+- `largeset5`: set ordering (`<`, `>=`); PIM/ISO only defines
+  `=`/`#`/`IN` for sets, so this is a gm2 extension rather than a
+  missing standard operation.
+
+---
+
+## Library / foreign-module cases
+
+- `badpointer`: requires gm2 `DynamicStrings`/opaque `String`
+  behavior; the module is not part of V3’s shipped library set.
+  Classified as a library/extension case, not a parser/codegen gap.
+
+---
+
+## Genuine gaps worth considering later
+
+- **ADDRESS ↔ pointer comparison**: `adraddress` exposes it, but the
+  file is also declaration-order.  A small `SymTab.EqCheck` extension
+  is safe (equality only), but it will not move the corpus count until
+  the file’s declaration order is fixed.
+- **Absolute variables** and **inline ASM** remain unimplemented
+  extensions; neither is part of the current PIM/ISO target.
+- **Wide sets** remain an explicit implementation limit; raising it is
+  a separate design task.
+
+No other genuine standard-language gap was found in the current
+`LANG` set.
+
+---
+
+## Recommendation
+
+Proceed with **separate compilation/library folders** as the next major
+feature.  Corpus policy and dialect categories should stay documented
+rather than being “fixed” by relaxing V3.