bend port flip: 9091 → 8320 (BEND mnemonic)

Port mnemonic embedded verbatim across our source files:

  8 ~= B (implied infinity B flattened; bake a cake; baby & me)
  3 ~= E (backward)
  2 ~= N (pivoted 90 degrees)
  0 ~= D (flattened)

Files touched:
- examples/cuda-fanout/gpu-worker.lsp (*worker-port*)
- examples/cuda-fanout/bend.lsp (*bend-worker-port*)
- examples/cuda-fanout/mock-worker.py (PORT)
- examples/cuda-fanout/bench_tiers.py (asm tier fixed port)
- examples/cuda-fanout/smoke-bend.lsp + smoke-bend-asm.lsp
- examples/cuda-fanout/README.md
- www/bend.html (catalog + multi-host text)
- Makefile (PORT default + comment)

bend.html updates 3090-ai + ai (4090) fleet table to active 2-node
mesh on 8320 — qwen moves off ai, bend takes over.
This commit is contained in:
russell@unturf.com 2026-06-06 15:06:18 -04:00
parent 9a547ee7df
commit 8d66bc01f1
No known key found for this signature in database
17 changed files with 76 additions and 20 deletions

@ -0,0 +1 @@
Subproject commit 7b7a79a98fcb2ec0e0a72ab34028cdaba4e22480

View file

@ -189,12 +189,18 @@ friction: c-build asm-build
# ─── GPU worker (bend primitive) ─────────────────────────────────
#
# Builds the cuda-fanout leaf binary & launches gpu-worker.lsp on
# port 9091 (override via PORT=NNNN). Client tier choice via
# port 8320 (override via PORT=NNNN). Client tier choice via
# LUMBDA=python|c|asm (default python). Once running, any tier can
# (bend …) to it from the same host or another LAN host.
#
# Port mnemonic — 8320 = BEND:
# 8 ~= B (implied infinity B flattened; bake a cake; baby & me)
# 3 ~= E (backward)
# 2 ~= N (pivoted 90 degrees)
# 0 ~= D (flattened)
GPU_WORKER_DIR := examples/cuda-fanout
PORT ?= 9091
PORT ?= 8320
LUMBDA ?= c
gpu-worker-bin:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -89,7 +89,7 @@ needed:
cd examples/cuda-fanout
python3 -u ../../lumbda.py /tmp/launch-worker.lsp
# → gpu-worker: ready cuda-shake-fanout ← ./shake256-fanout
# → gpu-worker listening on port 9091
# → gpu-worker listening on port 8320 (BEND mnemonic — see below)
# In another shell, drive via bend!:
python3 ../../lumbda.py smoke-bend.lsp

View file

@ -39,9 +39,15 @@ TIERS = {
"launch.lsp", "--port",
],
# asm tier launch uses a separate file that pre-defines *argv*
# (asm doesn't auto-bind it). Port is fixed to 9091 — asm tier
# (asm doesn't auto-bind it). Port is fixed to 8320 — asm tier
# also doesn't parse --port, so each asm bench uses its own
# binary launch.
#
# Port mnemonic — 8320 = BEND:
# 8 ~= B (implied infinity B flattened; bake a cake; baby & me)
# 3 ~= E (backward)
# 2 ~= N (pivoted 90 degrees)
# 0 ~= D (flattened)
"asm": [
os.path.join(LUMBDA_ROOT, "asm", "lumbda-gc"),
"launch-asm.lsp",
@ -260,9 +266,9 @@ def main():
all_results = {}
for i, tier in enumerate(tiers):
# asm tier hard-codes port 9091 (no --port parsing); run it
# last so other tiers get unique ports.
port = 9091 if tier == "asm" else (9090 + i + 1)
# asm tier hard-codes port 8320 (BEND, no --port parsing); run
# it last so other tiers get unique ports.
port = 8320 if tier == "asm" else (9090 + i + 1)
try:
all_results[tier] = bench_tier(tier, port, configs, binary=args.binary)
except Exception as e:

View file

@ -71,9 +71,14 @@
;;; -- worker endpoint -------------------------------------------
(define *bend-worker-host* "127.0.0.1")
(define *bend-worker-port* 9091)
;; Port 8320 — BEND mnemonic:
;; 8 ~= B (implied infinity B flattened; bake a cake; baby & me)
;; 3 ~= E (backward)
;; 2 ~= N (pivoted 90 degrees)
;; 0 ~= D (flattened)
(define *bend-worker-port* 8320)
;; Override our default localhost:9091 endpoint.
;; Override our default localhost:8320 endpoint.
(define (bend-set-worker! host port)
(set! *bend-worker-host* host)
@ -87,7 +92,7 @@
;;; falls back to a single *bend-worker-host* / *bend-worker-port* pair
;;; (full back-compat with single-host callers).
;;;
;;; Set via (bend-set-workers! '(("3090-ai.foxhop.net" . 9091)))
;;; Set via (bend-set-workers! '(("3090-ai.foxhop.net" . 8320)))
;;; or environment variable BEND_WORKERS="host:port,host:port".
;;;
;;; Production default: 3090-ai only. ai.foxhop.net (4090) is
@ -418,4 +423,4 @@
(let ((r (bend (cuda-shake-fanout (make-input 100000) 32))))
(display "-> ") (display (length r)) (display " result(s)\n")))
;; (demo) ; uncomment after launching gpu-worker.lsp on port 9091
;; (demo) ; uncomment after launching gpu-worker.lsp on port 8320 (BEND)

View file

@ -17,14 +17,20 @@
;;; pattern actually faster than local CPU for repeated calls.
;;;
;;; Run:
;;; lumbda gpu-worker.lsp ; default port 9091
;;; lumbda gpu-worker.lsp ; default port 8320 (BEND)
;;; lumbda gpu-worker.lsp --port 9001
;;;
;;; Port mnemonic — 8320 = BEND:
;;; 8 ~= B (implied infinity B flattened; bake a cake; baby & me)
;;; 3 ~= E (backward)
;;; 2 ~= N (pivoted 90 degrees)
;;; 0 ~= D (flattened)
;;;
;;; Requires the cuda binaries on disk; paths below.
(load "wire.lsp")
(define *worker-port* 9091)
(define *worker-port* 8320)
(define *binary-shake-fanout*
;; Override via env or per host.
"./shake256-fanout")

View file

@ -18,7 +18,12 @@ import threading
import time
HOST = "127.0.0.1"
PORT = 9091
# Port 8320 — BEND mnemonic:
# 8 ~= B (implied infinity B flattened; bake a cake; baby & me)
# 3 ~= E (backward)
# 2 ~= N (pivoted 90 degrees)
# 0 ~= D (flattened)
PORT = 8320
BINARY = sys.argv[1] if len(sys.argv) > 1 else "./shake256-fanout"
# spawn a warm daemon once

View file

@ -4,7 +4,7 @@
;;; macro. The function-form bend!-call is the portable path.
;;;
;;; Prereqs:
;;; - gpu-worker.lsp running on 127.0.0.1:9091 (Python or C tier)
;;; - gpu-worker.lsp running on 127.0.0.1:8320 (BEND mnemonic; Python or C tier)
;;; - cuda-shake-fanout binary reachable from that worker
;;;
;;; Run on asm tier:

View file

@ -1,7 +1,7 @@
;;; smoke-bend.lsp -- minimal end-to-end test of bend dispatch.
;;;
;;; Prereqs:
;;; - mock-worker.py listening on 127.0.0.1:9091
;;; - mock-worker.py listening on 127.0.0.1:8320 (BEND mnemonic)
;;; - cuda-shake-fanout binary on PATH (mock-worker spawns it)
;;;
;;; Run:

21
examples/fizzbuzz.lsp Normal file
View file

@ -0,0 +1,21 @@
;;; fizzbuzz.lsp — FizzBuzz from 1 to 100
;;; Run: python3 lumbda.py --fast examples/fizzbuzz.lsp
(define (fizzbuzz n)
(let ((div3 (= (modulo n 3) 0))
(div5 (= (modulo n 5) 0)))
(cond
((and div3 div5) "FizzBuzz")
(div3 "Fizz")
(div5 "Buzz")
(else (number->string n)))))
(define (run-fizzbuzz limit)
(let loop ((i 1))
(if (<= i limit)
(begin
(display (fizzbuzz i))
(newline)
(loop (+ i 1))))))
(run-fizzbuzz 100)

View file

@ -30,7 +30,13 @@
make gpu-worker
# → builds examples/cuda-fanout/shake256-fanout
# → builds the C tier (~10× faster wire orchestration than Python)
# → launches gpu-worker.lsp on port 9091
# → launches gpu-worker.lsp on port 8320 (BEND)
# Port 8320 = BEND mnemonic:
# 8 ~= B (implied infinity B flattened; bake a cake; baby &amp; me)
# 3 ~= E (backward)
# 2 ~= N (pivoted 90 degrees)
# 0 ~= D (flattened)
# Override tier or port:
make gpu-worker LUMBDA=python PORT=9001 # easier debugging
@ -74,11 +80,11 @@ make gpu-worker LUMBDA=asm # smallest footprint</code></pre>
<table>
<thead><tr><th>host</th><th>GPU</th><th>arch</th><th>port</th><th>status</th></tr></thead>
<tbody>
<tr><td><code>3090-ai.foxhop.net</code></td><td>RTX 3090 (24 GB)</td><td>sm_86</td><td>9091</td><td><strong>active</strong> &mdash; production worker</td></tr>
<tr><td><code>ai.foxhop.net</code></td><td>RTX 4090 (24 GB)</td><td>sm_89</td><td>9092</td><td>reserved for qwen LLM (llama.cpp); bend worker enabled per workload</td></tr>
<tr><td><code>3090-ai.foxhop.net</code></td><td>RTX 3090 (24 GB)</td><td>sm_86</td><td>8320</td><td><strong>active</strong> &mdash; production worker</td></tr>
<tr><td><code>ai.foxhop.net</code></td><td>RTX 4090 (24 GB)</td><td>sm_89</td><td>8320</td><td><strong>active</strong> &mdash; 2-node mesh</td></tr>
</tbody>
</table>
<p>Multi-host fan-out was validated at 1.6&times; aggregate throughput on small workloads, but routine round-robin against the 4090 would steal VRAM from qwen. Caller opts in explicitly when a workload justifies fan-out: <code>(bend-set-workers! '((&quot;3090-ai.foxhop.net&quot; . 9091) (&quot;ai.foxhop.net&quot; . 9092)))</code> brings the 4090 online for that call.</p>
<p>Multi-host fan-out enabled. Both 3090 + 4090 serve bend workloads on port 8320 (BEND mnemonic). Round-robin or explicit selection via <code>(bend-set-workers! '((&quot;3090-ai.foxhop.net&quot; . 8320) (&quot;ai.foxhop.net&quot; . 8320)))</code>.</p>
</section>
<section id="health">