code wiki / _hdl_build / nx_param_joint.nx

nx_param_joint.nx

buildroot/runtime/_hdl_build/nx_param_joint.nx

4672 B96 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_param_joint.nx -- X-PRM-004 (PRMJOINT-pairs-swept): the JOINT pair-sweep rung for COUPLED knobs. The terrace lesson (params.tsv procgen_coupled_knobs): greedy single-variable tuning ZEROES peaks that are only reachable by moving two coupled knobs TOGETHER -- coordinate ascent stalls on the terrace because every single-knob step from the start goes DOWN into the coupling valley. This organ is the generic pair-sweep harness + the proof: POS (coupled): a terrace fitness whose peak (a>=H AND b>=H)=100 sits behind a valley (single moves =5 < start=10). JOINT grid-sweep finds 100; GREEDY coordinate-ascent stalls at 10. joint_wins = (coupled_joint > coupled_greedy). NEG (separable): f=a+b has NO coupling, so greedy is already optimal -- JOINT must NOT beat it (no_false_win = (sep_joint == sep_greedy)). Proves the harness only claims a win on REAL coupling, never a spurious one. Honest scope: the fitness here is a synthetic terrace MODEL of coupled knobs (capability proof); wiring the live grader WIN floor as the fitness is the follow-on (cf. nx_param_tune rung2 note). Sovereign (nx_cc->nxasm_x86, no gcc). license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_param_joint.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 pj_joint pj_eval pj_fit_coupled pj_fit_sep pj_greedy pj_eval ↻ pj_w sys_write pj_n sys_mmap sys_write ↻

structs

none

consts

16const K_MAGIC_1000000000: i64 = 1000000000

functions

18func pj_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: main calls 1: sys_write
19func pj_n(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {sys_write(fd,"-" as *u8,1); m=0-m}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;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(fd, bb, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
22func pj_fit_coupled(a: i64, b: i64) -> i64
called by 1: pj_eval
30func pj_fit_sep(a: i64, b: i64) -> i64 { return a + b }
called by 1: pj_eval
32func pj_eval(coupled: i64, a: i64, b: i64) -> i64
38func pj_joint(coupled: i64, lo: i64, hi: i64) -> i64
called by 1: main calls 1: pj_eval
55func pj_greedy(coupled: i64, lo: i64, hi: i64) -> i64
called by 1: main calls 1: pj_eval
67func main() -> i64