code wiki / _hdl_build / nx_eqsat_bw_witness_gate.nx

nx_eqsat_bw_witness_gate.nx

buildroot/runtime/_hdl_build/nx_eqsat_bw_witness_gate.nx

3875 B72 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic eqsat
docsdependenciesstructsconstsfunctions

about

nx_eqsat_bw_witness_gate.nx -- the BOUNDED-WIDTH TRUNCATION GATE underneath the whole mul_pow2 rule. CLAIM, proven exhaustively: for a W-bit machine with mask = 2^W - 1, ((x * 2^k) & mask) == ((x << k) & mask) for ALL x in [0, 2^W) and ALL k in [0, W). That is the mul-to-shl identity in mod-2^W arithmetic, which is the form the shipping optimizer actually needs: real registers truncate, so an identity holding only over the integers is not the one being relied on. PROMOTED FROM A THROWAWAY 2026-08-14 and RENAMED in the same pass. Its own header called it a throwaway witness, it had NEVER BEEN COMPILED, and its verdict was an exit code nothing could read. A 1,048,576-vector exhaustive check of the semantics every other eqsat proof leans on is not throwaway work -- it is the floor those proofs stand on, and it was treated as scaffolding because of a word in a comment. WHY THE NAME CHANGED: /api/gate_run executes verifiers ONLY and requires a name ending in gate, test or kat -- the bound that stops that route reaching a daemon or deployer. The old name could be built and promoted but never RUN through the gate door, so it would have joined the promoted-but-uninvokable pile. The predecessor path is retired, not deleted. ANTI-VACUITY, WHICH THE ORIGINAL LACKED: `agree == total` is TRUE OVER AN EMPTY SWEEP, and also for a degenerate run where every value is zero -- an equality between two always-zero quantities proves nothing about multiplying or shifting. So the sweep length is asserted against its own arithmetic AND the run must produce non-zero values that COULD have differed. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_eqsat_bw_witness_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.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 ↻ gv_check gv_puts ↻ gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_puts ↻ gv_num ↻ gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻

structs

none

consts

31const BW_WIDTH_BITS: i64 = 16

functions

33func main() -> i64