Accepted and implemented
Native design-review performance decision
The standalone Rust design-review CLI is the performance path; Python remains the migration oracle.
Decision
The promoted Windows x64 kicad-cruncher design path retains the profiled Rust implementation that produces one complete review bundle without a Python interpreter. On the reviewed Speedy Processing Module input, its accepted median runtime is at least ten times faster than the equivalent Python command while preserving the established artifact, source-binding, resource, and transactional contracts.
The detailed whole-pipeline timing surface remains an explicit development option, and ordinary commands do not emit a profile. Coarse clocks used to account for bounded worker overlap remain active on the normal path. Performance evidence is advisory and source-bound; it is not added to routine CI because a complete three-round comparison takes several minutes and is sensitive to host power and scheduling policy.
Measurement authority
tests/support_scripts/speedy_dr_performance_probe.py extracts Speedy only from the reviewed KM_CORPUS ZIP, builds the locked release executable, alternates Python and Rust command order, excludes build, extraction, validation, and cleanup from the measured command interval, samples root-process peak working set, and fails closed unless every structured artifact and every SVG satisfies the migration oracle.
| Evidence | Python median | Rust median | Speedup | Disposition |
|---|---|---|---|---|
Matched release baseline, commit b210d3d, three rounds | 62.3544 s | 28.0167 s | 2.2256× | Rejected for promotion performance |
Accepted clean tree, commit 9c41108, three alternating-order pairs | 60.5809 s | 6.0271 s | 10.0514× | Accepted |
The accepted rounds used reviewed archive SHA-256 2f0ab3ae70a4b7dfe7a8acb0030687b152c45dbd97d8a443015e06d6c28f9f26. The Speedy source tree remained byte-identical before and after all six commands. Each command produced 35 files. Structured comparisons covered the manifest excluding its backend-specific source snapshot, Design JSON, compiled graph, JSON and S-expression netlists, and README. SVG comparison covered 19 schematic documents with 8,892 record identities and 10 PCB documents with 34,992 identities.
The three accepted Rust runs measured 5.9617, 6.0271, and 6.0712 seconds. Their root-process peak working sets were 859,529,216, 835,121,152, and 823,713,792 bytes. These are observed diagnostic values, not a replacement for the independently enforced source, model, derived-item, materialization, work, and output ceilings.
Retained implementation decisions
- Buffered staged artifact writers preserve exact pretty-JSON and text bytes while avoiding small synchronous file writes.
- SVG enrichment and contract projection borrow validated spans and typed values instead of repeatedly cloning complete documents.
- One full source-backed PCB view feeds Monkey board Plotter-IR, bounds, and contract projection; caller limits are intersected field by field and every formerly public family remains available. Cruncher review enrichment and structured Design JSON retain their separately bounded PCB parses.
- Design metadata is serialized once into an exact-sized, preflighted cache and reused by every schematic occurrence.
- The validated schematic definition returned by source loading is reused for same-pass hierarchy discovery, eliminating an immediate
definition()reparse without changing the public source carrier. The later source-bound schematic index separately parses its bundle carriers. - Independent schematic and board branches overlap only when their disjoint maximum retained-byte budgets fit. The sequential fallback recomputes its remaining budget after schematic publication.
- Board font discovery overlaps board-facts construction only after exact source-limit preflight. Scoped workers are always joined; the primary facts error wins over a simultaneous worker failure.
Safety and compatibility invariants
No optimization raises a Monkey or Cruncher resource ceiling, changes deterministic artifact order, weakens exact or one-under boundary behavior, or permits work to outlive the transaction. Concurrent work publishes nothing directly. The existing staged-tree promotion and restoration state machine remains the sole publisher, and tight aggregate budgets select the bounded sequential path.
Profile details record both actual elapsed time and overlap-accounted time. Parent/detail arithmetic, exact detail inventories, serialized artifact counts and bytes, positive memory samples, source hashes, executable hashes, lockfile hashes, and the reviewed corpus hash are validated before a performance report is accepted.
Verification
Persistent unit and cross-package tests cover profiled-versus-normal construction, exact timing inventories, report rejection, source mutation detection, artifact and SVG parity, worker panic and drop/join behavior, tight-budget sequential fallback, prepared-source identity, one-view PCB limits, cached-metadata ceilings, single schematic parsing, and text-cache authentication before PCB parsing. Final acceptance also passed the complete locked Rust workspace suite, strict all-target Clippy, formatting, and the performance probe's fail-closed tests.
Test inventory and runtime impact
The performance work adds 21 Rust tests and five Python test functions. The Python functions are fully registered as L0_005; no new corpus-backed L3 case or repeated full design-review command was added to routine CI.
| Location | Added tests | Owned evidence |
|---|---|---|
Cruncher design.rs | 3 | Overlap accounting, facts-error precedence, and source-limit preflight |
Cruncher design_bundle.rs | 7 | Parallel gate, joined workers, exact prepared bytes, buffered output, profile inventory, sequential fallback, and publication timing |
| Cruncher schematic review and cross-package design-core tests | 4 | Cached metadata/XML output plus validated schematic and full PCB-view reuse |
| Monkey core bundle, document, Design JSON, board, and schematic plot tests | 6 | Profiled/ordinary identity, timing separation, caller-limit intersection, and owned definition identity |
| Monkey SVG sink | 1 | Streaming escaped XML text |
Cruncher L0_005 | 5 Python functions | Safe ZIP extraction, semantic SVG comparison, profile binding, positive memory sampling, and sampler failure |
On the acceptance host, the warm locked workspace run collected 631 Rust tests and passed in 14.11 seconds. The preceding CLI slice recorded 610 tests in 14.25 seconds on the same host, so the 21 focused additions produce no material warm-lane increase beyond normal timing noise. L0_005 passes all five functions in 0.54 seconds.
The accepted three-pair Speedy comparison contains about 200 seconds of measured command time plus release build, extraction, validation, and cleanup. It remains an explicit advisory/signoff invocation and is not part of an ordinary Rack or Cargo lane. This preserves fast failure feedback while retaining a repeatable full-system performance authority when executable-producing code changes.