fix(schematic): resolve pins through their placed unit - #272
Open
nordic-style wants to merge 1 commit into
Open
Conversation
Schematic validators, exports, connectivity queries, and design-review audits transformed every library pin through each matching reference's first placement. Multi-unit parts therefore reported phantom pins, wrong nets, false audit findings, and unsafe connectivity snaps. Resolve only the selected unit at every per-instance call site, search all placed units for reference-level queries, identify units in additive response fields, and remove the temporary partial-review diagnostic. Regression fixtures place both units' pins at the same local coordinate so first-instance resolution cannot pass unnoticed. Refs mixelpixx#182
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fix_connectivityfrom snapping wires to phantom pins belonging to another unitRefs #182
Approach
Every per-instance path now calls
extract_lib_pins_for_unit(symbol, instance.unit)before applying that instance's transform. Reference-level queries either use the establishedresolve_placed_pinhelper or explicitly visit every placement sharing the reference. This preserves common pins while preventing another unit's local coordinates from being projected through the wrong placement.Regression fixtures deliberately give both units a pin at the same local coordinate, then place those units on different labelled nets. That shape makes a first-instance lookup return a plausible but demonstrably wrong answer instead of merely failing to find a pin.
The sole remaining
extract_lib_pinscall in these files is intentional and documented: design-review coverage compares the complete definition with the selected unit only to classify a component as multi-unit. All electrical analysis uses the unit-filtered set.This PR covers the read/analysis/export half of #182. The component mutation paths are being submitted separately, and #267 contains the additional intentional-NC/power-pin behavior for
validate_component_connections; the one shared unit-filtering line may need a trivial rebase depending on merge order.Compatibility and safety
get_component_nets,get_net_components, andget_connected_itemsgain additiveunitfields.export_netlist_summarygainsunit; each entry's pins now describe that placed unit rather than every unit superimposed at its coordinates.fix_connectivitykeeps its existing atomic write path but will no longer propose or apply a snap to an unplaced unit's phantom endpoint.1693251.Validation
cargo test --workspace --locked --lib --tests: all suites pass except the same three pre-existing localupdate_symbols_from_library_*failures caused by the installed KiCadDevice:Rlibrary shadowing the test fixture;konnect-corereaches 550/553 passing testscargo test --workspace --locked --doc: passcargo clippy --workspace --locked --all-targets -- -D warnings: passcargo fmt --all -- --check: pass