code wiki / (root) / nx_slopmeter_lib.nx

nx_slopmeter_lib.nx

buildroot/runtime/nx_slopmeter_lib.nx

7235 B150 linesdepth 1pulls 1 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_slopmeter_lib.nx -- MEASURE THE OUTPUT, NOT THE REGISTRY. u2605u2605u2605u2605u2605u2605A BOARD THAT SCORES YOUR TAXONOMY MEASURES YOUR INTENTIONS. nx_writebench reads 625 permil, and every one of its 28 axes asks whether we HAVE a registry, a gate or a lexicon for something. Not one of them looks at a single byte the generator actually produced. The board could reach 1000 while the product emits garbage, and nothing in the estate would notice -- because nothing in the estate reads the output. So this organ measures the artifact. It starts with the ONE axis that decides whether small-model prose is usable at all: DEGENERATE SELF-REPETITION. A 4B model asked for 1200 tokens loops -- it re-emits the same phrase with the same rhythm until the budget runs out. Humans call it slop; it is mechanically detectable and needs no judge, no model and no network to see. WHAT THIS IS NOT: a quality score. It cannot tell good prose from bad. It detects a specific, well-defined failure -- the text repeating itself -- and reports how much. Naming it honestly is the difference between an instrument and an advertisement. u2605A METRIC THAT CLAIMS MORE THAN IT MEASURES CORRUPTS EVERY DECISION MADE FROM IT. NO THRESHOLD LIVES HERE, DELIBERATELY. A verdict needs a cutoff, and a cutoff invented at the keyboard is exactly the magic number this estate keeps paying for. The organ REPORTS permil; the cutoff is a policy that belongs to a caller with measurements behind it. What the gate proves instead is MONOTONICITY -- degenerate text must score strictly above varied text -- which is threshold-free and cannot be satisfied by a broken meter. PURE: no syscalls, no allocation of its own, caller owns every buffer. license_tier: ORIGINAL module: nishi-core.write.slopmeter capability: WRITE_OUTPUT_REPETITION_MEASURE

dependencies 1 imports · 2 importers

nx_txtscan_lib.nx nx_slopmeter_lib.nx nx_slopmeter.nx nx_slopmeter_gate.nx

imports: nx_txtscan_lib.nx

imported by: nx_slopmeter.nxnx_slopmeter_gate.nx

structs

none

consts

31const SM_PERMIL: i64 = 1000
37const SM_NGRAM: i64 = 3
125const SM_UNMEASURABLE: i64 = 0 - 1

functions

39func sm_is_wordch(c: i64) -> i64
called by 1: sm_tokenize
50func sm_tokenize(buf: *u8, n: i64, starts: *i64, lens: *i64, cap: i64) -> i64
80func sm_tok_eq(buf: *u8, sa: i64, la: i64, sb: i64, lb: i64) -> i64
91func sm_gram_eq(buf: *u8, starts: *i64, lens: *i64, a: i64, b: i64) -> i64
called by 1: sm_repeat_count calls 1: sm_tok_eq
104func sm_repeat_count(buf: *u8, starts: *i64, lens: *i64, ntok: i64) -> i64
called by 1: sm_repeat_permil calls 1: sm_gram_eq
126func sm_repeat_permil(buf: *u8, starts: *i64, lens: *i64, ntok: i64) -> i64
called by 2: mainsg_rep calls 1: sm_repeat_count
136func sm_distinct_permil(buf: *u8, starts: *i64, lens: *i64, ntok: i64) -> i64
called by 2: mainsg_dist calls 1: sm_tok_eq