mkpost: POST's table and its documents the same run to run (#199)

The cells of v3's column whose value differs each run -- the three
addresses, and three values of the run's history -- are written
"varies run to run" (a varies mark on their rules). And a second
finding, in post_cases.c itself: ENTROPY!.overwrite took 20 or 0 from
v3's run, as its heartbeat cooled the word between the lines; pinned
to 20, its words' meaning (both ruled). Three runs write the same
POST.md, POST79.md and post_cases.c; post_cases.c is as committed, so
POST does not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
Claude
2026-11-21 02:18:35 +00:00
parent 63e9966abc
commit 9c7fa4f855
11 changed files with 1288 additions and 15 deletions
+4 -1
View File
@@ -556,7 +556,10 @@ def write_doc(cases, results, left_out, disagreements, untested, total, applied,
if rule is None:
continue
case, (error, stack, output) = by_label[label]
did = "error" if error else "stack `%s`, printed `%s`" % (" ".join(map(str, stack)) or "empty", output.replace("\n", "\\n")[:40])
# #199: what v3 printed, unless the rule says it is a different number each run (an address, or the
# run's own history) -- then that, so two runs write the same file
printed = "varies run to run" if rule.get("varies") else "`%s`" % output.replace("\n", "\\n")[:40]
did = "error" if error else "stack `%s`, printed %s" % (" ".join(map(str, stack)) or "empty", printed)
ran = code(rule["text"]) if "text" in rule else "unchanged"
out.append("| `%s` | %s | %s | %s | %s | %s |" % (label, code(case["text"]), did, ran, expects(rule), rule["why"]))
out += ["", "## 2. Address-dependent (%d)" % applied["address"], "",
+1 -1
View File
@@ -127,7 +127,7 @@ STANDARD = {
"SCR.after_load": dict(out="1 \n", why="v3 prints nothing after 1 LOAD; SCR is still 1 from the LIST before"),
"FIND.existing": dict(depth=0, why="FORTH-79: FIND takes the next word, DUP here, and leaves its address, which is printed"),
"FIND.user_word": dict(depth=0, why="the address FIND leaves is printed"),
"FIND.user_word": dict(depth=0, why="the address FIND leaves is printed", varies=True),
"FIND.empty": dict(stack=[0], why="FORTH-79: FIND leaves 0 when there is no word; v3 raises an error"),
"VOCABULARY.cross_vocab_access": dict(error=True, why=VOC),
+9 -5
View File
@@ -125,8 +125,8 @@ STANDARD = {
"LATEST.basic~2": {"text": "LATEST 0<> . CR", "stack": [], "out": "-1 \n", "why": V3INT},
"LATEST.after_def": {"text": ": test7 46 ; LATEST ' test7 = . CR", "stack": [], "out": "-1 \n", "why": V3INT},
"LATEST.after_forget": {"text": "LATEST CREATE test8 FORGET test8 LATEST = . CR", "stack": [], "out": "-1 \n", "why": V3INT},
">BODY.basic": {"text": "CREATE test9 FIND test9 >BODY ' test9 = . CR", "stack": [], "out": "-1 \n", "why": ANS_BODY},
">BODY.variable": {"text": "VARIABLE var1 FIND var1 >BODY var1 = . CR", "stack": [], "out": "-1 \n", "why": ANS_BODY},
">BODY.basic": {"text": "CREATE test9 FIND test9 >BODY ' test9 = . CR", "stack": [], "out": "-1 \n", "why": ANS_BODY, "varies": True},
">BODY.variable": {"text": "VARIABLE var1 FIND var1 >BODY var1 = . CR", "stack": [], "out": "-1 \n", "why": ANS_BODY, "varies": True},
# ---- vocabulary_words ----
"ORDER.basic": {"stack": [], "out": "Search order: FORTH \nCurrent: FORTH\n", "why": ORDERF},
"ORDER.multiple": {"stack": [], "out": "Search order: TEST-VOC9 FORTH\nCurrent: TEST-VOC9\n", "why": ORDERF},
@@ -138,15 +138,19 @@ STANDARD = {
"FROZEN?.not_found": {"stack": [], "out": "0 \n", "why": V3RUN},
"HEAT!.basic": {"stack": [], "out": "999 \n", "why": V3RUN},
"HEAT@.of_fresh_word": {"stack": [], "out": "0 \n", "why": V3RUN},
# #199 (Captain Bob, 2026-11-20: "Pin it to 20"): v3's heartbeat cools the word in real time between the
# case's two lines, so its run printed 20 or 0 by when the tick fell; the case is what its words say
"ENTROPY!.overwrite": {"stack": [], "out": "20 \n",
"why": "the second ENTROPY! overwrites the first: 20. v3's run printed 20 or 0, as its heartbeat cooled the word between the lines in real time"},
"DECAY-RATE@.basic": {"stack": [], "out": "1 \n", "why": DECAY},
# ---- inference_words ----
"Q.VARIANCE.three_cells": {"text": "100 HERE ! 200 HERE 1 + ! 300 HERE 2 + ! HERE 3 Q.VARIANCE Q.TO-INT . CR",
"stack": [], "out": "6666 \n", "why": D1},
"INFER-DECAY-SLOPE.three_cells": {"text": "300 HERE ! 200 HERE 1 + ! 100 HERE 2 + ! HERE 3 INFER-DECAY-SLOPE Q.TO-INT . CR",
"stack": [], "out": "0 \n", "why": D1},
"INFER-VARIANCE@.after_run": {"text": "INFER-RUN INFER-VARIANCE@ Q.TO-INT DROP CR", "stack": [], "out": "\n", "why": INFHIST},
"INFER-WINDOW@.after_run": {"text": "INFER-RUN INFER-WINDOW@ DROP CR", "stack": [], "out": "\n", "why": INFHIST},
"INFER-EARLY-EXIT@.after_run": {"text": "INFER-RUN INFER-EARLY-EXIT@ DUP 0= SWAP 1 = OR . CR", "stack": [], "out": "-1 \n", "why": INFHIST + " (0 or 1)"},
"INFER-VARIANCE@.after_run": {"text": "INFER-RUN INFER-VARIANCE@ Q.TO-INT DROP CR", "stack": [], "out": "\n", "why": INFHIST, "varies": True},
"INFER-WINDOW@.after_run": {"text": "INFER-RUN INFER-WINDOW@ DROP CR", "stack": [], "out": "\n", "why": INFHIST, "varies": True},
"INFER-EARLY-EXIT@.after_run": {"text": "INFER-RUN INFER-EARLY-EXIT@ DUP 0= SWAP 1 = OR . CR", "stack": [], "out": "-1 \n", "why": INFHIST + " (0 or 1)", "varies": True},
# ---- q48_words ----
"Q.1.raw_value": {"text": "Q.1 D. CR", "stack": [], "out": "65536 \n", "why": QD},
"Q.0.raw_value": {"text": "Q.0 D. CR", "stack": [], "out": "0 \n", "why": QD},