code wiki / (root) / nx_smoke_dom_inspect.nx

nx_smoke_dom_inspect.nx source

↩ module page · 36 lines · 1238 B

1// Probe dom_test to see what b4.idom actually is. 2// nx_safety_envelope: 3// intended_use: AUTO_APPLIED -- primitive-specific tuning queued 4// sil_target: SIL1 5// evidence: [bulk_applied_2026-05-16, see-file-comment-for-detail] 6// verdict: NOT_YET_EVALUATED 7 8import "nx_syscalls.nx" 9import "nx_dom.nx" 10 11func main() -> i64 { 12 let buf: *u8 = sys_mmap(512) 13 let blocks: *Block = buf as *Block 14 let base: i64 = blocks as i64 15 16 let b0: *Block = (base + 0 * 80) as *Block 17 b0.id = 0; b0.n_succs = 1; b0.succ0 = 1; b0.n_preds = 0 18 19 let b1: *Block = (base + 1 * 80) as *Block 20 b1.id = 1; b1.n_succs = 2; b1.succ0 = 2; b1.succ1 = 3 21 b1.n_preds = 1; b1.pred0 = 0 22 23 let b2: *Block = (base + 2 * 80) as *Block 24 b2.id = 2; b2.n_succs = 1; b2.succ0 = 4; b2.n_preds = 1; b2.pred0 = 1 25 26 let b3: *Block = (base + 3 * 80) as *Block 27 b3.id = 3; b3.n_succs = 1; b3.succ0 = 4; b3.n_preds = 1; b3.pred0 = 1 28 29 let b4: *Block = (base + 4 * 80) as *Block 30 b4.id = 4; b4.n_succs = 0; b4.n_preds = 2; b4.pred0 = 2; b4.pred1 = 3 31 32 dom_compute(blocks, 5, 0) 33 34 // Return b4.idom + 100 so we distinguish 0/1/2/3 results. 35 return __syscall(93, 100 + b4.idom, 0, 0, 0, 0, 0) 36}