Repository navigation
Remove the e-graph search now that synthesis replaces it - #67
Merged
Merged
Conversation
The e-graph experiment (#61) found full adders with fewer gates or less depth, but nearly all of them were unbuildable. Its lasting results were the diagnosis of why construction steps time out and the exact synthesis built on it. Synthesis designs netlists that are buildable by construction, proves minimum torch counts, and gave the actual gains: a 2-bit adder about a fifth smaller and a 4:1 mux built for the first time. The e-graph code had no remaining use but cost about 900 lines and the egg dependency (9 crates). - egraph.rs and egraph_extract.rsdsl are deleted, along with egg. - Synthesis gets its own expression evaluator (synthesis::truth_table), with a precedence test. - The output-depth helper moves to NorNetlist::output_depths. - The e-graph's 8-gate full adder stays as WIDE_FULL_ADDER text. The chaining test uses it. - The harness drops CIRCUIT=egraph-full-adder. Any netlist still runs as CIRCUIT=netlist, and EGRAPH_CHAIN is now CIRCUIT_CHAIN. - docs/egraph_netlists.md is kept as the experiment record. It notes that its measurements come from commit 600ad6d. The live harness knobs are documented in docs/nor_synthesis.md. Co-Authored-By: Claude Opus 5.5 <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.
Stacked on #61.
Why
#61 added an e-graph search (egg) for equivalent NOR netlists. Its netlists with fewer gates or less depth were nearly all unbuildable. What lasted was the diagnosis of why construction steps time out (too many live nets, inputs that branch around a gate) and the exact synthesis built on it. Synthesis designs buildable netlists directly, proves minimum torch counts, and gave the actual gains: a 2-bit adder about a fifth smaller, and a 4:1 mux built for the first time.
The e-graph code no longer had a use. It cost about 900 lines and the
eggdependency (9 crates).What
exact/egraph.rs,exact/egraph_extract.rsdsl, andegg.synthesis::truth_table:~ & ^ |, tightest first), with a precedence test.NorNetlist::output_depths.WIDE_FULL_ADDERinexact/tests.rs); the chaining test uses it.CIRCUIT=egraph-full-adder. Any netlist still runs asCIRCUIT=netlist CIRCUIT_NETLIST=..., andEGRAPH_CHAINis renamedCIRCUIT_CHAIN.docs/egraph_netlists.mdstays as the experiment record. It now says its measurements come from commit600ad6d. The live harness and diagnostic knobs moved todocs/nor_synthesis.md.Test plan
cargo test --release --lib exact::: 27 passed, including the newsynthesis_truth_tables_follow_precedence.CIRCUIT=netlist CIRCUIT_CHAIN=2withWIDE_FULL_ADDERreproduces the e-graph runs' counts (7 live nets, 2 continuing inputs).synthesize_buildable_circuitsstill findsnor9's 9 torches in 9 steps, proven.🤖 Generated with Claude Code