Closed bug report

Clip blank check flags painted clips of long thin boards (500 x 12 mm strip: the centre crop is all background)

noah · ·closed by John Lauer

Version: adom-aiflow 0.2.51 (blank_check in crates/adom-aiflow/src/main.rs), KiCad 10.0.4 on Windows, window capture.

What happened. On a 500 x 12 mm LED strip, every KiCad clip (routing, placement rework, thermal vias) is flagged looks blank: 8 of 8 sampled frames are one flat colour in the middle of the window (an unpainted or covered canvas) and marked suspect, so deliver will refuse it. The contact sheets show a painted editor with the whole board on it: at zoom-to-fit the 42:1 strip is a thin band about 3 % of the canvas height, so the centre 60 % crop that blank_check bins is more than 80 % background in every frame, and the strip's small per-trace changes stay under the "moved" threshold.

What was true. The window was painted and the board was changing (109 traces, then vias landing). Nothing was covered or unpainted.

Ask. Judge "blank" against the board, not a fixed centre crop: e.g. look for the board's own colours (copper, outline) anywhere in the frame, or crop to the board's projected box when the run knows its outline aspect, or count any changed pixels over the full frame. And say in the warning which region was sampled, so a false positive on an unusual board is visible from the message alone.

1 Reply

John Lauer ·

Noah, thanks for the clear diagnosis. You had it exactly right.

What was wrong: the blank check binned the centre 60 % of each sampled frame and called the frame flat when one grey level held over 80 % of it. A 500 x 12 mm strip at zoom-to-fit is a band about 3 % of the canvas high, so that crop really is more than 80 % background in every frame, even though the editor was painted and the board was changing. The small per-trace changes also stayed under the "moved" threshold, so nothing rescued it.

What changed, in adom-aiflow 0.2.56: the check now samples at 192 x 108 instead of 96 x 54, and a frame only counts as flat when the dominant level holds over 80 % of it AND it has fewer than two rows and fewer than two columns where a third or more of the pixels are something else. A long thin board, horizontal or vertical, is a few rows of copper and outline right across the canvas, so it now reads as painted. A cursor or a few specks do not. An unpainted or covered canvas is still flagged, and the warning now says which region it sampled: "(sampled: the centre 60 % of each frame, and no row or column of it had anything else on it: an unpainted or covered canvas)".

How it was verified: new unit tests on synthetic frames (flat canvas, a horizontal strip, a vertical strip, specks, a busy frame), plus an end-to-end test that renders two clips with ffmpeg. A dark 1280 x 720 canvas with an 18 px copper band and an outline line is no longer flagged; a flat canvas still is, and that verdict is still cleared by recut. All unit tests and workflow suites pass.

Still open: a clip already marked suspect keeps that mark until you run adom-aiflow recut, which runs the new check and clears blank-check verdicts that no longer hold.

Upgrade: tell your AI "give me the latest adom-aiflow" (or adom-wiki pkg install adom/adom-aiflow); adom-aiflow --version says 0.2.56.

John Lauer closed this ·

Log in to reply.