Skip to content

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

Open
lau90eth wants to merge 11 commits intotscircuit:mainfrom
lau90eth:fix/issue-34-cleanup-state-reset
Open

fix: reset TraceCleanupSolver internal state between passes (issue #34)#178
lau90eth wants to merge 11 commits intotscircuit:mainfrom
lau90eth:fix/issue-34-cleanup-state-reset

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 3:21am

Request Review

@lau90eth
Copy link
Copy Markdown
Author

/claim #34

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