code wiki / (root) / nx_oracleband_lib.nx

nx_oracleband_lib.nx

buildroot/runtime/nx_oracleband_lib.nx

7438 B186 linesdepth 3pulls 3 transitivereach 4 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_oracleband_lib.nx -- LIB: READ A CITED ORACLE TABLE AND JUDGE A VALUE AGAINST IT (2026-08-25). WHY THIS EXISTS. The whole "load a banked reference table, find a key, check a value is inside its cited band" capability lived as gf_load/gf_eq/gf_find/gf_band INSIDE nx_gamefeel_oracle_gate and nowhere else -- one consumer, private statics, and a conf path hardcoded into the loader. That is a general capability at the narrowest possible adoption level: every organ in this estate that derives a constant from cited data needs exactly this and could not reach it. Extracted, not retyped: the parser, the key compare and the cross-multiplied band test are the gate's own code, and the gate now composes this instead of owning it, so there is ONE oracle-table reader rather than one per lane. THREE THINGS THIS ADDS OVER THE PRIVATE VERSION, each because the private one could not do it: 1. THE PATH IS AN ARGUMENT. gf_load hardcoded knowledge/gamefeel_oracle.conf, so a second oracle table was unreachable without copying the file. ob_load takes the path. 2. THE ROW CAP ANNOUNCES. GF_ROWCAP was 32 and SILENT: a table that outgrew it would be read as a PREFIX and every absent-row verdict below it would read as an honest RED. A cap reached in silence becomes a measurement nobody knows is partial, so ob_truncated() reports it and ob_load refuses. 3. ob_pin -- ASSERT A COMPILED CONSTANT EQUALS ITS CITED ROW. A banded check proves a VALUE is in range; it cannot notice that the constant compiled into an organ has drifted from the row it cites. Without this the citation is decorative: edit either side and nothing complains. This is the tooth that makes a citation load-bearing, and it belongs beside the band check rather than in one gate's main(). FORMAT, unchanged from the table it was written for: comment lines start '#', rows are key<TAB>min<TAB>max<TAB>... and only the first three fields are read. Integers only, no division anywhere; the band compare is CROSS-MULTIPLIED so an integer truncation cannot silently pass a value. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 4 importers

nx_syscalls.nx nx_gate_verdict.nx nx_oracleband_lib.nx nx_gamefeel_oracle_gate.nx nx_tissuebudget.nx nx_tissuematerial_gate.nx nx_vpick_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nx

imported by: nx_gamefeel_oracle_gate.nxnx_tissuebudget.nxnx_tissuematerial_gate.nxnx_vpick_gate.nx

structs

none

consts

29const OB_ROWCAP: i64 = 256
30const OB_TAB: i64 = 9
31const OB_NL: i64 = 10
32const OB_HASH: i64 = 35

functions

42func ob_rows() -> i64 { return ob_n }
43func ob_truncated() -> i64 { return ob_trunc }
48func ob_load(path: *u8) -> i64
111func ob_eq(a: *u8, b: *u8) -> i64
called by 2: gf_eqob_find
119func ob_find(key: *u8) -> i64
called by 5: gf_findob_bandob_pinmainmain calls 1: ob_eq
129func ob_lo(r: i64) -> i64 { let p: *i64 = ob_min as *i64; return p[r] }
130func ob_hi(r: i64) -> i64 { let p: *i64 = ob_max as *i64; return p[r] }
133func ob_band(name: *u8, key: *u8, val: i64, ctr: *i64) -> i64
161func ob_pin(name: *u8, key: *u8, lo: i64, hi: i64, ctr: *i64) -> i64