lumbda/tests
russell@unturf.com 88c4b05032
c: enable Boehm GC by default, GC_INIT, file ops, regression test
Three coupled changes that unblock the ecdsa quantum-circuit
simulator's run on the C tier from neoblanka.

1. c/Makefile autodetects libgc-dev — if /usr/include/gc.h is
   present, the build links Boehm and defines USE_BOEHM_GC. Without
   GC, ul_free is a no-op (lumbda.h:35) and every allocation leaks;
   small REPL snippets work but workloads with thousands of envs
   OOM the process. Override with USE_GC=0 to force the malloc-only
   path for diagnostics.

2. c/main.c calls GC_INIT before init_symbols, then GC_disable.
   GC_INIT registers the stack base for conservative scan — without
   it some Linux configs miss roots. GC_disable is a deliberate
   stopgap: lumbda Values are NaN-boxed pointers that conservative
   Boehm cannot recognize as pointers, so live targets get reclaimed
   (env binding symbol payloads, SymbolEntry strings) and lookups
   fail with "undefined: <sym>". Reproducing this without GC_disable
   on the GC build: any sim.lsp call chain triggers the corruption
   after ~100 named-let iterations. Until tracing is precise,
   growing the heap is safer than wrong results. Long-running
   workloads run under ulimit -v.

3. c/builtins.c gains rename-file and delete-file matching the
   Python tier (lumbda.py:3468). sim.lsp's write-portal! pattern
   (write to .tmp, rename) needs rename-file to land cross-tier
   identical results.

4. tests/regression-named-let-leak.lsp + .sh pin four shapes that
   blew up ecdsa: the c/TODO-named-let-bytecode.md repro, the F1
   shape from foxhop.net's lumbda-c-tier-leak-SP.md (12-line
   minimum), a 200-iter scaled variant, and a sim.lsp run-ops!
   mirror. Wired into root Makefile as regression-named-let-leak;
   added to test-all. Wrapper caps memory at 256 MB virt and 15s
   per tier so a leak regression fails the run instead of consuming
   host RAM.

Known limits:
- --fast JIT still has the named-let + inner user-fn call hang
  (separate TODO; tree-walker handles this fine).
- GC_disable means the heap grows; workloads must bound their work
  budget. ecdsa's sim runs comfortably in 5 MB.

Verified inside a 2G/2vCPU QEMU guest (foxhop.net ecdsa/vm-runner.sh):
- test-c (tree-walker) — 35/35 PASS
- bench-c (tree-walker) — score 18 matches Python tier byte-identical
- F1 probe (tree-walker) — all four steps PASS
2026-06-04 00:55:31 -04:00
..
bench-3way.sh rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
bench-gc-adaptive.sh rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
bench-gc-arena.sh rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
bench-gc-http.sh rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
bench-gc-memory.sh rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
bench-hashset.sh rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
bench-lumbda-www.sh lumbda-www: asm-gc static file server for lumbda.com + caddy race 2026-04-19 12:12:59 -04:00
bench-proof.sh rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
bench-www-race.sh lumbda-www: sendfile(2) primitive + adaptive preload — matches caddy throughput at 9x less RSS 2026-04-19 12:41:40 -04:00
cl-compat.lsp asm: values + call-with-values + #(...) reader + exit + vector equal? 2026-04-24 12:38:47 -04:00
functional.lsp portal-rng: add (random-seed-from-os!) across all three tiers 2026-04-20 15:50:26 -04:00
portal-benchmark.sh rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
portal-cross-load.lsp asm/c/py: add (load), ports, write-file/file->string — full cross-impl parity 2026-04-16 16:37:40 -04:00
portal-cross-save.lsp asm/c/py: add (load), ports, write-file/file->string — full cross-impl parity 2026-04-16 16:37:40 -04:00
portal-cross-test.sh portal-rng: asm xoshiro256** + cross-impl tests + default seed=0 2026-04-20 11:11:47 -04:00
portal-exchange.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
portal-formats.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
portal-rng-cross-test.sh portal-rng: 9-cell cross-impl stream matches independent Python baseline 2026-04-23 20:19:16 -04:00
portal-rng-load.lsp portal-rng: asm xoshiro256** + cross-impl tests + default seed=0 2026-04-20 11:11:47 -04:00
portal-rng-save.lsp portal-rng: asm xoshiro256** + cross-impl tests + default seed=0 2026-04-20 11:11:47 -04:00
prove-ursa-runs.sh tests: prove-ursa-runs.sh — runs Zoë's live source on every tier 2026-04-24 12:48:09 -04:00
regression-named-let-leak.lsp c: enable Boehm GC by default, GC_INIT, file ops, regression test 2026-06-04 00:55:31 -04:00
regression-named-let-leak.sh c: enable Boehm GC by default, GC_INIT, file ops, regression test 2026-06-04 00:55:31 -04:00
rpc-chain-bench.sh rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
ursa-scheme.lsp asm: values + call-with-values + #(...) reader + exit + vector equal? 2026-04-24 12:38:47 -04:00
ursa.lsp asm: values + call-with-values + #(...) reader + exit + vector equal? 2026-04-24 12:38:47 -04:00
web-benchmark.sh rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
zoe-favorites-test.sh zoe-favorites-test: cover all four tiers (Python + C + asm + asm-full) 2026-04-24 12:27:51 -04:00