code wiki / _hdl_build / nx_nofloat_arch_config_gate.nx

nx_nofloat_arch_config_gate.nx

buildroot/runtime/_hdl_build/nx_nofloat_arch_config_gate.nx

11388 B153 linesdepth 9pulls 23 transitivereach 0 importersview sourcekind gate/prooftopic nofloat
docsdependenciesstructsconstsfunctions

about

nx_nofloat_arch_config_gate.nx -- proves ARCH-CONFIGURABLE inference: read the model's dims from GGUF METADATA (nac_read_config) instead of hardcoding, then run the REAL no-float forward with those read dims and confirm it STILL generates ' Paris' (id 12095). This is the keystone that lets our inference run ANY Qwen2/Llama-schema gguf -- the real 0.5B AND a small from-scratch model -> closes the sovereign train->serve loop (our f32 trainer -> gguf writer -> THIS inference). expect_exit: 0 license_tier: ORIGINAL D001 MIGRATION 2026-08-25. This gate hand-rolled its verdict: a pass/total pair, inline PASS/FAIL prints and a prose "verdict=" line, with main returning a bare 0 or 1. A gate whose EXIT CODE does not carry its verdict can print FAIL and still exit 0, silently blessing every failure it finds -- so it now inherits nx_gate_verdict. gv_ctr makes declared and executed tooth counts ONE number (a tooth that stops running can no longer read GREEN), gv_check names every tooth, and gv_verdict owns the exit code: 0 GREEN / 1 RED / 3 SKIP. THE MODEL FILE IS A PRECONDITION, NOT A SUBJECT. If the fixture gguf is absent this gate proves NOTHING about arch-configurable inference; it used to return 1, which reports its own environment in the same word it reports a regression. It now SKIPs. SKIP is not a pass -- it blocks any claim that this works. The old single compound T1 (seven dims nested in one if) is decomposed into one tooth per dimension. The predicate set is unchanged; what changes is that a failure now NAMES the dim that drifted instead of saying "config mismatch" and leaving the reader to guess which of the seven conjuncts fired.

dependencies 11 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_tier.nx nx_le.nx nx_tensor.nx nx_gguf.nx nx_gguf_load.nx nx_gguf_meta.nx nx_nofloat_llm.nx nx_nofloat_tok.nx nx_nofloat_arch_config_gate.nx

diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_gate_verdict.nxnx_tier.nxnx_le.nxnx_tensor.nxnx_gguf.nxnx_gguf_load.nxnx_gguf_meta.nxnx_nofloat_llm.nxnx_nofloat_tok.nxnx_nofloat_arch.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close gv_need gv_puts ↻ gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻

structs

none

consts

34const ACG_EXPECT_EMBED_DIM: i64 = 896
35const ACG_EXPECT_LAYERS: i64 = 24
36const ACG_EXPECT_HEADS: i64 = 14
37const ACG_EXPECT_KV_HEADS: i64 = 2
38const ACG_EXPECT_HEAD_DIM: i64 = 64
39const ACG_EXPECT_FFN_DIM: i64 = 4864
40const ACG_EXPECT_ROPE_SCALE_Q16: i64 = 8192
43const ACG_VOCAB_LO: i64 = 151000
44const ACG_VOCAB_HI: i64 = 152500
46const ACG_EXPECT_NEXT_TOKEN_ID: i64 = 12095
48const ACG_PROMPT_SLOTS: i64 = 8

functions

50func acg_eq(got: i64, want: i64) -> i64 { if got == want { return 1 } return 0 }
called by 1: main
51func acg_in(v: i64, lo: i64, hi: i64) -> i64 { if v < lo { return 0 } if v > hi { return 0 } return 1 }
called by 1: main
52func aslen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
54func main() -> i64