Skip to content

chore(deps): updated vihaco dependency to 0.4.0 - #214

Merged
kaihsin merged 7 commits into
QuEraComputing:mainfrom
robpatterson13:rob/update-to-vihaco-0.4.0
Aug 27, 2026
Merged

chore(deps): updated vihaco dependency to 0.4.0#214
kaihsin merged 7 commits into
QuEraComputing:mainfrom
robpatterson13:rob/update-to-vihaco-0.4.0

Conversation

@robpatterson13

Copy link
Copy Markdown
Contributor

Summary

Migrates ppvm-vihaco and vihaco-circuit-isa from vihaco 0.1.1 to vihaco 0.4.0.

Changes

  • Migrates PPVM to vihaco 0.4.0 surface/runtime instruction APIs.
  • Replaces the legacy parser pipeline with v0.4 parsing and resolution.
  • Generates the circuit instruction set with vihaco::component!.
  • Enforces one-to-one source-to-runtime instruction lowering.
  • Updates .sst syntax, including:
 const.u64 0 → cpu::cpu.const u64, 0
eq.u32 → cpu::cpu.eq u32
circuit.h → circuit::circuit.h
ret → cpu::cpu.ret 0
@label: → cpu::cpu.label @label
  • Resolves branch targets and function calls to runtime addresses.
  • Adds bytecode v2 serialization for function tables, labels, signatures, and main_function.
  • Updates CLI, TUI, examples, embedded programs, and test fixtures.
  • Adds and updates migration documentation in docs/changelog/vihaco-0.4.md.

Verification

  • cargo test --workspace
  • cargo check -p ppvm-vihaco
  • cargo test -p ppvm-vihaco
  • cargo test -p vihaco-circuit-isa
  • cargo test -p ppvm-cli
  • cargo test -p ppvm-tui

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👋 Thanks for opening your first pull request against PPVM!

A quick note on contribution terms: by submitting this PR you
agree that your contribution is licensed under the
Apache License 2.0
and that you accept the
PPVM Contributor License Agreement.
Please skim those before a maintainer reviews — opening this PR
counts as your acceptance.

A few things that will speed up review:

We'll get to your PR as soon as we can. Thanks for contributing!

@rafaelha
rafaelha self-requested a review August 26, 2026 00:20

@david-pldavid-pl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@robpatterson13 overall looks good, just some cosmetic comments. Agent review found two issues (which probably weren't introduced here, but still):

  1. Symbolic function references such as @helper fail because FunctionRef operands are parsed only as numeric IDs.
  2. main_function is stored as a code address instead of a function ID, and execution always starts at PC 0 rather than at @main.

Here are some failing tests (run as part of tests in ppvm-vihaco/src/lib.rs):

#[test]fnsymbolic_function_ref_calls_named_function(){let src = "device circuit.n_qubits 1;\n\ fn @main() {\n\ cpu::cpu.const fn_ref, @helper\n\ cpu::cpu.call_indirect\n\ cpu::cpu.ret 0\n\ }\n\ fn @helper() {\n\ cpu::cpu.const u64, 0\n\ circuit::circuit.measure\n\ cpu::cpu.ret 0\n\ }\n";let machine = run_program(src).expect("symbolic function reference should resolve");assert_eq!(machine.measurement_record().len(),1);}#[test]fnexecution_starts_at_main_when_helper_is_declared_first(){let src = "device circuit.n_qubits 1;\n\ fn @helper() {\n\ cpu::cpu.const u64, 0\n\ circuit::circuit.x\n\ cpu::cpu.ret 0\n\ }\n\ fn @main() {\n\ cpu::cpu.const u64, 0\n\ circuit::circuit.measure\n\ cpu::cpu.ret 0\n\ }\n";let module = compile_program(src).expect("program should compile");letmut machine = PPVM::default();
machine.load(&module).expect("module should load");
machine.run().expect("program should run");assert_eq!((module.main_function, machine.measurement_record().len()),(Some(1),1),"main_function should be a function-table ID and execution should begin at @main");}

Also, CI is blocked because the pre-commit hooks fail in an unrelated crate (not sure why). Would you mind fixing that so CI actually runs on the PR?

I'll approve the changes, feel free to merge once the above things are cleared up.

Comment threadcrates/ppvm-cli/examples/ghz.sst
Comment threadcrates/ppvm-vihaco/src/bytecode.rs Outdated
Comment threadcrates/ppvm-vihaco/src/composite.rs Outdated
Comment threadcrates/ppvm-vihaco/Cargo.toml
Comment threaddocs/changelog/vihaco-0.4.md
@kaihsin
kaihsin merged commit de21697 into QuEraComputing:mainAug 27, 2026
12 of 13 checks passed
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-27 16:30 UTC

david-pl added a commit that referenced this pull request Sep 1, 2026
Keep main's #214 clippy fixes (arg structs, type annotations) over the
Co-authored-by: Cursor <cursoragent@cursor.com>
#193 #[allow] workarounds on the five overlapping tableau files.
Sign up for freeto 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.

3 participants

@robpatterson13@david-pl@kaihsin