Skip to content

sch_batch, sch_export, sch_analysis and design_review still resolve pins against unit 1 #182

Description

@mixelpixx

Follow-up from #179, which fixed the multi-unit pin resolution in handle_batch_connect_to_net (the one that silently shorted two nets onto one coordinate). That fix was deliberately scoped; several other call sites still take the first instance carrying a reference, or use unit-blind extract_lib_pins.

A multi-unit part is placed once per unit, all sharing the designator, so "the first instance" is always unit 1 — and a pin owned by unit N transformed by unit 1's placement lands somewhere it doesn't belong.

Still unit-blind on main after #179 and #148:

  • crates/konnect-core/src/tools/sch_batch.rshandle_validate_wire_connections, handle_validate_component_connections
  • crates/konnect-core/src/tools/sch_export.rs — two sites
  • crates/konnect-core/src/tools/sch_analysis.rs — five sites
  • crates/konnect-core/src/tools/design_review.rs — five sites
  • crates/konnect-core/src/tools/sch_components.rs — the single-symbol delete/move/rotate/edit paths

Severity differs by site. The validators and analysis tools produce wrong reports rather than wrong files, which is bad but recoverable. The sch_components mutators are the ones to look at first: delete leaves the other units behind as orphans, and move/rotate tear a multi-unit part apart. #179 fixed the batch equivalents of those, so the shapes to copy already exist — find_all_symbol_instance_blocks (tools/mod.rs) and extract_lib_pins_for_unit.

The correct pattern is established in three places now: sch_wiring.rs::resolve_placed_pin (unit-aware, and after #148 also lib_name-aware via find_lib_symbol), and tools/mod.rs::placed_pins.

Acceptance

  • Each site either resolves per-unit or has a comment saying why unit 1 is correct for it.
  • Regression tests using a two-unit fixture where both units own a pin at the same local coordinate — that is the shape that makes the bug visible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions