v4: acceptance asserts the loops -- L1, L3, L2 with L5, L8 -- and WORD_PHYSICS (#189, Phase 7 Task 9)
Build / Image RASPI (push) Successful in 6m16s
Build / Image PC (push) Successful in 6m19s
Build / Image MILKV (push) Successful in 8m30s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 16m7s

The acceptance session's loops(), at every v4 boot's prompt: a word's
heat (L1), its decay from a set heat (L3), INFER-RUN's variance and
width with L8 held on card 18 (L2, L5), and L8's changes. L8-HOLD
( card -- ), request -42, beside L8-CARD@, with its POST case: POST 992.
WORD_PHYSICS (Kconfig.physics, default y) turns the word loops off: a
boot with it off fails acceptance at POST (ruled 3a). Measured on amd64:
heat 6, 1000 cooled to 0 in 40 s, width 455, 66 changes. L8 unheld
settles on card 11, with the window off, so L2/L5 hold a card (ruled).
test_mesh_boot: L8-HOLD failed first, 144 checks now. V3-PARITY.md 2.2
corrected, dated. Gates pass, POST 992/992.

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 18:06:09 +00:00
parent 43f8687f70
commit a9a8687fa5
31 changed files with 3767 additions and 17 deletions
+6
View File
@@ -77,6 +77,7 @@
#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) */
#define V4_REQ_L8_HOLD (-42) /* ( card -- ): L8 held on a card 0 .. 63, as v4_mesh_l8_force; -1 lets it choose (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 */
@@ -171,6 +172,11 @@ typedef struct {
/* COMPUDYNAMICS ON THE OPCODES (#189 Phase 7, ruling 7; Captain Bob, 2026-11-14: every loop on the 32 F18
* opcodes as on the composed words, "and an easy revert if opcodes are too granular"): this is the revert --
* 0, and the opcodes are counted and charged to the Stadium as in Phase 1, and nothing more. */
/* WORD_PHYSICS (Kconfig.physics; #189 Phase 7 Task 9): the loops on the words, at call and at each tick. Off, a
* word's calls are counted and charged and nothing more: the revert, as OPCODE_PHYSICS is the opcodes'. */
#ifndef WORD_PHYSICS
#define WORD_PHYSICS 1
#endif
#ifndef OPCODE_PHYSICS
#define OPCODE_PHYSICS 1
#endif
+1 -1
View File
@@ -1,3 +1,3 @@
991
992
# 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.
+15 -6
View File
@@ -675,13 +675,15 @@ static void inference_tick(unsigned place, v4_mesh_physics *p)
static void heartbeat_cycle(unsigned place, v4_mesh_physics *p)
{
p->tick = the->tick; /* the one heartbeat's: every node the same */
if (p->tick - p->last_inference_tick >= V4_MESH_INFERENCE_EVERY) inference_tick(place, p);
background_decay(place, p);
window_service(&p->win);
if (WORD_PHYSICS) { /* Task 9's revert: off, none of the words' loops */
if (p->tick - p->last_inference_tick >= V4_MESH_INFERENCE_EVERY) inference_tick(place, p);
background_decay(place, p);
window_service(&p->win);
}
#if OPCODE_PHYSICS
opcodes_cycle(p);
#endif
l8_update(p);
if (WORD_PHYSICS) l8_update(p);
/* the snapshot (v3's heartbeat_publish_snapshot) */
p->snapshot.tick = p->tick;
p->snapshot.window_width = p->win.effective_window_size;
@@ -731,7 +733,7 @@ static v4_cell on_call(void *ctx, v4_node *n, v4_cell target)
id = n->mem[target - 4];
if (id < 0 || id >= (v4_cell)V4_MESH_WORD_IDS) return target;
a = &accounts_of(place)[id];
if (the->physics) {
if (WORD_PHYSICS && the->physics) {
v4_mesh_physics *p = &the->physics[place];
decay(a, p, p->tick - a->last_decay_tick);
a->last_decay_tick = p->tick;
@@ -986,7 +988,14 @@ 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_L8_CARD) return 0;
if (value > V4_REQ_FREEZE_WORD || value < V4_REQ_L8_HOLD) return 0;
if (value == V4_REQ_L8_HOLD) { /* ( card -- ), for acceptance (Task 9) */
if (n->ds.depth < 1u) return 0;
u = v4_dstack_pop(&n->ds);
if (p && u >= 0 && u < (v4_cell)V4_L8_CARDS) v4_mesh_l8_force(the, place, (unsigned)u, 1);
else if (p && u == -1) v4_mesh_l8_force(the, place, p->l8.current_card, 0);
return 1;
}
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);
+3 -1
View File
@@ -1021,6 +1021,7 @@ 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" };
static const char *const l991[] = { "18 L8-HOLD L8-CARD@ DROP . -1 L8-HOLD CR" };
const v4_post_case v4_post_cases[] = {
{ "DUP.basic", l0, 1u, V4_POST_STACK | V4_POST_SUITE, 0, 0u, "5 5 \012", 5u },
@@ -2014,6 +2015,7 @@ const v4_post_case v4_post_cases[] = {
{ "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 },
{ "L8-HOLD.basic", l991, 1u, V4_POST_STACK | V4_POST_KERNEL | V4_POST_SUITE, 0, 0u, "18 \012", 4u },
};
const unsigned v4_post_case_count = 991u;
const unsigned v4_post_case_count = 992u;
+7
View File
@@ -360,6 +360,13 @@ int main(void)
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);
}
/* L8-HOLD ( card -- ), for acceptance (Task 9, ruled 2026-11-20): a card 0 .. 63 held, as v4_mesh_l8_force
* holds it; -1 lets L8 choose again */
r = line(V4_MESH_HERA, "18 L8-HOLD L8-CARD@ DROP .", &how);
CHECK(how == V4_TEXT_COMPLETED && strcmp(r, "18 ") == 0 && p->l8.hold && p->l8.current_card == 18u
&& p->l2_window && p->l5_window_inference, "18 L8-HOLD: card 18 held, its gates L2 and L5 on: \"%s\"", r);
r = line(V4_MESH_HERA, "-1 L8-HOLD", &how);
CHECK(how == V4_TEXT_COMPLETED && !p->l8.hold, "-1 L8-HOLD: L8 chooses again");
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
+1
View File
@@ -200,4 +200,5 @@ EXTRA = [
# 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"),
dict(label="L8-HOLD.basic", text="18 L8-HOLD L8-CARD@ DROP . -1 L8-HOLD CR", out="18 \n"),
]