Skip to content

Conversation

seveibar
Copy link
Contributor

@seveibar seveibar commented Sep 8, 2025

Summary

  • allow single-line solvers to return a direct horizontal/vertical trace when no obstacles exist
  • cover direct trace behavior with unit test

Testing

  • bun test tests/solvers/SchematicTraceSingleLineSolver2
  • bun test tests/solvers/SchematicTraceSingleLineSolver

https://chatgpt.com/codex/tasks/task_b_68bf634afad4832e981f4728ae900be7

Copy link

vercel bot commented Sep 8, 2025

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

Project Deployment Preview Comments Updated (UTC)
schematic-trace-solver Ready Ready Preview Comment Sep 9, 2025 0:06am

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines 81 to 96
// Attempt direct straight-line connection if pins are aligned
const EPS = 1e-6
const isDirectVertical = Math.abs(pin1.x - pin2.x) < EPS
const isDirectHorizontal = Math.abs(pin1.y - pin2.y) < EPS
if (isDirectVertical || isDirectHorizontal) {
const directPath = [
{ x: pin1.x, y: pin1.y },
{ x: pin2.x, y: pin2.y },
]
const excludeChipIds = Array.from(new Set(this.pins.map((p) => p.chipId)))
const intersects =
this.chipObstacleSpatialIndex.doesOrthogonalLineIntersectChip(
directPath,
{ excludeChipIds },
)
if (!intersects) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Direct-line solver ignores collisions with shared chip

The early return for aligned pins drops both pins’ chip IDs before calling doesOrthogonalLineIntersectChip. When the pins are on the same chip this removes the only obstacle that would block the path, so the solver now marks a straight segment across the chip interior as solved without running the later getRestrictedCenterLines and interior-approach checks. Previously these routes were forced to leave the chip and bend around its center; now they can cut directly through the component. This violates the solver’s own chip-intersection rules and will produce invalid traces for any same-chip connection. The shortcut should skip when both pins share a chip or still verify the path against that chip’s bounds.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant