code wiki / _hdl_build / _dgseed900.nx

_dgseed900.nx source

↩ module page · 26 lines · 746 B

1// _dgseed900.nx -- the SEEDED miscompile pattern for the diff-harness catch 2// proof (R1-T1-003): 4-deep nested ifs (LM-002's forbidden shape). All four 3// conditions are TRUE by construction, so a correct build runs the innermost 4// statement: v becomes 5+2=7, odd -> sys_exit(1). Hand-computed expected 5// exit = 1. Any lane disagreement OR wrong exit = the harness's quarry. 6// license_tier: ORIGINAL 7import "nx_syscalls.nx" 8 9func main() -> i64 { 10 var v: i64 = 5 11 var a: i64 = 1 12 var b: i64 = 2 13 var c: i64 = 3 14 var d: i64 = 4 15 if a > 0 { 16 if b > 1 { 17 if c > 2 { 18 if d > 3 { 19 v = v + 2 20 } 21 } 22 } 23 } 24 sys_exit(v & 1) 25 return 0 26}