fix(core): Base only analysis - #311
Draft
Saloed wants to merge 97 commits into
Draft
Conversation
Saloed
force-pushed
the
saloed/base-only-analysis
branch
from
July 27, 2026 14:34
397f02f to
f7b857b
Compare
Saloed
force-pushed
the
saloed/base-only-analysis
branch
from
July 29, 2026 21:18
3986f6c to
4c3148f
Compare
Saloed
force-pushed
the
saloed/base-only-analysis
branch
from
August 13, 2026 10:13
88ffe6d to
e32645b
Compare
ThingsBoard analyzes EntityActionService#pushEntityActionToRuleEngine under ~110 distinct JVM argument-type contexts, reached through the generic logEntityAction. Zero and ClassStatic facts depend on neither receiver nor argument types, so every context re-tabulated the same flows through the same large branch-heavy CFG. Route those two fact kinds through the empty method context during the shallow scan. The context only narrows virtual dispatch, so widening it is an over-approximation. Lambda-bearing contexts stay exact: a functional-interface constraint is the only evidence of the callee implementation, because JIRCallResolver excludes lambda classes from override enumeration. The normalization is applied symmetrically at call handling and at trace lookup, and BaseOnly method-entry traces now also consider tainted caller subscriptions, so backward resolution finds the summaries the forward pass stored. Gate the policy on Phase.ShallowScan rather than on BaseOnlyApManager. The manager predicate also holds during a full scan run with --ifds-ap-mode BaseOnlyField, which would have silently shared contexts there too. Supporting reductions in the same shallow path: an access-level index for BaseOnly ND summaries, an exact prefix filter on ND subscription publication, per-call-site reuse of summary handlers and prepared summaries, a versioned cache for repeated ND premise searches, transparent-closure discovery extended to calls, and class-static footprints that no longer treat every unresolved call as an unknown observer. ThingsBoard at -Xmx12g: shallow forward 100.6s -> ~50s, rule search 37.5s -> ~10s, with the same 14 sink/source findings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
No description provided.