Skip to content

feat: cross-architecture comparison profiling#33

Merged
m2papierz merged 3 commits into
masterfrom
feat/cross-architecture
Jun 19, 2026
Merged

feat: cross-architecture comparison profiling#33
m2papierz merged 3 commits into
masterfrom
feat/cross-architecture

Conversation

@m2papierz

Copy link
Copy Markdown
Contributor

What

Compare a circuit's execution profile across multiple QEC architectures (surface code, color code, qLDPC, Steane) with a single CLI command.

Why

Pirx could only profile one hardware model at a time. Evaluating architecture trade-offs (e.g. surface code d=17 vs qLDPC BB d=12) required separate runs and manual comparison. This adds first-class support for side-by-side profiling with pairwise diffs, making architecture selection data-driven.

How

Three layers, one per crate:

  • pirx-hw: logical_error_rate() now dispatches the suppression exponent by CodeType — surface/Steane use (d+1)/2, color code (4.8.8) and qLDPC use d/2 per published thresholds. Validation relaxed for qLDPC to accept even distances (e.g. BB [[144,12,12]] has d=12). Two reference TOML models added (color code d=9, qLDPC Gross d=12).
  • pirx-core: New comparison module runs Monte Carlo on the same circuit against N hardware models, then produces per-model summaries and pairwise relative diffs (runtime, qubit count, space-time product) with a winner per pair.
  • pirx-cli: pirx compare --hw model1.toml --hw model2.toml [--hw ...] subcommand wiring.

Testing

  • make ci passes locally (fmt + clippy + test + audit)
  • New behavior has tests
  • Hot-path changes have criterion benchmarks

Checklist

  • PR description explains why, not just what
  • No new unwrap()/expect() in production code
  • No new allocations in the simulation hot loop
  • Crate boundaries respected (pirx-core never imports from pirx-adapters)
  • New dependencies justified (not "it's popular" — what does it replace?)

Dispatch logical_error_rate exponent by CodeType: surface/Steane use
(d+1)/2, color code (4.8.8) and qLDPC use d/2 per literature refs.
Relax code distance validation for qLDPC (even d >= 2 allowed).
Add reference hardware models for color code d=9 and qLDPC BB d=12.
New comparison module runs Monte Carlo against multiple hardware models
on the same circuit and produces pairwise runtime, qubit count, and
space-time product comparisons with relative diffs and winners.
Wire up the Compare CLI subcommand to run_comparison, accepting 2+
hardware model paths and printing per-model summaries with pairwise
relative diffs and space-time winners.
@codspeed-hq

codspeed-hq Bot commented Jun 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 27 untouched benchmarks


Comparing feat/cross-architecture (26dfc1f) with master (f2df920)

Open in CodSpeed

@m2papierz m2papierz merged commit 13dacfe into master Jun 19, 2026
11 checks passed
@m2papierz m2papierz deleted the feat/cross-architecture branch June 19, 2026 12:33
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