code wiki / (root) / nx_slopmeter_gate.nx

nx_slopmeter_gate.nx

buildroot/runtime/nx_slopmeter_gate.nx

6431 B119 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_slopmeter_gate.nx -- REFEREE for nx_slopmeter_lib (output repetition measurement). THE HARD PART IS PROVING A METER WITHOUT INVENTING A THRESHOLD. Any cutoff I picked here would be a magic number wearing a gate's authority. So the teeth are ORDERING and IDENTITY properties, which a broken meter cannot satisfy and which need no constant: [T1] u2605BITE: fires on looped text, silent on varied text -- the whole claim, stated once. [T2] MONOTONE: looped scores STRICTLY above varied. A meter that ranks them equal is useless even if both numbers look plausible. [T3] floor: text with no repeated 3-gram scores exactly 0 -- not "small", 0. [T4] ceiling: text that is one phrase looped scores the full scale. Both ends pinned means the scale is real and not a squashed middle. [T5] u2605the 2-gram trap: "she said ... she said" repeats a BIGRAM but no trigram. A 2-gram meter would condemn ordinary prose; this must read 0 and prove the width choice is load-bearing. [T6] tokenizer counts words, not bytes, and treats an apostrophe as interior. [T7] u2605NEG-CONTROL: text too short to contain a window returns SM_UNMEASURABLE, never 0 -- "no measurement was possible" must not be averaged in as "clean". [T8] distinct-vocabulary is an INDEPENDENT axis: all-unique text is 1000 permil, one word repeated is a small fraction of it. [T9] case-insensitivity: "The Map" and "the map" are the same phrase repeated. Hermetic: in-memory fixtures, no filesystem, no engine, no network. Sovereign x86_64. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_gate_verdict.nx nx_slopmeter_lib.nx nx_slopmeter_gate.nx

imports: nx_gate_verdict.nxnx_slopmeter_lib.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap gv_head gv_puts sys_write sg_rep tx_len sm_tokenize sm_is_wordch sm_repeat_permil sm_repeat_count sm_gram_eq sm_tok_eq tx_lower gv_bite gv_puts ↻ gv_check gv_puts ↻ sq sg_ntok tx_len ↻ sm_tokenize ↻ sg_dist tx_len ↻ sm_tokenize ↻ sm_distinct_permil sm_tok_eq ↻ gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻

structs

none

consts

27const SG_TOKCAP: i64 = 4096

functions

29func sq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
32func sg_rep(s: *u8) -> i64
39func sg_dist(s: *u8) -> i64
46func sg_ntok(s: *u8) -> i64
called by 1: main calls 2: tx_lensm_tokenize
53func main(argc: i64, argv: *i64) -> i64