Python: cache shared SSA definition reachability - #148
Draft
yoff wants to merge 2 commits into
Draft
Conversation
Allow language-specific SSA instantiations that cross multiple cached API stages to cache the complete definition-rank and end-of-block reachability fixed points. Keep the default factory demand-specialized so unrelated instantiations retain their existing evaluator behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 07c775e7-cd7c-4e1c-8d97-5194ffd43e1a
Select the opt-in cached definition-reachability factory for Python main SSA. The independent capture-SSA instantiation continues to use the default uncached factory. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 07c775e7-cd7c-4e1c-8d97-5194ffd43e1a
Owner
Author
|
Broad isolated DCA launched: https://github.com/github/codeql-dca-main/issues/38887 Exact comparison: github#22465 |
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
This is a DCA-only stacked draft above github#22465. It is based directly on
yoff-python-cache-shared-ssa-livenessat8791147a0bc72325c35004ab741442cd7de3122d; this layer's head isfc71c20369d455a2ec5fb9969cafeabc62a03ccb.The layer contains two commits:
e9bb6ff417c7a5574ef3f1ff84637b029c10e9ca(SSA: add opt-in definition reachability caching) adds an opt-in shared-SSA factory that caches the complete definition-rank and end-of-block reachability fixed points while keeping the default factory demand-specialized.fc71c20369d455a2ec5fb9969cafeabc62a03ccb(Python: cache shared SSA definition reachability) selects that factory only for Python's main SSA instantiation.Capture SSA remains uncached:
VariableCapture.qllcontinues to instantiate the defaultSsa::Makefactory.Exact local evidence
Clean-cache serial controls retained exact BQRS/result hashes and unchanged complete result-generation hashes for the cached relations:
1,250,313,522 -> 1,243,689,535(-6,623,987,-0.53%), with 525 recursive runs removed.1,087,918,400 -> 1,084,198,621(-3,719,779,-0.34%), with 1,691 recursive runs removed.2,304,605,194 -> 2,241,319,019(-63,286,175,-2.75%), with 6,700 recursive runs removed.The main rank/end-of-block relations collapse from 2/2, 2/2, and 7/6 recursive materializations respectively to one each.
Validation
codeql query format --check-only -- shared/ssa/codeql/ssa/Ssa.qll python/ql/lib/semmle/python/dataflow/new/internal/SsaImpl.qllcodeql test run --search-path=. -- python/ql/test/library-tests/dataflow-new-ssa/SsaTest.ql python/ql/test/library-tests/dataflow-new-ssa/AdjacentUsesContract.qlBoth targeted tests pass.
Cache tradeoff
Tuple pools are unchanged. After clean-cache prewarm plus target and normal cleanup, persistent cache grows by
+7,172 KiBfor Airflow (363,004 -> 370,176 KiB,+1.98%) and+14,860 KiBfor Salt (509,484 -> 524,344 KiB,+2.92%).This draft is for DCA measurement only. It is not a merge proposal.