feat: wire points-to solver max-iterations cap through DEFAULTS.analysis.pointsToMaxIterations#1868
Conversation
…sis.pointsToMaxIterations MAX_SOLVER_ITERATIONS was a hardcoded 50 in both the WASM points-to solver (points-to.ts) and the native Rust solver (build_edges.rs), duplicating but never reading DEFAULTS.analysis.pointsToMaxIterations. Threads a maxIterations parameter from the pipeline's resolved config through buildPointsToMap -> buildPointsToMapForFile -> buildCallEdgesJS/buildCallEdgesNative on the TS side, and through build_call_edges -> process_file -> build_file_context -> build_pts_map_for_file -> build_points_to_map on the Rust side, sourced from a new BuildConfig.analysis.points_to_max_iterations field deserialized from the JSON config payload already passed to the native engine. Default value (50) is unchanged when no override is configured. docs check acknowledged: no README/CLAUDE.md/ROADMAP.md updates needed — purely internal plumbing for an already-documented, already-accepted config key with no new CLI flags or user-facing surface. Fixes #1753 Impact: 7 functions changed, 6 affected
Greptile SummaryThis PR wires
Confidence Score: 4/5Safe to merge; default behavior is byte-for-byte unchanged and both engines are guarded by thorough unit and integration tests. The plumbing is clean and the algorithm is untouched. The only open gap is that Both Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[".codegraphrc.json\nanalysis.pointsToMaxIterations"] -->|loadConfig TS| B["ctx.config.analysis\n.pointsToMaxIterations"]
A -->|serde JSON| C["BuildConfig.analysis\n.points_to_max_iterations"]
B -->|JS path| D["buildCallEdgesJS()"]
B -->|Native JS-orchestrated| E["buildCallEdgesNative()\nnative.buildCallEdges(..., maxIterations)"]
D --> F["buildPointsToMapForFile(symbols, importedNames, maxIterations)"]
F --> G["buildPointsToMap(..., maxIterations)"]
G --> H["buildCallSiteTypeMap(pts, constraints, maxIterations)\nfor iter in 0..maxIterations"]
E -->|NAPI u32| I["build_call_edges(files, nodes, builtins, max_iterations)"]
C -->|Native-first pipeline| J["build_and_insert_call_edges(..., max_iterations)"]
J --> I
I --> K["process_file(..., max_iterations)"]
K --> L["build_file_context(..., max_iterations)"]
L --> M["build_pts_map_for_file(..., max_iterations)"]
M --> N["build_points_to_map(..., max_iterations)\nfor _ in 0..max_iterations"]
style H fill:#d4edda
style N fill:#d4edda
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[".codegraphrc.json\nanalysis.pointsToMaxIterations"] -->|loadConfig TS| B["ctx.config.analysis\n.pointsToMaxIterations"]
A -->|serde JSON| C["BuildConfig.analysis\n.points_to_max_iterations"]
B -->|JS path| D["buildCallEdgesJS()"]
B -->|Native JS-orchestrated| E["buildCallEdgesNative()\nnative.buildCallEdges(..., maxIterations)"]
D --> F["buildPointsToMapForFile(symbols, importedNames, maxIterations)"]
F --> G["buildPointsToMap(..., maxIterations)"]
G --> H["buildCallSiteTypeMap(pts, constraints, maxIterations)\nfor iter in 0..maxIterations"]
E -->|NAPI u32| I["build_call_edges(files, nodes, builtins, max_iterations)"]
C -->|Native-first pipeline| J["build_and_insert_call_edges(..., max_iterations)"]
J --> I
I --> K["process_file(..., max_iterations)"]
K --> L["build_file_context(..., max_iterations)"]
L --> M["build_pts_map_for_file(..., max_iterations)"]
M --> N["build_points_to_map(..., max_iterations)\nfor _ in 0..max_iterations"]
style H fill:#d4edda
style N fill:#d4edda
|
Codegraph Impact Analysis7 functions changed → 6 callers affected across 2 files
|
Summary
MAX_SOLVER_ITERATIONS = 50was hardcoded independently in both the WASM (points-to.ts) and native (build_edges.rs) points-to solvers, duplicatingDEFAULTS.analysis.pointsToMaxIterations, which was marked@reserved/unwired in both.maxIterationsthroughbuildPointsToMap→buildPointsToMapForFile→buildCallEdgesJS/buildCallEdgesNative, sourced fromctx.config.analysis.pointsToMaxIterations. Native side: addedAnalysisConfigtoBuildConfig(deserialized from the same JSON payload TS already sends), threaded throughbuild_call_edges→process_file→build_file_context→build_pts_map_for_file→build_points_to_map.Closes #1753
Test plan
npm test— full suite green (3513 passed, 0 failed)npm run lint— cleancargo test— 445 passed.codegraphrc.jsonoverrideFiled #1867 for an out-of-scope finding: a pre-existing unrelated compiler warning in
extractors/javascript.rs.Stacked on #1866 (base branch
fix/issue-1752-blast-radius-incremental-stale) — only the resolver/builder/config/test diff is this issue's change.