code wiki / (root) / nx_arrhenius_crosscheck_test.nx

nx_arrhenius_crosscheck_test.nx

buildroot/runtime/nx_arrhenius_crosscheck_test.nx

12794 B236 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_arrhenius_crosscheck_test.nx -- do the ecosystem's TWO independent Arrhenius implementations agree? ===== WHY THIS EXISTS INSTEAD OF A REFACTOR ===================== nx_arrhenius.nx (seed-storage / soil-respiration lane) and nx_stability.nx (food + pharma stability lane) both compute how much faster a reaction runs when it gets warmer. Two implementations of one physical law is normally drift waiting to happen -- it is exactly what nx_pow10 was extracted to prevent -- so the obvious move is to collapse them into one. THAT WOULD DESTROY EVIDENCE. These two do not merely differ in style: - nx_arrhenius works in the NATURAL base, via nx_exp_q10 - nx_stability works in BASE TEN, via ipow10_q3 - nx_arrhenius uses Q10 fixed point (1024 = 1.0) - nx_stability uses Q3 fixed point (1000 = 1.0) - the reciprocal-temperature step is scaled completely differently Nothing is shared between them but the physics. So if they AGREE, that agreement is an independent cross-validation of both -- the same reason nx_icecream_balance is gated against nx_icecream rather than merged into it, and the same reason nx_peptide_formula's atom-count path is kept separate from the residue-sum path. Merging turns evidence into a tautology: one implementation can only ever agree with itself. So this gate MEASURES the agreement and keeps both. The DRY debt is answered by proving the copies converge, not by deleting one of them. The comparison: for the same Ea and the same temperature pair, nx_arrhenius: ratio_q10 = exp((-Ea/R)(1/T2 - 1/T1)) [1024 = 1.0] nx_stability: ratio_q3 = 10^(E10/T1 - E10/T2), E10 = Ea/(R ln10) which are the same number in two bases. Rescaled to a common Q3 they must land on top of each other. expect_exit: 0 license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_pow10.nx nx_stability.nx nx_arrhenius.nx nx_arrhenius_crosscheck_test.n

imports: nx_syscalls.nxnx_pow10.nxnx_stability.nxnx_arrhenius.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main stab_ich_ea_j stab_ea_from_equivalence ilog10_milli ipow10_mantissa_q3 stab_c_to_centi_kelvin stab_rate_ratio_q3 stab_e10_milli_kelvin stab_e10_over_t_milli stab_c_to_centi_kelvin ↻ ipow10_q3 ipow10_mantissa_q3 ↻ arrh_rate_ratio_as_q3 nx_arrh_celsius_to_kelvin_ nx_arrh_rate_ratio_q10 nx_exp_q10 nx_exp_q10_neg _nx_exp_table_get t_puts sys_write t_putn sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_write ↻ iabs nx_arrh_harrington_longevi nx_arrh_rate_ratio_celsius

structs

none

consts

none

functions

40func t_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
41func t_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { m = 0 - m; sys_write(1, "-" as *u8, 1) } let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } var i: i64 = 0; while i < k { bb[i] = t[k - 1 - i]; i = i + 1 } sys_write(1, bb, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
42func iabs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: main
47func stab_rate_ratio_q3(ea_j: i64, t1_c: i64, t2_c: i64) -> i64
59func arrh_rate_ratio_as_q3(ea_j: i64, t1_c: i64, t2_c: i64) -> i64
71func main() -> i64