Skip to content

D150 — Vias and pads that remove unconnected copper, and tuning patterns left out of pair coupling

Context

D149 left vme-wren's pair verdicts different from KiCad's and blamed via rings that KiCad removes on unconnected layers (remove_unused_layers), which the engine did not model. The same gap gave 22,362 clearance and 21 shorting reports on vme-wren where KiCad gives none: the engine judged rings, and filled zones around rings, that are not on the board. Looking further, two more KiCad 10.0.6 rules in the diff-pair coupling test (drc_test_provider_diff_pair_coupling.cpp) were missing: tracks of a tuning pattern are left out, and nearly parallel tracks are coupled because SEG::Intersect in line mode gives up when the crossing point does not fit in 32 bits. Doc 05 §60, records in bench/records/d150-padstacks.

Decision

  • Read the padstack mode of vias and through-hole pads token by token in file order, as KiCad's parser sets it, with zone_layer_connections.
  • Flash as KiCad does (drc::flash_layers): a conditional layer keeps copper where a zone joins it there or where a same-net track, arc, via or pad reaches its hole on that layer (CN_VISITOR), with KiCad's exclusions.
  • Split the copper item: copper on the flashed layers, plus a hole-shaped bare part on the others, checked at copper clearance and left out of connectivity and of the copper-only checks.
  • Refill recomputes the zone connections first, as KiCad's filler does, and knocks a same-net via that no zone joins out of the fill on that layer.
  • Router: stricter than KiCad. A new track keeps clear of a same-net bare part, and a new via keeps clear of a same-net item that may lose copper, instead of relying on KiCad to flash the layer.
  • Tuning patterns: members of a (generated (type tuning_pattern)) group are marked when read and skipped by the DRC's coupling test and length sums and by the router's coupling test.
  • Nearly parallel tracks: drc::couple computes the crossing point as SEG::intersects does (128-bit rescale, wrapping 64-bit addition) and couples the tracks when it falls outside 32 bits.

Alternatives

  • Treat such vias as copper on every layer (as before). Safe for the router, but the DRC reports thousands of errors KiCad does not, and the refill leaves voids KiCad fills.
  • Let the router flash layers it reaches, as KiCad would. Correct, but the commit check would need to rebuild a via's shape as tracks arrive; four fixture boards use the option and none is in a bench tier.
  • Leave the tuning-pattern and parallel quirks out. Each changes vme-wren's verdicts, and both are small.

Consequences

  • vme-wren: 425 clearance and 20 shorting reports left (other causes, listed in the records), and all 28 gap and 6 uncoupled-length errors are KiCad's. jetson still matches. The eight B1/B2 pair-rule boards route byte for byte as before.
  • Rule parity: 234 cases, three new (via_unused_layers, diff_pair_tuning_pattern, diff_pair_near_parallel), all matching KiCad. The D149 build fails the three.
  • Assumption A92 records the router's stricter rule.
  • Still open on vme-wren: fromTo() (34 length errors), the pad-to-track rule resolution, copper-graphic shorts, and a 10-minute DRC.