code wiki / _hdl_build / nx_div_pick_test.nx

nx_div_pick_test.nx

buildroot/runtime/_hdl_build/nx_div_pick_test.nx

2167 B44 linesdepth 11pulls 13 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_div_pick_test.nx -- proves the hardware-adaptive divider picker selects the OPTIMAL divider per target, reproducing the honest crossover BY MEASUREMENT (not hardcoded). The Seed's "grow to the hardware" mechanism, gated. From the proven honest latency race (nx_latency_metric_test): W=16: r2=181 r4=139 Newton-shallow=166 Newton-deep=363 -> radix-4 optimal W=64: r2=967 r4=743 Newton-shallow=320 Newton-deep=709 -> Newton optimal So the picker must choose: W16 -> R4 (1) for BOTH multiplier models; W64 -> NEWTON (2) for BOTH (shallow 320 and deep 709 both beat r4's 743). The sign-flip R4->NEWTON across width IS the multiplicative-divider frontier, chosen optimally. Known answer (FAIL LOUD): "1 1 2 2" rc=0 (p16_shallow p16_deep p64_shallow p64_deep).

dependencies 1 imports · 0 importers

nx_div_pick.nx nx_div_pick_test.nx

imports: nx_div_pick.nx

imported by: nobody (leaf or entry point)

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

main nx_div_pick nxdp_newton_iters nx_lat_log2_ceil nxdp_gsim nx_div_synth nx_sink_init_mem nx_div_synth_sink nx_sink_const nx_hdl_wire nx_hdl_signal_alloc nx_sink_cell nx_hdl_wire ↻ sys_mmap nx_lat_honest nx_lat_critical_path nx_gsim_kind_supported nx_lat_kind_weight nx_lat_log2_ceil ↻ nx_div_synth_r4 div_const div_op2 div_mux nx_newton_struct div_const ↻ div_op2 ↻ nx_newton_mulprod nx_mul_wide_synth nx_sink_init_mem ↻ nx_mul_wide_sink nx_sink_const ↻ nx_sink_cell ↻ div_op2 ↻ div_mux ↻ _emit_num _nl

structs

none

consts

none

functions

16func _emit_num(v: i64) -> i64
called by 1: main
24func _nl() -> i64 { let z: *u8 = sys_mmap(2); z[0] = 10; sys_write(1, z, 1); return 0 }
called by 1: main
26func main() -> i64