lumbda/docs/five-scopes-feedback.dot
russell@unturf.com 661f9a01ec
whitepaper: add bend chapter, fifth scope of feedback, source link
Folds 76 commits of substance since 2026-04-24 into the whitepaper
without losing any of the novel cross-domain glue the language earns
its keep on.

Additions
- §4.3 extended from four scopes to five, with bend as feedback across
  heterogeneous compute (host ↔ GPU). New diagram
  diagrams/five-scopes-feedback.png stacks the boundaries.
- §11.8 Bend: cross-tier GPU dispatch. Wire modes (S-exp text, BSHK
  binary), worker hosting per tier, spawn-process-stdio + flush-port
  cross-tier IPC, worker health heartbeat with VRAM-ranked pick,
  6-row catalog of live forms (cuda-shake-fanout, cuda-secp256k1-mul,
  cuda-bignum-cgbn, cuda-radix-sort, cuda-blake3-tree,
  cuda-sim-ops-bin). New diagram diagrams/bend-dispatch.png.
- §2.1 C-tier bignum: arbitrary-precision integers (Boehm-GC managed),
  which unblocked the secp256k1 widths the GPU forms need on the host
  side.
- §12.1 post-cycle audit: recv-exact O(n²)→O(n), asm scheme_read
  overflow, asm gc_sweep page-fault, C-tier JIT cur_code restore
  across CALL/RETURN.
- §13 GPU Phase 1 moved from future to shipped; Phase 2 trampolining
  and Phase 3 interaction combinators sharpened.
- Source repo link (git.unturf.com/engineering/unturf/lumbda) added
  to the cover page band and the Citation block.

Compressions (no novel glue dropped — audited per fox's constraint)
- §8.2-§8.5 EML derivation prose collapsed into a single §8.2
  derivation chain code block; §8.6 renumbered to §8.3.
- §6.6.3 adaptive-meta-GC narrative compressed; result table kept.
- §7.4.1 GC-build S-expression portal tightened to two paragraphs;
  "language is its own wire format" insight kept.

Preserved in full per audit
- §7.5 portable RNG state across tiers
- §7.5.1 one-side kernel entropy + portable bit-identical continuation
- §11.7 sendfile + adaptive preload (27 KB asm-gc within 2% of Caddy)
- §6.6.1 collaborative arena + mark verifier
- §6.6.5 precise block typing
- §8.1 + §8.3 Lumbda hosts its own EML proof checker, ~16× faster
  than Lean cold

Net RST: 1622 → 1655 lines.
2026-06-07 10:49:48 -04:00

105 lines
3.5 KiB
Text

// Five scopes of feedback — 2026-06-07
// "A diagram is worth 10,000 words." — russell@unturf.com
//
// One primitive (feedback) at five nested boundaries. Each row shows what
// crosses, the mechanism that lets it cross, and the implementation
// primitive that makes the mechanism real. The rows stack so a reader
// can run their eye top-to-bottom and see the abstraction widen.
digraph five_scopes {
rankdir=TB
splines=true
nodesep=0.4
ranksep=0.35
node [shape=box, style="filled,rounded", fontname="Helvetica", fontsize=11, margin="0.15,0.08"]
edge [fontname="Helvetica", fontsize=10, arrowsize=0.8]
label="Five scopes of feedback — one primitive, five boundaries"
labelloc=t
fontsize=14
fontname="Helvetica Bold"
// Row 1 — within process
subgraph cluster_1 {
label="① Within process — call/cc continuation (live)"
labelloc=b
style="rounded,filled"
fillcolor="#e8f4f8"
color="#0984e3"
fontname="Helvetica Bold"
fontsize=11
fontcolor="#0984e3"
rank=same
n1a [label="frame stack" fillcolor="#b3d9e8" color="#0984e3"]
n1b [label="frame stack" fillcolor="#b3d9e8" color="#0984e3"]
n1a -> n1b [color="#0984e3" penwidth=1.8]
}
// Row 2 — across process
subgraph cluster_2 {
label="② Across process — portal (VM state + continuation)"
labelloc=b
style="rounded,filled"
fillcolor="#e8f5e9"
color="#2e7d32"
fontname="Helvetica Bold"
fontsize=11
fontcolor="#2e7d32"
rank=same
n2a [label="process A (any tier)" fillcolor="#a5d6a7" color="#2e7d32"]
n2b [label="process B (any tier)" fillcolor="#a5d6a7" color="#2e7d32"]
n2a -> n2b [color="#2e7d32" penwidth=1.8]
}
// Row 3 — across impl
subgraph cluster_3 {
label="③ Across impl — source-as-data (the reader)"
labelloc=b
style="rounded,filled"
fillcolor="#fff8e1"
color="#f57f17"
fontname="Helvetica Bold"
fontsize=11
fontcolor="#f57f17"
rank=same
n3a [label="Python tier" fillcolor="#ffe082" color="#f57f17"]
n3b [label="C / asm tier" fillcolor="#ffe082" color="#f57f17"]
n3a -> n3b [color="#f57f17" penwidth=1.8]
}
// Row 4 — across machine
subgraph cluster_4 {
label="④ Across machine — TCP socket (request / response bytes)"
labelloc=b
style="rounded,filled"
fillcolor="#fce4ec"
color="#c2185b"
fontname="Helvetica Bold"
fontsize=11
fontcolor="#c2185b"
rank=same
n4a [label="machine M1" fillcolor="#f8bbd0" color="#c2185b"]
n4b [label="machine M2" fillcolor="#f8bbd0" color="#c2185b"]
n4a -> n4b [color="#c2185b" penwidth=1.8]
}
// Row 5 — across compute
subgraph cluster_5 {
label="⑤ Across compute — (bend …) form (S-exp or BSHK binary)"
labelloc=b
style="rounded,filled"
fillcolor="#f3e5f5"
color="#7b1fa2"
fontname="Helvetica Bold"
fontsize=11
fontcolor="#7b1fa2"
rank=same
n5a [label="host CPU (any tier)" fillcolor="#ce93d8" color="#7b1fa2"]
n5b [label="CUDA worker + kernel" fillcolor="#ce93d8" color="#7b1fa2"]
n5a -> n5b [color="#7b1fa2" penwidth=1.8]
}
// Invisible chain forces vertical stacking of clusters.
n1a -> n2a [style=invis]
n2a -> n3a [style=invis]
n3a -> n4a [style=invis]
n4a -> n5a [style=invis]
}