nx_recording_gate.nx
buildroot/runtime/nx_recording_gate.nx
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
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
structs
| none |
consts
| 26 | const W: i64 = 64 |
| 27 | const H: i64 = 64 |
| 28 | const CS: i64 = 8 // cell size px (W/8) |
| 29 | const N: i64 = 16 |
| 30 | const NEAR: i64 = 8 |
| 31 | const HOLD: i64 = 8 |
| 32 | const MINP: i64 = 4 |
functions
| 34 | func gp(logfd: i64, s: *u8) -> i64 |
| 41 | func gn(logfd: i64, v: i64) -> i64 |
| 58 | func hash_seeded(buf: *u8, seed: i64) -> i64 |
| 78 | func report(logfd: i64, label: *u8, hold: i64, lpf: i64, cls: i64) -> i64 |
| 89 | func main() -> i64 |