code wiki / _hdl_build / nx_dpendulum_gate.nx

nx_dpendulum_gate.nx

buildroot/runtime/_hdl_build/nx_dpendulum_gate.nx

6744 B138 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_dpendulum_gate.nx -- the DOUBLE PENDULUM, the continuous chaotic system named as the sim workstream's flagship "no-float determinism under chaos" vehicle (companion to the discrete nx_chaos_logistic_gate). Pure integer/no-float fixed point (all quantities x1e6 = "q"); reuses the Taylor sin/cos from nx_pendulum. Equal masses + lengths (m1=m2=1, l1=l2=1, g=9.8); full nonlinear COUPLED equations of motion (myphysicslab form), denom = 3 - cos(2(th1-th2)) in [2,4] => no singularity. Semi-implicit (symplectic-style) Euler: update omega from current theta, then theta from the new omega -- energy-bounded enough to integrate the chaotic regime over a short horizon. THREE measured properties + liar-kill (GREEN means it discriminates): (1) SENSITIVE DEPENDENCE: at LARGE amplitude (th1=th2=2.5 rad) two runs whose th2 differ by 1 micro-rad DIVERGE to O(1 rad) -- deterministic chaos. (2) DETERMINISM: the SAME integer run recomputed gives a BIT-IDENTICAL max-separation (no-float => exactly reproducible even under chaos = the Reproducibility-EXCEEDS property). (3) NEGATIVE CONTROL: the SAME integrator at SMALL amplitude (th1=th2=0.05 rad) is quasi-linear (two normal modes, NOT chaotic) -> the 1-micro-rad perturbation stays bounded/tiny. So the gate cannot be fooled into calling regular motion "chaos". GREEN needs all three. Sovereign: imports only nx_syscalls. Additive. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_dpendulum_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main dp_p dp_len sys_write dp_run_sep sys_mmap dp_step sin_fixed cos_fixed sin_fixed ↻ mulq dp_pn sys_mmap ↻ sys_write ↻ sys_exit

structs

none

consts

20const SC: i64 = 1000000 // x1e6 fixed-point scale
21const GQ: i64 = 9800000 // g = 9.8 in q
22const DTDIV: i64 = 1000 // dt = 1ms: x += rate/1000

functions

24func dp_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: dp_p
25func dp_p(s: *u8) -> i64 { let n: i64 = dp_len(s); sys_write(1, s, n); return 0 }
called by 1: main calls 2: dp_lensys_write
26func dp_pn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
37func sin_fixed(Xin: i64) -> i64
called by 2: cos_fixeddp_step
49func cos_fixed(X: i64) -> i64 { return sin_fixed(X + 1570796) }
called by 1: dp_step calls 1: sin_fixed
52func mulq(a: i64, b: i64) -> i64 { return a * b / SC }
called by 1: dp_step
55func dp_step(s: *i64) -> i64
called by 1: dp_run_sep calls 3: sin_fixedcos_fixedmulq
86func dp_run_sep(th0: i64, pert: i64, n: i64) -> i64
called by 1: main calls 2: sys_mmapdp_step
104func main() -> i64