writeonce/runtime/src
shoney.arickathil 3c53d27347 fix: close per request, soak the daemon, kill five soak-found leaks (Tasks 5+6)
- Task 5: net.close on every path out of a serve iteration (400
  included) and the listener on stop; measured 4 -> 54 fds over 50
  requests before, 4 -> 4 over 200 after. The loop's comment claimed
  the iteration-end drop IS the close -- wrong twice (net.Conn is a
  scalar, and a drop would not close an fd); it now says what is true
- Task 6: LW_SOAK=<seconds> in the acceptance script -- each mode under
  load, resident+descriptor deltas against a WARMED baseline (warm-up
  includes load: cold-to-high-water is not growth), 256 KiB / zero
  tolerance; LW_ACCEPT_WOVM soaks another build
- the soak caught ~1.6 MiB/min of in-arena leaks ASan cannot see (the
  arena is one allocation to LeakSanitizer); an arena size-class
  census + pointer trace attributed five bugs:
  - jparse_string sized every decoded string at "rest of the input"
    and relabeled len after -- blocks filed on free lists their next
    allocation never reads (fs.read_all's mis-size, again); copy out
    exact, free at the taken size
  - `!=` never dropped fresh operands (headers["authorization"] !=
    "Bearer ${key}" leaked both sides per request); Ne now reaps as Eq
  - an Int interpolation segment is a fresh int_to_text, not a borrow;
    is_borrowed_value_t asks the segment's type
  - json.encode(Ctor{...}) had no owner -- record + both field copies
    leaked per tool call; its bespoke lowering now drops the argument
  - a discarded expression statement owns its result: `pop(lines);`
    leaked the popped element; reader builtins excluded
- after: arena live bytes flat per request on every handler; release
  soak 30 s per mode watch 0 / run 0 / mcp +20 KiB, descriptors flat;
  ASan build flat at 14600 KiB across 601686 requests in 90 s past its
  ~1200-request quarantine warm-up
- gates: oop-accept ALL CRITERIA MET, oop-e2e 71/0, woc-test 565/0,
  wovm-test green, log-watcher 7/0 (soak opt-in, fast path <1 min)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 00:32:49 +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 fix: Text is an owned value copied at every boundary (executable plan, Task 1) 2026-08-14 22:45:03 +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: status board on the compile-and-run milestone + CODE-LOGIC beside the code 2026-08-14 17:20:59 +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): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
gc.h feat(runtime): wovm VM core (Iteration 2) 2026-08-10 09:35:55 +02:00
json.c fix: close per request, soak the daemon, kill five soak-found leaks (Tasks 5+6) 2026-08-15 00:32:49 +02:00
loader.c fix: Text is an owned value copied at every boundary (executable plan, Task 1) 2026-08-14 22:45:03 +02:00
loader.h feat: json encode/decode + as, .wob v2 class metadata — log-watcher compiles 2026-08-14 17:08:46 +02:00
main.c fix: a stopping program stops (executable plan, Task 4) 2026-08-14 23:58:21 +02:00
obj.c fix: copy-on-push closes the container double-free; line-buffer program output 2026-08-14 18:50:18 +02:00
obj.h feat: nil literal + systems-stdlib text/container builtins 2026-08-14 16:43:38 +02:00
sysio.c fix: a stopping program stops (executable plan, Task 4) 2026-08-14 23:58:21 +02:00
vm.c fix: a stopping program stops (executable plan, Task 4) 2026-08-14 23:58:21 +02:00
vm.h fix: a stopping program stops (executable plan, Task 4) 2026-08-14 23:58:21 +02:00
wob.h fix: Text is an owned value copied at every boundary (executable plan, Task 1) 2026-08-14 22:45:03 +02:00