Skip to content

fix: keep power and ground rail recovery in the preferred direction - #1206

Open
seveibar wants to merge 3 commits into
mainfrom
fix/power-ground-rail-direction
Open

seveibar wants to merge 3 commits into
mainfrom
fix/power-ground-rail-direction

Conversation

@seveibar

@seveibar seveibar commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Automatic rail recovery can send AM3352 J_SD.4 down several units to reach J_I2C's V3V3 rail. Prefer a local label when an optional connection travels more than 1 schematic unit downward toward power, or 1 unit upward toward ground. Also cap total vertical travel at 4 units, even in the preferred direction; lateral travel does not consume this budget.

Measure the routed path from each candidate terminal to the shared label, stopping at that label. A large height difference between terminals is valid when both approach the label in the correct direction. For example, V_IN.2 and C1.2 in bug-report-20260707T141421Z remain connected because their shared GND anchor lies below both pins; that snapshot is unchanged.

  • Preview label placement and collision relocation for new shared rails; use retained labels directly for late recovery.
  • Count cumulative vertical and wrong-direction travel along the same connected path, including bends, junctions, and labels inside segments. Preserve alternative paths when one uses less of the vertical budget.
  • Apply the preference in long-distance and final label-to-trace recovery. Primary routing, explicit wires, same-component buses, and signals retain their existing behavior.
  • Resolve rail direction and net aliases through connectivity and availableNetLabelOrientations.

On AM3352, J_SD receives its own upward V3V3 label. J_SPI and J_I2C use separate ground labels, while their power pins can share an upper V3V3 rail.

Review

Two recovery solvers use a shared policy and path-traversal helper. Regression tests cover the 1-unit boundary in both directions, endpoint reversal, correct-direction joins, aliases, explicit wiring, detours, junctions, the reported GND connection, C1’s excessive 7.42-unit drop in bug-report-20260716T144856Z, and the AM3352 output. C1 now uses a local GND label. There are 19 reviewed snapshot changes relative to the merged reproduction baseline.

This is a recovery preference based on the available label layout, not a global constraint on primary wiring or every subsequent layout operation.

Validation

  • bun test: 429 pass, 4 skip, 0 fail across 264 files
  • bunx tsc --noEmit: passes
  • Biome formatting for changed TypeScript and git diff --check: pass
  • Reviewed all 19 changed schematic snapshots against the merged baseline

@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
schematic-trace-solver Ready Ready Preview Sep 16, 2026 4:17am UTC

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.

1 participant