code wiki / _hdl_build / nx_h264_research_run.nx
nx_h264_research_run.nx source
↩ module page · 31 lines · 1872 B
1// nx_h264_research_run.nx -- the SOVEREIGN half of the H.264-codec research pass.
2// Fetch was done by the tool layer (WebFetch -> knowledge/fetched/h264_codec_research.txt);
3// this drives the team's deterministic sovereign extractor (ce_extract) over it.
4// Fetch = tool; extract = Nishi. Mirrors _research_run.nx. license_tier: ORIGINAL
5import "nx_claim_extract.nx"
6import "nx_itoa_lib.nx" // shared MSB-first emitter (zero-alloc)
7import "nx_syscalls.nx"
8const K_MAGIC_262144: i64 = 262144
9const K_MAGIC_262143: i64 = 262143
10
11func rr_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
12// MIGRATED to the shared emitter (debt 1785563586). The old body mmapped a scratch buffer
13// per call and never freed it. At PAGE granularity that is 4096B leaked PER CALL -- the
14// defect that took 28.5GB of a 36GB host in nx_ts_lumadiff (2MB input, ~3.66M calls).
15// nxi_* is MSB-first, allocates NOTHING, and emits identical bytes including the sign.
16func rr_putn(v: i64) -> i64 { nxi_out(v); return 0 }
17
18func main() -> i64 {
19 let buf: *u8 = sys_mmap(K_MAGIC_262144)
20 let n: i64 = ce_read_file("knowledge/fetched/h264_codec_research.txt" as *u8, buf, K_MAGIC_262143)
21 if n <= 0 { rr_puts("NISHI-EXTRACT: fetched H.264 research file not found/empty\n" as *u8); sys_exit(1); return 1 }
22 let out: *i64 = sys_mmap(64) as *i64
23 let facts: i64 = ce_extract(buf, n, out)
24 rr_puts("NISHI-EXTRACT (sovereign ce_extract) over tool-fetched H.264 codec research:\n bytes=" as *u8); rr_putn(n)
25 rr_puts(" sentences=" as *u8); rr_putn(out[0])
26 rr_puts(" fact_claims(number+unit)=" as *u8); rr_putn(out[1])
27 rr_puts(" first_claim_value=" as *u8); rr_putn(out[2])
28 rr_puts("\n decision: H.264 first (broadest); VP9+H.265 follow-ups; rung-1 multi-codec classifier validated.\n" as *u8)
29 sys_exit(0)
30 return 0
31}