nx_kubelka_gate.nx
buildroot/runtime/nx_kubelka_gate.nx
about
nx_kubelka_gate.nx -- THE GATE FOR THE KUBELKA-MUNK CHROMOPHORE SUBSTRATE, 2026-09-03.
SUBJECT: km_r_from_ks / km_ks_from_r / km_ks_mix / km_r_of_mix in-process (the lib has no main).
WHAT MAKES THESE TEETH NON-VACUOUS. This model needs no external table to be falsifiable: it carries its
own oracle. The forward and the inverse are independent closed forms, so a ROUND TRIP over a ladder of
reflectances convicts either one of them being wrong -- a mistyped forward cannot invert back to where it
started. The physical checks are the ones that matter for skin: more melanin must be DARKER, more
haemoglobin must be DARKER, and reflectance must stay inside [0,1] for every input on the ladder.
Teeth, in order:
T1 zero absorption is unit reflectance, EXACTLY (not within a tolerance -- the algebra is exact there).
T2 the ladder is NON-DEGENERATE: it spans real range. Without this, T3 and T4 could pass on a constant.
T3 ROUND TRIP r -> K/S -> r over the whole ladder, every rung, no sampling.
T4 monotone: reflectance falls as K/S rises, strictly, across every adjacent pair.
T5 bounds: every reflectance on the ladder lies in [0,1].
T6 PHYSICAL: more melanin is strictly darker.
T7 PHYSICAL: more haemoglobin is strictly darker.
T8 NEG-CONTROL: a non-positive scattering coefficient REFUSES rather than dividing by zero.
T9 NEG-CONTROL: inverting a reflectance of zero REFUSES rather than returning an infinity as a number.
T10 NEG-CONTROL: inverting a reflectance above one REFUSES (outside the model's domain).
PROVEN 10/10 GREEN on the laptop build farm 2026-09-03 while the NAS build lane was storm-refused.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_kubelka_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 28 | const KG_SLOT: i64 = 8 |
| 29 | const KG_N: i64 = 9 |
| 30 | const KG_MICRO: i64 = 1000000 |
| 31 | const KG_RT_TOL_MICRO: i64 = 300 |
| 32 | const KG_SPAN_MIN_MICRO: i64 = 400000 |
| 33 | const KG_BAD_R_HIGH_MICRO: i64 = 1500000 |
functions
| 35 | func kg_q(micro: i64) -> i64 { return fq_div(fq_from_int(micro), fq_from_int(KG_MICRO)) } |
| 36 | func kg_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } called by 1: main |
| 38 | func main(argc: i64, argv: *i64) -> i64 |