Summary
Stand up a reproducible performance measurement pipeline for patina_boot that runs without requiring any physical Surface (or other vendor) hardware. The harness has two layers: (1) cargo bench microbenchmarks for individual primitives, and (2) QEMU + OVMF end-to-end boot timing for full BDS-phase measurement. Both layers run in CI on every PR.
Motivation
The first weeks of patina_boot development have shown that measuring performance directly on production hardware (Surface SKUs) couples performance work to platform-integration debugging. Every Patina-side change has triggered cascading platform-specific issues — missing primitives, console-init gaps, capsule-processing assumptions — that take days to surface and resolve. This makes "measure perf" effectively mean "debug platform integration for a week, then measure." Numbers gathered this way are noisy, not reproducible by external partners, and don't isolate the contribution of patina_boot itself from the platform's accumulated EDK2 assumptions.
The measurement harness fixes this by decoupling performance work from platform-integration work. With a microbenchmark + QEMU pipeline in place:
- Every patina_boot PR can have its perf impact measured automatically (regression catches happen at the PR level, not after a
platform-integration cycle)
- Numbers we publish to OEMs are reproducible on commodity hardware (anyone with a dev laptop can clone, run, and verify)
- Performance becomes a first-class concern with continuous visibility, not a one-off measurement at the end of integration
This unblocks the broader BMMI deliverables — every comparison number cited in the OEM whitepaper, every per-primitive regression check, every "Patina is X% faster" claim flows through this harness.
Deliverables
- Microbenchmark harness in patina_boot/benches/ using criterion + mockall. Covers all major primitives (BootOrchestrator::execute, helpers::connect_all, helpers::expand_device_path, etc.) with synthetic inputs sized parametrically.
- QEMU + OVMF integration test pipeline that boots a minimal patina_boot-driven binary in qemu-system-x86_64, captures FPDT-style timing for the BDS phase, and produces millisecond-resolution numbers.
- CI integration for both layers: every PR runs the bench suite, regressions > 10% fail the build, results are posted as a PR comment.
- Methodology documentation (docs/measurement-methodology.md) describing the harness, the metrics it captures, and how an external engineer reproduces the numbers.
Definition of Done
- cargo bench in the patina_boot repo runs and emits a baseline JSON report covering all 8 vtable primitives
- qemu-system-x86_64 boots OVMF + patina_boot, reaches BDS, and emits parsable boot-time output
- CI gates patina_boot PRs on a > 10% bench regression
- An engineer outside the patina_boot team can follow docs/measurement-methodology.md and reproduce a number within 5% of the baseline
- Numbers from this harness are cited in the BMMI perf comparison whitepaper (Epic 7)
Out of Scope
- Production-platform measurement (covered in Epic 6 — Surface SKU Integration)
- Physical reference platform measurement (covered in Epic 5)
- Native Rust replacement of the C proxy primitives (covered in Epic 4)
- Any orchestrator design changes beyond what's needed to be benchmarkable (covered in Epic 3)
Dependencies
- Blocks: Epics 4, 5, 6, 7 all consume the methodology + tooling this epic produces
- Blocked by: None — this is the first thing to build
Estimated effort
~2.5 weeks (1 engineer)
Summary
Stand up a reproducible performance measurement pipeline for patina_boot that runs without requiring any physical Surface (or other vendor) hardware. The harness has two layers: (1) cargo bench microbenchmarks for individual primitives, and (2) QEMU + OVMF end-to-end boot timing for full BDS-phase measurement. Both layers run in CI on every PR.
Motivation
The first weeks of patina_boot development have shown that measuring performance directly on production hardware (Surface SKUs) couples performance work to platform-integration debugging. Every Patina-side change has triggered cascading platform-specific issues — missing primitives, console-init gaps, capsule-processing assumptions — that take days to surface and resolve. This makes "measure perf" effectively mean "debug platform integration for a week, then measure." Numbers gathered this way are noisy, not reproducible by external partners, and don't isolate the contribution of patina_boot itself from the platform's accumulated EDK2 assumptions.
The measurement harness fixes this by decoupling performance work from platform-integration work. With a microbenchmark + QEMU pipeline in place:
platform-integration cycle)
This unblocks the broader BMMI deliverables — every comparison number cited in the OEM whitepaper, every per-primitive regression check, every "Patina is X% faster" claim flows through this harness.
Deliverables
Definition of Done
Out of Scope
Dependencies
Estimated effort
~2.5 weeks (1 engineer)