Legacy schematic start contact suppresses later crossing markers

Open
#3,729 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

Start at createSchematicTraceCrossingSegments and reproduce the minimal horizontal-edge input with perpendicular edges at x=0, 4, and 7. Run the trace tests and inspect the labeled SVG snapshot, including horizontal and vertical wires in both directions. Done means the start contact remains non-crossing while crossing segments appear at x=4 and x=7, with endpoints and segment continuity preserved.

Written by the indexing model from the issue text.

Description

The legacy schematic crossing helper skips all later crossings when another perpendicular edge meets the start of the input edge.

At 1fc6c2c400d8ae82875eeabde599dc62f5206883, this minimal input to createSchematicTraceCrossingSegments returns the original edge with zero is_crossing segments:

const edges = [{from: {x: 0, y: 0}, to: {x: 10, y: 0}}];
const otherEdges = [0, 4, 7].map(x => ({
  from: {x, y: -1},
  to: {x, y: 1},
}));

Expected: preserve the existing no-crossing-at-start behavior at x=0, but still emit crossing segments at x=4 and x=7. Removing only the x=0 edge makes those two crossings appear.

The start contact becomes the nearest candidate. The later coincident-point guard then continues the outer input-edge loop, so the two remaining candidates are never considered. Moving that guard into candidate collection fixes the suppression without changing crossing length or near-end handling.

Scope: this is the helper used by the legacy per-trace renderer. The current default _featureMspSchematicTraceRouting = true bypasses that renderer. I have not demonstrated an effect in default rendering, and this report does not claim one.

A local regression fails before the change (expected two crossings, got zero) and passes afterward for horizontal/vertical wires in both directions, both candidate orders, preserved endpoints, segment continuity and a start-only contact. A labeled SVG snapshot verifies the resulting wire crossings. All 15 trace tests pass with a 30-second timeout; one existing solver test exceeded the default five-second timeout.

Found and validated with AI assistance. A focused fix is ready for review.

Dominant language
TypeScript
Stars
58
Forks
203
Avg merge
7h 39m
Merged PRs (30d)
286

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tscircuit/core

All issues in tscircuit/core

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.