code wiki / _hdl_build / nx_research_phys_gate.nx

nx_research_phys_gate.nx

buildroot/runtime/_hdl_build/nx_research_phys_gate.nx

6207 B95 linesdepth 10pulls 13 transitivereach 0 importersview sourcekind gate/prooftopic research
docsdependenciesstructsconstsfunctions

about

nx_research_phys_gate.nx -- the research-engine reproducibility loop in the THIRD domain: PHYSICS (operator: "discover new capabilities through different math/chemistry/physics via simulations... s class exceed on research AND reproducibility"). RESEARCHER confirms the foundationed physics reference (CODATA Fundamental Physical Constants) is in the no-link-rot library. TESTING-TEAM simulates classical-mechanics events and REPRODUCES the known outcomes: elastic-collision velocities (incl. the Newton's-cradle equal-mass swap) and projectile kinematics (range/height/flight-time closed forms). VERIFIER checks the conservation laws and a liar-kill: an INELASTIC collision conserves momentum but VIOLATES kinetic-energy conservation -- which is exactly what distinguishes elastic from inelastic, so the verifier can't be fooled. Exact integer (no float). GREEN iff 6/6. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_library.nx nx_gate_verdict.nx nx_research_phys_gate.nx

imports: nx_syscalls.nxnx_library.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

main sys_mmap g_w sys_write rs_lib_contains sys_mmap ↻ lib_list cat_list ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat sys_fstatat ssc_streq ss_open ss_open2 ssc_retire_handle cat_idx_load sys_mmap ↻ ss_hget sys_mmap ↻ ss_idx_find cat_idx_key lib_get cat_get ar_get_by_cid ss_open_cached ↻ ss_hget ↻ rs_has el_v1 el_v2 momentum ke2 g_n g_w ↻ sys_mmap ↻ sys_write ↻ g_row g_w ↻

structs

none

consts

none

functions

14func g_w(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 3: g_ng_rowmain calls 1: sys_write
15func g_n(v: i64) -> i64 { var m: i64=v; if m<0{g_w("-");m=0-m} let t:*u8=sys_mmap(24); 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; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1}; sys_write(1,o,k); return 0 }
called by 1: main calls 3: g_wsys_mmapsys_write
16func g_row(id: *u8, ok: i64, pass: *i64) -> i64 { g_w(" "); g_w(id); g_w(": "); if ok==1 { g_w("OK\n"); pass[0]=pass[0]+1 } else { g_w("FAIL\n") } return 0 }
called by 1: main calls 1: g_w
18func rs_has(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: rs_lib_contains
25func rs_lib_contains(needle: *u8) -> i64
called by 1: main calls 4: sys_mmaplib_listlib_getrs_has
35func el_v1(m1: i64, m2: i64, u1: i64, u2: i64) -> i64 { return ((m1-m2)*u1 + 2*m2*u2) / (m1+m2) }
called by 1: main
36func el_v2(m1: i64, m2: i64, u1: i64, u2: i64) -> i64 { return ((m2-m1)*u2 + 2*m1*u1) / (m1+m2) }
called by 1: main
37func momentum(m1: i64, m2: i64, a: i64, b: i64) -> i64 { return m1*a + m2*b }
called by 1: main
38func ke2(m1: i64, m2: i64, a: i64, b: i64) -> i64 { return m1*a*a + m2*b*b } // 2x kinetic energy (avoids the 1/2)
called by 1: main
40func main() -> i64