TS

Summary

Fixes #78

When UntangleTraceSubsolver._applyBestRoute() reroutes L-shaped corners, it concatenates path segments:

const newTracePath = [
...originalTrace.tracePath.slice(0, p2Index),
...bestRoute,
...originalTrace.tracePath.slice(p2Index + 1),
]

This can produce duplicate consecutive points at the junctions (where the old path meets the rerouted segment), which render as zero-length extra trace line segments in the schematic output.

Fix

  1. UntangleTraceSubsolver: Added removeDuplicateConsecutivePoints() after path concatenation in _applyBestRoute() to strip duplicate junction points
  2. simplifyPath: Enhanced with duplicate consecutive point preprocessing before the existing collinear point removal

Key difference from prior PRs (#100, #119)

Those PRs applied the full simplifyPath (including collinear removal) in _applyBestRoute(), which changed the timing of path simplification relative to downstream minimizeTurns and balanceZShapes — causing the example29 snapshot to change. This was seen as a regression.

This PR applies only duplicate point removal in _applyBestRoute(), which is the minimal fix needed. Collinear simplification still happens at the correct time downstream. Zero existing snapshots change.

Tests

  • 9 new unit tests for simplifyPath covering duplicates, collinear points, and combined cases
  • New integration test (example_issue78): NE555 timer circuit with J1 connector and maxMspPairDistance=6, verifying all trace paths are clean (no duplicates, no collinear intermediate points)
  • All 59 existing tests pass, 0 snapshot regressions

/claim #78

🤖 Generated with Claude Code

AI Disclosure: This PR was developed using Claude Code (claude-opus-4-6). All code was reviewed and tested before submission.

Claim

Total prize pool $75
Total paid $0
Status Pending
Submitted February 17, 2026
Last updated February 17, 2026

Contributors

MA

makaiachildress-web

@makaiachildress-web

100%

Sponsors

TS

tscircuit

@tscircuit

$75