Skip to content

Build deterministic trace playback from CLI trace frames in Studio #9

Description

@DennisWayo

Problem Statement

The architecture describes a LivePropagationPlayer that consumes trace frames for deterministic gate-by-gate playback. The current Studio UI has a Photon Live toggle and visual overlays, and runAction loads trace output, but there is no playback controller that lets users pause, seek, scrub, change speed, inspect frame metrics, or replay the exact trace as evidence.

Proposed Solution

Add a trace playback subsystem:

  • parse and store trace frames from schrosim-cli trace,
  • playback controls: play, pause, seek, step, speed,
  • frame inspector: gate index, gate type, measurement count, mean photon number, backend, and dropped frame count,
  • deterministic replay checksum,
  • bounded-memory handling for large traces,
  • audit entries for playback actions.

Acceptance Criteria

  • A completed run exposes an interactive frame timeline.
  • Same seed and same foundry profile hash reproduce the same frame sequence.
  • Playback state does not mutate the circuit design.
  • Tests cover trace parsing, frame ordering, and checksum stability.
  • The trace SLO script remains the CLI-side performance guard.

Validation

bash scripts/trace-slo-check.sh --max-gates 512 --max-frame-ms 50
bash scripts/swift-test.sh

Evidence

  • studio/docs/SWIFTUI_STUDIO_UI_ARCHITECTURE.md
  • core-swift/Sources/schrosim-studio/StudioStore.swift
  • core-swift/Sources/schrosim-studio/StudioViews.swift
  • scripts/trace-slo-check.sh

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