nx_nofloat_prefill_gate.nx
buildroot/runtime/nx_nofloat_prefill_gate.nx
about
nx_nofloat_prefill_gate.nx -- R0r (2026-09-17): the BATCHED PREFILL is bit-identical to the sequential per-token prefill it
replaces, proven on a real model through the serve core's own generate path, and its speed is printed as values.
Two runs of nsv_generate on one prompt long enough for two full NF_PREFILL_M blocks plus a partial one:
A = g_nsv_prefill_batched 0 (the sequential control) B = 1 (the served default)
Teeth: the fixture reached the condition (blocks and a partial block), every KV cache row of every layer for every
prompt position identical, a planted cell read as a difference (the comparator is live), the generated bytes and the
token count identical, the served default is batched. Prefill ms for both paths and the speedup are values.
The model (2026-09-18): argv[1] > sp_engine_model -- the engine model THIS HOST has staged (NX_ENGINE_MODEL env >
knowledge/stage.conf engine_model=), a valid subject because the identity holds for ANY model the engine runs -- >
the stage's nx_coder_model.gguf > SKIP when none opens. A roster forks this gate BARE, so the host-declared key is how
the heavy roster reaches a real model without staging another model under the coder model's name (a label that lies).
The rung that answered prints on the MODEL line (model_source=argv|engine_model|stage|none) and as model_source_code.
expect_exit: 0 license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_nofloat_serve_core.nxnx_gate_verdict.nxnx_stage_path.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 19 | const PG_OUT_CAP: i64 = 8192 |
| 20 | const PG_MAX_NEW: i64 = 6 |
| 21 | const PG_SEED: i64 = 12345 |
| 22 | const PG_PERMIL: i64 = 1000 |
| 23 | const PG_REPEATS: i64 = 12 // sentence repeats: ~230 tokens, so two full 32-blocks and a partial one |
| 24 | const PG_PROMPT_CAP: i64 = 4096 |
| 25 | const PG_GP_SLOTS: i64 = 16 |
| 26 | const PG_META_SLOTS: i64 = 8 |
| 27 | const PG_MODE_I8: i64 = 1 |
| 46 | const PG_MSRC_NONE: i64 = 0 |
| 47 | const PG_MSRC_ARGV: i64 = 1 |
| 48 | const PG_MSRC_ENGINE: i64 = 2 |
| 49 | const PG_MSRC_STAGE: i64 = 3 |
functions
| 29 | func pg_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var p: i64 = o; while s[i] != (0 as u8) { d[p] = s[i]; p = p + 1; i = i + 1 } return p } called by 1: main |
| 31 | func pg_kv_snapshot(dst: *i64, nrows: i64) -> i64 called by 1: main |
| 43 | func pg_same(a: *i64, b: *i64, n: i64) -> i64 { var i: i64 = 0; while i < n { if a[i] != b[i] { return 0 } i = i + 1 } return 1 } called by 1: main |
| 50 | func pg_src_name(s: i64) -> *u8 called by 1: pg_announce |
| 57 | func pg_announce(msrc: i64, mpath: *u8, esrc: i64, epath: *u8) -> i64 |
| 68 | func main(argc: i64, argv: *i64) -> i64 |