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

5133 B90 linesdepth 9pulls 18 transitivereach 0 importersview sourcekind gate/prooftopic opt
docsdependenciesstructsconstsfunctions

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

nx_gate_verdict.nx nx_opt.nx nx_opt_eqsat_pass.nx nx_opt_eqsat_pass_gate.nx

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

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ ir_type_i64 alloc_type sys_mmap ↻ ir_module_new sys_mmap ↻ ir_function_new sys_mmap ↻ diag_capacity_named nx_puts_err sys_write ↻ sys_write ↻ diag_put_dec sys_write ↻ sys_mmap ↻ sys_exit ↻ nx_assert_lt sys_write ↻ nx_puti_err sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

19func main() -> i64