Skip to content

Add a cross-runtime parity corpus for Swift and Rust #12

Description

@DennisWayo

Problem Statement

Studio exposes Swift and Rust runtime choices and attempts a reference-runtime parity comparison after a run. However, the public automated test surface is not yet a broad parity corpus. Rust currently has a very small unit-test surface, while Swift has much broader simulator tests.

Proposed Solution

Add a checked-in parity corpus and script:

  • fixture circuits for Gaussian, loss, thermal, measurement, feedback, QEC, and supported Fock/hybrid paths,
  • expected tolerance windows per metric,
  • Swift and Rust execution for every supported fixture,
  • JSON diff output for mean photon number, final state summary, measurement count, QEC metrics, backend used, and provenance,
  • CI job that runs the fast subset on every PR.

Acceptance Criteria

  • scripts/runtime-parity-suite.sh --runtime both exists and produces machine-readable output.
  • Parity failures identify fixture, metric, expected tolerance, and actual delta.
  • Unsupported runtime/backend combinations are explicit skips, not silent passes.
  • Rust and Swift version metadata is included in the parity report.
  • Studio can reuse the same parity comparison model.

Validation

cargo test -p schrosim-core
bash scripts/swift-test.sh
bash scripts/runtime-parity-suite.sh --runtime both

Evidence

  • core-swift/Sources/schrosim-studio/CLIService.swift
  • core-swift/Sources/schrosim-cli/main.swift
  • core-rust/schrosim-core/src/main.rs
  • docs/examples/

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions