code wiki / _hdl_build / nx_ledger_data.nx

nx_ledger_data.nx

buildroot/runtime/_hdl_build/nx_ledger_data.nx

12322 B317 linesdepth 3pulls 4 transitivereach 5 importersview sourcekind librarytopic ledger
docsdependenciesstructsconstsfunctions

about

nx_ledger_data.nx -- LEDGER-AS-DATA (rung AN1): an Analyst case is a .led FILE, not code. New question = new file, NO recompile (the vizsla archetype-matrix lesson). The file carries SOURCE COLUMNS so the strict source-criticism re-grade is data too: every MEASURED leaf must be backed by >=2 DISTINCT incentive classes or it is DEMOTED to DERIVED before the verdict. Grammar (one record per line; '#'/blank = comment; integers only, space-separated): T <tol_ppm> <min_traced_permil> <max_residual_permil> (exactly one) C <class_a> <class_b> (opposed pair; 0..4 rows) S <rel 1-6> <cred 1-6> <party 1-3> <method 1-5> <class> (source; idx = order) N <parent> <value_cents> <kind 0/1/2> (node; idx = order; node 0 = root) B <node> <src> (backing edge) Any other line, bad field, bad grade, or bad reference fails LOUD (parse returns 0) -- a ledger that cannot be read exactly is never half-answered. Composes nx_analyst (verdict math) + nx_source_grade (grades, independence, confidence). LAWS: struct-free, integer-only, flat ifs, <=6 args (st-table for the parse state). license_tier: ORIGINAL

dependencies 3 imports · 4 importers

nx_analyst.nx nx_source_grade.nx nx_syscalls.nx nx_ledger_data.nx nx_analyst_case_led.nx nx_analyst_html.nx nx_ledger_data_gate.nx nx_market_cmp.nx

imports: nx_analyst.nxnx_source_grade.nxnx_syscalls.nx

imported by: nx_analyst_case_led.nxnx_analyst_html.nxnx_ledger_data_gate.nxnx_market_cmp.nx

structs

none

consts

19const LD_MAX_SRC: i64 = 64
20const LD_MAX_NODE: i64 = 64
21const LD_MAX_EDGE: i64 = 256
22const LD_MAX_OPP: i64 = 4
25const LD_REL: i64 = 0 // *i64[LD_MAX_SRC]
26const LD_CRED: i64 = 1
27const LD_PARTY: i64 = 2
28const LD_METHOD: i64 = 3
29const LD_CLASS: i64 = 4
30const LD_PARENT: i64 = 5 // *i64[LD_MAX_NODE]
31const LD_VALUE: i64 = 6
32const LD_KIND: i64 = 7
33const LD_BNODE: i64 = 8 // *i64[LD_MAX_EDGE]
34const LD_BSRC: i64 = 9
35const LD_OPPA: i64 = 10 // *i64[LD_MAX_OPP]
36const LD_OPPB: i64 = 11
37const LD_NS: i64 = 12 // counts
38const LD_NN: i64 = 13
39const LD_NB: i64 = 14
40const LD_NC: i64 = 15
41const LD_TOL: i64 = 16 // thresholds
42const LD_MINTP: i64 = 17
43const LD_MAXRP: i64 = 18
44const LD_NT: i64 = 19 // how many T rows seen (must end at exactly 1)

functions

46func ld_alloc(st: *i64) -> i64
called by 1: ld_parse calls 1: sys_mmap
64func ld_line_end(b: *u8, i: i64, n: i64) -> i64
69func ld_skip(b: *u8, i0: i64, e: i64) -> i64
77func ld_int(b: *u8, j0: i64, e: i64, out: *i64) -> i64
called by 1: ld_ints calls 1: ld_skip
96func ld_ints(b: *u8, i0: i64, e: i64, k: i64, out: *i64) -> i64
called by 2: ld_linemc_line calls 2: sys_mmapld_int
110func ld_line(b: *u8, i: i64, e: i64, st: *i64) -> i64
173func ld_parse(b: *u8, n: i64, st: *i64) -> i64
186func ld_parse_file(path: *u8, st: *i64) -> i64
196func ld_class_best(st: *i64, node: i64, c: i64) -> i64
called by 1: ld_node_support calls 1: sg_score_permil
220func ld_node_support(st: *i64, node: i64, out: *i64) -> i64
264func ld_strict_kinds(st: *i64, skind: *i64) -> i64
285func ld_eval(st: *i64, out: *i64) -> i64