## Progress Log

### Starting State
- TeaVM build compiles 259 Java files → 3.1MB JS
- ecc83: 22/22 nets, 18 wires (0.7s)
- pic_programmer: 116/119 nets, 156 wires
- maxPasses parameter accepted but not wired to autorouter
- No JSON config support
- Console output is clean (no errors)

### Phase 1: Wire maxPasses to Multi-Pass Routing
- maxPasses was already wired to set_stop_pass_no() in FreeroutingWasm.doRoute() (prior session)
- Fixed BasicBoard.get_hash(): was returning constant "no-hash", preventing multi-pass loop
- Implemented hash using trace count + via count + ID sum (TeaVM lacks MessageDigest)
- Multi-pass now works: pass 2 executes when maxPasses>1
- pic_programmer: 156 wires with both maxPasses=1 and maxPasses=3 (pass 2 finds no new routes — remaining nets are blocked)
- ecc83: 18 wires, unchanged — correct
- Phase 1 COMPLETE

### Phase 2: JSON Configuration API
- route() API already accepted 3 params (dsnContent, maxPasses, configJson) from prior session
- JsonHelper.java uses TeaVM JSO bridge to call JSON.parse/Object.keys in JS
- applyConfig() handles: fanout, viasAllowed, viaCost, startRipupCost, layer settings (active, direction)
- Demo page has config textarea with "Enable config" checkbox
- Verified backward compat: 2-arg call route(dsn, 1) works (undefined → isNonEmpty returns false)
- Verified 3-arg null call route(dsn, 1, null) works: 156 wires
- Verified config changes routing: viaCost=10 → 160 wires + 6 vias vs default 156 wires + 0 vias
- Verified startRipupCost=5, fanout=true changes results: 129 wires
- ecc83 unchanged: 18 wires
- Phase 2 COMPLETE

### Phase 3: Debug Mounting Hole / Obstacle Overlap
- Tested 3 existing fixtures: mounting_hole_test, mounting_hole_gnd_test, mounting_hole_outline_only — all routed correctly
- Created mounting_hole_small_pad_test.dsn: small 1.6mm pad + large 8.6mm outline, exposes the bug
- ROOT CAUSE: Network.java line 1141 — when pin_count() > 0, outline goes through insert_component_outline() (visual only, NOT a routing obstacle). Mounting holes with pads but no net had their outline ignored as obstacle.
- FIX: Track `any_pin_has_net` during pin insertion loop. If no pin has a net (and no keepouts defined), treat outline as routing obstacle on all signal layers, same as pin-less components.
- Before fix: trace at 113112 distance from MH center (inside 430000 outline radius)
- After fix: trace at 463232 distance from MH center (outside outline radius)
- All mounting hole tests pass, ecc83: 18 wires, pic_programmer: 156 wires — no regression
- Phase 3 COMPLETE
