Repository navigation
Conversation
Since uber#1654, the executable type used for inference is the method's type as a member of its receiver, and computing it infers the receiver when the receiver is itself a generic call. inferCallType computed it twice for a call not yet inferred (constraints, then return type), and runInferenceForCall a third time for lambda argument types. Inference run from dataflow is never cached, so every generic call in a receiver chain doubled the work below it: checking a fluent chain such as `r.path(..).entity(..).isEqualTo(..)` repeated n times took O(4^n). Compute the executable type once and pass it to runInferenceForCall and generateConstraintsForCall. At 9 links, dataflow inference runs drop from 524,259 to 315; a 96-link chain now checks in under 1s. Assisted-by: Claude Code (claude-opus-5-5)
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: uber/NullAway/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughGeneric-call inference now computes executable types at call sites and reuses them for constraint generation, return-type substitution, and argument mapping. Nested generic calls and generic method-type substitution also pass computed executable types into inference. A new timeout-limited test checks that a 24-segment generic method chain reports a nullable argument at its final Suggested reviewers: Priority: ⬇️ Low Change: Bug fix Merge Risk: ⚪ Minimal · up to No merge-blocking issue is established; this change is ready for normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
msridhar
left a comment
There was a problem hiding this comment.
Thanks for the great fix and the test! I had a feeling I missed some pathological cases like this.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1896 +/- ##
============================================
+ Coverage 87.62% 87.67% +0.05%
Complexity 3499 3499
============================================
Files 110 110
Lines 11642 11641 -1
Branches 2403 2403
============================================
+ Hits 10201 10206 +5
+ Misses 664 657 -7
- Partials 777 778 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@ericschlarmann how critical is this fix for your codebase? Do you need a release soon that includes it? |
Thanks for the quick review and merge! |
…es (uber#2138) Several NullAway slowdowns and stack overflows share one shape: work whose cost grows with the checked code, repeated once per lookup, nesting level, or link of a call chain (uber#1327, uber#1896, uber#2079, uber#2093), or recursion that comes back to a question already in progress (uber#1760, uber#1842, uber#2090). AGENTS.md said nothing about it, so a coding or reviewing agent had no reason to look for either. The new Performance section states the rule and what a fix owes: a timeout or a count of the repeated work, a stack overflow for a cycle, and a test that shows a new cache or cycle guard hits. Whether a dataflow run is reused depends on the key of `DataFlow.CfgParams` (by leaf for constructors and initializers, by `TreePath` identity otherwise, see [`CfgParams.equals`](https://github.com/uber/NullAway/blob/c7732521fc6d4b23ef9efcc87a2ec49171080906/nullaway/src/main/java/com/uber/nullaway/dataflow/DataFlow.java#L436-L463)), so the section spells out which new paths rerun a method or a lambda. Some sites on master already rerun dataflow, some of them on purpose; the section points at uber#2137 for those, so that an agent flags a diff that adds a rerun rather than every diff that passes near an existing one. **Scope.** The section calls uber#2093 still open; that note goes once uber#2095 merges. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Added performance guidance for contributors covering repeated analysis work, rerun conditions, cycle risks, and regression-test expectations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Since #1654, the executable type used for inference is the method's type as a member of its receiver, and computing it infers the receiver when the receiver is itself a generic call. inferCallType computed it twice for a call not yet inferred (constraints, then return type), and runInferenceForCall a third time for lambda argument types. Inference run from dataflow is never cached, so every generic call in a receiver chain doubled the work below it: checking a fluent chain such as
r.path(..).entity(..).isEqualTo(..)repeated n times took O(4^n).Compute the executable type once and pass it to runInferenceForCall and generateConstraintsForCall. At 9 links, dataflow inference runs drop from 524,259 to 315; a 96-link chain now checks in under 1s.
Adds GenericMethodTests.longChainOfGenericInstanceMethodCalls, which times out on master and passes in about 0.1s with the fix. No existing test's diagnostics change.
I used Claude Code to bisect the regression to #1654, find the cause and write the fix and test. I have reviewed and understood all the changes.
Assisted-by: Claude Code (claude-opus-5-5)
Summary by CodeRabbit
Bug Fixes
Tests