code wiki / _hdl_build / nx_optimize_suite_test.nx
nx_optimize_suite_test.nx
buildroot/runtime/_hdl_build/nx_optimize_suite_test.nx
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
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
structs
| none |
consts
| none |
functions
| 17 | func opt_one(K: i64, nodes: *NxENode, classes: *NxEClass, g: *NxEGraph, |
| 50 | func main() -> i64 |