Skip to content

Add verification tool #57

@denialhaag

Description

@denialhaag

Note

This issue is part of unitaryHACK 2026; note that you have to be registered to complete this issue. Learn more about the PR review process here

A message from unitaryHACK about AI Slop: "While we allow LLMs as collaborative tools, fully AI-generated PRs are prohibited. Maintainers have the right to reject any contribution that appears to be automated or lacks human oversight."

Learn more about unitaryHACK rules and opportunities here and about the usage of AI, in particular, here!

Description

The Cap'n Proto schema does not necessarily prevent the creation of invalid jeff programs. It would be nice to add a tool that can verify whether an encoded jeff program is valid.

A first version of this tool should check:

  • Are all required module attributes (e.g., version and entrypoint) set?
  • Is a value used before it is defined?
  • Are all values used in a function's body defined in its values list?
  • Are all input and output values of the expected type?
  • Are the input and output values of a given integer or float operation (e.g., add or max) of the same type (i.e., the same bitwidth or float precision)?
  • Is linearity respected, i.e., are all qubit and qureg values used exactly once?
  • Are all regions isolated from above?

Acceptance criteria

  • The verification tool can check all of the bullet points listed above.
  • Each bullet point is tested with at least one positive and one negative test.
  • The tests are run in the CI.
  • The verifier is implemented in either Python, Rust, or C++.
  • The implementation lives at tools/verifier/.

Metadata

Metadata

Assignees

Labels

C-feature-acceptedCategory: A feature request that has been accepted pending implementation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions