Repository navigation
fix: make the summary fixpoints converge - #266
Closed
SizzleUnrlsd wants to merge 2 commits into
Closed
SizzleUnrlsd wants to merge 2 commits into
SizzleUnrlsd wants to merge 2 commits into
Conversation
A summary listed its external calls in the order the rounds met them, a caller copying its callee's in the callee's order. Around a call cycle of three functions or more, that order rotated forever while the content had settled, so the order-sensitive comparison ending the module's fixpoint never held and the analysis never returned. Summaries now sort their external calls on the key record merges them on. The cache format moves to 17.
A call between two modules of an import cycle was a call to an unknown symbol on the first iteration and a project call on the next, so around a cycle of three modules the iteration shifted by one module each time and ran to MAX_PROJECT_ITERATIONS. The members' functions now start from the summaries SummaryAnalysis starts from, shared as starting_summaries. Closes #261.
Contributor
Author
|
Opened by mistake before deciding how to handle #265; closing for now. |
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.
Summary
Closes #261. Two mechanisms kept the summary fixpoints from converging; each has its own commit.
SummaryAnalysisnever held, and--checknever returned (ansible, fastapi, sentry, home-assistant).summarizesorts the external calls on the keyrecordmerges them on: location, call site, invocation site, symbol.MAX_PROJECT_ITERATIONS: ansible's 68-module component, sentry's 1,330.SummaryAnalysisstarts from, shared asstarting_summaries. The bound stays as a guard; no component of the corpus reaches it any more.The canonical order of the first commit was proposed independently in #265.
Compatibility
CACHE_FORMAT16 → 17: caches built by an earlier engine are recomputed once.orm-n-plus-one(Enterprise) names the first query of a callee's summary, now the first in source order. On saleor, 4 of 228 findings name another query of the same callee, at the same line.coretrace_python.interprocedural.starting_summaries.Tests
New file
tests/test_summary_fixpoint.py. No existing test or snapshot is changed.--checkin a subprocess with a timeout, so the failing case cannot hang the suite. Each must report its one injection.The new tests failed before the change for the expected reasons: timeout, order, 21 extractions against a bound of 20.
Mutations caught:
Removing the call site from the sort key is not caught. Two records share a location only from two call sites of the caller, met in its block order whatever the callee's order. The key keeps it anyway, so the order is total.
Verification
test_packaging, which also fails onmainin this environment);full-stack-fastapi-template, a PEP 758 syntax only 3.14 accepts, also differs onmain);Measurements
-j 16, Enterprise plugins, 38 projects without their test files, fixedPYTHONHASHSEED. Measured on a shared machine, so times are indicative.Findings on the projects 0.23.0 completes: unchanged, except the 4 saleor findings above. The suites pass unchanged against these engines.
These figures come from copies of 0.23.0 with the same changes. The measurements of this branch itself are pending, as the remote machine is unreachable; I will add them in a comment.