code wiki / (root) / nx_vidclass_reality_check.nx

nx_vidclass_reality_check.nx source

↩ module page · 83 lines · 6342 B

1// nx_vidclass_reality_check.nx -- the HONESTY LOOP for the video-classification system (CLAUDE.md doctrine: 2// "SOTA ONLY WHEN MEASURED-BEAT-THE-TOOL"). An evidence-backed SOTA-GAP LEDGER that, per axis, states WHAT WE HAVE 3// (a gated sovereign organ) against the NAMED SOTA system for that axis, grounded in the researcher's banked PRIMARY 4// literature (knowledge/library/vidclass_lit_*.txt from OpenAlex/Crossref/Semantic-Scholar), and emits the standing. 5// Its PURPOSE is to AUTHORIZE claims: it PASSES (exit 0) only when every SOTA reference is grounded (the cited banked 6// file opens) AND every "ours" is gate-backed -- so no axis can silently over-claim. It deliberately AUTHORIZES only 7// the T1 deterministic signals (which we can honestly claim actionable today) and REFUSES any pose/action/dance SOTA 8// claim, whose honest gap = TRAINED WEIGHTS measured on the same public benchmark. LIAR-KILLED both directions. 9// license_tier: ORIGINAL expect_exit: 0 10import "nx_gate.nx" 11 12func rc_open(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } 13 14// one axis row. c=[grounded, ungrounded]. Grounded iff BOTH our gate source AND the banked SOTA source open. 15func rc_axis(label: *u8, ours: *u8, our_gate: *u8, sota: *u8, sota_src: *u8, standing: *u8, c: *i64) -> i64 { 16 let og: i64 = rc_open(our_gate) 17 let os: i64 = rc_open(sota_src) 18 if og == 1 { if os == 1 { c[0] = c[0] + 1; gw("[GROUNDED ] " as *u8) } } 19 if og == 0 { c[1] = c[1] + 1; gw("[UNGROUNDED] " as *u8) } 20 if og == 1 { if os == 0 { c[1] = c[1] + 1; gw("[UNGROUNDED] " as *u8) } } 21 gw(label); gw("\n" as *u8) 22 gw(" OURS : " as *u8); gw(ours); gw(" (gate: " as *u8); gw(our_gate); gw(")\n" as *u8) 23 gw(" SOTA : " as *u8); gw(sota); gw(" (banked: " as *u8); gw(sota_src); gw(")\n" as *u8) 24 gw(" STAND: " as *u8); gw(standing); gw("\n\n" as *u8) 25 return 0 26} 27 28func main() -> i64 { 29 let c: *i64 = sys_mmap(64) as *i64 30 c[0] = 0; c[1] = 0 31 gw("=== nx_vidclass_reality_check: measured standing vs NAMED SOTA, grounded in the banked primary literature ===\n" as *u8) 32 gw(" (GROUNDED = our gate source AND the banked SOTA source both open. The ledger PASSES only if it never over-claims.)\n\n" as *u8) 33 34 gw("-- T1 FOUNDATION: deterministic demux signals (no training) -- the ONLY axis we AUTHORIZE as a live claim --\n" as *u8) 35 rc_axis("activity / scene / dead-air / rhythm markers " as *u8, 36 "bitrate-relative demux markers (NXMK), self-calibrating, gate 9/9, LIVE on /gallery" as *u8, 37 "runtime/nx_ts_marks_gate.nx" as *u8, 38 "ffmpeg scene-score / black-frame / silence-detect + Plex/Jellyfin intro-skip heuristics" as *u8, 39 "knowledge/library/vidclass_lit_scene.txt" as *u8, 40 "COMPARABLE + HONEST: same CLASS of heuristic as the media-server tools; we run sovereign, no external decode. AUTHORIZED to claim as actionable." as *u8, c) 41 42 gw("-- T2 POSE: keypoints / posture --\n" as *u8) 43 rc_axis("body pose estimation " as *u8, 44 "f32 pose-CNN FORWARD (nx_pose_cnn 5/5) + keypoint back-half (nx_pose_keypoints 5/5) + skeleton posture (nx_pose_skeleton 6/6) -- architecture-complete, WEIGHTS-FREE" as *u8, 45 "runtime/nx_pose_cnn_gate.nx" as *u8, 46 "OpenPose (Part Affinity Fields, arXiv 1812.08008); HRNet/ViTPose-class heatmap nets on COCO-keypoints" as *u8, 47 "knowledge/library/vidclass_lit_pose.txt" as *u8, 48 "BEHIND: we have the SOVEREIGN ARCHITECTURE + arithmetic proven end-to-end, but NO trained weights -> no COCO-AP number. NOT a SOTA claim. Gap = trained weights measured on COCO-keypoints." as *u8, c) 49 50 gw("-- T3 ACTION / BEHAVIOR --\n" as *u8) 51 rc_axis("action / behavior recognition " as *u8, 52 "motion + rhythm + scene markers as CANDIDATE signals; no trained video classifier yet (no-float ML substrate present)" as *u8, 53 "runtime/nx_ts_marks_gate.nx" as *u8, 54 "Two-Stream ConvNets + Temporal Segment Networks; SlowFast/ViViT-class nets on Kinetics-400" as *u8, 55 "knowledge/library/vidclass_lit_action.txt" as *u8, 56 "NOT COMPARABLE: our markers are UNSUPERVISED cues, not a trained label. Kinetics top-1 is a different measurement. NOT a SOTA claim. Gap = a trained head + labeled data, benchmarked on Kinetics." as *u8, c) 57 58 gw("-- T3 DANCE-TYPE --\n" as *u8) 59 rc_axis("which-dance classification " as *u8, 60 "rhythm/tempo marker (ts_rhythm_marks, integer autocorrelation) detects PERIODIC motion; does NOT name the style" as *u8, 61 "runtime/nx_ts_marks_gate.nx" as *u8, 62 "dance-style CNN/RNN classifiers over pose sequences (labeled dance corpora)" as *u8, 63 "knowledge/library/vidclass_lit_dance.txt" as *u8, 64 "BEHIND: we detect THAT there is cadence, not WHICH dance. NOT a SOTA claim. Gap = a labeled dance corpus + a style head over the skeleton stream." as *u8, c) 65 66 let total: i64 = c[0] + c[1] 67 gw("--- LEDGER TALLY ---\n GROUNDED=" as *u8); gn(c[0]); gw(" UNGROUNDED=" as *u8); gn(c[1]); gw(" of " as *u8); gn(total); gw(" axes\n" as *u8) 68 69 gw("\n--- CLAIM AUTHORIZATION ---\n" as *u8) 70 gw(" AUTHORIZED (honest, live): the T1 deterministic marker layer -- activity / scene-cut / dead-air / rhythm --\n" as *u8) 71 gw(" is the SAME CLASS of signal the media servers ship, runs sovereign, and is actionable on arbitrary content NOW.\n" as *u8) 72 gw(" NOT AUTHORIZED (would be a lie): any pose / action / dance-type SOTA claim. We hold the sovereign ARCHITECTURE\n" as *u8) 73 gw(" (T2 pose forward+back+skeleton, all gated) but NO trained weights, so there is NO benchmark number to stand on.\n" as *u8) 74 gw(" The gap is exactly TRAINED WEIGHTS measured on the public benchmark (COCO-keypoints / Kinetics) -- the T3 arc.\n" as *u8) 75 76 if c[1] == 0 { 77 gw("\nREALITY-CHECK GREEN: every axis is grounded in the banked literature and NONE over-claims. Ledger is honest.\n" as *u8) 78 sys_exit(0) 79 } 80 gw("\nREALITY-CHECK RED: an axis is UNGROUNDED (missing banked source or gate) -- fix the grounding before any claim.\n" as *u8) 81 sys_exit(1) 82 return 0 83}