| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The previous capturedJumpStep shape introduced an independent Cfg::DefinitionNode and related it to the captured variable before nodeTo bound the relevant scope-entry definition. On substantial databases, the evaluator chose a plan that materialized a high-duplication store/variable join before applying the target entry and source-node constraints. Bind the scope-entry definition from nodeTo first, derive its source variable, and then match nodeFrom's DefinitionNode directly to that variable's store. This is relation-equivalent existential elimination: the old nodeFrom.asCfgNode() = def and def.getNode() = store constraints become nodeFrom.asCfgNode().(Cfg::DefinitionNode).getNode() = store, preserving the DefinitionNode type restriction and the unchanged enclosing-scope condition. On Airflow a9da0f7 with CodeQL 2.26.2, against exact github#21925 head 1a8e317: * The call-target diagnostic retains the identical 59,732-edge set while tuples joined fall from 1,032,403,207 to 66,969,953 (-93.5%), maximum duplication falls from 1,473,981 to 4,053, and evaluator wall time falls from 59.9s to 6.2s. * py/clear-text-logging-sensitive-data retains every result tuple (130 alerts, 256,708 path edges, 102,385 path nodes, and 116,976 subpaths) while tuples joined fall from 1,329,594,809 to 242,111,554 (-81.8%) and evaluator wall time falls from 94s to 14.4s. The preceding commit is intentionally a semantic call-target invariant diagnostic that passes on the unoptimized relation and after this rewrite. An inline MISSING/SPURIOUS red-state would assert an artificial semantic delta; this optimization must preserve every valid captured call target. These measurements cover one exact substantial Airflow database and two query shapes. No DCA was run, the fix does not reduce legitimate call-graph or path growth, and broader fleet performance remains to be confirmed separately. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5dfda5f5-08c8-481b-9ecb-299018701497
| Back | FazBrowse Home | New Git URL |
Depends on #21925.
Summary
This rewrites the captured-scope type-tracking jump so the scope-entry definition binds the source variable before the source CFG node is matched. The relation is unchanged, but the evaluator no longer materializes the high-duplication store/variable cross product induced by the previous join shape.
The old constraints introduced an independent Cfg::DefinitionNode def, related def to var.getVariable().getAStore(), and only then constrained nodeFrom = def. The new form binds e from nodeTo, derives var from e, and directly applies the same DefinitionNode.getNode() = store constraint to nodeFrom. This is existential elimination with the same type and scope restrictions, not a semantic change.
Diagnostic commit
Commit 1 is intentionally a semantic call-target invariant diagnostic, not an inline MISSING/SPURIOUS red-state. It records the valid captured-callable targets produced for decorator wrappers and captured type parameters in comprehensions, including the mechanism behind Airflow's legitimate _RegexpIgnoreRule.compile and _GlobIgnoreRule.compile targets. It passes before and after the optimization so that commit 2 must preserve the relation exactly. An annotation that failed before the fix would assert an artificial semantic delta and would not test this behavior-preserving plan optimization.
Exact Airflow measurement
Measured with CodeQL 2.26.2 on Airflow a9da0f7fb48dc7526b2745be3e8fe64e1c775da2, comparing exact #21925 head 1a8e317b4a328bea1059453a2ab3ba6eada09e3f to this branch:
No valid call target is suppressed.
Limitations
These measurements cover one exact substantial Airflow database and two query shapes. The fix does not reduce legitimate semantic call-graph or path growth, and fleet-wide performance remains to be confirmed. No DCA was launched.
Tests