Skip to content

config: port remaining emitters into resolve() (phase 2b)#478

Open
w1ne wants to merge 4 commits into
mainfrom
feat/canonical-config-phase2b
Open

config: port remaining emitters into resolve() (phase 2b)#478
w1ne wants to merge 4 commits into
mainfrom
feat/canonical-config-phase2b

Conversation

@w1ne

@w1ne w1ne commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Completes the phase-2 resolver: every remaining TS emitter (board-config/src/compile/emitters.ts) is now ported into the Rust resolve(), byte-for-byte gated against the TS oracle snapshots.

Ported

  • SPI: ili9341 / max31855 / ssd1680
  • ultrasonic, pcd8544, sn74hc165
  • iolink-master, neo6m-gps, can-diagnostic-tool
  • ADC-input board_io branch
  • board_io_kind is now a total faithful port of CATALOG.boardIoKind; bus lookups cover the STM32 F103/F401/L476/H563 base map

UnsupportedInPhase2a removed. The TS oracle is total over part types — it emits nothing for unclaimed parts rather than throwing — so resolve() now faithfully ignores unhandled/unbound parts to keep byte-parity. resolve_rejects_unported_part_types replaced with resolve_ignores_unhandled_and_unbound_parts.

Gate: resolve_matches_ts_oracle asserts byte-equality over all 13 STM32 fixtures (10 new). Fixtures + expected YAML are embedded verbatim from the board-config snapshot, so this test is self-contained.

Honest limitation: 3 planned non-STM32 GPIO fixtures (RP2040/ESP32/nRF) were dropped — the TS oracle (diagramToConfig) throws for boards absent from CHIP_YAMLS (only stm32f103/f401/l476 exist), so there's no oracle snapshot to gate against. parse_mcu_pin already handles those boards' GPIO; bus lookups correctly return None (faithful to findPinFunction on an unmapped board).

Local: cargo fmt --all -- --check clean, cargo test -p labwired-config canonical 13 passed.

w1ne added 4 commits July 5, 2026 14:40
Ports every remaining TS emitter from board-config/src/compile/emitters.ts
into the Rust resolve(): SPI (ili9341/max31855/ssd1680), ultrasonic, pcd8544,
sn74hc165, iolink-master, neo6m-gps, can-diagnostic-tool, and the ADC-input
board_io branch. board_io_kind is now a total faithful port of
CATALOG.boardIoKind; bus lookups cover the STM32 F103/F401/L476/H563 base map.

Removes UnsupportedInPhase2a: the TS oracle is total over part types (it emits
nothing for unclaimed parts rather than throwing), so resolve() now faithfully
ignores unhandled/unbound parts to preserve byte-for-byte parity.

Gated by resolve_matches_ts_oracle over all 13 STM32 fixtures (10 new).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant