nx_slopmeter_lib.nx
buildroot/runtime/nx_slopmeter_lib.nx
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
imports: nx_txtscan_lib.nx
imported by: nx_slopmeter.nxnx_slopmeter_gate.nx
structs
| none |
consts
| 31 | const SM_PERMIL: i64 = 1000 |
| 37 | const SM_NGRAM: i64 = 3 |
| 125 | const SM_UNMEASURABLE: i64 = 0 - 1 |
functions
| 39 | func sm_is_wordch(c: i64) -> i64 called by 1: sm_tokenize |
| 50 | func sm_tokenize(buf: *u8, n: i64, starts: *i64, lens: *i64, cap: i64) -> i64 |
| 80 | func sm_tok_eq(buf: *u8, sa: i64, la: i64, sb: i64, lb: i64) -> i64 |
| 91 | func sm_gram_eq(buf: *u8, starts: *i64, lens: *i64, a: i64, b: i64) -> i64 |
| 104 | func sm_repeat_count(buf: *u8, starts: *i64, lens: *i64, ntok: i64) -> i64 |
| 126 | func sm_repeat_permil(buf: *u8, starts: *i64, lens: *i64, ntok: i64) -> i64 |
| 136 | func sm_distinct_permil(buf: *u8, starts: *i64, lens: *i64, ntok: i64) -> i64 |