lumbda/examples
russell@unturf.com 477bd5f7cd guardrails: bound http server, trap+cleanup bench, asm-no-GC in CLAUDE.md
Prevent recurrence of 2026-04-16 incident where a leaked asm HTTP
server grew to 19.3 GB RSS and crashed the machine.

examples/http-server.lsp:
- Adds *max-requests* = 50000 hard ceiling. Server self-terminates
  before unbounded heap growth reaches dangerous levels.
- Loop tracks request count, exits cleanly + closes server socket.

tests/web-benchmark.sh:
- SPAWNED_PIDS array tracks every background process.
- EXIT/INT/TERM trap kills them all (SIGTERM then SIGKILL).
- stop_server does SIGTERM with 500ms grace period then SIGKILL.
- Final straggler check via pgrep narrows to actual HTTP server
  processes (not shell/tmux with "uncommonlisp" in the name).
- pkill -9 fallback as belt-and-suspenders.

CLAUDE.md:
- New "Asm memory discipline" section documents the bump allocator
  leak behavior and the required operational discipline.
- Test counts updated (571 py + 83 c + 132 asm + 189 shared = 975).
2026-04-16 19:38:34 -04:00
..
fibonacci.lsp Add peephole optimizer, --help, examples, README update 2026-04-13 16:56:21 -04:00
generator.lsp Add peephole optimizer, --help, examples, README update 2026-04-13 16:56:21 -04:00
http-server.lsp guardrails: bound http server, trap+cleanup bench, asm-no-GC in CLAUDE.md 2026-04-16 19:38:34 -04:00
mergesort.lsp Add peephole optimizer, --help, examples, README update 2026-04-13 16:56:21 -04:00
objects.lsp Add peephole optimizer, --help, examples, README update 2026-04-13 16:56:21 -04:00
portal-prime.lsp Add portal: serialize and resume VM state across machines 2026-04-13 19:00:11 -04:00