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

refactor: Validate hugrs before extension inference is run #943

Closed
croyzor opened this issue Apr 17, 2024 · 0 comments · Fixed by #1011
Closed

refactor: Validate hugrs before extension inference is run #943

croyzor opened this issue Apr 17, 2024 · 0 comments · Fixed by #1011
Assignees

Comments

@croyzor
Copy link
Contributor

croyzor commented Apr 17, 2024

Problem:

When we add extension parameters to extension inference, as in #713, we may run into the situation where the type variables don't actually make sense, causing inference to fail with an opaque error message. We check that type variables make sense during validation, but currently this happens after extension inference.

Proposed solution:

  • Separate extension validation from the rest of validation
  • Run general validation before extension inference is run
  • Then, run the extension validation
  • Down the line, we can think about merging extension inference with validation

Downside: This means traversing the graph for validation twice rather than just once

@croyzor croyzor self-assigned this Apr 17, 2024
github-merge-queue bot pushed a commit that referenced this issue May 8, 2024
A further refactor to validation. Note that the CI will fail without
#1010 because this change raises the hugr validity errors before the
extension errors. This seems like the win #943 is meant to give us 😁

Resolves #943
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant