Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.

Ignore Unnecessary Simplification Pathways and other nice changes - #129

Merged
gselzer merged 4 commits into
mainfrom
scijava-ops-engine/bag-of-goodies
Feb 28, 2024
Merged

gselzer merged 4 commits into
mainfrom
scijava-ops-engine/bag-of-goodies

Conversation

@gselzer

@gselzer gselzer commented Feb 27, 2024

Copy link
Copy Markdown
Member

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 a Computers.Arity3<Mat, Size, Integer, Mat>. The SimplifiedOpInfo generated is a Computers.Arity3<RAI<?>, Size, Number, RAI<?>>, which can be matched with adequate engine.simplify, engine.focus and engine.copy Ops. The resulting Mat->RAI<?>->Mat simplification pathways, however, are completely unnecessary. This PR short-circuits such pathways within the FocusedOpInfo, saving lots of computation.

A couple additional changes were made:

  • MatchingConditions.toString() was added for debugging convenience.
  • DefaultOpMatcher.match's exception message no longer calls OpEnvironment.help() to avoid StackOverflowExceptions from repeated attempts at simplification.
  • Comments were added to explain why OpFieldInfos cannot have any dependencies.

@gselzer gselzer mentioned this pull request Feb 27, 2024
@gselzer
gselzer force-pushed the scijava-ops-engine/bag-of-goodies branch from a7c83ed to 5cb3bef Compare February 28, 2024 14:46
@gselzer
gselzer merged commit 0d9c28e into main Feb 28, 2024
@gselzer
gselzer deleted the scijava-ops-engine/bag-of-goodies branch February 28, 2024 14:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant