Browse Source

docs: sync current TP3 status and remaining work

Eric Streit 2 days ago
parent
commit
7e9d0521d9
3 changed files with 62 additions and 10 deletions
  1. 21 8
      CALC-COMPILE.md
  2. 38 2
      SUMMARY.md
  3. 3 0
      shell/tests/run_all.sh

+ 21 - 8
CALC-COMPILE.md

@@ -14,6 +14,21 @@ The measurements were taken against the tree at tag `v-TP3-INTERRUPT-RESTORE`
 tagged `v-TP3-CALC-LAYOUT`, and §1's rung table and the "Session state" section
 are the current figures).
 
+## Current status (2026-10-27)
+
+The goal of this document is met: `CALC.PAS` compiles to its final `.` and the
+smoke test boots the resulting `.COM`.  The stage plan below is a historical
+record; phrases such as "next", "still open" or "not implemented" describe the
+state when that stage was written, not the current compiler.
+
+Current measurements: **27,519 B code, 19,694 B data, 37,790 B `.COM`**;
+runtime **10,268 bytes / 68 entries**.  The surviving `pascsrc` TP3 corpus is
+**71 / 71 OK** and is checked by `tests/corpus_check.py`.
+
+What is still outside the automated CALC evidence: a full Help/heap session and
+the complete editor/menu workflow.  The smoke test covers the welcome screen,
+cell entry, `1+2 -> 3.00`, the menu and `/Q`.
+
 ---
 
 ## 0. Scope decisions, fixed before any code
@@ -28,21 +43,19 @@ are the current figures).
 2. **Compile first, run second.** The gate is the compiler's verdict, not a
    working spreadsheet. A construct may be *incomplete* only if it is *loudly*
    incomplete (`Err (ENoLib)`); it may never be accepted and mis-compiled.
-   This project has already shipped that bug once. One of the two cases below
-   is now closed (Stage 2); the other is not:
+   This project has already shipped that bug once. Both cases below are now
+   closed:
 
-   - `var` parameters are **silently accepted and passed by value** —
-     `ProcFunc` drops the `var` (`DropB (MatchKey (tok))`, comment "VAR
-     parameter recorded as value in this milestone"); `writeln (g)` after
-     `q (g)` prints `7`, not `42`. Ten CALC routines take `var` parameters.
+   - `var` parameters were once silently accepted and passed by value; that
+     was fixed at Stage 10.  Ten CALC routines take `var` parameters.
    - `{$I CALC.INC}` was **silently swallowed as a comment**, so `CALC.PAS`
      without its include compiled green (`program p; {$I part.inc} begin halt
      end.` → `OK code=32 data=4`, `part.inc` never opened). **Closed at Stage
      2**: the include is expanded before parsing and an unopenable file is
      error 90, not a comment.
 
-   The `var`-parameter case is still open and must be closed by
-   implementation, or by an explicit `Err` until it is (Stage 10).
+   **Resolved at Stage 10:** `var` parameters are passed by reference and are
+   covered by `t73_varparam`.
 
 3. **One fixture and one ratchet per step.** Every stage lands with a fixture
    that is provably red before and green after, plus a move of the ratchet

+ 38 - 2
SUMMARY.md

@@ -1198,7 +1198,43 @@ Details that are deliberate, not incidental:
   a non-string — `ENoLib`, because neither has an encoding yet.
 
 
-## Honest limitations
+## Current status (2026-10-27)
+
+The compiler target is met: the complete surviving TP3 example corpus compiles,
+CALC compiles to its final `.`, and every default check is green.
+
+- `Sources/Dezip/pascsrc`: **71 / 71 `.pas` compile**; this is now checked by
+  `tests/corpus_check.py`, which `run_all.sh` runs when the tree exists.
+- `tests/run_all.sh`: **OVERALL: ALL PASS**.
+- `tests/nonvacuity.sh`: **121 ok, 0 failed**.
+- Runtime: **10,268 bytes / 68 entries**.
+- CALC: **27,519 B code, 19,694 B data, 37,790 B `.COM`**.
+- The working `Sources/` tree contains only `Dezip/pascsrc` (78 files,
+  71 `.pas`, no archives).
+
+This does not claim the whole Turbo Pascal 3 standard library or every TP3
+compiler option.  The corpus is the regression target; the historical notes
+below are retained because they explain why the implementation has its current
+shape.
+
+## Remaining work
+
+1. **Library surface not exercised by the corpus.** Verify the exact TP3 set and
+   add what is still missing, such as `Pos`, `Concat`, file positioning /
+   rename / erase / block I/O, and the low-level `Random`/`FillChar`/`Move`/
+   `Port` routines.
+2. **Optional TP3 compiler options.** Range/index checking and the remaining
+   directives are not part of the corpus path; they should stay loud if
+   unsupported rather than being silently ignored.
+3. **Execution coverage for file I/O and CALC.** Several file paths are checked
+   by compiling only, and CALC's automated run covers the main screen and
+   `1+2`, not the full Help/heap path.
+4. **Documentation drift.** The historical sections below and the stage notes in
+   `CALC-COMPILE.md` must be read as history; this summary is the current
+   status.
+5. **Long-argument limit.** A call is still capped at 16 arguments.
+
+## Historical limitations (pre-corpus-clean)
 
 - **`runtest.py` runs one fixture through `R`, not the whole suite.** It drives
   `t34_arith`
@@ -2031,7 +2067,7 @@ independently-scanned inventory at all.
   disassembly wins.
 - `Resources/coeur-tp-ocr/` — OCR of "Au coeur de Turbo Pascal".
 
-## Next steps
+## Historical next steps (superseded by the current status above)
 
 **CALC is now a separate, planned line of work — see `CALC-COMPILE.md`.** Its
 plan of record is a staged roadmap (ratchet → `{$I}` include → `#nn`/`^X` →

+ 3 - 0
shell/tests/run_all.sh

@@ -9,6 +9,9 @@
 #                       it changes whenever a fixture is added, and a number
 #                       that is only right until the next edit is how a
 #                       comment starts claiming things it cannot support.
+#   1b. source corpus  the surviving Sources/Dezip/pascsrc tree, one compiletest
+#                       process per file; skipped when that user-owned tree is
+#                       absent.  See tests/corpus_check.py.
 #   2. .COM linker      links every fixture, then re-verifies the bytes with an
 #                       independent checker that restates the layout constants
 #                       instead of asking the compiler.