Fix unused _d_i adjoints in hessian with -enable-va - #1880
Open
MdSaifAliMolla wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
vgvassilev
reviewed
Jul 9, 2026
| bool m_PrintNumericalDiffErrorDiag = false; | ||
| /// Stores AnalysisDeclContexts built for nested requests that don't go | ||
| /// through DiffPlanner's traversal. | ||
| std::vector<std::unique_ptr<clang::AnalysisDeclContext>> |
Owner
There was a problem hiding this comment.
Which requests do not go via the DiffPlanner? Ideally these should be zero.
Contributor
Author
There was a problem hiding this comment.
the nested reverse-mode request created inline by the Hessian forward→reverse pipeline bypasses DifffPlanner's normal traversal.
Owner
There was a problem hiding this comment.
I'd prefer fixing that issue, rather than working it around.
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
MdSaifAliMolla
marked this pull request as draft
July 9, 2026 17:13
MdSaifAliMolla
force-pushed
the
fix-1665
branch
2 times, most recently
from
July 10, 2026 11:27
6002a0b to
e0ddadf
Compare
Extract the duplicated AnalysisDeclContext/VariedAnalyzer setup from DiffCollector::VisitCallExpr and VisitCXXConstructExpr into a single PrepareRequestAnalysis() function. HandleNestedDiffRequest now calls this same function instead of maintaining a second copy of the logic, reusing CladPlugin's existing OwnedAnalysisContexts storage. shouldHaveAdjointForw checks VariedDecls when EnableVariedAnalysis is true, and VariedDecls seeding covers forward, hessian, and hessian_diagonal modes. Fixes vgvassilev#1665
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
MdSaifAliMolla
marked this pull request as ready for review
July 11, 2026 15:35
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.
shouldHaveAdjointForw now checks VariedDecls when EnableVariedAnalysis is true, and VariedDecls seeding covers forward, hessian, and hessian_diagonal modes. HandleNestedDiffRequest runs VariedAnalyzer for reverse-mode nested requests instead of unconditionally zeroing analysis flags.
Fixes #1665