feat(v4): Phase 7 Task 3, first step -- each node's tick by execution, as v3 (#189)

Captain Bob, 2026-11-13: "By execution, as v3". v3's kernel runs a VM's heartbeat cycle every 256 word
executions (HEARTBEAT_CHECK_FREQUENCY, vm_core.c:912 and :1210), and its tick_count is the count of cycles.
Task 2a had used the kernel's timer heartbeat as the decay clock: corrected. Each node counts its word
calls; every 256th runs its heartbeat cycle at the call; the cycle's loops follow. The kernel no longer
gives the mesh its timer. Test first: test_mesh_boot.c, 59 checks (67 with pipelining and the cache on).
Not pushed (held to the end of Phase 7).

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-13 22:17:50 +00:00
parent e125c2b590
commit 5c79bddbbb
5 changed files with 41 additions and 7 deletions
-2
View File
@@ -78,7 +78,6 @@ static uint32_t sk_v4_charge_ids[V4_MESH_WORD_IDS];
static uint64_t sk_v4_charge_calls[V4_MESH_WORD_IDS];
static uint32_t sk_v4_charge_n;
static v4_mesh_physics sk_v4_physics[SK_V4_PLACES]; /* each node's physics: its tick, decay slope, L8's gates (#189, Phase 7) */
static uint64_t sk_v4_heartbeat_ticks(void) { return heartbeat_ticks(); } /* what decay is measured by, as v3's VM tick */
/* a word's transition counters, from the kernel's heap, zeroed (pipelining, when the build has it) */
static void *sk_v4_alloc(void *self, unsigned long bytes)
{
@@ -322,7 +321,6 @@ void sk_v4_boot(void (*chain)(void), const BootDisk *boot_disk)
}
sk_v4_mesh.forgot = sk_v4_forgot;
sk_v4_mesh.physics = sk_v4_physics;
sk_v4_mesh.ticks = sk_v4_heartbeat_ticks;
sk_v4_mesh.alloc = sk_v4_alloc; sk_v4_mesh.release = sk_v4_release;
sk_v4_mesh.out = sk_v4_out; sk_v4_mesh.key = sk_v4_key;
sk_v4_mesh.words = sk_v4_words; sk_v4_mesh.word_count = sizeof sk_v4_words / sizeof sk_v4_words[0];