code wiki / _hdl_build / _gpu_bm_gpfifo_gate.nx
_gpu_bm_gpfifo_gate.nx
buildroot/runtime/_hdl_build/_gpu_bm_gpfifo_gate.nx
about
_gpu_bm_gpfifo_gate.nx -- BARE-METAL SOVEREIGN-GPU rung BM-GPU-1: a spec-accurate sovereign NVIDIA GPFIFO
MODEL executes the SAME pushbuffer our emitter produces -> the semaphore payload lands in modeled GPU memory.
WHY: WSL GPU-PV gatekeeps execution (host translates the cmd buffer; raw pushbuffers ignored -- R5a payload-
independence test). The TRUE hardware-rung-up sovereign path is bare-metal (native Linux + PCIe/BAR0/doorbell).
This rung builds the development substrate + closes the loop WSL broke: a faithful model of the NVIDIA host/FIFO
(GF100 method-header decode + NVC56F semaphore-release semantics, straight from the open hardware spec) that
EXECUTES our sovereign pushbuffer. NISHI-ECOSYSTEM-ONLY: our model + our driver + our pushbuffer; the NVIDIA
command format is the last-mile hardware protocol (the benchmark to drive real iron), emitted+interpreted by us.
HONEST SCOPE: this verifies the command-emission + FIFO-execution LOGIC against a spec-accurate model (the same
way the driver-from-spec arc gates against gold device models). It does NOT execute on the real 5080 -- that is
the bare-metal PCIe/doorbell last-mile (when on native Linux owning the GPU). NO real silicon, NO throughput.
GREEN iff (author=organ): our emitted pushbuffer, run through the SPEC-FAITHFUL GPFIFO model, writes the exact
payload to the exact semaphore address; AND tampers (corrupt method offset / non-RELEASE op / short count) all
FAIL to write -> the model is faithful, so a real NVIDIA FIFO would behave identically.
Marker -> knowledge/status/gpu_baremetal.log (BMGPFIFOGATE). license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_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
| 21 | func p(s: *u8) -> i64 { var nn: i64=0; while s[nn]!=(0 as u8){nn=nn+1} sys_write(1,s,nn); return 0 } |
| 22 | func fp(fd: i64, s: *u8) -> i64 { var nn: i64=0; while s[nn]!=(0 as u8){nn=nn+1} sys_write(fd,s,nn); return 0 } |
| 23 | func n(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 } |
| 24 | func x(v: i64) -> i64 { p("0x" as *u8); let bb:*u8=sys_mmap(20); var k:i64=0; var m:i64=v; if m==0{bb[0]=48;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 } |
| 25 | func fx(fd: i64, v: i64) -> i64 { let bb:*u8=sys_mmap(20); var k:i64=0; var m:i64=v; if m==0{bb[0]=48;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 } let o:*u8=sys_mmap(20); var i:i64=0; while i<k{o[i]=bb[k-1-i];i=i+1} fp(fd,"0x" as *u8); sys_write(fd,o,k); return 0 } |
| 26 | func rd32(buf: *u8, off: i64) -> i64 { return (buf[off] as i64)|((buf[off+1] as i64)<<8)|((buf[off+2] as i64)<<16)|((buf[off+3] as i64)<<24) } |
| 27 | func wr32(buf: *u8, off: i64, val: i64) -> i64 { let w: *u8 = (buf as i64 + off) as *u8; w[0]=(val&0xff) as u8; w[1]=((val>>8)&0xff) as u8; w[2]=((val>>16)&0xff) as u8; w[3]=((val>>24)&0xff) as u8; return 0 } |
| 34 | func gpfifo_run(mem: *u8, pb_off: i64, pb_dwords: i64) -> i64 |
| 65 | func emit_pb(mem: *u8, pb_off: i64, sem_addr: i64, payload: i64, corrupt: i64) -> i64 |
| 80 | func main() -> i64 |