code wiki / _hdl_build / nx_hf_tree_parse_gate.nx
nx_hf_tree_parse_gate.nx
buildroot/runtime/_hdl_build/nx_hf_tree_parse_gate.nx
about
nx_hf_tree_parse_gate.nx -- GATE for nx_hf_tree_parse (M2b: per-shard path/size/sha256 for a verified pull).
Over a real-shaped HF tree fixture (a non-LFS config.json + one LFS .safetensors shard whose top-level "size"
is the pointer size 99 but whose lfs "size" is the REAL 16060 -> proves we read the LFS size, not the pointer):
T1 shard count hft_count(".safetensors") == 1
T2 lfs count hft_count("\"lfs\":{\"oid\":\"") == 1
T3 lfs sha256 hft_lfs_oid -> the exact 64-hex digest (= what the orchestrator fail-closed verifies against)
T4 real file size hft_num_field from the oid -> 16060 (the lfs size, NOT the 99 pointer size)
T5 paths in order path[0]="config.json", path[1]="model-00001-of-00002.safetensors"
GREEN iff T1-T5 pass. Sovereign nx_cc->nxasm. expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_hf_tree_parse.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 13 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 14 | func wn(v: i64) -> i64 { var m: i64=v; if m<0{w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 15 | func streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while 1==1 { if a[i]!=b[i] {return 0} if a[i]==(0 as u8) {return 1} i=i+1 } return 1 } called by 1: main |
| 17 | func main() -> i64 |