analyze current reads pours only from a live measure: offline adopted pours read as no copper, finish-guard never completes

noah · ·closed by Colby Knox

What happened

On a run whose pours were written offline and adopted (verify-pours --from-board --adopt, no live editor, so no measure), analyze current reports the poured power nets as having no copper, and finish-guard then never completes:

FINDINGS (suggestions, nothing is blocked): current analysis not passed:
+5V no-copper: net +5V carries 1.2 A but the routing plan has no copper for it
GND fail: GND carries 1.2 A on a 0.25 mm bottleneck (20 C rise, limit 10 C) and has no pour: pour it on the outer layers or widen to 0.5 mm

finish-guard --json then stays at "remaining": ["invalidated or failed evidence: analyze-current"], and a recorded deviation does not clear it.

The board does carry the pours: the saved file has filled F.Cu zones for +5V (about 4270 mm2) and GND (about 3600 mm2), export reports "fills in saved board yes", and the same-input Adom Fields screen on that board passed.

Why

Cmd::Analyze reads the pours only from <run>/zone-state.json, which only measure writes, and measure needs the live editor (br.zone_state). Issue #149 made a pour-only net pass, but only when that live zone state exists. An offline run has none, so pours_by_net(None) is empty and every poured net reads as no copper or no pour. The hint ("has no pour: pour it on the outer layers") is wrong for this board.

Fix (tested on a local build)

When zone-state.json is absent, build the same zone state from the saved board's own filled_polygons (net, layers, area per fill; keepouts and unfilled zones skipped). Say so on stderr. The rest of the check is unchanged: pour_cover::check still judges the board. The patch adds pour_cover::zone_state_from_board(&Board) and uses it in Cmd::Analyze only when no live measurement exists. Patch attached (about 40 lines over local056).

Result on the same board with the patched build:

no live copper measurement on this run (no zone-state.json): the pours are read from the saved board's own fills (2 filled zone(s))
OK: current analysis passed:
+5V pass: +5V is carried only by its pour (4269 mm2 on F.Cu), no tracks; one F.Cu pour reaches all 136 +5V terminals, so the narrow tracks run beside it
GND pass: pour on F.Cu (3605 mm2 filled) carries the load; tracks are 0.40 mm at most; one F.Cu pour reaches all 134 GND terminals, so the narrow tracks run beside it

cargo test -p aiflow-analyze: 59 passed. finish-guard then reports complete after finish and deliver.

Environment

  • adom-aiflow 0.2.56 (local build 0.2.56+noah.2, which adds only a silkscreen waiver, #194); the patched build is 0.2.56+noah.3.
  • Hydrogen local workspace (WSL2), KiCad 10.0.4 pcbnew and kicad-cli in the container, no KiCad socket (screen hands-off, offline run).
  • Board: one-layer 166 x 54 mm LED molecule, pour-only +5V and GND on F.Cu.

Repro

  1. Write the pours offline with pcbnew, refill and save.
  2. adopt-board, then verify-pours --from-board --adopt --why ....
  3. analyze current --plan <plan> --fields <run>/fields/fields.json (no measure, since there is no live editor).
  4. finish, deliver, then finish-guard --json.

offline-zone-state.patch.txt

1 Reply

Colby Knox marked this in progress ·
Colby Knox linked pull request #95, which closes this when it merges ·
Colby Knox closed this in pull request #95 ·
Colby Knox ·

Thanks Noah, the diagnosis and patch were spot on. It's in AI Flow 0.2.76. I applied the zone_state_from_board part on top of the current release; the silkscreen hunks in your patch were already in since 0.2.63.

  • With no zone-state.json (no live measure), analyze current and analyze thermal now build the zone state from the saved board's own filled zones: net, layers and area per fill, with keepouts and unfilled zones skipped. They say so on stderr.
  • A live measurement still wins when there is one.
  • I added a unit test (a filled zone counts; an unfilled zone and a keepout don't), and the pour and continuation workflow suites pass.

Upgrade with adom-wiki pkg install adom/adom-aiflow; adom-aiflow --version then shows 0.2.76, and your +noah.3 build can go.

Log in to reply.