lumbda/examples/cuda-fanout/plans
russell@unturf.com 88e16c0ce2
bend: dual-port worker (8320 wire + 8321 http) — playground onramp
Each gpu-worker.lsp now listens on both wire-TCP (existing :8320) and
HTTP/1.1+CORS (new :8321), sharing one handle-request dispatcher. Lets
a tab on https://lumbda.com/playground/ POST to its own machine via
http://localhost:8321/ — browsers permit localhost from HTTPS origins
without TLS, so no proxy, no cert, no fox-owned infra required for the
decentralized run-your-own-bend story.

main() forks at startup: child runs http-run-loop on :8321, parent
keeps existing run-loop on :8320. Adding a new op-head to handle-request
exposes it over both transports automatically. Binary modes
(BSHK/BCGB/BSCP/BSRT/BSB3) stay wire-only — they exist for native
callers who already cache the binary locally; browser callers send
S-expression recipes the worker dispatches the same way.

Two latent defects fixed to make CPU-only and Python-tier hosts work:
- vram-used-mib now file-exists? guards /usr/bin/nvidia-smi. Python
  tier's spawn-process-stdio raises FileNotFoundError on missing
  binary, not returning #f as the prior code expected, which crashed
  every worker on a CPU-only laptop.
- fork-self return discriminated via (number? pid) not (eq? pid 0).
  Python tier's (eq? 0 #f) returns #t because == conflates int 0
  with bool False; pre-existing run-loop has the same risk but
  C/asm tier (identity eq?) masks it for the production case.

Phase 2 (server-side factory ops: compile uploaded .lsp recipes into
.bin before bending — the foxhop champion-circuit workflow) deferred
until authentication lands; today a worker on the public internet
would let any caller occupy our GPU.

Operational Caddy + DNS proposals in plans/bend-http-deploy.md cover
the personal-remote-access endpoint chain (proxy.unturf.com edge →
ai.foxhop.net Caddy → 3090-ai:8321) gated by trusted-IP allowlist —
applied separately.

Also codifies the playground "CSS Grid only, never flexbox" rule in
CLAUDE.md: all www/ and wasm/ stylesheets are already grid-only;
documenting the invariant so future edits don't drift.

Tests: smoke-bend-http.sh — (ping)→(ok pong), unknown-op fallback,
OPTIONS CORS preflight — all PASS. Wire path unchanged, verified
round-trip via 8-digit-prefix framing.
2026-06-14 17:32:46 -04:00
..
bend-http-deploy.md bend: dual-port worker (8320 wire + 8321 http) — playground onramp 2026-06-14 17:32:46 -04:00
form-A-day2-progress.md cuda-fanout plans: Day-2/3 progress + Form D pivot RESULTS docs 2026-06-05 15:32:32 -04:00
form-A-day3-progress.md bend form A — Day-3 v3 windowed-base ladder, 1.73x at n=1M on 3090 2026-06-05 18:14:56 -04:00
form-A-day4-progress.md examples/cuda-fanout: Day-4 v4 stack landed (byte-clean, -12% vs v3); daemon flips to v3 --window-w 4 2026-06-05 19:07:00 -04:00
form-A-secp256k1-batched-mul.md bend: planning docs for forms A, B, D (CATALOG.md build runway) 2026-06-05 13:25:37 -04:00
form-B-bignum-cgbn.md bend: planning docs for forms A, B, D (CATALOG.md build runway) 2026-06-05 13:25:37 -04:00
form-D-axis-flip-RESULTS.md cuda-fanout: drop legacy demo_ops references — bend-cuda only 2026-06-09 15:17:04 -04:00
form-D-build-progress.md cuda-fanout plans: Day-2/3 progress + Form D pivot RESULTS docs 2026-06-05 15:32:32 -04:00
form-D-clifford-stabilizer.md cuda-fanout: drop legacy demo_ops references — bend-cuda only 2026-06-09 15:17:04 -04:00
form-D-packing-RESULTS.md cuda-fanout plans: Form D Option 3 (ops.bin packing) results 2026-06-05 14:14:56 -04:00
form-E-progress.md form E day-1 — Montgomery batch-inv 0x0A regressed 300x vs 0x05, parked 2026-06-05 21:50:51 -04:00
form-G-progress.md bend form G — cuda-radix-sort lands live (CUB DeviceRadixSort u64) 2026-06-05 21:50:05 -04:00