Skip to content

fix(compiler): list wildcard type roots with the compiler host to stop a panic with project references - #1048

Merged
camc314 merged 3 commits into
mainfrom
fix/1047-wildcard-types
Nov 20, 2026
Merged

camc314 merged 3 commits into
mainfrom
fix/1047-wildcard-types

Conversation

@camc314

@camc314 camc314 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

compilerOptions.types: ["*"] in a program that uses the sources of referenced projects panicked with should not be called by resolver. tsrs-lint and the language server load programs this way.

// tsconfig.json
{
  "compilerOptions": { "types": ["*"] },
  "references": [{ "path": "./lib" }]
}

resolve_automatic_type_directives listed the type roots through project_references.host. With source references, that is the dts faking host, and its get_accessible_entries is only for module resolution and panics. tsgo lists them with the compiler host's file system (p.host.FS(), internal/compiler/fileloader.go:293), and this does the same.

get_automatic_type_directive_names now takes (options, current_directory, fs), matching Go's (options, baseDirectory, fs). The directory is still the host's current directory, as it was, because ParsedCommandLine has no base directory.

Before, tsrs-lint headless exited 1 with the panic. Now the @types packages load and the rules run, and tsgo loads the same program with no diagnostics.

Fixes #1047

Copilot AI balanced review requested due to automatic review settings November 20, 2026 11:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T11:37:30.034172Z c9f12af New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@camc314
camc314 force-pushed the fix/1047-wildcard-types branch from b6de5dd to c9f12af Compare November 20, 2026 11:36
@camc314
camc314 enabled auto-merge November 20, 2026 11:36
@camc314
camc314 added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 9f74013 Nov 20, 2026
20 checks passed
@camc314
camc314 deleted the fix/1047-wildcard-types branch November 20, 2026 11:48
@codspeed

codspeed Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 3%

2 warnings

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 1 benchmark with a significant change ran on different hardware

Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 1 improved benchmark
✅ 7 untouched benchmarks
⏩ 8 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Memory drizzle-orm 102.2 MB 99.2 MB +3%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fix/1047-wildcard-types (c9f12af) with main (312f8ca)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@github-actions

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run · main 312f8ca70d67 → PR merge 4368dcd153d4 (head c9f12afd0e69)

Clef gate: Clef estimated 19.6% default and single-threaded wall time, 25.7% peak RSS, 27.5% single-threaded instruction count impact probability.

Release builds in fast mode (TSRS_FAST=1) with Hyperfine 2 hardware counters. After warming each binary, alternating main/PR pairs measure wall time at both the fast preset's default checker count and with --singleThreaded, with ten pairs per configuration by default. Instructions come from the single-threaded runs; peak RSS comes from the default-count runs.
Incremental runs start with fresh build info before every invocation; check runs disable incremental compilation.

Project Mode Single-thread wall time Δ Single-thread instructions Δ Default wall time Δ Default peak RSS Δ
vscode check +3.2% -0.001% -1.1% +0.4%
vscode incremental +3.0% -0.001% -0.9% 0.0%
xstate-main check -1.5% 0.000% -0.8% +0.5%
xstate-main incremental +0.3% -0.002% -0.9% +0.4%
webpack check -0.3% -0.002% -1.1% +0.6%
webpack incremental +1.4% 0.000% +0.4% +0.2%
mui-docs check -0.2% -0.003% -0.5% -1.1%
mui-docs incremental +0.5% -0.024% -0.5% -0.2%
Compiler check -0.4% -0.001% -1.7% +0.3%
Compiler incremental +1.7% 0.000% +0.6% 0.0%
Compiler-Unions check +3.1% 0.000% -1.9% +0.8%
Compiler-Unions incremental -1.2% 0.000% +0.3% +0.1%
cal-diy check -0.5% +0.001% -0.2% +0.7%
cal-diy incremental +0.3% -0.001% -0.5% -0.2%
formbricks-web check +2.6% -0.001% -3.3% 0.0%
formbricks-web incremental -0.8% 0.000% +0.8% -0.1%
supabase-studio check +0.2% 0.000% 0.0% -0.1%
supabase-studio incremental +0.4% +0.005% 0.0% 0.0%
t3code-server check -1.9% -0.002% -1.4% 0.0%
t3code-server incremental +1.0% -0.004% +0.3% +0.3%
mikro-orm check -6.6% +0.001% -1.5% 0.0%
mikro-orm incremental +7.5% -0.001% -3.5% -0.2%
next-packages-next check -1.0% +0.001% +2.7% -0.3%
next-packages-next incremental +3.1% -0.001% -1.3% +0.4%
next-root check -2.3% +0.002% -0.8% -0.1%
next-root incremental -8.8% +0.001% -1.2% +0.1%
storybook check +0.9% 0.000% -1.4% +0.1%
storybook incremental -1.2% +0.004% +1.9% -0.2%
nuxt check +3.1% -0.001% +2.3% +0.3%
nuxt incremental -1.8% -0.002% -1.1% +0.4%
playwright check -0.3% 0.000% -2.4% +0.1%
playwright incremental +1.0% +0.003% +2.9% -0.5%
drizzle-orm check +0.3% -0.001% +0.1% -0.3%
drizzle-orm incremental -0.1% -0.007% +1.2% 0.0%
typeorm check -0.6% +0.001% -0.8% +0.2%
typeorm incremental +1.5% +0.002% -1.9% -0.1%
date-fns check 0.0% -0.001% -0.9% -0.2%
date-fns incremental +1.1% -0.003% -0.2% -0.4%

Negative means the PR used less; positive means it used more. Deltas are medians of paired PR/main ratios for wall time and instructions. Single-threaded runs reduce scheduling noise; shared CI machines can still add noise to wall time.

Measured medians (main → PR)
Project Mode Single-thread wall time (s) Single-thread instructions Default wall time (s) Default peak RSS (MiB)
vscode check 12.718 → 13.214 82,249,763,326 → 82,248,749,831 2.115 → 2.098 1835.0 → 1842.4
vscode incremental 9.510 → 9.550 84,664,879,783.5 → 84,663,713,606.5 1.781 → 1.759 2159.9 → 2160.7
xstate-main check 0.633 → 0.627 5,563,481,495.5 → 5,563,473,908 0.149 → 0.148 243.0 → 244.3
xstate-main incremental 0.551 → 0.542 5,726,156,387 → 5,726,077,412 0.158 → 0.158 243.1 → 244.0
webpack check 0.938 → 0.940 10,882,152,355.5 → 10,882,046,139 0.213 → 0.217 403.6 → 405.9
webpack incremental 1.162 → 1.207 11,105,788,627.5 → 11,105,573,457.5 0.280 → 0.278 402.2 → 402.9
mui-docs check 2.433 → 2.426 33,089,810,826 → 33,088,476,560 0.955 → 0.931 1230.8 → 1217.6
mui-docs incremental 2.558 → 2.557 34,437,444,748.5 → 34,430,242,329 1.113 → 1.106 1162.5 → 1160.5
Compiler check 0.140 → 0.140 1,775,763,079 → 1,775,751,381.5 0.065 → 0.063 77.9 → 78.1
Compiler incremental 0.178 → 0.183 1,788,554,057.5 → 1,788,558,685 0.073 → 0.076 79.8 → 79.8
Compiler-Unions check 0.228 → 0.238 3,053,548,949.5 → 3,053,562,109 0.109 → 0.106 81.2 → 81.9
Compiler-Unions incremental 0.201 → 0.197 3,065,397,668.5 → 3,065,400,861 0.093 → 0.093 84.9 → 84.9
cal-diy check 2.686 → 2.650 28,947,338,194.5 → 28,947,527,464 0.822 → 0.822 1350.8 → 1359.9
cal-diy incremental 2.745 → 2.758 30,567,131,086.5 → 30,566,765,332.5 1.031 → 1.024 1268.1 → 1266.1
formbricks-web check 5.299 → 5.352 37,065,615,749 → 37,065,389,539 1.413 → 1.357 1581.2 → 1581.6
formbricks-web incremental 4.402 → 4.381 39,665,979,975 → 39,665,843,752 1.221 → 1.228 1624.6 → 1623.6
supabase-studio check 3.603 → 3.609 40,795,268,171 → 40,794,280,780 0.892 → 0.893 1308.7 → 1307.1
supabase-studio incremental 3.900 → 3.921 43,742,286,887.5 → 43,744,328,764.5 1.189 → 1.179 1363.5 → 1362.9
t3code-server check 4.243 → 4.218 41,051,955,866.5 → 41,050,746,698 1.770 → 1.741 1447.2 → 1447.3
t3code-server incremental 4.119 → 4.238 41,574,001,248 → 41,573,365,731 1.426 → 1.435 1304.5 → 1308.0
mikro-orm check 6.260 → 6.084 44,481,631,799 → 44,481,993,414.5 0.874 → 0.856 1280.4 → 1279.9
mikro-orm incremental 4.725 → 4.978 44,793,038,473 → 44,792,037,431 1.270 → 1.262 1260.9 → 1257.8
next-packages-next check 1.692 → 1.746 17,395,924,932.5 → 17,396,080,771.5 0.513 → 0.482 562.9 → 561.2
next-packages-next incremental 1.988 → 1.999 17,721,674,837 → 17,721,491,955 0.592 → 0.562 562.2 → 564.3
next-root check 1.253 → 1.254 13,952,821,710 → 13,953,200,317.5 0.273 → 0.272 432.8 → 432.2
next-root incremental 1.877 → 1.727 14,414,800,427 → 14,414,943,700.5 0.485 → 0.455 472.6 → 473.1
storybook check 0.908 → 0.890 8,861,597,646.5 → 8,861,547,566.5 0.204 → 0.199 397.3 → 397.8
storybook incremental 0.986 → 0.984 9,186,033,816.5 → 9,186,188,531.5 0.296 → 0.310 376.2 → 375.3
nuxt check 1.052 → 1.065 8,493,578,821.5 → 8,493,445,244 0.253 → 0.263 390.2 → 391.5
nuxt incremental 1.102 → 1.065 8,895,294,593.5 → 8,895,286,363 0.282 → 0.273 391.1 → 392.6
playwright check 0.709 → 0.711 7,400,457,760 → 7,400,451,158 0.200 → 0.195 360.9 → 361.3
playwright incremental 0.723 → 0.730 7,571,952,458.5 → 7,572,221,176.5 0.213 → 0.234 340.9 → 339.3
drizzle-orm check 0.578 → 0.609 5,945,835,485 → 5,945,530,695.5 0.181 → 0.177 382.3 → 381.1
drizzle-orm incremental 0.600 → 0.600 6,117,107,197 → 6,116,902,879.5 0.198 → 0.202 345.5 → 345.7
typeorm check 0.649 → 0.652 6,387,323,619 → 6,387,399,720.5 0.145 → 0.144 227.2 → 227.6
typeorm incremental 0.694 → 0.703 6,764,354,649.5 → 6,764,489,502.5 0.171 → 0.178 234.4 → 234.1
date-fns check 0.299 → 0.296 3,346,357,688.5 → 3,346,283,679 0.088 → 0.089 152.8 → 152.5
date-fns incremental 0.307 → 0.311 3,583,208,599 → 3,583,098,636 0.147 → 0.146 164.1 → 163.5

tsrs-lint

Release tsrs-lint linting each project's source files with all 61 rules. After a warmup run of each binary, alternating main/PR pairs (10 per mode) measure wall time, CPU time and peak RSS with TSRS_FAST unset and with TSRS_FAST=1.

Project Mode Wall time Δ CPU time Δ Peak RSS Δ Diagnostics (main → PR)
webpack default -0.7% 0.0% -0.2% 37258, identical
webpack TSRS_FAST=1 -3.1% -0.5% -0.2% 37258, identical
drizzle-orm default +1.7% +1.9% -0.2% 7057, identical
drizzle-orm TSRS_FAST=1 +1.5% +1.4% +0.2% 7057, identical
xstate-main default -2.2% -1.2% +0.2% 6489, identical
xstate-main TSRS_FAST=1 +3.3% +0.8% -0.3% 6489, identical

Negative means the PR used less. Wall and CPU time deltas are medians of paired PR/main ratios; peak RSS compares medians.

Measured lint medians (main → PR)
Project Mode Wall time (s) CPU time (s) Peak RSS (MiB)
webpack default 0.418 → 0.409 2.118 → 2.110 467.6 → 466.8
webpack TSRS_FAST=1 0.420 → 0.417 2.140 → 2.119 468.3 → 467.5
drizzle-orm default 0.235 → 0.244 1.247 → 1.284 404.4 → 403.4
drizzle-orm TSRS_FAST=1 0.234 → 0.245 1.263 → 1.270 403.1 → 404.1
xstate-main default 0.338 → 0.339 1.476 → 1.552 342.8 → 343.3
xstate-main TSRS_FAST=1 0.336 → 0.335 1.490 → 1.476 342.7 → 341.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

tsrs-lint panics ("should not be called by resolver") on types: ["*"] in a project with project references

2 participants