FABRIC-3.8.md Stage FR: VM frame stacks, each frame with an ID
Captain Bob: "give frames IDs and call by ID" -- frames stack per VM, each
with an ID. New vm_frame.h/.c: VMFrameEntry { VMFrameID id; VMUuid vm_id;
kind (INTERPRET/DRAIN/IDLE) }, a growable VMFrameStack embedded as VM.frames
(reserved at birth, freed in vm_cleanup, grown by allocate-copy-free).
vm_interpret() -> vm_interpret_kind() pushes a frame onto the running stack's
owner, holds only its ID, fails closed if it cannot grow, and pops by ID
(mismatch reported as VM FRAME CORRUPTION).
The Stage A/B loose fields are gone and everything is derived from the stack:
- ownership gate: one frame, and it is vm's own
- drain guard: a DRAIN frame for vm already on the running stack
- parked-idle: an IDLE frame the trampoline pushes around its yield
- log attribution: the top frame's vm_id, resolved by ID through the registry
The single saved-and-restored attribution global is removed.
Evidence: the probe baseline on the pre-frame code read HSSAS (the global
named Hestia while Hera resumed). With frames it reads HSHAS on all three
ISAs, with Hestia's top frame IDLE and Hera's frames back to 0; the probe is
reverted. Formal acceptance on all three ISAs: dict_hash identical and
unchanged, zero UNKNOWN WORD, faults, frame corruption or refused interprets,
and the WIREBIND relay 1 2 + . -> 3 works.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
56da55aba9
commit
6a313c7bf2
+8
-21
@@ -442,6 +442,7 @@ typedef struct {
|
||||
#ifdef __STARKERNEL__
|
||||
#include "starkernel/vm_uuid.h" /* VMUuid -- item 4.2, VM.stadium_vm_id */
|
||||
#include "starkernel/vm_identity.h" /* VMIdentity -- FABRIC-2.md §F.2/§F.16 */
|
||||
#include "starkernel/vm/vm_frame.h" /* VMFrame -- FABRIC-3.8.md §3.12 */
|
||||
|
||||
/* Saved interpreter state for VM lifecycle calls (BIRTH, VM-EXEC, START).
|
||||
* Dynamically allocated; grows on demand via sf_realloc. */
|
||||
@@ -669,27 +670,13 @@ typedef struct VM
|
||||
* let a later switch-in from a different VM get
|
||||
* silently bounced to the original caller instead
|
||||
* of itself. */
|
||||
int interpret_depth; /**< FABRIC-3.8.md §3.1 (Stage A, 2026-09-23): THIS
|
||||
* VM's own vm_interpret() nesting depth. Replaces
|
||||
* the single global g_vm_interpret_depth as the
|
||||
* ownership gate's depth test -- once VMs genuinely
|
||||
* interleave on their own native stacks, a global
|
||||
* count across all VMs stops meaning "this VM is
|
||||
* at its own outermost frame." 0 = not
|
||||
* interpreting; 1 = outermost frame. */
|
||||
int hermes_draining; /**< FABRIC-3.8.md §3.3 (Stage B): nonzero while
|
||||
* sk_hermes_drain_checkpoint() is interpreting one
|
||||
* of this VM's own messages. No drain site drains
|
||||
* again while it is set -- a payload running at the
|
||||
* VM's depth 1 would otherwise let its own in-word
|
||||
* checkpoint drain a SECOND message inside the
|
||||
* first one's execution. */
|
||||
int parked_idle; /**< FABRIC-3.8.md §3.5 (Stage B): nonzero only while
|
||||
* this VM is parked in its switch trampoline's idle
|
||||
* branch -- nothing borrowed on its stack, no work
|
||||
* in progress. Distinct from VM_STATE_SWITCHED_OUT,
|
||||
* which is also true of a VM parked mid-work.
|
||||
* Consumed by the kill path in Stage D. */
|
||||
VMFrameStack frames; /**< FABRIC-3.8.md §3.12 (Stage FR, 2026-09-23):
|
||||
* this VM's execution frame stack -- the nested
|
||||
* levels running on its own native stack, each
|
||||
* with a frame ID and the executing VM's ID. The
|
||||
* ownership gate, drain guard, parked-idle and log
|
||||
* attribution are all derived from it. See
|
||||
* starkernel/vm/vm_frame.h. */
|
||||
/** @} */
|
||||
|
||||
/** @name Stadium Identity (item 4.2, FABRIC-0.md §25.5)
|
||||
|
||||
Reference in New Issue
Block a user