# GPU backend — scope note ## What lives upstream - **bend wire protocol** — `examples/cuda-fanout/` (`gpu-worker.lsp`, `bend.lsp`, `bend-macros.lsp`, `wire.lsp`). S-expression + binary (`BSHK` magic) modes. Tier-agnostic — runs under Python, C, or asm tier. - **GPU launcher** — `make gpu-worker LUMBDA={c,python,asm} PORT=NNNN`. Spawns gpu-worker.lsp on chosen tier. - **Factory** — `factory/` orchestrates a queue of cells against any backend reachable via `LUMBDA_BACKEND_CMD`. Backend-agnostic. ## What stays in a domain consumer Specific GPU simulator backends (Clifford tableau, stabilizer, surface-code) couple deeply to a research domain's operation set. They live in domain consumers: - Foxhop ecdsa Clifford tableau simulator: `~/git/www.foxhop.net/ecdsa/cuda/` — secp256k1 group operations, `BSHK` binary ops format with secp-specific opcodes. These backends accept a portal-file interface and expose `LUMBDA_BACKEND_CMD`-compatible call shape. Consumers point factory at their backend; factory provides everything around it (queue, autoscaling, DLQ, tier admission). ## Why a generic Clifford backend stays out of this port A truly upstream Clifford simulator would need: 1. **Generic ops format** — abstract over per-domain instruction sets (currently `main_ops.c` carries secp-specific group ops). 2. **Domain-agnostic memory model** — current tableau layout sized for n=257 qubits + ancilla; would need width-parametric VRAM accounting. 3. **Standalone test coverage** — current correctness gates run against secp256k1 truth tables. Each is several days' work + a research-quality decision (which Clifford simulator family becomes canonical upstream). Out of scope for this AGPLv3 share-back. Filed as future work. ## What this means for AGPLv3 compliance The factory + lumbda quantum primitives discharge the share-back. The domain-specific backend belongs to consumer repos under their own license (AGPLv3 if derivative). Foxhop's `ecdsa/cuda/` remains AGPLv3 in its tree.