Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a7da1d4
Add opt-in KiCad schematic export and functional overview planning
Suke0811 Nov 2, 2026
8849bb2
Improve deterministic schematic readability and preserve pin semantics
Suke0811 Nov 2, 2026
19660cd
Preserve local bypass ownership and configure schematic ground style
Suke0811 Nov 3, 2026
6bd5213
Checkpoint deterministic fixed-placement schematic route optimizer
Suke0811 Nov 3, 2026
f41faf9
Improve native schematic layout, symbols, and orientation safety
Suke0811 Nov 11, 2026
a7752d1
Verify standalone PB schematic export without agent adapters
Suke0811 Nov 11, 2026
3237066
Roll back interrupted schematic bundle writes
Suke0811 Nov 11, 2026
53bfd63
Merge remote-tracking branch 'origin/master' into codex/kicad-schemat…
Suke0811 Nov 11, 2026
b2a491d
Type native schematic models and satisfy upstream static checks
Suke0811 Nov 11, 2026
7662a4d
Keep native KiCad test artifacts alive through assertions
Suke0811 Nov 12, 2026
7d74af2
Share native schematic serialization and page-fit rules
Suke0811 Nov 12, 2026
0f493f0
Preserve schematic arc geometry in clearance bounds and mirrored symbols
Suke0811 Nov 12, 2026
3d054fe
Use shared native test helper for visual clearance
Suke0811 Nov 12, 2026
75e47a5
Respect explicit schematic symbols and reserve the overview sheet title
Suke0811 Nov 12, 2026
f38dc3b
Reserve explicit sheet titles before naming automatic pages
Suke0811 Nov 12, 2026
c9fa4e5
Reject cross-net contacts in final schematic wire geometry
Suke0811 Nov 12, 2026
39d7949
Format the native pin escape regression tests
Suke0811 Nov 12, 2026
7a3b262
Quantize schematic placements before translating fixed pin stubs
Suke0811 Nov 12, 2026
f5899d7
Remove schematic example PNGs from documentation
Suke0811 Nov 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,8 @@ Check out our papers (all open-access), which have more details:
[Embedded Device Generation](https://dl.acm.org/doi/10.1145/3083157.3083159) (or more generally Electronic Device Generation) was a prior version of this project that focused on algorithms and models for embedded device synthesis, though it lacked a user-facing component.
This project is a continuation of that work focusing on an end-to-end system, and for most of its development cycle has been called `edg`.
But, for the purposes of writing research papers, naming collisions are confusing and bad, and we chose to keep the repo and paper name consistent.

### Generated KiCad schematic views (opt-in)

See [schematic export](docs/schematic-export.md) for generated review schematics,
symbol mappings, and validation requirements. PB Python remains the source of truth.
771 changes: 771 additions & 0 deletions docs/schematic-export.md

Large diffs are not rendered by default.

109 changes: 109 additions & 0 deletions docs/schematic-orientation-benchmark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Orientation and converter layout evaluation

PB Python remains authoritative for components, physical pins and connectivity.
These generated schematics are reference artifacts. Evaluation completed on
2026-11-08–09 using native KiCad 9.0.9 and 10.0.8.

## USB-C converter comparison

All three profiles use the same compiled 261-component design and source-owned
presentation intent. The controlled baseline preserves the new position-search
stage and suppresses orientation/bridge selection in the evaluation harness.
The rotation-only profile suppresses bridge proposals. Route-order optimization
stays enabled in all profiles. Native component identities, footprints, values,
modeled pin inventories and connected physical-pin sets match across profiles. These two harness profiles are diagnostic controls;
the public API exposes `optimize_orientations`, and explicit placements constrain
position-changing proposals.

| Power-stage sheet | Local fallback endpoints | Crossings | Bends | Local wire (mm) | First export (s) |
| --- | ---: | ---: | ---: | ---: | ---: |
| Controlled baseline | 7 | 45 | 53 | 1939.3 | 182.8 |
| Fixed-center rotations | 6 | 34 | 59 | 1934.2 | 476.2 |
| Rotations + bridge | 0 | 26 | 60 | 1602.1 | 399.8 |

The final bridge removes local route fallbacks, reduces crossings by 42%, and
reduces local wire length by 17% against the controlled baseline. Bends increase
from 53 to 60. Metrics cover local routed wires; fixed pin stubs, final label
repair tails and inter-region connections are excluded. Counts are physical
fallback endpoints, not disconnected electrical nets: labels preserve electrical
connectivity in every profile.

The first-export timings are one observation per profile. Compilation, repeat
verification, native CLI and raster rendering are excluded. Parallel validation
load, OS cache and unrelated host activity were not controlled. No statistical
speedup claim is made, and peak memory was not measured. Orientation increases
export cost; large boards may require the MCP's explicit 900-second timeout
instead of its 300-second default.

## Verification

| Check | Result |
| --- | --- |
| Schematic unit/native suite | 203 tests pass, no skips |
| MCP suite, including complete direct Python/MCP bundle parity | 23 tests pass, no skips |
| Full automatic corpus | 54 targets: 51 valid pass, 2 expected compile rejections, 1 empty |
| Native fidelity | Every valid corpus scope passes KiCad 9 and 10 physical identity, footprint, modeled pin inventory and connected-pin-set comparisons |
| Determinism | Byte-identical repeated exports for every valid corpus design and final curated USB-C export |
| Fixed centers | All 261 physical component centers retain relative positions within their functional regions in the controlled rotation-only comparison; sheet packing may translate regions |
| Opt-out compatibility | Complete USB-C bundle: all 28 files byte-identical to the preceding exporter when `optimize_orientations=False` |
| MCP preparation cost | Exactly one native export per plan, generate or review action; stale plans still rejected before artifact writing |

Across the 51 valid automatic exports, local routing counts compare with the
preceding native implementation as follows. These are machine measures, not
whole-corpus visual acceptance; grouping changes can affect their scope.

| Metric | Decreased | Same | Increased |
| --- | ---: | ---: | ---: |
| Local fallback endpoints | 37 | 14 | 0 |
| Crossings | 34 | 2 | 15 |
| Bends | 33 | 3 | 15 |
| Local wire length | 26 | 2 | 23 |

## Drawing-only findings

Fresh reviewers inspected all eight Ballu sheets and all seventeen PDU sheets,
with dense-region crops. Both are qualified usable references. Ballu retains
convoluted white-LED branches and regulator wiring; PDU retains dense converter
feedback and long connector/MCU harnesses.

The blind USB-C comparison selected the conventional bridge as clearest: two
vertical halfbridges, the inductor link, rail banks and series shunts are directly
recognizable. Review caught a real C66/driver-label overlap. The final bypass
placement uses the controller's measured external-label corridor, and the final
full-board power sheet was rechecked. That overlap is resolved. Gate/bootstrap
and I2C routing around L4 remains dense. Independent final USB-C review covers
the converter sheet, not all twenty pages; the complete page inventory was
contact-sheet scanned separately. Native equality does not approve aesthetics
or electrical design safety.

## Search and evidence scope

The fixed-center stage performs at most two stable PB-path sweeps, with one
baseline-router call per geometrically viable 180-degree trial and cached
incumbent routes. Four measured bridge alternatives add at most four calls.
Existing automatic placement and final route-order searches add separate costs.
This is a finite local search, not a global optimum. Explicit placements retain
rotation locks unless `lock_rotation=False`.

Verified converter core endpoints (controller, FETs, inductor, series shunts and
bootstrap branches) determine primary-path fallbacks. Bulk/bypass-bank fallbacks
are recorded separately. Authored primary nets elsewhere keep their original
meaning. `orientation.after` and `selected_rotations` describe that stage; a
later bridge can change poses. Final symbol coordinates are in the schematic,
and region-level `routing.after` records the selected final local route.

The broad corpus snapshot is `17e639c5da676449bdf5c4ba41cdd779c42285343875421a7442853835757447`.
The final snapshot is `be45bd1a3136463855b796e383bb3729af1f5dfb6b44c7d4ebdb2a0621790292`.
Only `KiCadSchematicPower.power_template_candidates` changed between them, to
move bypasses outside controller label corridors. Automatic corpus circuits use
`template="auto"`, and Ballu/PDU do not request a four-switch bridge, so that
changed function is outside those export paths. The final fix received the full
USB-C export/repeat/native 9+10 checks plus complete unit/MCP suites. The broad
corpus was not redundantly rerun after this isolated visual placement fix.

Reproduction inputs, scripts, source ledgers, per-target results, native XML/SVG,
full PNGs, hash-bound reviews, change-impact analysis and aggregate `RESULTS.json`
are retained in the host PCB repository under
`.local-execution/orientation-readability-2026-11-08/`. Expected rejections and
superseded/rejected visual candidates are retained separately. No PCB edits,
normal board regeneration, commits or pushes were performed.
68 changes: 68 additions & 0 deletions docs/schematic-passive-quarter-corpus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Passive quarter-turn corpus results

Frozen implementation: `8f93b26079b6790fd2de88ab445148d4140cdb4a498a3ee7899f25a3df95af20`.

All 54 targets completed: 51 valid designs passed, two intentionally invalid designs were rejected during compilation, and one design was empty. Each valid design and the empty design passed KiCad 9.0.9 and 10.0.8 physical-netlist comparisons and byte-identical repeat checks. Source and framework hashes remained stable.

Deltas compare the cached incumbent after the legacy placement/half-turn/template/routing pipeline with the final selected passive result, including rollback. Wire, bend and cost deltas use local routed wires plus fixed pin stubs, excluding final label tails and inter-region links. Cost is wire millimeters + 2.54 per measured bend. The scene column counts all final readability findings, including fallback-symbol diagnostics. Export seconds are a single first successful export under eight-worker functional load; they are not controlled performance samples.

Adopted turns are relative angle changes (90/180/270). The three 180-degree changes arise from the balanced objective; the 25 quarter turns exercise the new angular capability. The 28 changes occur across 10 targets. All 1,941 eligible passives receive three angle evaluations; 5,765 additional router calls stay within the 5,823-call limit. Geometry rejects the other trials before routing.

| Target | Status | Eligible P | Calls / 3P | Adopted 90/180/270 | Δ fallback | Δ crossings | Δ bends | Δ wire mm | Δ cost mm | Scene | Export s |
| --- | --- | ---: | ---: | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| `BalluGen3` | pass | 54 | 162 / 162 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 130 | 160.7 |
| `PduMain` | pass | 99 | 291 / 297 | 1/0/1 | +0 | +0 | -4 | -17.78 | -27.94 | 195 | 454.4 |
| `UsbcPdBidir` | pass | 183 | 540 / 549 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 414 | 959.3 |
| `BatteryProtectorCircuit` | pass | 3 | 9 / 9 | 1/0/1 | +0 | +0 | -1 | -33.02 | -35.56 | 5 | 24.6 |
| `BldcController` | pass | 38 | 114 / 114 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 97 | 114.8 |
| `BleJoystick` | pass | 36 | 108 / 108 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 146 | 92.4 |
| `TestBlinkyArray` | pass | 17 | 49 / 51 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 21 | 33.5 |
| `TestBlinkyBasic` | pass | 1 | 3 / 3 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 2 | 2.4 |
| `TestBlinkyEmpty` | empty (0 physical components) | — | — | — | — | — | — | — | — | — | — |
| `TestBlinkyImplicit` | pass | 21 | 61 / 63 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 61 | 92.3 |
| `TestBlinkyIncomplete` | expected compile rejection | — | — | — | — | — | — | — | — | — | — |
| `TestBlinkyInvalid` | expected compile rejection | — | — | — | — | — | — | — | — | — | — |
| `TestBlinkyPacked` | pass | 13 | 37 / 39 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 21 | 31.6 |
| `TestBlinkyPinned` | pass | 21 | 61 / 63 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 61 | 97.4 |
| `TestBlinkyRegulated` | pass | 14 | 40 / 42 | 1/1/1 | +0 | -2 | +2 | +15.88 | +20.95 | 47 | 64.3 |
| `TestBlinkyRgb` | pass | 21 | 61 / 63 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 62 | 100.0 |
| `TestBlinkySwitchMatrix` | pass | 1 | 3 / 3 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 22 | 27.1 |
| `TestBlinkySwitchMatrixRefined` | pass | 1 | 3 / 3 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 22 | 29.3 |
| `TestBlinkyWithLibrary` | pass | 18 | 52 / 54 | 3/0/1 | +0 | -2 | -6 | -52.70 | -67.95 | 27 | 38.4 |
| `TestBlinkyWithLibraryExport` | pass | 18 | 52 / 54 | 3/0/1 | +0 | -2 | -6 | -52.70 | -67.95 | 27 | 35.8 |
| `TestBlinkyWithModeledSchematicImport` | pass | 21 | 61 / 63 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 26 | 86.8 |
| `TestBlinkyWithSchematicImport` | pass | 21 | 61 / 63 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 26 | 86.9 |
| `TestLed` | pass | 1 | 3 / 3 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 1 | 1.2 |
| `CanAdapter` | pass | 18 | 54 / 54 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 29 | 29.4 |
| `Datalogger` | pass | 33 | 99 / 99 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 233 | 160.0 |
| `DeskController` | pass | 34 | 102 / 102 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 72 | 168.7 |
| `EspProgrammer` | pass | 11 | 33 / 33 | 1/1/1 | +0 | -3 | -5 | -54.61 | -67.31 | 28 | 20.4 |
| `Fcml` | pass | 107 | 317 / 321 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 288 | 364.1 |
| `HighSwitch` | pass | 25 | 75 / 75 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 147 | 128.1 |
| `IotCurtainCrawler` | pass | 26 | 78 / 78 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 41 | 64.0 |
| `IotRollerBlinds` | pass | 21 | 63 / 63 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 27 | 33.8 |
| `IotDisplay` | pass | 33 | 99 / 99 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 125 | 76.7 |
| `IotFan` | pass | 52 | 156 / 156 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 113 | 114.8 |
| `IotIron` | pass | 60 | 180 / 180 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 124 | 173.1 |
| `IotLedDriver` | pass | 58 | 166 / 174 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 65 | 155.6 |
| `IotThermalCamera` | pass | 82 | 242 / 246 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 185 | 207.1 |
| `JacdacKeyswitch` | pass | 11 | 33 / 33 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 35 | 53.6 |
| `Keyboard` | pass | 33 | 99 / 99 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 120 | 174.5 |
| `LedMatrix` | pass | 13 | 39 / 39 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 105 | 134.3 |
| `EspLora` | pass | 68 | 204 / 204 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 152 | 306.7 |
| `Multimeter` | pass | 61 | 182 / 183 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 178 | 168.4 |
| `PcbBot` | pass | 45 | 135 / 135 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 191 | 116.5 |
| `ProtectedCharger` | pass | 8 | 24 / 24 | 2/0/0 | +0 | -1 | -1 | +6.35 | +3.81 | 16 | 13.1 |
| `RobotCrawler` | pass | 64 | 190 / 192 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 208 | 276.5 |
| `RobotDriver` | pass | 40 | 120 / 120 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 123 | 98.6 |
| `SevenSegment` | pass | 87 | 261 / 261 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 179 | 427.1 |
| `Simon` | pass | 17 | 51 / 51 | 1/0/3 | +0 | +0 | -3 | -66.04 | -73.66 | 59 | 38.4 |
| `PicoProbe` | pass | 26 | 78 / 78 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 75 | 208.2 |
| `SwdDebugger` | pass | 25 | 73 / 75 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 69 | 72.6 |
| `TofArray` | pass | 34 | 102 / 102 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 119 | 103.7 |
| `UsbFpgaProgrammer` | pass | 21 | 63 / 63 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 56 | 109.8 |
| `UsbKey` | pass | 9 | 27 / 27 | 0/0/2 | +0 | +0 | +2 | -40.64 | -35.56 | 4 | 16.5 |
| `UsbSourceMeasure` | pass | 209 | 625 / 627 | 0/0/0 | +0 | +0 | +0 | 0.00 | 0.00 | 488 | 469.9 |
| `UsbUart` | pass | 8 | 24 / 24 | 0/1/1 | +0 | -1 | -3 | -36.83 | -44.45 | 17 | 17.0 |

These are machine acceptance results. Drawing-only review covered the named curated sheets in the [main report](schematic-passive-quarter-turn-benchmark.md); this table does not assert whole-corpus visual approval.
Loading
Loading