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

4218 B62 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic hf
docsdependenciesstructsconstsfunctions

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

nx_hf_tree_parse.nx nx_syscalls.nx nx_hf_tree_parse_gate.nx

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

main w sys_write hft_count wn w ↻ sys_mmap sys_write ↻ sys_mmap ↻ hft_lfs_oid hft_find hft_copy_hex hft_is_hex streq hft_num_field hft_find ↻ hft_parse_uint hft_path hft_find ↻ hft_copy_until sys_exit

structs

none

consts

none

functions

13func w(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 2: wnmain calls 1: sys_write
14func 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 }
called by 1: main calls 3: wsys_mmapsys_write
15func 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
17func main() -> i64