Skip to content

fix(core): Base only analysis - #311

Draft
Saloed wants to merge 97 commits into
mainfrom
saloed/base-only-analysis
Draft

fix(core): Base only analysis#311
Saloed wants to merge 97 commits into
mainfrom
saloed/base-only-analysis

Conversation

@Saloed

@Saloed Saloed commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Saloed
Saloed force-pushed the saloed/base-only-analysis branch from 397f02f to f7b857b Compare July 27, 2026 14:34
@Saloed
Saloed force-pushed the saloed/base-only-analysis branch from 3986f6c to 4c3148f Compare July 29, 2026 21:18
@Saloed
Saloed force-pushed the saloed/base-only-analysis branch from 88ffe6d to e32645b Compare August 13, 2026 10:13
Saloed and others added 10 commits August 13, 2026 11:54
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant