code wiki / (root) / nx_safetensors_load_gate.nx

nx_safetensors_load_gate.nx

buildroot/runtime/nx_safetensors_load_gate.nx

4183 B75 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic safetensors
docsdependenciesstructsconstsfunctions

about

nx_safetensors_load_gate.nx -- proof of the safetensors->f32 loader on a synthetic in-memory blob (header JSON + F32 and BF16 tensors), verifying header/offset parse + exact value reads. expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_f32_cvt.nx nx_safetensors_load.nx nx_safetensors_load_gate.nx

imports: nx_syscalls.nxnx_f32_cvt.nxnx_safetensors_load.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap put_str put_u64le put_u32le nx_i32_to_f32 stl_header_len stl_u64le stl_data_start stl_u64le ↻ gp sys_write gn sys_mmap ↻ sys_write ↻ stl_tensor stl_find sys_mmap ↻ stl_parse_int stl_streq stl_read_f32 stl_streq ↻ stl_u32le nx_f16_to_f32 stl_u16le sys_exit

structs

none

consts

none

functions

7func gp(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return sys_write(1, s, n) }
called by 1: main calls 1: sys_write
8func gn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
17func put_u64le(buf: *u8, off: i64, v: i64) -> i64 { var i: i64=0; while i<8 { buf[off+i]=((v>>(i*8))&0xff) as u8; i=i+1 } return 0 }
called by 1: main
18func put_u32le(buf: *u8, off: i64, v: i64) -> i64 { var i: i64=0; while i<4 { buf[off+i]=((v>>(i*8))&0xff) as u8; i=i+1 } return 0 }
called by 1: main
19func put_str(buf: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ buf[off+i]=s[i]; i=i+1 } return off+i }
called by 1: main
21func main(argc: i64, argv: *i64) -> i64