lumbda/examples
russell@unturf.com 28beee9944
examples/cuda-fanout: daemon mode (574x faster per-call) + honest bench
Bench findings drove three changes to the reference primitive:

1. Per-spawn mode loses to host hashlib at every size we tested.
   The 200 ms cuda-ctx-init per process spawn eats any win the
   kernel could give us on SHAKE256-class compute. Honest table:

     in_sz  N         total    host ms  device ms  kernel ms  speedup
     32     3 M       96 MB    1818     4246       3.04       0.43x
     1024   100 k     102 MB   260      4753       1.72       0.05x
     16384  10 k      164 MB   343      18638      2.66       0.02x
     262144 1 k       262 MB   508      454171     39.07      0.00x

   The 454 SECONDS at 262 MB is portal hex-parsing, NOT the kernel
   (which is 39 ms). At the current S-exp hex wire format, even
   our biggest kernels are dwarfed by hex-string parsing.

2. Daemon mode lands in shake256-fanout.cu. Touch CUDA context
   once at startup, then accept commands on stdin:

     process <in.portal> <out.portal>     → fan-out + write result
     quit                                  → clean shutdown

   bench_daemon.py measures 574x speedup per call:

     workload: 10 calls × 100 inputs × 32 bytes each
       host hashlib loop  :    0.6 ms total ( 0.06 ms/call)
       per-spawn fanout   : 1825.9 ms total (182.59 ms/call)
       daemon-mode init   :  109.2 ms  (one-time)
       daemon-mode calls  :    3.2 ms total ( 0.32 ms/call)

   Daemon is the production architecture for any workload doing
   repeated fan-outs. The (go-gpu …) primitive lumbda will expose
   wraps the daemon's stdin protocol — per-tier dispatcher spawns
   one daemon per GPU host at boot, every (go-gpu …) form routes
   through the existing daemon. CUDA init never re-runs while
   lumbda is up.

3. DESIGN-go-gpu.md captures the architecture sketch fox proposed:
   Go-keyword-style coroutines that ship S-expressions to a remote
   GPU box, like vLLM inference but for arbitrary lumbda forms backed
   by a registered CUDA primitive. Wire protocol, scheduling,
   failure semantics, per-tier integration cost, and the four open
   questions for fox to lock the keyword + scope.

README.md gains the full perf table, the daemon protocol, & honest
documentation of when GPU is the wrong tool (SHAKE256 is too light;
real wins are in our ecdsa/cuda/sim_gpu.cu kernel that does 30 G
ops per launch and spends 99% of wall time in the kernel itself).
2026-06-04 18:43:06 -04:00
..
cuda-fanout examples/cuda-fanout: daemon mode (574x faster per-call) + honest bench 2026-06-04 18:43:06 -04:00
bench-gc-adaptive.lsp asm-gc: adaptive EMA-driven meta-GC policy + bench + two correctness fixes 2026-04-18 11:33:39 -04:00
bench-gc-arena.lsp asm-gc: meta-GC layer — arena fast path with mark-phase verifier 2026-04-18 10:01:28 -04:00
bench-gc-memory.lsp asm: naive stop-the-world mark-sweep GC as a control group 2026-04-18 09:34:51 -04:00
bench-hashset.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
fibonacci.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
generator.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
http-client-bench.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
http-server-noarena.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
http-server.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
http-static-server-adaptive.lsp lumbda-www: sendfile(2) primitive + adaptive preload — matches caddy throughput at 9x less RSS 2026-04-19 12:41:40 -04:00
http-static-server-cached.lsp lumbda-www cached: in-memory hash-table cache, 1.64x PDF throughput 2026-04-19 12:18:56 -04:00
http-static-server-sendfile.lsp lumbda-www: sendfile(2) primitive + adaptive preload — matches caddy throughput at 9x less RSS 2026-04-19 12:41:40 -04:00
http-static-server.lsp lumbda-www: asm-gc static file server for lumbda.com + caddy race 2026-04-19 12:12:59 -04:00
mergesort.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
objects.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
portal-http-client.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
portal-http-server.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
portal-prime.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
proof-netspace-client.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
proof-netspace-node-a.lsp proof netspace: 2-node spiral demo — independent caches converge 2026-04-18 05:29:23 -04:00
proof-netspace-node-b.lsp proof netspace: 2-node spiral demo — independent caches converge 2026-04-18 05:29:23 -04:00
proof-netspace-server-lib.lsp proof netspace: 2-node spiral demo — independent caches converge 2026-04-18 05:29:23 -04:00
proof-netspace-server.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
repl-server.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
rpc-chain-bench.lsp rpc-chain-bench: Python → C relay → asm, timing end-to-end 2026-04-17 09:18:42 -04:00
rpc-client.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
rpc-relay.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
rpc-server.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
spiral-client.lsp rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
spiral-demo.sh rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
ursa-scheme.lsp zoe-favorites-test: cover all four tiers (Python + C + asm + asm-full) 2026-04-24 12:27:51 -04:00
ursa.lisp.txt cl-compat: run Zoë Trout's favorites unchanged (ticket 0004) 2026-04-24 07:02:21 -04:00