nx_video_h2h_gate.nx
buildroot/runtime/nx_video_h2h_gate.nx
about
nx_video_h2h_gate.nx -- THE REFEREE for the video head-to-head JUDGE (2026-09-02).
Subject: nx_video_h2h, the sovereign organ that turns raw strip samples into the video.bench receipt. The gate builds a
SYNTHETIC call whose truth is known in closed form -- a sender preview advancing one index every 33 ms, a receiver
showing the same indices 120 ms later with indices 50..59 never shown, two index-aligned luma snapshot pairs (one
identical, one shifted by exactly +1 everywhere) -- forks the judge on it and asks whether the receipt carries the numbers
the fixture planted: glass-to-glass 120000 us, 290 of 300 delivered (966 permil), one stall of 363 ms, the PSNR cap on the
identical pair and 48.13 dB on the +1 pair. Negative controls: a second file with a DIFFERENT card sha must read VOID, a
reference arm that does not exist must read UNMEASURABLE, and a fixture with a different planted latency must move the
median (the number is measured, not constant). A missing judge binary SKIPs (I could not look), never RED.
usage: nx_video_h2h_gate [judge-elf] (default _build/nx_video_h2h.sov.elf) exit: 0 GREEN . 1 RED . 3 SKIP
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_gatekit_lib.nxnx_bench_receipt_lib.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 17 | const G_DIR: *u8 = "/tmp/nx_video_h2h_gate" |
| 18 | const G_MODE_DIR: i64 = 493 |
| 19 | const G_MODE_RW: i64 = 420 |
| 20 | const G_N: i64 = 300 |
| 21 | const G_T0: i64 = 1000000 |
| 22 | const G_IV_MS: i64 = 33 |
| 23 | const G_LAT_MS: i64 = 120 |
| 24 | const G_LAT2_MS: i64 = 200 |
| 25 | const G_DROP_FROM: i64 = 50 |
| 26 | const G_DROP_TO: i64 = 60 |
| 27 | const G_W: i64 = 352 |
| 28 | const G_H: i64 = 288 |
| 29 | const G_PLANE: i64 = 101376 |
| 30 | const G_TXT_CAP: i64 = 262144 |
| 31 | const G_OUT_CAP: i64 = 65536 |
| 32 | const G_PATTERN_MOD: i64 = 250 |
| 33 | const G_SNAP_A: i64 = 30 |
| 34 | const G_SNAP_B: i64 = 60 |
| 35 | const G_EXP_DELIVERED: i64 = 966 |
| 36 | const G_EXP_STALL_MAX: i64 = 363 |
| 37 | const G_EXP_EFF_FPS_MILLI: i64 = 29289 |
| 38 | const G_EXP_PSNR_PLUS1_CDB: i64 = 4813 |
| 39 | const G_PSNR_TOL: i64 = 20 |
| 40 | const G_FPS_TOL_PERMIL: i64 = 10 |
| 41 | const G_PSNR_CAP_CDB: i64 = 9900 |
| 42 | const G_US_PER_MS: i64 = 1000 |
| 43 | const G_EXIT_VOID: i64 = 1 |
| 44 | const G_EXIT_UNMEASURABLE: i64 = 3 |
functions
| 46 | func g_cat(d: *u8, o: i64, s: *u8) -> i64 { return br_cat(d, o, s) } |
| 47 | func g_catn(d: *u8, o: i64, v: i64) -> i64 |
| 60 | func g_writefile(path: *u8, buf: *u8, n: i64) -> i64 |
| 68 | func g_note_int(note: *u8, key: *u8) -> i64 |
| 91 | func g_has(s: *u8, needle: *u8) -> i64 |
| 106 | func g_fixture(path: *u8, lat_ms: i64, sha0: i64) -> i64 |
| 159 | func g_arm_index(arms: *i64, n: i64, name: *u8) -> i64 |
| 165 | func main(argc: i64, argv: *i64) -> i64 |