Skip to content

impact: walk the import closure back from the reached modules, not over the whole project (#1033) - #1786

Merged
swapnilpaliwal-sd merged 1 commit into
0.1.9from
loop/ty-is1033
Sep 29, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
0.1.9from
loop/ty-is1033

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

The flat ~40 s floor under every impact on a large project was one rule: imports_file, the transitive closure of every file's imports, rebuilt on every query by joining the relation to itself, whatever the target. Only import_hop reads it, and only for files of modules the change reaches.

  • imports_file is now seeded from those files and walked back linearly; it derives the same pairs.
  • New case typescript/runs-at-import-through-a-chain: a test reaching a module-level call only through a 3-file import chain with a cycle (fails with the recursion removed), plus a control chain that must reach nothing.

Checked: on a real 3.6k-file TypeScript project (39.8k symbols, 284k refs), 7 targets (file, Owner.method, bare name) went from 61–85 s to 4–17 s with identical --json answers; the closure had been 1.2M rows and 27 s of the solve. Control on a real NestJS app: 7/7 identical, time unchanged.

Closes #1033

Local: the 5 import cases pass (11/11); the full case suite, fastpath.py --lang typescript and query_rules.py were still running on the VM when this was opened.

…er the whole project (#1033)

imports_file was the transitive closure of every file's imports, built by
joining the relation to itself on every query whatever was asked. Only
import_hop reads it, and only for the files of modules the change reaches.
It is now seeded from those files and walked back linearly, which derives
the same pairs.

On a 3.6k-file TypeScript project the closure was 1.2M rows and 27 s of
the solve; impact goes from 61-85 s to 4-17 s over seven targets, with
identical JSON answers. A new case covers a chain of imports through a
cycle, with a control chain that reaches nothing.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit c53441e into 0.1.9 Sep 29, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the loop/ty-is1033 branch September 29, 2026 07:37
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