code wiki / (root) / nx_embfeat_gate.nx

nx_embfeat_gate.nx

buildroot/runtime/nx_embfeat_gate.nx

7253 B99 linesdepth 6pulls 13 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_embfeat_gate.nx -- GATE for the embedding-feature library (nx_embfeat_lib), driven IN-PROCESS on a PLANTED pair of models under /tmp/nx_embfeat_gate: a four-word PPMI vocabulary written through nx_wordclust's fixture writer (the canonical NXPPMI1 shape) and a four-row NXEMB1 table written by the library's own fixture writer in the same sorted-hash order. Proves: the pair loads, header fields read back, the scale is derived from the table (RMS then a half step), a known word resolves to its own planted row and an unknown word reads -1, the bucket arithmetic (zero, one step, minus one step, a clamp on both sides), the two-byte spelling, determinism across two loads, and the fail-closed controls (a missing table, a table with a wrong magic). Every fixture asserts its own condition first. No network. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_gatekit_lib.nx nx_reviewmine_lib.nx nx_wordclust.nx nx_embfeat_lib.nx nx_gate_verdict.nx nx_embfeat_gate.nx

imports: nx_syscalls.nxnx_gatekit_lib.nxnx_reviewmine_lib.nxnx_wordclust.nxnx_embfeat_lib.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gv_head gv_puts sys_write 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 ↻ gk_mkdir sys_mkdir sys_mmap ↻ rm_catn gv_check_eq gv_check gv_puts ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap ef_plant sys_mmap ↻ db_semhash sys_openat_wr sys_write ↻ sys_close gk_size sys_openat_rd

structs

none

consts

16const G_ROOT: *u8 = "/tmp/nx_embfeat_gate"
17const G_PPMI: *u8 = "/tmp/nx_embfeat_gate/mini.ppmi"
18const G_EMB: *u8 = "/tmp/nx_embfeat_gate/mini.emb"
19const G_BADEMB: *u8 = "/tmp/nx_embfeat_gate/bad.emb"
20const G_MISSING: *u8 = "/tmp/nx_embfeat_gate/absent.emb"
21const G_I64: i64 = 8
22const G_NW: i64 = 4
23const G_DIM: i64 = 3
24const G_TABLE_BYTES: i64 = 120 // 24 + 4*3*8
27const G_EXPECT_RMS: i64 = 836
28const G_EXPECT_STEP: i64 = 418
29const G_CH_ZERO: i64 = 48
30const G_CH_AT: i64 = 64

functions

32func main() -> i64