code wiki / _hdl_build / nx_tamper_lit.nx
nx_tamper_lit.nx
buildroot/runtime/_hdl_build/nx_tamper_lit.nx
about
nx_tamper_lit.nx -- TAMPER_PROOF organ (mainless module): deterministically
corrupt the Nth long decimal literal in a source file, in place. Used by the
math rung-runner to make the honesty proof MECHANICAL: tamper -> gate must go
RED -> regenerate from the emitter -> gate must return GREEN.
"Long literal" = a run of >= 17 decimal digits (f64 raw constants are 18-19
digits; nothing else in kernel sources is that long; hex literals are 0x..
and never qualify). The flip targets the MIDDLE digit of the run: that is a
~2^-32 RELATIVE change to the constant -- a guaranteed multi-thousand-ulp
defect on a load-bearing constant (the weak-tamper lesson: a LAST-digit flip
is sub-ulp and the gate honestly stays GREEN). Which literal is load-bearing
is per-kernel knowledge: the caller passes skip (0 = first long run) from the
rung table (e.g. sincos/sinhcosh skip their quantization-only 2/pi / 1/ln2
rows, whose corruption only matters within 2^-23 of rounding boundaries).
license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_math_rung_run.nx
structs
| none |
consts
| 18 | const K_MAGIC_524288: i64 = 524288 |
| 19 | const K_MAGIC_524287: i64 = 524287 |
functions
| 22 | func tl_flip(path: *u8, skip: i64) -> i64 |