code wiki / (root) / nx_recording_gate.nx

nx_recording_gate.nx

buildroot/runtime/nx_recording_gate.nx

7172 B185 linesdepth 6pulls 9 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_recording_gate.nx -- REFEREE for MEDIA-STUDIO R1 (nx_recording). Frames are 64x64, built as an 8x8 grid of 8px cells each set bright(255) or dark(0) by a seeded LCG, then fingerprinted through the REAL nx_phash aHash pipeline. Sequences of N=16 fingerprints exercise the classifier: LIVE : 16 distinct random frames -> no hold, no loop -> LIVE. HOLD : same frame x16 (frozen slate) -> max_hold=16 -> RECORDING. LOOP : 4 distinct frames cycled (period 4) -> recurrence -> RECORDING. FREEZE : distinct frames with a 3-frame freeze in the middle. NEG-CONTROL: a brief freeze (3 < hold_frames=8, gap < min_period=4) must NOT be called a recording -> stays LIVE. Proves hold needs to be SUSTAINED, not any near-match (the R1 analog of R0's 1px debounce). Plus a sanity check that distinct frames really differ (ham(live0,live1) > near) so a green can't come from degenerate all-equal hashes. Every measured value PRINTED. stdout + knowledge/status/recording_gate.log. Exit 0 GREEN / 1 RED. Sovereign: syscalls + nx_phash + nx_simhash + nx_recording. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

syscalls.nx nx_phash.nx nx_simhash.nx nx_recording.nx nx_recording_gate.nx

imports: syscalls.nxnx_phash.nxnx_simhash.nxnx_recording.nx

imported by: nobody (leaf or entry point)

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

main sys_openat_append gp gn hash_seeded nx_phash_ahash nx_phash_downscale nx_rec_max_hold nx_simhash_hamming nx_bits_popcount64_soft nx_rec_has_loop nx_simhash_hamming ↻ nx_rec_classify nx_rec_max_hold ↻ nx_rec_has_loop ↻ report gp ↻ gn ↻ nx_simhash_hamming ↻

structs

none

consts

26const W: i64 = 64
27const H: i64 = 64
28const CS: i64 = 8 // cell size px (W/8)
29const N: i64 = 16
30const NEAR: i64 = 8
31const HOLD: i64 = 8
32const MINP: i64 = 4

functions

34func gp(logfd: i64, s: *u8) -> i64
called by 2: reportmain
41func gn(logfd: i64, v: i64) -> i64
called by 2: reportmain
58func hash_seeded(buf: *u8, seed: i64) -> i64
called by 1: main calls 1: nx_phash_ahash
78func report(logfd: i64, label: *u8, hold: i64, lpf: i64, cls: i64) -> i64
called by 1: main calls 2: gpgn
89func main() -> i64