Pārlūkot izejas kodu

docs: record the write-field-width rung (ladder 15026)

CALC-COMPILE.md: the rung table gains v-TP3-CALC-WIDTH (099f8fd,
ERR 102 15026), the session state says twenty-one rungs and notes the
runtime is 878 bytes, the baseline is the run just made (77/77 compile,
66/66 executed under both oracles, non-vacuity 97/97), the next-session
plan marks integer widths done (real :width:decimals still open) and
names the 2-D subscript plus `with` as the next rung.

SUMMARY.md: the intro now stops at ERR 102 15026 and lists field widths
among the landed features.
Eric Streit 1 dienu atpakaļ
vecāks
revīzija
d6800cc4ef
2 mainītis faili ar 34 papildinājumiem un 29 dzēšanām
  1. 29 25
      CALC-COMPILE.md
  2. 5 4
      SUMMARY.md

+ 29 - 25
CALC-COMPILE.md

@@ -97,7 +97,7 @@ Current rung (measured today, normalised position):
 
 | position | blocker |
 |---|---|
-| **14330** | `writeln(I:2)` in `DisplayP` — a write field width (`ERR 1`) |
+| **15026** | `with Sheet[I,J] do` in `DisplayP` — a 2-D subscript and `with` (`ERR 102`) |
 
 Rungs behind it (now passed):
 
@@ -118,12 +118,13 @@ Rungs behind it (now passed):
 | 12901 | `var` parameters | by reference + DupTest shadowing (`t73_varparam`) |
 | 13052 | comma-separated CASE labels | plus real CASE ranges (`t74_caselist`) |
 | 14195 | variable array subscripts | scaled addressing, 1 byte or 2 (`t75_arrvar`) |
+| 14330 | write field widths | `wrintw`, runtime 770 -> 878 (`t76_width`) |
 
 Rungs ahead:
 
 | position | blocker |
 |---|---|
-| 14330 | write field widths (`expr:width`); then the rest of `CALC.INC` |
+| 15026 | 2-D subscripts (`Sheet[I,J]`, row stride) and `with`; then the rest of `CALC.INC` |
 
 Corrections the measurements force, worth stating plainly because the stage list
 below was written before them:
@@ -397,13 +398,13 @@ ladder order (each stage removes the blocker the previous one exposed).
 
 ### Session state — where to resume
 
-Last touched 2026-10-21. **Twenty rungs are landed across three sessions**
+Last touched 2026-10-21. **Twenty-one 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, and variable array subscripts).  The ladder row has moved from the
-first typed constant at 7791 to **14330, inside `CALC.INC`'s `DisplayP` —
-`writeln(I:2)`, a write field width**.
+labels, variable array subscripts, and write field widths).  The ladder row has
+moved from the first typed constant at 7791 to **15026, inside `CALC.INC`'s
+`DisplayP` — `with Sheet[I,J] do`, the 2-D subscript and `with`**.
 
 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
@@ -430,10 +431,11 @@ Exec86):
 | `033eb8e` | `v-TP3-CALC-KEYPRESSED` | `ERR 41 12901` (`IBMCh`'s `var` parameter) |
 | `5eb82c4` | `v-TP3-CALC-VARPARAM` | `ERR 1 13052` (comma-separated CASE labels) |
 | `8a265e7` | `v-TP3-CALC-CASELIST` | `ERR 102 14195` (variable array subscript) |
-| `b41c669` | `v-TP3-CALC-ARRVAR` | **`ERR 1 14330`** (write field width) |
+| `b41c669` | `v-TP3-CALC-ARRVAR` | `ERR 1 14330` (write field width) |
+| `099f8fd` | `v-TP3-CALC-WIDTH` | **`ERR 102 15026`** (2-D subscript + `with`) |
 
-- **Code HEAD** `b41c669` (`v-TP3-CALC-ARRVAR`); this commit only updates
-  this document.  Nothing pushed; `origin/master` is behind by thirteen code
+- **Code HEAD** `099f8fd` (`v-TP3-CALC-WIDTH`); this commit only updates
+  this document.  Nothing pushed; `origin/master` is behind by fourteen 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`.
@@ -535,10 +537,11 @@ 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 **76/76**, CALC ladder **1/1** at
-  `ERR 1 14330`, terminal config **4/4**, 64 `.COM` linked and **65 executed
+  **OVERALL: ALL PASS**, compile matrix **77/77**, CALC ladder **1/1** at
+  `ERR 102 15026`, terminal config **4/4**, 64 `.COM` linked and **66 executed
   under both qemu and Exec86** (`t64_arrays` is compile-only: its image is past
-  the 8 KB boot-sector read).  `tests/nonvacuity.sh`: **96 ok, 0 failed**.
+  the 8 KB boot-sector read).  `tests/nonvacuity.sh`: **97 ok, 0 failed**.
+  The runtime is now 878 bytes (wrintw added; the golden was re-blessed).
 - **`tests/nonvacuity.sh`:** re-run after this commit's cases (the set
   membership bit among them); see the commit message for the count. It is not in
   the default `run_all.sh` and must be run **manually** after touching any check.
@@ -574,8 +577,8 @@ Exec86):
 
 ### Next session — the concrete plan
 
-The ladder is at `ERR 1 14330`, **`writeln(I:2)`, a write field
-width**.  Everything
+The ladder is at `ERR 102 15026`, **`with Sheet[I,J] do` — a 2-D
+subscript and `with`**.  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
@@ -600,12 +603,14 @@ commit.
    `IoResult`; `read`/`write` with a leading file argument).  Runtime entries
    doing `INT 21h` open/create/read/write/close, text-mode newline and `^Z`.
    The file *types* and variables are already in place (`FileVarSize`).
-4. **Variable array subscripts — DONE, 1-D** (`v-TP3-CALC-ARRVAR`): a
-   run-time index is `(i - lo) * elemsize` from the base, with the element's
-   address in DI; one and two bytes are loaded/stored.  **Still open:** a
-   SECOND run-time subscript (`Sheet[FX,FY]`, row stride) and a field of a
-   DI-addressed record, which need the element type to travel with the
-   expression.  `with` follows on the same addressing work.
+4. **Array subscripts — DONE, 1-D; THE NEXT RUNG is 2-D + `with` (15026).**
+   A run-time index is `(i - lo) * elemsize` from the base, with the element's
+   address in DI; one and two bytes are loaded/stored.  **Still open:**
+   `Sheet[I,J]` needs the row stride `(hi1 - lo1 + 1) * elem` accumulated
+   across dimensions, and `with Sheet[I,J] do` needs the ELEMENT's record
+   field table to follow the DI-addressed element (today `.field` uses the
+   array symbol's table).  Both are the same "element type travels with the
+   expression" change.
 5. **Pointers and the heap** (`^T`, `New`, `Dispose`, `Buffer^[i]`), 4-byte
    (offset then segment); the heap must hold `Pages` (16,281 bytes).
 6. **`var` parameters by reference — DONE** (`v-TP3-CALC-VARPARAM`).  The slot
@@ -636,11 +641,10 @@ Then the two that are *outside* the ladder and gate the goal as stated:
     original" (data low, code high) vs a dynamic data base with fixups, and
     re-baseline `t43_codewindow` in the same commit.  This is the only stage
     that blocks *emitting* the whole program.
-13. **Write field widths — THE NEXT RUNG (14330).**  `writeln(I:2)`, then
-    `Real:width:decimals`.  IoCall parses the expression and then demands `,`
-    or `)`, so the `:` is ENoSemi.  The integer writer needs a width (pad with
-    spaces on the left); the real writer needs width and decimals.  A string's
-    width also pads/truncates.
+13. **Write field widths — DONE for integers** (`v-TP3-CALC-WIDTH`, entry 20
+    `wrintw`).  **Still open:** `Real:width:decimals` (CALC's
+    `Value:FW:DEC`, which waits for real support) and widths on
+    CHAR/BOOLEAN/STRING, which are loud today.
 
 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,17 +2037,18 @@ 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 **variable array subscripts** are landed: the ladder
+features through **write field widths** are landed: the ladder
 (`tests/calc_ladder.sh` + `tests/fixtures/calc_ladder.tsv`, run by `run_all.sh`;
-CALC.PAS now stops at `ERR 1` at pos 14330, `writeln(I:2)` in `DisplayP`), the `{$I}` include,
+CALC.PAS now stops at `ERR 102` at pos 15026, `with Sheet[I,J]` in `DisplayP`), 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`/
 `NormVideo`/`Delay`), `Kbd`, `KeyPressed` (`INT 21h AH=0B`), `var` parameters
 (by reference; `t73_varparam`), comma-separated CASE labels and real CASE
 ranges (`t74_caselist`), variable array subscripts scaled by the element size
-(`t75_arrvar`), and `INT 10h`+`C6` in Exec86 (fixtures through `t75_arrvar`).
-The next rung is write field widths; then the remaining string
+(`t75_arrvar`), write field widths (`t76_width`, runtime entry 20 `wrintw`),
+and `INT 10h`+`C6` in Exec86 (fixtures through `t76_width`). The next rung is
+the 2-D subscript and `with`; 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.