This repository was archived by the owner on Oct 26, 2026. It is now read-only.
Repository navigation
Ignore Unnecessary Simplification Pathways and other nice changes - #129
Merged
Merged
Conversation
Merged
gselzer
force-pushed
the
scijava-ops-engine/bag-of-goodies
branch
from
February 28, 2024 14:46
a7c83ed to
5cb3bef
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR makes a couple small changes that arose from work pertaining to #123 and #128, but were unrelated to both PRs and would be nice to share/utilize in both PRs. The major change added is the short-circuiting of unnecessary simplification pathways, which plagues the work in #123.
Unnecessary simplification pathways can be generated when simplification is required for only one parameter in an Op. For example, consider the Op
Computers.Arity3<Mat, Size, Double, Mat>, which we'd like to call as aComputers.Arity3<Mat, Size, Integer, Mat>. TheSimplifiedOpInfogenerated is aComputers.Arity3<RAI<?>, Size, Number, RAI<?>>, which can be matched with adequateengine.simplify,engine.focusandengine.copyOps. The resultingMat->RAI<?>->Matsimplification pathways, however, are completely unnecessary. This PR short-circuits such pathways within theFocusedOpInfo, saving lots of computation.A couple additional changes were made:
MatchingConditions.toString()was added for debugging convenience.DefaultOpMatcher.match's exception message no longer callsOpEnvironment.help()to avoidStackOverflowExceptions from repeated attempts at simplification.OpFieldInfos cannot have any dependencies.