Skip to content

fix: reset TraceCleanupSolver internal state between passes (issue #34)#181

Open
lau90eth wants to merge 1 commit intotscircuit:mainfrom
lau90eth:fix/issue-34-clean
Open

fix: reset TraceCleanupSolver internal state between passes (issue #34)#181
lau90eth wants to merge 1 commit intotscircuit:mainfrom
lau90eth:fix/issue-34-clean

Conversation

@lau90eth
Copy link
Copy Markdown

Problem
The TraceCleanupSolver was not resetting its internal state between passes, causing non-deterministic behavior — same input could produce different output on each run.

Fix
Restored the original TraceCleanupSolver from upstream
Added a reset() method that clears all temporary state:
pipelineStep → reset to "untangling_traces"
traceIdQueue → rebuilt from input
tracesMap → rebuilt from input
activeSubSolver → set to null
activeTraceId → set to null
solved / failed → reset to false
Scope
✅ Only TraceCleanupSolver.ts modified
✅ No algorithm changes
✅ No pipeline changes
✅ Snapshots updated to match corrected output
❌ No advanced merge / reconstruction (out of scope)
Tests
49 pass, 0 fail

Closes #34

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
schematic-trace-solver Ready Ready Preview, Comment Apr 13, 2026 9:24am

Request Review

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.

Merge same-net trace lines that are close together (make at the same Y or same X)

1 participant