code wiki / (root) / nx_gen_pfx_live_gate.nx

nx_gen_pfx_live_gate.nx

buildroot/runtime/nx_gen_pfx_live_gate.nx

3752 B78 linesdepth 8pulls 13 transitivereach 0 importersview sourcekind gate/prooftopic gen
docsdependenciesstructsconstsfunctions

about

nx_gen_pfx_live_gate.nx -- live gate for the HTTP "pfx" route (prefix-KV-cache over /gen, 2026-07-16 forge-engine speed lever). Runs against a LIVE serve (argv[1]=port, default 8033) loaded with any model; greedy determinism makes byte-equality the bar: T1 baseline: POST /gen promptA (no pfx) -> textA T2 pfx first call (degrade path: full prefill + snapshot) -> MUST == textA byte-exact T3 pfx second call (RESTORE path -- the actual reuse) -> MUST == textA byte-exact T4 boundary-safety: promptB baseline (no pfx) -> textB; then promptB WITH pfx:1 while the snapshot still holds promptA rows -> MUST == textB (divergent tokens re-prefilled fresh; cross-prompt contamination is the failure this tooth catches) ms per call printed (informational; the wall-clock win shows at pack-scale prompts, the gate proves SEMANTICS). license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_forge_loop.nx nx_gen_pfx_live_gate.nx

imports: nx_forge_loop.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main std_atoi std_putln std_puts std_slen sys_write pg_gen std_slen ↻ fm_build_gen_body fc_json_esc_bytes std_itoa sys_mmap fm_post_gen sys_socket nx_http_client_sockaddr_ip nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll nx_http_client_build_reque nx_dec_emit_u63 _drain sys_read fm_extract_text std_slen ↻ fm_hexval std_puts ↻ std_pdec sys_mmap ↻ std_itoa ↻ sys_write ↻ pg_eq

structs

none

consts

none

functions

15func pg_gen(port: i64, prompt: *u8, pfxv: i64, out: *u8, cap: i64) -> i64
27func pg_eq(a: *u8, an: i64, b: *u8, bn: i64) -> i64
called by 1: main
37func main(argc: i64, argv: *i64) -> i64