writeonce/runtime/src
shoney.arickathil 4f1b04d02d feat(runtime): fiber run queue + reduction budget (arc T2)
- fiber states (RUNNABLE/PARKED/DONE), intrusive FIFO run queue,
  wo_vm_spawn_fiber (calloc'd context, frame 0 set up like wo_vm_call)
- reduction budget: WO_REDUCTIONS (default 4000), checked at loop
  BACK-EDGES AFTER the jump lands so the saved pc is the loop head —
  a pre-instruction save at budget 1 re-executes the jump into the
  same decrement and livelocks (found by reasoning, pinned by the
  budget-1 test; deviation from the spec's three-site wording,
  recorded in the yield macro's comment)
- FIBER_DONE: main returning ends the program and reaps every
  remaining fiber through vm_unwind (drop maps run); a spawned fiber
  ending frees silently; its return value is discarded by contract
- TRAPF: an uncaught trap in a spawned fiber kills that fiber ALONE
  (stderr report, program lives); in main it stays the program's death
- WO_SYS_STOPPED reaps all fibers wherever it lands (main unlinked
  from the queue and unwound if a spawned fiber caught the stop)
- vm_gc_roots walks the live fiber plus every queued one
- test_fiber (45 checks, ASan): EXACT round-robin interleave at budget
  1 across three fibers pushing tags into one shared multi;
  main-return reaps a spinning fiber holding an owned Big (ASan proves
  the free); a DIV0 fiber dies alone, main answers 0
- full battery green: wovm-test, oop-e2e 89/0, woc-test, log-watcher
  7/0, employee 8/0, web-app 21/0, deps-accept 8/0 (scheduler dormant
  = one branch per back-edge)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 07:03:40 +02:00
..
.gitkeep feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
borrow.c feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
borrow.h feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
builtin.c refactor(runtime): extract the fiber context from wo_vm (arc T1) 2026-08-20 06:40:58 +02:00
builtin.h fix: a stopping program stops (executable plan, Task 4) 2026-08-14 23:58:21 +02:00
CODE-LOGIC.md docs: CODE-LOGIC files reflect the 7b collector and inference pass 2026-08-19 17:12:52 +02:00
cont.c feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
cont.h feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
gc.c feat(runtime): incremental tri-color mark-sweep replaces RC (7b Phase 3a) 2026-08-19 16:52:48 +02:00
gc.h feat(runtime): incremental tri-color mark-sweep replaces RC (7b Phase 3a) 2026-08-19 16:52:48 +02:00
json.c feat(json): Bool encodes true/false; fraction/exponent decode fails honestly 2026-08-19 18:04:15 +02:00
loader.c feat(json): Bool encodes true/false; fraction/exponent decode fails honestly 2026-08-19 18:04:15 +02:00
loader.h feat: secondary indexes + @unique trap (iteration 9, Task 4; wob v3) 2026-08-15 12:57:32 +02:00
main.c feat(runtime): incremental tri-color mark-sweep replaces RC (7b Phase 3a) 2026-08-19 16:52:48 +02:00
obj.c feat(runtime): incremental tri-color mark-sweep replaces RC (7b Phase 3a) 2026-08-19 16:52:48 +02:00
obj.h feat(runtime): incremental tri-color mark-sweep replaces RC (7b Phase 3a) 2026-08-19 16:52:48 +02:00
sysio.c fix: a stopping program stops (executable plan, Task 4) 2026-08-14 23:58:21 +02:00
vm.c feat(runtime): fiber run queue + reduction budget (arc T2) 2026-08-20 07:03:40 +02:00
vm.h feat(runtime): fiber run queue + reduction budget (arc T2) 2026-08-20 07:03:40 +02:00
wob.h feat(json): Bool encodes true/false; fraction/exponent decode fails honestly 2026-08-19 18:04:15 +02:00