code wiki / _hdl_build / nx_optimize_suite_test.nx

nx_optimize_suite_test.nx

buildroot/runtime/_hdl_build/nx_optimize_suite_test.nx

5148 B101 linesdepth 8pulls 13 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_optimize_suite_test.nx -- the Nishi TEAM optimizing a SUITE autonomously (the mechanism for grinding benchmarks). For each kernel the loop: SEARCHES for a cheaper equivalent (e-graph superopt), MEASURES the cost gain, VERIFIES the candidate still evaluates equal (1:1), and the crew GOVERNS the swap -- absorbing real wins, correctly leaving already-optimal kernels alone. No hand-optimizing: the loop builds + optimizes. This is point-and-deliver in miniature. Suite: mul x K for K in {3,4,8,16,32}. K=2^k strength-reduces (mul->shl, cost 3->1, ABSORBED); K=3 has no cheaper equivalent (cost stays 3, DEFERRED -- the loop honestly banks no false win). Known answer: "absorbed=4 deferred=1 gain=8".

dependencies 2 imports · 0 importers

nx_superopt.nx nx_crew_council.nx nx_optimize_suite_test.nx

imports: nx_superopt.nxnx_crew_council.nx

imported by: nobody (leaf or entry point)

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

main cc_puts sys_write opt_one nx_eqsat_init nx_eqsat_add_var nx_eqsat_add nx_eqsat_op_is_valid nx_eqsat_arity_for nx_cf_intern_const nx_eqsat_add_const nx_eqsat_add ↻ nx_eqsat_mix nx_cf_make_const_node nx_eqsat_new_class nx_eqsat_find nx_eqsat_find ↻ nx_eqsat_fold_value nx_eqsat_op_to_gate_kind nx_gsim_kind_supported nx_eqsat_arity_for ↻ nx_eqsat_find ↻ nx_gsim_eval_cell nx_eqsat_op_cost nx_eqsat_new_class ↻ nx_eqsat_union_cited nx_eqsat_find ↻ nx_eqsat_log_rule nx_eqsat_push_dirty nx_eqsat_fingerprint nx_eqsat_mix ↻ nx_hmap_has nx_hmap_probe_find nx_hmap_hash nx_hmap_entry_at nx_hmap_get nx_hmap_probe_find ↻ nx_hmap_entry_at ↻ nx_eqsat_node_matches nx_eqsat_arity_for ↻

structs

none

consts

none

functions

17func opt_one(K: i64, nodes: *NxENode, classes: *NxEClass, g: *NxEGraph,
50func main() -> i64
calls 2: cc_putsopt_one