iwls_runner: pipeline driving mig_egg on IWLS 2026 contest benchmarks#9
Open
kvisaweb wants to merge 1 commit into
Open
iwls_runner: pipeline driving mig_egg on IWLS 2026 contest benchmarks#9kvisaweb wants to merge 1 commit into
kvisaweb wants to merge 1 commit into
Conversation
Two coupled pieces, intentionally atomic:
1. mig_egg/src/lib.rs (133-line diff)
- rules() switched to AIG-only. Majority-language rewrites are
commented out because they cannot fire on AIG-form input (& a b);
the 5 AND-language rules already defined in the file (comm_and,
comp_and, dup_and, and_true, and_false) are uncommented. associ_and
stays off because its O(N^2) match cost blows past node_limit on
dense ASTs.
- simplify_depth / simplify_best runners: iter_limit(1000) ->
iter_limit(10). egg's time_limit is best-effort and does not bound
a single iteration on large e-graphs; tightening iter_limit is what
actually keeps wall-clock bounded.
- New iwls_run test entry: reads $IWLS_PREFIX_FILE (one PO per line,
"<idx>\t<expr>"), calls simplify_best per PO, and prints
"iwls case <idx> best_expr[0] = <expr>" so a Python wrapper can
grep the optimized expressions out. $IWLS_FIRST_DEPTH={true,false}
chooses delay-first vs area-first cost.
2. iwls_runner/ (new top-level folder)
- 100 IWLS contest truth tables under benchmarks/ex2NN.truth.
- Pipeline: truth -> ABC strash -> AIG -> Lisp prefix
-> mig_egg simplify_best per PO -> EQN -> ABC strash + resyn2
-> binary AIGER -> ABC cec -n.
- scripts/aig_to_prefix.py + prefix_to_aig.py for the two conversions;
scripts/run_one_bench.py for end-to-end one bench;
scripts/run_all.py for parallel; scripts/finalize.py for
per-bench Pareto + cec + contest zip.
- examples/smoke_one.sh (ex212, ~30s) and examples/full_run.sh
(100 benches, ~30 min on 16 cores).
Quick start (with this branch checked out):
cd mig_egg && cargo build --release --tests --no-default-features
cd ../iwls_runner
export ELOGIC_REPO_DIR="$(cd .. && pwd)"
export ABC=/path/to/abc
bash examples/smoke_one.sh
Smoke validation (ex212): 1409 AND / lev 24 -> 571 AND / lev 11
(-59% area, -54% delay), cec equivalent, 1.94s wall.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a self-contained pipeline that drives
mig_eggon the IWLS 2026 contest benchmarks (100 truth tablesex200..ex299). Two coupled pieces in one atomic commit:1.
mig_egg/src/lib.rs(133-line diff)rules()switched to AIG-only: the 5 AND rewrites already defined in the file (comm_and,comp_and,dup_and,and_true,and_false) are uncommented; majority-language rules are off because they cannot fire on AIG-form input(& a b).associ_andstays off — its O(N²) match cost blows pastnode_limiton dense ASTs.simplify_depth/simplify_bestrunners:iter_limit(1000)→iter_limit(10)at three sites. egg'stime_limitis best-effort and does not bound a single iteration on large e-graphs; tighteningiter_limitis what actually keeps wall-clock bounded.iwls_runtest entry: reads$IWLS_PREFIX_FILE(one PO per line,<idx>\t<expr>), callssimplify_bestper PO, printsiwls case <idx> best_expr[0] = <expr>for the Python wrapper to grep.$IWLS_FIRST_DEPTH={true,false}switches delay-first vs area-first cost.2.
iwls_runner/(new top-level folder)benchmarks/scripts/aig_to_prefix.py+prefix_to_aig.pyfor the two conversionsrun_one_bench.py(end-to-end one bench),run_all.py(parallel runner),finalize.py(per-bench Pareto + cec verify + contest-shaped zip)examples/smoke_one.sh(ex212, ~30s) andexamples/full_run.sh(100 benches, ~30 min on 16 cores)Full pipeline:
truth→ ABCstrash→ AIG → Lisp prefix →mig_egg simplify_bestper PO → EQN → ABCstrash + resyn2→ AIG → ABCcec -n.Test plan
1409 AND / lev 24→571 AND / lev 11(−59% area, −54% delay), cec equivalent, 1.94s wallELOGIC_REPO_DIR,ABC) or package-relative; no hardcoded absolute paths.gitignorecoversresults/so per-run outputs don't leak into commitsnode_limit(5000)ceiling — that's a real saturation cap of the AIG ruleset on densely shared graphs, not a timeout)Quick start
Full doc in
iwls_runner/README.mdon the branch.🤖 Generated with Claude Code