fix(native): stop scoping full-build dataflow-vertex extraction to files with edges - #2573
Merged
Conversation
…les with edges runDataflowVertexPass's full-build file selection only included native-language files that already had dataflow EDGE rows (flows_to/returns/mutates) from the Rust orchestrator, on the theory that a file with no edges would produce zero vertices anyway. That theory is wrong: a plain leaf function with params and a return but no calls to or from any other function has zero inter-procedural edges yet still has vertex-worthy params/returns -- extractDataflowAnalysis's vertex output isn't gated on argFlows/assignments/mutations being non-empty. In practice this meant the native engine silently dropped dataflow_vertices for most files in a typical codebase, while WASM recorded them unconditionally. Confirmed via node scripts/parity-compare.mjs --dataflow: the full 34-language fixture suite goes from 1/42 fixtures OK on df-vertices to 42/42 (the one remaining jelly-micro divergence is the pre-existing, unrelated technique-label mismatch filed as #2572). Fixes the filter to include any native-language file with at least one function/method definition (via the nodes table), matching what actually determines whether a file can produce vertices. docs check acknowledged. Closes #2483 Impact: 1 functions changed, 4 affected
Contributor
Greptile SummaryThe PR corrects native full-build dataflow-vertex selection by processing files containing callable definitions rather than requiring existing inter-procedural dataflow edges.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
Build["Native graph build"] --> Mode{"Full build?"}
Mode -->|Yes| Query["Select files containing callable nodes"]
Mode -->|No, changed files| Changed["Select changed files"]
Mode -->|No changes| Skip["Skip vertex pass"]
Query --> Extract["Extract native dataflow analysis"]
Changed --> Extract
Extract --> Persist["Persist parameter, return, and local vertices"]
Reviews (2): Last reviewed commit: "fix: skip dataflow-vertex full-build sca..." | Re-trigger Greptile |
Contributor
Codegraph Impact Analysis2 functions changed → 5 callers affected across 4 files
|
…tal rebuild Caught by CI's perf-canary: broadening runDataflowVertexPass's full-build file filter (previous commit) also broadened how many files a literal no-op incremental rebuild re-scans, since changedFiles=[] fell into the same "full build" branch as changedFiles=undefined. Adds the same "quiet incremental: nothing changed" early return backfillEdgeTechniquesAfterNativeOrchestrator already has for the identical isFullBuild=false, changedFiles=[] case, just above it in the same file. Verified locally: dataflow_vertices from a full build are still present after a following no-op incremental rebuild (no data loss), and a genuinely-changed file still gets its vertices re-extracted on an incremental rebuild. The actual wall-clock regression this fixes is measured by CI's own benchmark gate, which caught the original bug. docs check acknowledged. Impact: 2 functions changed, 5 affected
Contributor
Author
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
runDataflowVertexPass's full-build file selection (the P6 pass that backfillsdataflow_verticesafter the Rust orchestrator's edge-only dataflow pass) only included native-language files that already haddataflowEDGE rows (flows_to/returns/mutates) — on the theory that a file with no edges would produce zero vertices anyway.That theory is wrong: a plain leaf function with params and a return but no calls to or from any other function has zero inter-procedural edges, yet still has vertex-worthy params/returns —
extractDataflowAnalysis's vertex output isn't gated onargFlows/assignments/mutationsbeing non-empty. In practice this meant the native engine silently droppeddataflow_verticesfor most files in a typical codebase (confirmed empirically:bind-call-apply.js,class-scope.js,define-property.js,define-property-accessor.jsin thejavascriptfixture, plus most ofhierarchy.ts/index.ts/serializer.tsintypescriptand several files inpts-javascript, all had zero native-engine vertices while WASM recorded them correctly), while WASM has always recorded vertices unconditionally.Fix: the filter now includes any native-language file with at least one function/method definition (checked via the
nodestable,kind IN CALLABLE_SYMBOL_KINDS) — which is what actually determines whether a file can produce vertices, not edge presence.Verification
node scripts/parity-compare.mjs --dataflowacross the full 34-language fixture suite:javascript,typescript,pts-javascriptall diverged on df-vertices (17/20/6 missing vertex rows respectively)jelly-microdivergence is a pre-existing, unrelatedtechnique-label mismatch oncallsedges (0 node/edge/df-vertex diffs beyond that), filed separately as bug(parity): native engine tags inherited-method call edges as ts-native instead of cha (jelly-micro classes/classes2) #2572The originally-filed issue's own note ("
--dataflowrequires migration v18 — worth checking whether the test DB has that migration applied") turned out not to be the cause — this was a genuine extraction-scoping bug, not a migration issue.Test plan
tests/integration/issue-2483-native-dataflow-vertices-leaf-functions.test.ts— a real dual-function leaf-function fixture built end-to-end throughbuildGraphwith the native engine, confirming both functions' param/return vertices are recorded[](zero vertices) for both new testsdataflow-vertices,dataflow-p4-native,dataflow-incremental) still pass (28 passed)npx tsc --noEmit -p .,npm run lint, fullnpm test(5487 passed)parity-compare.mjs --dataflowrun across all 34 language fixtures (42/42 OK on df-vertices)Closes #2483