[GW] Real GPU --serve: wire the verified forward + sampler + Lean-proven session

Resident GEN/STOP/QUIT service (strata-ctl contract) composing the three verified pieces:

- ld::layer::forward_inkling_with_state (48-visit autoregressive forward, persistent KV/ShortConv);

- abi::sampler (hardened zero-alloc greedy/top-k/p/min-p + penalties, non-finite tracking);

- gw::session::ServeSession (proofs/serve_session.lean FSM: GEN 0 pre-warm, STOP->DONE drain).

serve_gen is a pure orchestration fn (engine + ParsedGen + stop flag + emit closure), GPU-integration-tested. run_serve adds a stdin reader thread raising stop/quit atomics so STOP interrupts decode and drains to DONE. Token-id based (no tokenizer needed). gw 'hip' feature default OFF keeps the gateway host-independent.

Measured: live binary over pipe -> READY 8192 stop; 'The capital of France is' -> T 152717 (' Paris', exact ref) T 13 T 198 T 3967; DONE length. STOP after 2 tokens -> DONE 2 ... stop, no further tokens (Theorem 4/9). QUIT exits clean.

Verified: cargo test --workspace green (-D warnings), gw hip 10 default + 2 GPU serve tests green, 5 Lean files 0 sorryAx.
This commit is contained in:
adm committed 2026-12-01 16:42:24 +01:00
1 parent 08514e81b1
commit 26bff57645
5 files changed
+421 -1

No files matched your search

+3
View File
@@ -12,6 +12,9 @@
pub mod session;
#[cfg(feature = "hip")]
pub mod serve;
/// Python-repr float spelling (always a decimal point), as `strata-ctl` emits.
fn fmt_float(v: f64) -> String {
let s = format!("{v}");