v4: L8-CARD@ ( -- card changes ), and its POST case; POST 991 (#189, Phase 7 Task 9, part A)

Request -41, served by the kernel from the node's L8 state; the word
in physics.4th. test_mesh_boot checks it against the kernel's own
values, changes more than 0: failed first (UNKNOWN WORD), now 142
checks pass. POST.md takes only the new case and the counts: the two
cells that differ run to run are #199's. POST_FLOOR 990 -> 991.

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-20 15:12:33 +00:00
parent 0522d77337
commit 43f8687f70
12 changed files with 308 additions and 5 deletions
+1
View File
@@ -76,6 +76,7 @@
#define V4_REQ_HOT_COUNT (-38) /* ( -- n ): words with heat */
#define V4_REQ_HOT_NTH (-39) /* ( i -- xt heat ): the i-th hottest, as v3's TOP-WORDS orders them; 0 0 past them */
#define V4_REQ_XT_HEAT (-40) /* ( xt -- n ): a word's heat, 0 for what is not one */
#define V4_REQ_L8_CARD (-41) /* ( -- card changes ): L8's card on this node, and how often it has changed (Phase 7 Task 9) */
typedef struct {
v4_uheat_t calls; /* every call since the word was defined */
v4_uheat_t since; /* calls since the owner last charged them */
+1 -1
View File
@@ -1,3 +1,3 @@
990
991
# v4 POST: the fewest tests an accepted boot may report (#173). Raise it when POST grows;
# never lower it without Captain Bob. scripts/nightly.sh post-count reads the first line.
+7 -1
View File
@@ -986,7 +986,13 @@ static int physics_serve(unsigned place, v4_node *n, v4_cell value)
v4_cell u, a, xt;
v4_mesh_account *r;
const uint64_t *d;
if (value > V4_REQ_FREEZE_WORD || value < V4_REQ_XT_HEAT) return 0;
if (value > V4_REQ_FREEZE_WORD || value < V4_REQ_L8_CARD) return 0;
if (value == V4_REQ_L8_CARD) { /* ( -- card changes ), for acceptance (Task 9) */
if (n->ds.depth + 2u > V4_DATA_DEPTH) return 0;
v4_dstack_push(&n->ds, p ? (v4_cell)p->l8.current_card : 0);
v4_dstack_push(&n->ds, p ? (v4_cell)p->l8.changes : 0);
return 1;
}
if (value <= V4_REQ_ENTROPY_FETCH) return entropy_serve(place, n, value);
switch (value) {
case V4_REQ_FREEZE_WORD: case V4_REQ_UNFREEZE_WORD: case V4_REQ_FROZEN: case V4_REQ_HEAT_FETCH: case V4_REQ_HEAT_STORE:
+3 -1
View File
@@ -1020,6 +1020,7 @@ static const char *const l986[] = { ": W1 BL WORD COUNT TYPE ; W1 HELLO" };
static const char *const l987[] = { ": W2 44 WORD COUNT TYPE ; W2 A B," };
static const char *const l988[] = { ": W3 BL WORD C@ . ; W3 ABC" };
static const char *const l989[] = { ": W4 BL WORD COUNT TYPE ; W4 X" };
static const char *const l990[] = { "L8-CARD@ 0< . 64 U< . CR" };
const v4_post_case v4_post_cases[] = {
{ "DUP.basic", l0, 1u, V4_POST_STACK | V4_POST_SUITE, 0, 0u, "5 5 \012", 5u },
@@ -2012,6 +2013,7 @@ const v4_post_case v4_post_cases[] = {
{ "WORD.delimiter", l987, 1u, V4_POST_STACK, 0, 0u, "A B", 3u },
{ "WORD.count", l988, 1u, V4_POST_STACK, 0, 0u, "3 ", 2u },
{ "WORD.skips_leading", l989, 1u, V4_POST_STACK, 0, 0u, "X", 1u },
{ "L8-CARD@.basic", l990, 1u, V4_POST_STACK | V4_POST_KERNEL | V4_POST_SUITE, 0, 0u, "0 -1 \012", 6u },
};
const unsigned v4_post_case_count = 990u;
const unsigned v4_post_case_count = 991u;
+9
View File
@@ -351,6 +351,15 @@ int main(void)
&& p->l7_adaptive_heartrate == 1u, "the gates are the current card's (%u), through card_bits", p->l8.current_card);
CHECK(p->l1_cache == (ENABLE_HOTWORDS_CACHE && (b & 0x40u)) && p->l4_pipelining == (ENABLE_PIPELINING && (b & 0x08u)),
"and L1 and L4 within the build's ceilings");
/* L8-CARD@ ( -- card changes ), for acceptance (Phase 7 Task 9, rulings 2 and 2a): the node's card, and how
* often it has changed -- more than 0 once L8 has run, which a boot without the physics never shows */
{
char want[64];
r = line(V4_MESH_HERA, "L8-CARD@ . .", &how);
snprintf(want, sizeof want, "%lu %u ", (unsigned long)p->l8.changes, (unsigned)p->l8.current_card);
CHECK(how == V4_TEXT_COMPLETED && strcmp(r, want) == 0 && p->l8.changes > 0,
"L8-CARD@ leaves the card and its changes, more than 0: \"%s\", the kernel's \"%s\"", r, want);
}
v4_mesh_l8_force(&ms, 0, 0u, 1);
r = line(V4_MESH_HERA, ": L8T 300 0 DO 3 DUP * DROP LOOP ; L8T", &how);
CHECK(p->l8.current_card == 0 && !p->l2_window && !p->l3_decay && !p->l1_cache && !p->l4_pipelining
+3
View File
@@ -197,4 +197,7 @@ EXTRA = [
dict(label="WORD.delimiter", text=": W2 44 WORD COUNT TYPE ; W2 A B,", out="A B"),
dict(label="WORD.count", text=": W3 BL WORD C@ . ; W3 ABC", out="3 "),
dict(label="WORD.skips_leading", text=": W4 BL WORD COUNT TYPE ; W4 X", out="X"),
# v4's own, not v3's: L8's card and its changes, for acceptance (Phase 7 Task 9, ruled 2026-11-20).
# Their values come of the run; the case holds what any run has: changes not negative, the card one of 64
dict(label="L8-CARD@.basic", text="L8-CARD@ 0< . 64 U< . CR", out="0 -1 \n"),
]