code wiki / _hdl_build / nx_opt_eqsat_pass_gate.nx
nx_opt_eqsat_pass_gate.nx
buildroot/runtime/_hdl_build/nx_opt_eqsat_pass_gate.nx
about
nx_opt_eqsat_pass_gate.nx -- proves opt_eqsat_pass REWRITES REAL IR, and that it reaches an
expression the shipping pipeline structurally cannot.
THE MONEY TOOTH is a head-to-head on ONE function: build `x ^ x` where x is a runtime parameter,
run the INCUMBENT opt_const_fold first and require it to fold NOTHING (it needs both operands
constant, so it cannot see this), then run opt_eqsat_pass and require it to fold exactly one
instruction to the constant 0. A pass that merely duplicated the incumbent would fail that pair.
WHY THIS IS NOT A STUB CARRYING A CONTRACT NAME: the flip law says a completion signal keyed on a
symbol rewards writing the symbol. So this gate does not ask whether opt_eqsat_pass EXISTS -- it
asks whether a Value that was an XOR instruction is a CONSTANT afterwards, and whether the number
the incumbent folded on the same input was zero. Those are properties of the program, not the name.
license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_gate_verdict.nxnx_opt.nxnx_opt_eqsat_pass.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
| 19 | func main() -> i64 |