code wiki / _hdl_build / nx_kfd_gate.nx

nx_kfd_gate.nx

buildroot/runtime/_hdl_build/nx_kfd_gate.nx

3470 B49 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_kfd_gate.nx -- gate for the native-Linux AMD executor (nx_kfd). Verifies the LOCALLY-verifiable core: a composed minimal PM4 COMPUTE DISPATCH stream (SET_SH_REG + DISPATCH_DIRECT) has the documented packet headers + structure, and reports the device-iface (on WSL2 /dev/kfd ABSENT -> EXECUTE cloud-pending on an AMD instance). No hw writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_kfd.nx nx_pm4_asm.nx nx_kfd_gate.nx

imports: nx_syscalls.nxnx_kfd.nxnx_pm4_asm.nx

imported by: nobody (leaf or entry point)

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

main bp sys_write kfd_open sys_openat_rd sys_close bd sys_mmap sys_write ↻ sys_mmap ↻ pm4_compose_dispatch pm4_ring_put pm4_packet3 chk bp ↻ bx bp ↻ sys_mmap ↻ sys_write ↻ rget sys_exit

structs

none

consts

none

functions

9func bp(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 3: bxchkmain calls 1: sys_write
10func bx(v: i64) -> i64 { bp("0x" as *u8); let bb:*u8=sys_mmap(20); var k:i64=0; var m:i64=v; if m==0{bb[0]=48 as u8;k=1} while m>0{ let d:i64=m&15; if d<10{bb[k]=(48+d) as u8}else{bb[k]=(87+d) as u8}; m=(m>>4); k=k+1 } var i:i64=0; let o:*u8=sys_mmap(20); while i<k{o[i]=bb[k-1-i];i=i+1} sys_write(1,o,k); return 0 }
called by 1: chk calls 3: bpsys_mmapsys_write
11func bd(v: i64) -> i64 { let p: *u8=sys_mmap(1); p[0]=(48+v) as u8; sys_write(1,p,1); return 0 }
called by 1: main calls 2: sys_mmapsys_write
12func rget(ring: *u8, off: i64) -> i64 { return (ring[off] as i64)|((ring[off+1] as i64)<<8)|((ring[off+2] as i64)<<16)|((ring[off+3] as i64)<<24) }
called by 1: main
14func chk(name: *u8, got: i64, ref: i64, st: *i64) -> i64
called by 1: main calls 2: bpbx
20func main() -> i64