Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

result extension not exposed as ExtensionOp #529

Closed
qartik opened this issue Aug 7, 2024 · 1 comment · Fixed by CQCL/guppylang#367
Closed

result extension not exposed as ExtensionOp #529

qartik opened this issue Aug 7, 2024 · 1 comment · Fixed by CQCL/guppylang#367
Assignees
Labels
bug Something isn't working

Comments

@qartik
Copy link
Member

qartik commented Aug 7, 2024

The recent result extension added in #494 seems to not be exposed as an ExtensionOp but only as opaque, ie, as_extension_op() returns None on a node containing the result HUGR.

Here's a sample HUGR that I was trying to process via hugr-llvm:

&args.node().as_ref() = Opaque(
    OpaqueOp {
        extension: IdentList(
            "tket2.results",
        ),
        name: "Result",
        description: "",
        args: [
            Type {
                ty: TypeBase(
                    Sum(
                        Unit {
                            size: 2,
                        },
                    ),
                    Copyable,
                ),
            },
            BoundedNat {
                n: 0,
            },
        ],
        signature: FuncTypeBase {
            input: TypeRowBase {
                types: [
                    TypeBase(
                        Sum(
                            Unit {
                                size: 2,
                            },
                        ),
                        Copyable,
                    ),
                ],
            },
            output: TypeRowBase {
                types: [],
            },
            extension_reqs: ExtensionSet(
                {},
            ),
        },
    },
)
@qartik qartik added the bug Something isn't working label Aug 7, 2024
@aborgna-q aborgna-q self-assigned this Aug 7, 2024
@aborgna-q
Copy link
Collaborator

aborgna-q commented Aug 8, 2024

Turns out this is a bug in guppy.
The extension name should be tket2.result (without an s), and the operation should be called result_uint

See CQCL/guppylang#367

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants