Split multi-term reductions in hoist_invariants - #9388
Open
alexreinking wants to merge 1 commit into
Open
Conversation
alexreinking
commented
Aug 25, 2026
Comment on lines
+26
to
+28
| .def("hoist_invariants", [](Stage &stage) { | ||
| return std::vector<Func>(stage.hoist_invariants()); | ||
| }) |
Member
Author
There was a problem hiding this comment.
I don't bother to bind FuncVec in Python because std::vector gets turned into a list, which supports destructuring natively in the language, like:
(f_intm,) = f.hoist_invariants()
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## alexreinking/funcvecs #9388 +/- ##
=========================================================
+ Coverage 70.06% 70.19% +0.13%
=========================================================
Files 261 261
Lines 79483 79510 +27
Branches 19382 19391 +9
=========================================================
+ Hits 55693 55816 +123
+ Misses 17911 17899 -12
+ Partials 5879 5795 -84 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mcourteaux
force-pushed
the
alexreinking/hoist-splitting
branch
from
August 26, 2026 07:20
5138a6a to
e291904
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 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.
Adjusts
hoist_invariants(below in the stack) to return aFuncVec, where each entry is a separate handle to a parallel subterm, e.g.f() += a * g(r) + b * h(r)returns two intermediates (one for g, one for h), and replacesfwithf() += a * f_intm0() + b * f_intm1()(i.e. scales are still hoisted).Checklist
Stack created with GitHub Stacks CLI • Give Feedback 💬