v3's whole POST on v4 at 983 of 1010 (the table's own count with its drops), from 850.
What remains is capacity ("Dictionary full", the 100-900-deep stacks): next, as ruled.
Found and fixed under the rulings (docs/v4.0.0/POST-PARITY.md):
- IS and DEFER@ refuse a word DEFER did not make, as v3: error 22, "Not deferred".
v4's IS stored into any word -- POST's `42 IS DUP` broke DUP for every case after it.
DEFER marks its word with flag 128 (dict.f18).
- SMUDGE and HIDDEN are compile-only, as v3's table: at the prompt v4's hid the newest word.
- Q./ by zero gives 0 and no error (ruled: v3's table); error 11 retired. The ROM's,
the test's reference and its hand-assembled copy changed alike.
- FENCE is v3's: it protects what is defined so far. The variable is (FENCE).
- The line's length is (#SRC), no longer SPAN: an EXPECT in a line cut the rest of
the line off, and 0 EXPECT could not leave SPAN 0 (FORTH-83).
- POST gains V4_POST_HEAD: the values left and how the output begins -- the form of a
printout whose values are the run's own (TOP-WORDS, WORD-ENTROPY).
post_all_rules.py: the rest of the whole table where it is not taken as v3 ran it --
v4's units for the cases that wrote through HERE as a byte address (CMOVE>, BLANK,
ERASE, FILL wrote into the system's code), the standard's results (COMPARE, SEARCH,
BASE output, THRU, >BODY with FIND's address), v3's descriptions where v3 printed
otherwise, and the cases dropped with their reasons (SP@/SP! by D-2, DABS/DMIN
underflow, CMOVE>.bounds, THRU.negative_end).
make -C v4 test: all v4 tests passed (both widths, mesh-boot, inference).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
143 lines
11 KiB
Markdown
143 lines
11 KiB
Markdown
# v3's whole POST on v4 -- the inventory
|
|
|
|
Started 2026-11-13, Task 0 of `plans/2026-11-13-engine-step4-phase7-the-loops-and-parity.md` (#189).
|
|
Captain Bob, 2026-11-13: Phase 7 is accepted on **"v3's whole POST"**. This counts every case of v3's
|
|
POST against v4 as it is on e8e7ec8b (377 live words), with `v4/tools/mkpost.py`'s own reader of
|
|
`v3/src/test_runner/modules/`. It proposes; it decides nothing.
|
|
|
|
## 1. The 17 modules `mkpost.py` reads today
|
|
|
|
v4's POST keeps only their cases for the FORTH-79 Required Word Set (550 read, 539 after what
|
|
`mkpost.py` leaves out: the keyboard, words that forget or damage the system, lines too long).
|
|
|
|
| Module | Cases | Required (on v4's POST) | Other words v4 has | Words v4 lacks |
|
|
|---|---|---|---|---|
|
|
| stack_words_test.c | 55 | 50 | 5 | 0 |
|
|
| return_stack_words_test.c | 11 | 11 | 0 | 0 |
|
|
| memory_words_test.c | 53 | 38 | 15 | 0 |
|
|
| arithmetic_words_test.c | 104 | 92 | 12 | 0 |
|
|
| logical_words_test.c | 103 | 64 | 39 | 0 |
|
|
| mixed_arithmetic_words_test.c | 40 | 18 | 22 | 0 |
|
|
| double_words_test.c | 125 | 21 | 104 | 0 |
|
|
| format_words_test.c | 31 | 25 | 6 | 0 |
|
|
| string_words_test.c | 49 | 15 | 34 | 0 |
|
|
| io_words_test.c | 73 | 61 | 3 | 9 (`BASE_OUTPUT`, `FORMAT_COMBO`: groups, not words) |
|
|
| block_words_test.c | 51 | 30 | 21 | 0 |
|
|
| dictionary_words_test.c | 49 | 22 | 15 | 12 (`SP!`, `SP@`; `COMPILATION`, `STACK_MGMT`: groups) |
|
|
| dictionary_manipulation_words_test.c | 29 | 16 | 13 | 0 |
|
|
| vocabulary_words_test.c | 22 | 19 | 3 | 0 |
|
|
| system_words_test.c | 7 | 4 | 3 | 0 |
|
|
| defining_words_tests.c | 32 | 22 | 10 | 0 |
|
|
| control_words_test.c | 54 | 42 | 12 | 0 |
|
|
| **Total** | **888** | **550** | **317** | **21** |
|
|
|
|
The 317 test words v4 already has; they are left out only because `mkpost.py` keeps the Required set.
|
|
|
|
## 2. The nine modules `mkpost.py` does not read
|
|
|
|
| Module | Cases | Words v4 lacks | Kind |
|
|
|---|---|---|---|
|
|
| q48_words_test.c | 28 | none | FORTH lines; every word is on v4 |
|
|
| starforth_words_test.c | 29 | `ENTROPY!` `ENTROPY@` `RESET-ENTROPY` `TOP-WORDS` `WORD-ENTROPY` `(-` | FORTH lines; the entropy and top-words words read the physics |
|
|
| physics_freeze_words_test.c | 7 | `FREEZE-WORD` `UNFREEZE-WORD` `FROZEN?` `HEAT@` `HEAT!` `DECAY-RATE@` | FORTH lines; the loops' words |
|
|
| inference_words_test.c | 9 | `INFER-RUN` `INFER-DECAY-SLOPE` `INFER-DECAY@` `INFER-EARLY-EXIT@` `INFER-FIT@` `INFER-VARIANCE@` `INFER-WINDOW-WIDTH` `INFER-WINDOW@` `Q.VARIANCE` | FORTH lines; the inference engine's words |
|
|
| stress_tests.c | 45 | none (14 group names) | FORTH lines |
|
|
| integration_tests.c | 8 | none (3 group names) | FORTH lines |
|
|
| mama_forth_words_test.c | 20 | `CAPSULE-BIRTH` `CAPSULE-RUN` `CAPSULE-TEST` `CAPSULE-COUNT` `CAPSULE@` `CAPSULE-FLAGS@` `CAPSULE-HASH@` `CAPSULE-LEN@` `MAMA-VM-ID` `VM-COUNT` | FORTH lines about v3's VMs and capsule directory |
|
|
| acl_words_test.c | 11 | -- | **C**, against v3's VM's fields (`vm->...`), not FORTH lines |
|
|
| break_me_tests.c | 1 | -- | **C**, one routine against v3's VM |
|
|
|
|
## 3. For ruling
|
|
|
|
1. **Mama** (20 cases): the words are v3's: a VM ID, a VM count, v3's capsule directory. v4 has nodes,
|
|
births (`BIRTH`, `NODE-ME`) and its own capsules. Written as v4 words with v3's names and meaning,
|
|
mapped to v4's equivalents, or out of parity?
|
|
2. **The C modules** (ACL, break_me): they read v3's VM's fields directly. Rewritten as tests of the
|
|
same behaviour against v4 (FORTH lines where they can be, host tests in C where they cannot), or
|
|
out?
|
|
3. **The group names** (`STACK_BOUNDARY`, `COMPILATION`, ...): v3 files cases under a group, not a word.
|
|
They are cases like any other, run as they are; nothing to rule unless a case fails.
|
|
|
|
**Ruled (Captain Bob, 2026-11-13):**
|
|
1. **Mama:** v4 words with v3's names and meaning, mapped to v4's equivalents -- "but do not compose
|
|
words in C99, use F18 and StarForth". The words are written in the system's F18 or in StarForth;
|
|
where only the kernel can answer (the registry, the capsules it holds), the word asks it by a
|
|
request on port 0, as `KERNEL-WORD` words do. The 20 cases run as they are.
|
|
2. **The C modules:** rewritten for v4, the same behaviour shown case by case -- as FORTH lines in POST
|
|
where they can be, as host tests in C where they need internals.
|
|
|
|
## 4. What parity needs, in count
|
|
|
|
About 1,050 cases: 888 in section 1, 146 FORTH-line cases in section 2's modules, and the C modules' 12 tests -- 1,046. v4 has 539 today.
|
|
The loops' own words (physics freeze, inference, entropy, top words) are 22 cases; the ACL and Mama
|
|
modules wait on section 3.
|
|
|
|
## 5. Measured (2026-11-14, Task 8)
|
|
|
|
`v4/tools/mkpost.py --all --out FILE` writes every case of v3's whole POST -- v3's 22 POST modules in
|
|
`test_runner.c`'s order, Q48, the stress and integration tests -- as a table, v3 the reference, leaving
|
|
`system/post_cases.c` as it is. Run on Hera in the kernel's fabric (the mesh boot, with the kernel's
|
|
capsules) on the tree after Task 4: **1020 cases, 849 pass, 171 fail.**
|
|
|
|
Failures by word: `C,` 8, `TOP-WORDS` 7, `CASE` 5, `M/MOD` 5, `U/MOD` 5, `(-` 4, `BASE_OUTPUT` 4, `COMPARE` 4, `LATEST` 4, `M+` 4, `SEARCH` 4, `WORD` 4, `-!` 3, `2!` 3, `COMPLETE_PROGRAMS` 3, `FENCE` 3, `MEMORY_STRESS` 3, `ORDER` 3, `SCAN` 3, `SKIP` 3, `SP@` 3, `STACK_DEPTH` 3, `WORD-ENTROPY` 3, `2,` 2, `2>R` 2, `2R>` 2, `2R@` 2, `>BODY` 2, `AGAIN` 2, `BEGIN` 2, `CMOVE>` 2, `DEEP_NESTING` 2, `EXIT` 2, `FROZEN?` 2, `MIXED_COMPLEX` 2, `NUMERIC_BOUNDARY` 2, `RETURN_STACK` 2, `S"` 2, `STACK_BOUNDARY` 2, `STACK_MGMT` 2, `STRING_EDGE` 2, `THRU` 2, `WHILE` 2, `+LOOP` 1, `."` 1, `?` 1, `ALGORITHMS` 1, `BL` 1, `COMPILATION` 1, `COMPILE` 1, `CONTROL_EDGE` 1, `CONVERT` 1, `DABS` 1, `DECAY-RATE@` 1, `DMIN` 1, `ENTROPY@` 1, `ERROR_RECOVERY` 1, `EXECUTE` 1, `FLUSH` 1, `FREEZE-WORD` 1, `HEAT!` 1, `HEAT@` 1, `HIDDEN` 1, `INFER-DECAY-SLOPE` 1, `INFER-EARLY-EXIT@` 1, `INFER-VARIANCE@` 1, `IS` 1, `LITERAL` 1, `Q./` 1, `Q.0` 1, `Q.1` 1, `Q.SCALE` 1, `Q.VARIANCE` 1, `REPEAT` 1, `RESET-ENTROPY` 1, `SMUDGE` 1, `SP!` 1, `SPAN` 1, `STATE` 1, `UNFREEZE-WORD` 1, `UNTIL` 1, `[']` 1, `[COMPILE]` 1.
|
|
|
|
What they are:
|
|
1. **Address units.** v3's cases do byte-address arithmetic in 8-byte cells (`C,`, `2!`, `SEARCH`,
|
|
`COMPARE`, `CMOVE>`, `-!` ...); v4's address unit is a cell (D-1). The case wants v4's units, as
|
|
`post79_rules.ADDRESS` already gives 20.
|
|
2. **What v4 lacks or does otherwise.** `SP@` `SP!`; `CASE` (its cases define `TC` with it); `U/MOD` and
|
|
`M/MOD` in v3's shape; `SKIP` `SCAN` `SEARCH` `COMPARE`; `ORDER` `THRU` `FLUSH`; the vocabulary and
|
|
compile-time edges. To be built, or the difference shown to be the standard's.
|
|
3. **v3's output naming v3's own words.** `TOP-WORDS` expects v3's hottest -- `EXIT`, `DROP`, `LIT`, `."` --
|
|
and `WORD-ENTROPY` v3's word count: v4's system is not v3's.
|
|
4. **v3 not doing what its own table says** (29 cases; e.g. `2!.basic`): the expectation recorded is v3's
|
|
error, and a v4 that does what the table says fails it.
|
|
5. The rest -- formatting, the stress and integration groups -- case by case.
|
|
|
|
**Ruled (Captain Bob, 2026-11-14): "v3's table, not v3's bugs".** Where v3 does not do what its own table
|
|
says (kind 4: 29 cases), v4 is held to the table -- what v3 meant -- and each such case is listed. Where a
|
|
case's output names v3's internals (kind 3), v4 is held to the same form with its own words: the case's
|
|
shape, v4's values; listed too. Everything else: v3's recorded behaviour, exactly.
|
|
|
|
**Ruled (Captain Bob, 2026-11-14): "The standard first".** Read with their descriptions, v3's cases are not a
|
|
reliable authority: `16 BASE ! 255 .` -- v3 prints 597, its description says FF, FORTH (and v4) print 255; `M+`
|
|
-- v3 300 0, its description 200 100, FORTH and v4 100 200. So, for each case: FORTH-79 where it defines the
|
|
word (as `post79_rules.py` already does for the Required set); FORTH-83 for words 79 lacks (`M+`, `2>R` ...);
|
|
v3's behaviour -- or its table, where v3 contradicts it -- only for v3's own extensions no standard defines
|
|
(`COMPARE`'s form, `ENTROPY@`, `TOP-WORDS` ...). Every case rewritten is listed with its reason.
|
|
|
|
**Ruled further (Captain Bob, 2026-11-14), with the texts in `docs/reference/standards/`:**
|
|
- **The order of authority:** FORTH-79, then FORTH-83, then ANS Forth 1994 ("Yes: 79, then 83, then ANS, then
|
|
v3"), then v3 -- held to its table where it contradicts itself -- only for what no standard defines
|
|
(`ENTROPY@`, `TOP-WORDS`, Mama's words ...).
|
|
- **A double in memory: FORTH-83's layout** ("Yes, FORTH-83's layout"). FORTH-83 (`FORTH83.TXT`, under
|
|
"number"): "Double numbers are represented in memory by two consecutive 16-bit numbers. The address of the
|
|
least significant 16 bits is two greater than the address of the most significant 16 bits." FORTH-79 says
|
|
only "as for a double number" (`2!`). v4's `2!` `2@` `2,` stored the low cell first, "as v3": changed to the
|
|
high cell at the lower address.
|
|
|
|
**Ruled (Captain Bob, 2026-11-14), on four questions from the whole table at 969 of 1018:**
|
|
- **Capacity: "Enlarge v4 to fit".** Four stress cases push 100 to 900 values (v4's prompt node: 32); 21
|
|
cases late in the run meet "Dictionary full" (1018 cases defining words in one dictionary; Hera's run-time
|
|
space about 5.5K cells). The standards ask less (FORTH-79 6.2: a 64-byte data stack, 2000 bytes of
|
|
dictionary; ANS: 32 cells), but v4 is grown until v3's cases fit.
|
|
- **`Q./` by zero: "v3's table: q = 0".** No standard defines the Q48 words; v3's table says division by
|
|
zero yields 0. v4's error 11 ("Division by zero (Q./)") goes.
|
|
- **`SP@` `SP!`: D-2 stands; `FENCE`: v3's** ("D-2 for SP@; v3 for FENCE"). The six `SP@`/`SP!` cases are
|
|
dropped: no stack pointer is visible to code (DECOMPOSITION.md D-2). `FENCE` becomes v3's word -- it
|
|
protects what is defined so far from FORGET -- and the variable FORGET and COLD read is `(FENCE)`.
|
|
- **SPAN: "Fix it in Phase 7".** v4's interpreter took the line's length from SPAN, so an `EXPECT` in a
|
|
line cut the rest of the line off, and `0 EXPECT` could not leave SPAN 0 (FORTH-83: SPAN is the count the
|
|
last EXPECT stored). The line's length gets its own variable.
|
|
|
|
Settled under the rulings above, without a question:
|
|
- `IS` and `DEFER@` refuse a word `DEFER` did not make, as v3 ("was not created by DEFER"): error 22, "Not
|
|
deferred". v4's IS stored into any word -- `42 IS DUP` broke `DUP` for every case after it.
|
|
- `SMUDGE` and `HIDDEN` at the prompt are errors, as v3's table (no standard defines them): v4 marks them
|
|
compile-only. v4's hid the newest word.
|
|
- `DABS` and `DMIN` given too few values: ANS (8.6.1.1160, 8.6.1.1220) makes stack underflow an ambiguous
|
|
condition, so there is no error to expect: dropped.
|
|
- `CMOVE>.bounds` and `THRU.negative_end` dropped (no standard asks for the error); the cases that write
|
|
through `HERE` as a byte address -- `CMOVE>`, `BLANK`, `ERASE`, `FILL` -- in v4's units (they wrote into
|
|
the system's code).
|