diff --git a/periscope/src/docs/development/EMMAFORO_PCB_TIMING.md b/periscope/src/docs/development/EMMAFORO_PCB_TIMING.md new file mode 100644 index 0000000..9ff286d --- /dev/null +++ b/periscope/src/docs/development/EMMAFORO_PCB_TIMING.md @@ -0,0 +1,28 @@ +# Emmaforo PCB exam timing (live VPS, 2026-09-20) + +Project `759a4dea9612` (`usr_9a8d1881a66143b69287d77a0f3d6d35`), board `uploads/pcb.kicad_pcb` (508 KiB, 34 footprints, 313 segments, 62 vias). Read-only `docker exec` of live modules. **No full MODE=pcb re-run** (would rewrite `pcb_report.json` and call DeepSeek again). LLM slice is wall time from the 14:17–14:22 UTC event log of the already-complete exam. + +## Wall seconds + +| Slice | Source | Seconds | +| --- | --- | --- | +| parse `.kicad_pcb` | `parse_kicad_pcb` perf_counter | **0.12** | +| ImpedenceFinder / inventory Z0 | `analyze_where_needed` (19 signal nets) | **1.83** | +| `run_pcb_checks` (geometry + SI + via≠pad) | perf_counter | **0.04** | +| of which SI `check_si` | same | 0.0035 | +| of which via≠pad `check_bom_pcb_datasheet` | same | 0.002 | +| of which `check_pcb_gnd_stitch` (hottest check) | same | 0.015 | +| PCB AI review (U1, U3, U39, U5) | event log 14:17:22 → 14:22:15 | **~293** | +| Full MODE=pcb job (ensure_graph cached → pcb_complete) | event log 14:17:19 → 14:22:15 | **~296** | + +Import of modules ~0.36 s (once). Historical parse/inventory/checks on that job: 0.13 / 2.09 / 0.056 s — same order as this re-measure. + +## Hottest functions (cProfile, overhead included) + +- **Parse:** `_tokenize` / `_parse_sexp` in `parsers_kicad.py` (s-expression walk). Not geometry checks. +- **Z0:** `impedancefinder.planes.coverage_at` → Shapely `Polygon` construction (`_to_shapely_polygons`). Dominates the **deterministic** path. +- **pcb_checks:** `kicad_nets_match` / `normalize_kicad_hierarchy_net` (tens of thousands of calls from gnd stitch, return path, keepout). Still **< 0.05 s** wall. + +## Does geometry dominate? + +**No.** Deterministic geometry + via≠pad is tens of milliseconds. ImpedenceFinder (Shapely plane coverage) is ~2 s. The realistic MODE=pcb wall is **~5 minutes**, almost all DeepSeek `review_pcb_ics`. Next board (Hubaudio) should be compared the same way; do not hunt that project until it exists.