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

[new] Validate IO nodes have resources matching parent signatures #375

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

croyzor
Copy link
Contributor

@croyzor croyzor commented Aug 8, 2023

Add a validation check that dataflow graph's input and output nodes have the same resource requirements as the incoming/outgoing wires of the parent.

@croyzor croyzor requested a review from aborgna-q August 8, 2023 13:29
@croyzor
Copy link
Contributor Author

croyzor commented Aug 8, 2023

I'm open to refactoring suggestions, because the code seems quite ugly

src/hugr/validate.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@aborgna-q aborgna-q left a comment

Choose a reason for hiding this comment

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

This should do for now.

If there was an specialized version of get_io (s/get_io/get_io_nodes/ and add get_io(parent: NodeIndex, dir: Direction)?) then we could remove the repeated code 🤔

@croyzor croyzor force-pushed the fix/io-resource-validation branch from 89548d9 to ae98d56 Compare August 9, 2023 13:14
@croyzor croyzor enabled auto-merge August 9, 2023 13:15
@croyzor croyzor added this pull request to the merge queue Aug 9, 2023
Merged via the queue into main with commit dc97710 Aug 9, 2023
@croyzor croyzor deleted the fix/io-resource-validation branch August 9, 2023 13:19
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.

2 participants