lumbda/examples
russell@unturf.com aaa6e9075c
examples/cuda-fanout: bend end-to-end on lumbda Python tier
Wired bend.lsp to lumbda's existing TCP primitives via wire.lsp
(length-prefixed S-exp framing, lifted from
ecdsa/lumbda/fleet/wire.lsp). The (bend …) macro now actually
dispatches: lumbda → tcp-connect → wire-send → wire-recv → result.

End-to-end on the 3090 (mock-worker as gpu-worker stand-in until
spawn-process-stdio lands in lumbda's core):

  λ> (load "smoke-bend.lsp")
  === smoke-bend ===
  1. cost estimator picks local for 3 inputs (cost too small): OK
  2. worker available? #t
  3. bend! (cuda-shake-fanout '("00" "01" "deadbeef") 32):
     (#xb8d01df855... #x94da6280b2... #xfa094fa86e...)

All three hashes byte-identical to hashlib.shake_256.

Files added:
  wire.lsp         — 8-digit-LE length-prefixed S-exp framing
  smoke-bend.lsp   — minimal lumbda-side test
  mock-worker.py   — Python stand-in for gpu-worker.lsp until
                     spawn-process-stdio + flush-port primitives
                     land in lumbda's core

bug fix:
  wire-recv had one missing close-paren; lumbda surfaced it as
  'unclosed (' on load. Fixed in the same commit.

mock-worker.py accepts two request shapes since bend.lsp serializes
(quote (...)) for list literals while the portal format uses
(inputs ...). Tolerating both keeps the wire protocol bend-friendly.

Per-tier integration status:
  Python tier — bend, wire, smoke-test all work ✓
  C tier      — needs: same Scheme files port directly; tcp-* exist;
                spawn-process-stdio still missing for gpu-worker.lsp
  asm tier    — needs: tcp-* exist; spawn-process-stdio requires raw
                fork + pipe + execve in asm; biggest delta vs Python

Open primitive gaps for full cross-tier bend:
  spawn-process-stdio   — for gpu-worker.lsp's daemon pool
  flush-port            — to push daemon stdin
  (current-time-ms      — exists in Python tier; needed in C/asm too)

Once those land, gpu-worker.lsp replaces mock-worker.py and bend
runs cross-tier-identical. The protocol & cost-estimator code in
bend.lsp + wire.lsp need no changes — they speak only the existing
tcp-* + read-from-string + write-to-string primitives every tier
already has.
2026-06-04 19:16:01 -04:00
..
cuda-fanout examples/cuda-fanout: bend end-to-end on lumbda Python tier 2026-06-04 19:16:01 -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