nx_logadd_gate.nx
buildroot/runtime/nx_logadd_gate.nx
about
nx_logadd_gate.nx -- GATE for the fixed-point log-domain library (nx_logadd_lib), driven IN-PROCESS with no fixture:
its subject is arithmetic, so every tooth is a known-answer test against values derived by hand from ln 2, e and
ln 3 (S = 1024 units per nat), plus the structural laws a log-sum-exp must obey (identity with minus infinity,
symmetry, bounds, monotone tables, a three-way partition that sums to one, determinism across two inits) and one
neg-control (a positive argument to the probability reader is clamped AND counted, never silently accepted).
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_logadd_lib.nxnx_gate_verdict.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
| 11 | const G_LN2_Q10: i64 = 710 // 1024 * ln 2 = 709.78 |
| 12 | const G_LN3_Q10: i64 = 1125 // 1024 * ln 3 = 1125.03 |
| 13 | const G_SOFTPLUS_1: i64 = 321 // 1024 * ln(1 + e^-1) = 320.78 |
| 14 | const G_INV_E_Q10: i64 = 377 // 1024 / e = 376.71 |
| 15 | const G_INV_E2_Q10: i64 = 139 // 1024 / e^2 = 138.58 |
| 16 | const G_TOL: i64 = 1 // one Q10 unit: the table's own quantisation |
| 17 | const G_TOL_SUM: i64 = 3 // a three-way partition may lose one unit per rounding |
| 18 | const G_THIRD_Q10: i64 = 341 // 1024 / 3 = 341.33 |
| 19 | const G_FAR: i64 = 0 - 20000 // well past the horizon |
| 20 | const G_EXP_UNIT_Q30: i64 = 1072693760 // 2^30 * e^(-1/1024) = 1,072,693,759.83 |
functions
| 22 | func main() -> i64 |