code wiki / _hdl_build / _gpu_dxg_open_gate.nx

_gpu_dxg_open_gate.nx

buildroot/runtime/_hdl_build/_gpu_dxg_open_gate.nx

10325 B137 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic gpu
docsdependenciesstructsconstsfunctions

about

_gpu_dxg_open_gate.nx -- SOVEREIGN-GPU ladder R2 (adapter-handle open from LUID). R0 reached the real GPU set (LX_DXENUMADAPTERS2). R1 positively IDed the discrete RTX 5080 by its ADAPTERTYPE bit. R2 takes that IDENTITY (the adapter's LUID) and opens a fresh kernel ADAPTER HANDLE for it through the raw /dev/dxg ioctl LX_DXOPENADAPTERFROMLUID (0xC00C4701, _IOWR(0x47,0x01,12)) -- the openable handle that LX_DXCREATEDEVICE (R3) will consume to make the WDDM device. ABI (WSL2-Linux-Kernel linux-msft-wsl-6.6.y, include/uapi/misc/d3dkmthk.h; recon-confirmed live): struct winluid { __u32 a; __u32 b; } // 8 bytes struct d3dkmt_openadapterfromluid { winluid adapter_luid(@0,IN); d3dkmthandle adapter_handle(@8,OUT); } GREEN iff (author=organ, from REAL device returns, never $?): A) enum ret==0 AND num_adapters>=2 AND exactly ONE discrete hw adapter (R1 identity holds); B) open(discrete LUID) ret==0 AND opened_handle != 0; C) opened discrete handle != the discrete adapter's ENUM handle (a FRESH kernel allocation, not an echo); D) open(integrated LUID) ret==0 AND its handle != 0 AND != the discrete handle (DISCRIMINATION: the open resolves the SPECIFIC adapter from its LUID, not "any adapter"); E) TAMPER matrix, each distinct from the real ret==0 AND yielding handle==0: T1 bogus LUID (0xdeadbeef) -> -EINVAL ; T2 bogus ioctl code (0x99..) ; T3 open on a non-dxg fd. The fd close releases the opened adapter handles (dxgkrnl frees per-fd handles on close). Marker -> knowledge/status/gpu_dxg.log (DXGOPENGATE). raw syscalls only (no libvulkan/cuda/dxcore/libc). NO-WAVE: this rung proves only "open a per-adapter kernel handle from the LUID". ZERO throughput/exceed. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx _gpu_dxg_open_gate.nx

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

main p sys_write sys_openat_rd sys_exit sys_mmap sys_ioctl n sys_mmap ↻ sys_write ↻ query_type sys_mmap ↻ sys_ioctl ↻ x p ↻ sys_mmap ↻ sys_write ↻ open_from_luid sys_mmap ↻ sys_ioctl ↻ sys_close sys_openat_append fp sys_write ↻ fx sys_mmap ↻ fp ↻ sys_write ↻

structs

none

consts

26const ENUM2_CODE: i64 = 0xC0104714 // LX_DXENUMADAPTERS2
27const QAI_CODE: i64 = 0xC0184709 // LX_DXQUERYADAPTERINFO (ADAPTERTYPE)
28const OAFL_CODE: i64 = 0xC00C4701 // LX_DXOPENADAPTERFROMLUID
29const OAFL_BOGUS: i64 = 0x990C4701 // magic-0x99 tamper of the open code

functions

31func p(s: *u8) -> i64 { var nn: i64=0; while s[nn]!=(0 as u8){nn=nn+1} sys_write(1,s,nn); return 0 }
called by 2: xmain calls 1: sys_write
32func 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 }
called by 2: fxmain calls 1: sys_write
33func 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 }
called by 1: main calls 2: sys_mmapsys_write
34func 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 }
called by 1: main calls 3: psys_mmapsys_write
36func 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 }
called by 1: main calls 3: sys_mmapfpsys_write
38func query_type(fd: i64, handle: i64, qtype: i64, psize: i64, outv: *i64) -> i64
called by 1: main calls 2: sys_mmapsys_ioctl
49func open_from_luid(fd: i64, code: i64, luid_lo: i64, luid_hi: i64, outh: *i64) -> i64
called by 1: main calls 2: sys_mmapsys_ioctl
57func main() -> i64