Skip to content

Keep a placed switch its own input when a new input is placed - #62

Closed
rollrat wants to merge 1 commit into
masterfrom
claude/construct-switch-owner
Closed

rollrat wants to merge 1 commit into
masterfrom
claude/construct-switch-owner

Conversation

@rollrat

@rollrat rollrat commented Oct 5, 2026

Copy link
Copy Markdown
Member

Bottom of a stack: this fix, then the e-graph netlist search, then OR nets for wide NORs.

Why

A construction step that placed a new input sometimes failed as infeasible within 0.1 s, for every window, and construction then restarted with a new seed. This happened in three of five seeds of one full-adder netlist and, earlier, at the carry tile's carry entry. It wasted whole construction attempts and hid which netlists can actually be placed.

What

  • Cause: the new input's candidate sites covered the whole window, including the overlap slice, where a switch placed in an earlier step is kept as a fixed cell. dsl.rs gave a fixed switch to the first input with a site there. The kept switch became the new input's, so the earlier input lost its only site, and the frozen gates it drove contradicted their given signals.
  • Fix: new inputs no longer get sites where a switch is already placed. A fixed switch belongs to the input whose only site it is when several inputs could claim it (an error if that is still ambiguous).
  • Diagnosis hook: with EXACT_DIAGNOSE_INFEASIBLE, an infeasible step is re-solved with given signals, each observation, each single-site input, and frozen air dropped in turn, and the placed inputs' surroundings are logged. That is how the cause was found: only freeing the kept switch made the step solvable.

The same seed now places that step in 9 s.

Test plan

  • cargo test --release --lib exact::: all pass.
  • The failing seed of CIRCUIT=egraph-full-adder EGRAPH_DEPTH=3 now places the step.

🤖 Generated with Claude Code

Construction steps that place a new input sometimes failed as infeasible
within 0.1 s for every window, then restarted with a new seed (three of
five seeds of one full-adder netlist, and earlier the carry tile's carry
entry). The step diagnosis (EXACT_DIAGNOSE_INFEASIBLE) showed the culprit:
freeing an earlier input's kept switch made the step solvable.

The new input's candidate sites covered the whole window, including the
overlap slice where a switch placed in an earlier step is kept as a fixed
cell. dsl.rs gave a fixed switch to the first input with a site there, so
the kept switch became the new input's: the earlier input lost its only
site and the frozen gates it drove contradicted their given signals.

New inputs no longer get sites where a switch is already placed, and a
fixed switch belongs to the input whose only site it is when several
inputs could claim it (an error if that is still ambiguous). The same
seed now places that step in 9 s. The diagnosis hook stays: with
EXACT_DIAGNOSE_INFEASIBLE, an infeasible step is re-solved with given
signals, each observation, each single-site input, and frozen air dropped
in turn, and the placed inputs' surroundings are logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rollrat
rollrat added this pull request to stack #64 October 5, 2026 08:26
@rollrat
rollrat removed this pull request from stack #64 October 5, 2026 08:30
@rollrat

rollrat commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

Opened by mistake as a separate stack; the work stays in #61 on top of #59.

@rollrat rollrat closed this Oct 5, 2026
@rollrat
rollrat deleted the claude/construct-switch-owner branch October 5, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant