code wiki / _hdl_build / _rt_bad.nx

_rt_bad.nx source

↩ module page · 6 lines · 575 B

1// _rt_bad.nx -- DISCRIMINATION FIXTURE for pe16: a BROKEN inverse pair (decode does NOT invert 2// encode) -> the round-trip MUST fail -> the emitted gate MUST go RED. Proves pe16's gate is 3// no-false-green (not a rubber stamp). license_tier: ORIGINAL (test fixture) 4import "nx_syscalls.nx" 5func _rt_bad_encode(src: *u8, n: i64, dst: *u8) -> i64 { var i: i64 = 0; while i < n { dst[i] = (((src[i] & 255) + 90) & 255) as u8; i = i + 1 } return n } 6func _rt_bad_decode(enc: *u8, m: i64, out: *u8) -> i64 { var i: i64 = 0; while i < m { out[i] = enc[i]; i = i + 1 } return m }