Allow function bodies to (initially) contain duplicate nodes#637
Merged
inducer merged 2 commits intoinducer:mainfrom Feb 24, 2026
Merged
Allow function bodies to (initially) contain duplicate nodes#637inducer merged 2 commits intoinducer:mainfrom
inducer merged 2 commits intoinducer:mainfrom
Conversation
6bcc82c to
80fe016
Compare
…n code InputGatherer is too strict, as it will error on any duplicated nodes in the function body
80fe016 to
1e3bacb
Compare
1e3bacb to
9eec7a5
Compare
Owner
|
Could you speak a bit about the rationale for this change? |
Collaborator
Author
Yeah. Duplicates can arise from ordinary math operations on the application side; it shouldn't be an error for them to be present initially. We just remove them at the start of DAG transforming. But |
Owner
|
Makes sense, thx! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FunctionDefinitionusesInputGathererwhen searching the DAG for its argument placeholders, which gives an error if the function body initially contains any duplicate nodes. This relaxes that requirement by adding aListOfInputsGathererthat caches byidinstead. (Note: the argument placeholders themselves are still not allowed to be duplicated, but AFAIK that shouldn't ever happen.)