Sfoglia il codice sorgente

docs: record the UpCase/set-membership rung (ladder 18267)

CALC-COMPILE.md: the rung table gains v-TP3-CALC-UPCASE (17f7f7c,
ERR 102 18267), the session state says twenty-six rungs, the baseline is
the run just made (83/83 compile, 72/72 executed under both oracles,
non-vacuity 107/107), item 16 is marked done, and item 17 names the next
blocker: REAL output and arithmetic, a design step rather than a
one-rung change.

SUMMARY.md: the intro now stops at ERR 102 18267 and lists UpCase,
run-time set membership and DI string writes among the landed features.
Eric Streit 1 giorno fa
parent
commit
3332320f7d
2 ha cambiato i file con 34 aggiunte e 23 eliminazioni
  1. 29 19
      CALC-COMPILE.md
  2. 5 4
      SUMMARY.md

+ 29 - 19
CALC-COMPILE.md

@@ -97,7 +97,7 @@ Current rung (measured today, normalised position):
 
 | position | blocker |
 |---|---|
-| **15911** | `Upcase(Ch)` in `Clear` — an unknown builtin (`ERR 41`) |
+| **18267** | `Write(Value:FW:DEC)` in `GotoCell` — REAL output/arithmetic (`ERR 102`) |
 
 Rungs behind it (now passed):
 
@@ -123,12 +123,13 @@ Rungs behind it (now passed):
 | 15131 | set field assignment | typed by the target; run-time `in` (`t78_setfield`) |
 | 15201 | string field through DI | `<len><chars>`, truncated (`t79_strfield`) |
 | 15272 | REAL constants and copies | measured MBF, 6-byte stores (`t80_realconst`) |
+| 15911 | `UpCase` + run-time `in` | set fields through DI in WRITE (`t81`, `t82`) |
 
 Rungs ahead:
 
 | position | blocker |
 |---|---|
-| 15911 | `UpCase` (a CHAR fold, then the string form); real arithmetic still waits |
+| 18267 | REAL output (`FW:DEC`) and real arithmetic; then the rest of the evaluator |
 
 Corrections the measurements force, worth stating plainly because the stage list
 below was written before them:
@@ -402,15 +403,15 @@ ladder order (each stage removes the blocker the previous one exposed).
 
 ### Session state — where to resume
 
-Last touched 2026-10-21. **Twenty-five rungs are landed across three sessions**
+Last touched 2026-10-21. **Twenty-six rungs are landed across three sessions**
 (Stages 1-4, sets, enums, record types, array declarations, element/field
 access, file types, the calling convention and string value parameters,
 `Length`, the CRT identifiers, `Kbd`, `KeyPressed`, `var` parameters, the CASE
 labels, variable array subscripts, write field widths, WITH with
-n-dimensional subscripts, set-field assignment, string fields through DI, and
-REAL constants).  The ladder row has moved from the first typed constant at
-7791 to **15911, inside `CALC.INC`'s `Clear` — `Upcase(Ch)`, an unknown
-builtin**.
+n-dimensional subscripts, set-field assignment, string fields through DI, REAL
+constants, UpCase, run-time set membership, and string fields in WRITE).  The
+ladder row has moved from the first typed constant at 7791 to **18267, inside
+`CALC.INC`'s `GotoCell` — `Write(Value:FW:DEC)`, real output**.
 
 The rung commits and their tags, in order (each is one rung with its own
 fixture, red proof, and — where the harness allows — execution under qemu and
@@ -442,10 +443,11 @@ Exec86):
 | `a559843` | `v-TP3-CALC-WITH` | `ERR 102 15131` (set assignment to a field) |
 | `21ef4e1` | `v-TP3-CALC-SETFIELD` | `ERR 102 15201` (string field through DI) |
 | `a2e5e69` | `v-TP3-CALC-STRFIELD` | `ERR 102 15272` (REAL field) |
-| `0946e80` | `v-TP3-CALC-REALCONST` | **`ERR 41 15911`** (`Upcase`) |
+| `0946e80` | `v-TP3-CALC-REALCONST` | `ERR 41 15911` (`Upcase`) |
+| `17f7f7c` | `v-TP3-CALC-UPCASE` | **`ERR 102 18267`** (real output) |
 
-- **Code HEAD** `0946e80` (`v-TP3-CALC-REALCONST`); this commit only updates
-  this document.  Nothing pushed; `origin/master` is behind by eighteen code
+- **Code HEAD** `17f7f7c` (`v-TP3-CALC-UPCASE`); this commit only updates
+  this document.  Nothing pushed; `origin/master` is behind by nineteen code
   commits.  Two non-ladder commits in the same period are the terminal-config
   work (`v-TP3-TERMCFG`) and the editor key map (`v-TP3-EDITORKEYS`); they do
   not move the ladder and are documented in `TERMINAL.md`.
@@ -547,10 +549,10 @@ Exec86):
   byte-for-byte the same for INTEGER locals, so the compile matrix would have
   been green and only `t40_readln` (and later CALC) would have noticed.
 - **Verified baseline, run on the code HEAD above:** `./tests/run_all.sh` →
-  **OVERALL: ALL PASS**, compile matrix **81/81**, CALC ladder **1/1** at
-  `ERR 41 15911`, terminal config **4/4**, 64 `.COM` linked and **70 executed
+  **OVERALL: ALL PASS**, compile matrix **83/83**, CALC ladder **1/1** at
+  `ERR 102 18267`, terminal config **4/4**, 64 `.COM` linked and **72 executed
   under both qemu and Exec86** (`t64_arrays` is compile-only: its image is past
-  the 8 KB boot-sector read).  `tests/nonvacuity.sh`: **105 ok, 0 failed**.
+  the 8 KB boot-sector read).  `tests/nonvacuity.sh`: **107 ok, 0 failed**.
   The runtime is 878 bytes (wrintw added; the golden was re-blessed).
   `tests/check_realconst.py` pins the measured 6-byte Real operand bytes.
 - **`tests/nonvacuity.sh`:** re-run after this commit's cases (the set
@@ -588,8 +590,8 @@ Exec86):
 
 ### Next session — the concrete plan
 
-The ladder is at `ERR 41 15911`, **`Upcase(Ch)` — an unknown
-builtin**.  Everything
+The ladder is at `ERR 102 18267`, **`Write(Value:FW:DEC)` — real output
+and arithmetic**.  Everything
 below is ordered by what the ladder will hit next, not by the original stage
 numbers (the measurements have reordered them repeatedly).  Each item is the
 same shape as the rungs already landed: one focused change, one fixture that is
@@ -660,10 +662,18 @@ Then the two that are *outside* the ladder and gate the goal as stated:
     representation, integer constants and six-byte copies are in; real
     ARITHMETIC, real function results and real formatting remain item 7.
 
-16. **`UpCase` — THE NEXT RUNG (15911).**  `Upcase(Ch)` in `Clear`.  TP3's
-    UpCase takes a CHAR here (later TP versions also accept a string): fold
-    `'a'..'z'` to `'A'..'Z'`.  A CHAR-only implementation, with the string
-    form still ENoLib, is the honest first step.
+16. **`UpCase` + run-time `in` — DONE** (`v-TP3-CALC-UPCASE`).  UpCase folds a
+    CHAR constant and maps a value; `e in set` works with a run-time element
+    against literals, typed constants and data sets; a string field is
+    readable/writable through DI; Exec86 gained D0-D3.
+
+17. **REAL output and arithmetic — THE NEXT RUNG (18267).**  `Write(Value:
+    FW:DEC)` needs the 6-byte MBF value formatted with a width and decimals,
+    and CALC's evaluator (`Expression`/`Factor`/`Term`, `Sqrt`, `Sqr`, `Sin`,
+    `Cos`, `Arctan`, `Ln`, `Exp`, `Str`, `Val`) needs real arithmetic and
+    function results.  This is item 7's stage and is a design step, not a
+    one-rung change: decide the arithmetic core (runtime routines over MBF vs
+    a wider internal form) and the formatting algorithm before emitting code.
 
 14. **Raise the execution harness's read.**  `tests/exec/bootcom.s` reads 16
     sectors (8192 bytes); `t64_arrays` is already compile-only for that reason,

+ 5 - 4
SUMMARY.md

@@ -2037,9 +2037,9 @@ census of what `CALC.PAS` actually needs and the reference measurements from
 the original `TURBO.COM`. Two tracks run in parallel: the ladder (front-end,
 verifiable on small fixtures) and the layout (§3, the only thing that stops
 the compiler *emitting* a 16,560-byte program). The ratchet and front-end
-features through **REAL constants** are landed: the ladder
+features through **run-time set membership** are landed: the ladder
 (`tests/calc_ladder.sh` + `tests/fixtures/calc_ladder.tsv`, run by `run_all.sh`;
-CALC.PAS now stops at `ERR 41` at pos 15911, `Upcase(Ch)` in `Clear`), the `{$I}` include,
+CALC.PAS now stops at `ERR 102` at pos 18267, `Write(Value:FW:DEC)` in `GotoCell`), the `{$I}` include,
 `^X`/`#nn`, scalar typed constants, sets, enums, records (CellRec = 80),
 subranges, arrays, element/field access, file types, string value parameters,
 `Length`, the CRT identifiers (`ClrScr`/`GotoXY`/`ClrEol`/`LowVideo`/
@@ -2050,8 +2050,9 @@ ranges (`t74_caselist`), variable array subscripts scaled by the element size
 WITH and n-dimensional subscripts (`t77_with`), set-field assignment and
 run-time `in` (`t78_setfield`), string fields through DI (`t79_strfield`),
 the measured 6-byte REAL constants (`t80_realconst`, with a byte-level check),
-and `INT 10h`+`C6` in Exec86 (fixtures through `t80_realconst`). The next rung
-is `UpCase`; then the remaining string
+`UpCase` and run-time set membership (`t81_upcase`, `t82_setin`), and
+`INT 10h`+`C6`+`D0-D3` in Exec86 (fixtures through `t82_setin`). The next rung
+is REAL output/arithmetic; then the remaining string
 builtins, file operations, variable-index subscripts + `with`, pointers, `var`
 params, reals, recursion, and the layout change. Items 1-4 below are
 independent of both.