code wiki / (root) / nx_video_h2h.nx

nx_video_h2h.nx

buildroot/runtime/nx_video_h2h.nx

34958 B614 linesdepth 3pulls 6 transitivereach 0 importersview sourcekind tooltopic video
docsdependenciesstructsconstsfunctions

about

nx_video_h2h.nx -- THE VIDEO-CALL HEAD-TO-HEAD JUDGE, SOVEREIGN AND RECEIPTED (2026-09-02). Operator: "get nishifamily.com/video properly evaluated ... true jitsi and above performance ... using MSU VQMT as the benchmark and oracle ... native first byte up nishi on everything". Jitsi and native WebRTC are REFEREES here, never the direction: every arm plays the SAME index-strip test card (akiyo_cif + a machine-readable frame index burned into the top luma rows) through a real browser client, and the SAME 20 ms strip reader records what each receiver actually RENDERED. This organ is the only thing that computes or judges: the drivers dump raw samples and never a number. GLASS-TRUTH DELIVERY (per receiver): effective displayed fps, delivered fraction (distinct frames shown over the source index span), stalls (a gap longer than VH_STALL_MULT source intervals, the WebRTC freezeCount rule), glass-to-glass latency (receiver first shows index i minus the sender's own preview first showing index i -- one machine clock). FULL-REFERENCE FIDELITY (VQMT class): PSNR and SSIM of the received 352x288 luma against the SENDER'S preview of the same index (both rendered by the same browser pixel pipeline = the fair reference), strip band excluded, using the estate's sovereign metric organ nx_quality_metric (the seed of the sovereign VQMT; MS-SSIM/VMAF-class are the gap). Writes ONE receipt (<dom>.bench grammar, nx_bench_receipt_lib -- the reader the /compare generators and gates share): min_us/median_us = glass-to-glass latency, checksum = the test card (every arm must have played the same card or its row is VOID), note = the delivery + fidelity numbers. A receiver that never rendered a remote is a RUN-FAIL row that SAYS so, never a missing row. usage: nx_video_h2h <out.bench> <ref-arm-name> <samples.txt> [samples2.txt ...] (frames come from <samples>.frames.idx/.bin) exit: 0 VALID . 1 VOID (an arm played a different card) . 2 usage . 3 UNMEASURABLE (no ref arm / ref not VALID) license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_bench_receipt_lib.nx nx_quality_metric.nx nx_video_h2h.nx

imports: nx_syscalls.nxnx_bench_receipt_lib.nxnx_quality_metric.nx

imported by: nobody (leaf or entry point)

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

main vh_puts sys_write sys_exit vh_putn sys_mmap nxa_die sys_write ↻ sys_exit ↻ nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ vh_catn sys_mmap ↻ sys_write ↻ sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close vh_line_end vh_kv vh_copy_range vh_atoi_range vh_field vh_ser_find br_streq vh_role vh_has

structs

none

consts

24const VH_MAX_ROWS: i64 = 262144
25const VH_MAX_SERIES: i64 = 128
26const VH_KEY_BYTES: i64 = 160
27const VH_MAX_FILES: i64 = 8
28const VH_STR_BYTES: i64 = 512
29const VH_MAX_CHG: i64 = 65536
30const VH_MAX_FRAMES: i64 = 4096
31const VH_WRAP: i64 = 256
32const VH_HALF_WRAP: i64 = 128
33const VH_LAT_WINDOW_MS: i64 = 8000
34const VH_STALL_MULT: i64 = 3
35const VH_FREEZE_ADD_MS: i64 = 150 // WebRTC freezeCount: gap > max(3*avg_frame_duration, avg_frame_duration + 150 ms)
36const VH_SNAP_W: i64 = 352
37const VH_SNAP_H: i64 = 288
38const VH_STRIP_ROWS: i64 = 32
39const VH_MIN_PAIRS: i64 = 10
40const VH_MIN_DISTINCT: i64 = 30
41const VH_CAP_RECEIPT: i64 = 65536
42const VH_NOTE_BYTES: i64 = 1024
43const VH_MODE_RW: i64 = 420
44const VH_PATH: i64 = 1024
45const VH_EXIT_VALID: i64 = 0
46const VH_EXIT_VOID: i64 = 1
47const VH_EXIT_USAGE: i64 = 2
48const VH_EXIT_UNMEASURABLE: i64 = 3
49const VH_ROLE_IGNORE: i64 = 0
50const VH_ROLE_SELF: i64 = 1
51const VH_ROLE_REMOTE: i64 = 2
52const VH_FILE_STRIDE: i64 = 8
53const VH_F_ARM: i64 = 0
54const VH_F_HOST: i64 = 1
55const VH_F_CARDSHA: i64 = 2
56const VH_F_FPS: i64 = 3
57const VH_F_START: i64 = 4
58const VH_F_DUR: i64 = 5
59const VH_F_URLA: i64 = 6
60const VH_F_URLB: i64 = 7
61const VH_CH_NL: i64 = 10
62const VH_CH_HASH: i64 = 35
63const VH_CH_SPACE: i64 = 32
64const VH_CH_PIPE: i64 = 124
65const VH_CH_EQ: i64 = 61
66const VH_CH_MINUS: i64 = 45
67const VH_CH_ZERO: i64 = 48
68const VH_CH_A: i64 = 65
69const VH_CH_B: i64 = 66
70const VH_HEX_DIGITS: i64 = 15
71const VH_DEFAULT_FPS: i64 = 30
72const VH_MS_PER_S: i64 = 1000
73const VH_US_PER_MS: i64 = 1000
74const VH_PERMIL: i64 = 1000
75const VH_P90_NUM: i64 = 9
76const VH_P90_DEN: i64 = 10
77const VH_UA_KEEP: i64 = 96
78const VH_URL_KEEP: i64 = 200

functions

80func vh_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
81func vh_catn(dst: *u8, off: i64, v: i64) -> i64
called by 2: vh_putnmain calls 1: sys_mmap
94func vh_putn(v: i64) -> i64 { let b: *u8 = sys_mmap(32); let o: i64 = vh_catn(b, 0, v); sys_write(1, b, o); return 0 }
called by 1: main calls 3: sys_mmapvh_catnsys_write
96func vh_has(s: *u8, needle: *u8) -> i64
called by 2: vh_rolemain
110func vh_line_end(b: *u8, n: i64, p: i64) -> i64 { var e: i64 = p; while e < n { if b[e] == (VH_CH_NL as u8) { return e } e = e + 1 } return n }
called by 1: main
112func vh_field(b: *u8, s: i64, e: i64, k: i64, fs: *i64, fe: *i64) -> i64
called by 1: main
128func vh_atoi_range(b: *u8, s: i64, e: i64) -> i64
called by 1: main
141func vh_copy_range(dst: *u8, cap: i64, b: *u8, s: i64, e: i64) -> i64
called by 1: main
151func vh_kv(b: *u8, s: i64, e: i64, key: *u8, vs: *i64, ve: *i64) -> i64
called by 1: main
173func vh_hexval(c: i64) -> i64
called by 1: vh_hex15
180func vh_hex15(s: *u8) -> i64
called by 1: main calls 1: vh_hexval
192func vh_role(key: *u8) -> i64
called by 1: main calls 1: vh_has
207func vh_isort(a: *i64, n: i64) -> i64
called by 1: main
221func vh_write_atomic(path: *u8, buf: *u8, n: i64) -> i64
236func vh_ser_find(ser_file: *i64, ser_br: *i64, ser_keys: *u8, nser: i64, f: i64, br: i64, key: *u8) -> i64
called by 1: main calls 1: br_streq
248func vh_changes(ser: i64, row_ser: *i64, row_t: *i64, row_idx: *i64, nrows: i64, out_t: *i64, out_u: *i64, out_raw: *i64, cap: i64) -> i64
called by 1: main
270func main(argc: i64, argv: *i64) -> i64