Files
LithosAnanake/include
Robert Allan JamesandClaude Sonnet 5 e51a8d229e
Build / build-amd64-iso (push) Waiting to run
Build / build-aarch64-iso (push) Waiting to run
Build / build-riscv64-img (push) Waiting to run
Fix stadium_grant_quota() donor floor; rerun std79 DoE clean, 81/81 (FABRIC-3.md §XVII)
capsule_birth.c hardcoded every new VM's initial Stadium quota grant to split
from Hera specifically. Since a grant always halves whatever the donor
currently has, Hera's own free list converges toward empty after a bounded
number of grants — independent of whether the Stadium as a whole still had
spare capacity, since VMs she'd granted to earlier typically still held
nearly all of their own share untouched. Past that point every subsequent
VM birth's Stadium grant would be silently refused (soft-failed, non-fatal
by existing design), even with plenty of capacity sitting idle elsewhere.

Fixed by adding an O(1)-maintained free_count to StadiumVMQuota (incremented
in stadium_evict(), decremented at both of stadium_admit()'s free-list-pop
sites, set/adjusted in stadium_grant_quota()'s own split — this also let
grant_quota drop its old O(free-list length) counting walk in favor of an
O(1) read) and stadium_best_donor(), an O(live VM count) scan over quota
slots returning whichever in-use VM currently has the most free cells.
capsule_birth.c's birth path now splits from that VM instead of
unconditionally vm_uuid_hera().

Verified with another full rerun of the 3x9x3 std79 DoE campaign from
scratch — same discipline as the prior Stadium fix (any defect repair
reruns the whole DoE from the top) — one continuous boot per architecture,
all 9 identities simultaneously live throughout. 81/81 trials correct, 0
mismatches, DOE-RUN header sequence md5-identical to every prior run.
aarch64 ~280s total (vs ~290s for the O(ncells)-scan fix alone — confirms
no regression). Both known Stadium defects are now closed together on one
clean campaign rerun.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EXieurDfDSsDFdnSyusuWo
2026-09-11 17:20:07 -04:00
..
2026-08-01 07:49:56 -04:00
2026-08-01 07:49:56 -04:00
2026-08-01 07:49:56 -04:00
2026-08-01 07:49:56 -04:00

include/

Public headers for the hosted StarForth VM (src/). Kernel-only headers live under include/starkernel/.

Core VM

  • vm.h — the VM struct and all core types (DictEntry, DictPhysics, stacks, dictionary state); the central header most other files include.
  • vm_api.h — external VM API surface.
  • vm_host.h, vm_debug.h, startup.h, version.h — host integration, debug utilities, startup sequencing, version string.
  • cli.h, repl.h, io.h, log.h — CLI parsing, REPL loop, I/O, logging.
  • word_registry.h — word registration system shared by every src/word_source/*.c file.
  • compudynamics.h — the generic compudynamics module: tuning-word/config lookups (cd_tuning_word(), cd_tuning_vm()) consumed by ssm_jacquard.c.

Memory / blocks

  • memory_management.h, dictionary_management.h — dictionary allocator and search.
  • block_subsystem.h, blkcfg.h, blkio.h, blkio_factory.h — logical→ physical block mapper and pluggable block I/O backends (file/RAM).
  • platform_alloc.h, platform_lock.h, platform_time.h — platform abstraction shims (hosted vs. kernel allocation/locking/timing).

Physics-driven adaptive runtime (7 feedback loops)

  • physics_runtime.h — main physics coordinator.
  • physics_hotwords_cache.h — Loop #1, execution-heat hot-words cache.
  • physics_metadata.h — per-word DictPhysics metadata tracking.
  • physics_pipelining_metrics.h — Loop #4, word-transition prediction.
  • physics_execution_hooks.h — execution instrumentation hook points.
  • rolling_window_of_truth.h, rolling_window_knobs.h — Loop #2 circular execution-history buffer and its tuning knobs.
  • inference_engine.h — Loops #5/#6, window-width and decay-slope statistical inference.
  • dictionary_heat_optimization.h — Loop #1 heat counters.
  • ssm_jacquard.h — L8 Jacquard steady-state mode selector.
  • doe_metrics.h — Design of Experiments (2^7 factorial) metrics.
  • profiler.h — performance profiling hooks.

Arithmetic / codegen

  • q48_16.h — Q48.16 deterministic fixed-point arithmetic (used instead of IEEE-754 float specifically to keep cross-architecture behavior bit-identical).
  • math_portable.h — portable math helpers.
  • arch_detect.h, starforth_config.h — architecture detection and the build-flag fallback-default layer (used when a .c file is compiled by hand without make).
  • vm_asm_opt.h, vm_asm_opt_arm64.h, vm_asm_opt_riscv64.h, vm_inner_interp_asm.h, vm_inner_interp_arm64.h, vm_inner_interp_riscv64.h — per-architecture assembler-optimized inner interpreter (USE_ASM_OPT=1).

See include/starkernel/README.md for the bare-metal kernel headers.