Skip to content

Implement circuit component and vm#66

Merged
Roger-luo merged 104 commits into
mainfrom
david/42-circuit-component
Jul 8, 2026
Merged

Implement circuit component and vm#66
Roger-luo merged 104 commits into
mainfrom
david/42-circuit-component

Conversation

@david-pl

@david-pl david-pl commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Implements a vihaco component for circuit execution with instructions and a simple VM, finally putting the VM into ppvm.

Closes #42.

Requires https://github.com/QuEraComputing/stellarscope/pull/51 to be merged.
Requires https://github.com/QuEraComputing/stellarscope/pull/59 to be merged.
Requires QuEraComputing/vihaco#3 to be merged.

CI fails because of dependency issues (the repo can't pull in vihaco, since that's still private).

@david-pl david-pl requested review from Roger-luo and kaihsin May 29, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 64 changed files in this pull request and generated 10 comments.

Comment thread crates/ppvm-vihaco/src/syntax.rs Outdated
Comment thread crates/ppvm-vihaco/src/syntax.rs
Comment thread crates/ppvm-vihaco/src/syntax.rs
Comment thread crates/ppvm-vihaco/src/syntax.rs
Comment thread crates/ppvm-vihaco/tests/function_call.sst
Comment thread crates/ppvm-vihaco/tests/function_call_ret.sst
Comment thread crates/ppvm-vihaco/tests/sst_fixtures.rs
Comment thread crates/ppvm-vihaco/src/measurements.rs Outdated
Comment thread crates/ppvm-vihaco/src/component.rs
Comment thread crates/ppvm-vihaco/src/component.rs
Copilot AI review requested due to automatic review settings June 30, 2026 10:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 64 changed files in this pull request and generated 10 comments.

Comment thread crates/ppvm-vihaco/src/syntax.rs Outdated
Comment thread crates/ppvm-vihaco/src/syntax.rs Outdated
Comment thread crates/ppvm-vihaco/src/syntax.rs Outdated
Comment thread crates/ppvm-vihaco/src/syntax.rs
Comment thread AGENTS.md
Comment thread crates/ppvm-vihaco/tests/bell.sst
Comment thread crates/ppvm-vihaco/tests/function_call.sst
Comment thread crates/ppvm-vihaco/tests/function_call_ret.sst
Comment thread crates/vihaco-circuit-isa/Cargo.toml
Comment thread crates/ppvm-tableau/src/data.rs
Copilot AI review requested due to automatic review settings June 30, 2026 10:29
@david-pl david-pl force-pushed the david/42-circuit-component branch from 893211d to 5a3765d Compare June 30, 2026 10:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 64 changed files in this pull request and generated 10 comments.

Comment thread crates/ppvm-vihaco/src/syntax.rs
Comment thread crates/ppvm-vihaco/src/syntax.rs
Comment thread crates/ppvm-tableau/src/data.rs
Comment thread AGENTS.md
Comment thread crates/ppvm-cli/src/commands.rs
Comment thread crates/ppvm-vihaco/src/component.rs
Comment thread crates/ppvm-vihaco/src/component.rs
Comment thread crates/ppvm-vihaco/tests/bell.sst
Comment thread crates/ppvm-vihaco/tests/function_call.sst
Comment thread crates/ppvm-vihaco/tests/function_call_ret.sst
Copilot AI review requested due to automatic review settings June 30, 2026 10:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 63 out of 66 changed files in this pull request and generated 7 comments.

Comment thread crates/ppvm-vihaco/tests/bell.sst
Comment thread crates/ppvm-vihaco/tests/function_call.sst
Comment thread crates/ppvm-vihaco/tests/function_call_ret.sst
Comment thread crates/ppvm-vihaco/Cargo.toml
Comment thread crates/ppvm-vihaco/src/observable.rs
Comment thread crates/ppvm-tableau/src/data.rs
Comment thread prek.toml
Copilot AI review requested due to automatic review settings July 1, 2026 07:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 64 changed files in this pull request and generated 8 comments.

Comment thread crates/ppvm-vihaco/tests/bell.sst
Comment thread crates/ppvm-vihaco/tests/function_call.sst
Comment thread crates/ppvm-vihaco/tests/sst_fixtures.rs
Comment thread crates/ppvm-vihaco/tests/function_call_ret.sst
Comment thread crates/ppvm-vihaco/src/observable.rs
Comment thread crates/ppvm-vihaco/src/component.rs
Comment thread crates/ppvm-vihaco/src/bytecode.rs
Comment thread crates/ppvm-vihaco/src/bytecode.rs
Copilot AI review requested due to automatic review settings July 1, 2026 13:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 64 changed files in this pull request and generated 5 comments.

const.u64 0
circuit.measure

const.u64 0
Comment on lines +4 to +6
// Jump into the helper, which finishes the program with `halt`.
// Using `halt` instead of `ret` from the callee avoids depending on
// vihaco-cpu restoring a return PC, which it doesn't track today.
Comment on lines +3 to +5
// TODO: aspirational — depends on `ret <n>` restoring the caller's PC and
// leaving the top `n` values on the caller's stack. The runtime doesn't do
// this today (Frame has no return_pc), so this fixture currently fails.
Comment on lines +81 to +83
// `function_call.sst` has main `call` into `@run_circuit`, which puts q1
// in |+>, measures it, and `halt`s. Verifies CallPatch resolves the
// symbolic target and op_call actually transfers control there.
}
PPVMEffect::Measurement(effect) => {
let follow_ups = Observe::<MeasurementEffect>::observe(self, &effect)?;
// NOTE: push measurements to stack; two booleans: outcome, is_lost
@Roger-luo

Copy link
Copy Markdown
Collaborator

I'm gonna merge this first, we can come back to refactor if we are not happy with it, otherwise it's taking too long to review such a giant PR.

@Roger-luo Roger-luo merged commit 60de9c8 into main Jul 8, 2026
14 checks passed
@Roger-luo Roger-luo deleted the david/42-circuit-component branch July 8, 2026 03:56
Roger-luo added a commit that referenced this pull request Jul 8, 2026
Reverts #66.

PR #66 was squash-merged into `main` (commit `60de9c8b`) but is causing
repeated merge-conflict churn on `main`. This PR reverts that squash
commit, restoring `main` to exactly its pre-#66 state (verified:
reverted tree is identical to `2570637b`, the commit immediately before
the merge).

No work is lost:
- The full 104-commit change set still lives on branch
`david/42-circuit-component`.
- That branch is re-opened as a fresh PR (see below) so the useful
pieces can be re-introduced via targeted cherry-picks in separate,
smaller PRs.

Merge this first, then cherry-pick from the companion PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Roger-luo Roger-luo restored the david/42-circuit-component branch July 8, 2026 04:16
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.

feat: vihaco circuit component backed by ppvm simulators

3 participants