code wiki / (root) / nx_video_h2h_gate.nx

nx_video_h2h_gate.nx

buildroot/runtime/nx_video_h2h_gate.nx

15338 B264 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic video
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gate_verdict.nx nx_gatekit_lib.nx nx_bench_receipt_lib.nx nx_video_h2h_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_gatekit_lib.nxnx_bench_receipt_lib.nx

imported by: nobody (leaf or entry point)

structs

none

consts

17const G_DIR: *u8 = "/tmp/nx_video_h2h_gate"
18const G_MODE_DIR: i64 = 493
19const G_MODE_RW: i64 = 420
20const G_N: i64 = 300
21const G_T0: i64 = 1000000
22const G_IV_MS: i64 = 33
23const G_LAT_MS: i64 = 120
24const G_LAT2_MS: i64 = 200
25const G_DROP_FROM: i64 = 50
26const G_DROP_TO: i64 = 60
27const G_W: i64 = 352
28const G_H: i64 = 288
29const G_PLANE: i64 = 101376
30const G_TXT_CAP: i64 = 262144
31const G_OUT_CAP: i64 = 65536
32const G_PATTERN_MOD: i64 = 250
33const G_SNAP_A: i64 = 30
34const G_SNAP_B: i64 = 60
35const G_EXP_DELIVERED: i64 = 966
36const G_EXP_STALL_MAX: i64 = 363
37const G_EXP_EFF_FPS_MILLI: i64 = 29289
38const G_EXP_PSNR_PLUS1_CDB: i64 = 4813
39const G_PSNR_TOL: i64 = 20
40const G_FPS_TOL_PERMIL: i64 = 10
41const G_PSNR_CAP_CDB: i64 = 9900
42const G_US_PER_MS: i64 = 1000
43const G_EXIT_VOID: i64 = 1
44const G_EXIT_UNMEASURABLE: i64 = 3

functions

46func g_cat(d: *u8, o: i64, s: *u8) -> i64 { return br_cat(d, o, s) }
called by 1: g_fixture calls 1: br_cat
47func g_catn(d: *u8, o: i64, v: i64) -> i64
called by 1: g_fixture calls 1: sys_mmap
60func g_writefile(path: *u8, buf: *u8, n: i64) -> i64
68func g_note_int(note: *u8, key: *u8) -> i64
91func g_has(s: *u8, needle: *u8) -> i64
106func g_fixture(path: *u8, lat_ms: i64, sha0: i64) -> i64
159func g_arm_index(arms: *i64, n: i64, name: *u8) -> i64
165func main(argc: i64, argv: *i64) -> i64