Skip to content

Python shared CFG: optimize explicit-step binding order - #152

Draft
yoff wants to merge 1 commit into
yoff-python-cache-cfg-node-mapfrom
yoff-python-explicit-step-binding
Draft

Python shared CFG: optimize explicit-step binding order#152
yoff wants to merge 1 commit into
yoff-python-cache-cfg-node-mapfrom
yoff-python-explicit-step-binding

Conversation

@yoff

@yoff yoff commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

Introduce a private explicitAfterValue wrapper with bindingset[ast, successor] and pragma[inline_late], and use it only within explicitStep. This binds caller AST/successor demand before control-flow-node expansion. CFG semantics are unchanged; NodeImpl.isAfterValue is untouched.

This draft is stacked directly on yoff-python-cache-cfg-node-map at exact base SHA 133845e41556803743fbc1f76e7fce54941f20a1.

Validation

This is DCA-only aggregate validation, not a merge proposal.

  • Airflow: -48,951,260 combined joins (-4.379%).
  • Nova: -38,510,549 combined joins (-3.563%).
  • Salt: -74,634,190 combined joins (-5.486%).
  • Exact internal relations were equal for Rank6ExplicitStep, Rank6Succ, Rank6BlockMembership, Rank6BlockSucc, Rank6Dominates, Rank6Reachable, Rank6SsaReads, Rank6SsaWrites, and Rank6SsaPhi; target BQRS output was equal.
  • No new materialization was introduced.
  • Airflow clean-cache reproduction produced equal logical bytes.

Local validation:

  • codeql query format --check-only shared/controlflow/codeql/controlflow/ControlFlowGraph.qll
  • ExceptionReachabilityTest.ql
  • SsaTest.ql
  • Python shared-CFG dominance and evaluation-order suites (29 tests total; all passed)

This draft preserves the DCA experiment as a clean rank-6 stack layer and is not proposed for merge.

Late-inline the explicit-step after-value wrapper so AST and successor demand are bound before expanding control-flow nodes, without changing CFG semantics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.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