Skip to content

fix(checker): stop an arity underflow on an optional JSDoc this parameter - #1090

Merged
camc314 merged 1 commit into
mainfrom
fix/jsdoc-optional-this-arity
Nov 25, 2026
Merged

camc314 merged 1 commit into
mainfrom
fix/jsdoc-optional-this-arity

Conversation

@camc314

@camc314 camc314 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

An optional JSDoc this parameter stops is_arity_smaller's count at zero, and the function then subtracts one for that this parameter. Go's count is signed and becomes -1. Ours is a usize, so it panicked in overflow-checked builds and would wrap in release builds, dropping the contextual signature.

/** @type {{ m: (x: number) => number }} */
const obj = {
  /**
   * @this {any}
   * @param {any} [this]
   */
  m(...args) { args[1]; return args.length; }
};

With allowJs, checkJs and noImplicitAny, tsgo keeps the contextual signature and reports TS2493 on args[1] for [x: number]. tsrs panicked with attempt to subtract with overflow and exited 5.

Saturating at zero matches Go's -1, since no signature has a negative parameter count. The case is added as a regression fixture.

Copilot AI balanced review requested due to automatic review settings November 25, 2026 14:26
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 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-25T14:27:02.231277Z 096dce0 PR opened
ℹ️ 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.

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.

@github-actions

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run Β· main 64bd6bfb1cb4 β†’ PR merge c1a88a54f3d0 (head 096dce002b94)

Clef gate: Clef estimated 19.6% default and single-threaded wall time, 20.5% peak RSS, 31.2% 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 +0.5% +0.001% -4.7% +0.3%
vscode incremental -0.3% -0.002% +0.7% 0.0%
xstate-main check -1.5% -0.001% +2.7% -0.1%
xstate-main incremental +0.9% +0.001% +0.4% -0.2%
webpack check +0.4% +0.002% +0.6% -0.3%
webpack incremental -0.3% +0.001% -1.0% -0.4%
mui-docs check -0.2% +0.005% +0.6% +0.5%
mui-docs incremental -3.4% -0.012% +8.1% -0.2%
Compiler check +2.2% 0.000% -2.7% +0.7%
Compiler incremental +5.5% 0.000% +0.7% -2.0%
Compiler-Unions check +9.2% 0.000% -4.4% +0.3%
Compiler-Unions incremental -2.3% 0.000% +0.7% -0.2%
cal-diy check -0.6% +0.004% -1.1% +0.2%
cal-diy incremental -2.5% +0.001% -0.8% -0.4%
formbricks-web check -1.4% -0.004% -0.1% -0.1%
formbricks-web incremental +0.7% +0.002% -0.5% 0.0%
supabase-studio check +1.9% -0.001% +4.7% -0.1%
supabase-studio incremental +0.1% +0.004% +2.1% +0.1%
t3code-server check +2.8% 0.000% +0.2% -0.1%
t3code-server incremental +2.7% -0.002% +0.5% -0.2%
mikro-orm check -0.9% 0.000% +0.2% +0.3%
mikro-orm incremental 0.0% +0.002% +0.2% -0.2%
next-packages-next check +0.6% -0.001% +1.9% -0.4%
next-packages-next incremental +1.1% -0.002% +1.4% +0.3%
next-root check -0.1% 0.000% -0.4% -0.4%
next-root incremental -0.1% +0.001% +4.4% +0.1%
storybook check +0.6% -0.001% +0.4% +0.6%
storybook incremental +1.9% -0.006% +2.6% 0.0%
nuxt check +0.5% -0.001% +0.5% +0.5%
nuxt incremental -2.5% +0.003% -1.0% +0.1%
playwright check +4.7% +0.001% 0.0% +1.0%
playwright incremental -3.4% +0.001% -3.4% +0.3%
drizzle-orm check -0.6% -0.003% -4.5% -0.9%
drizzle-orm incremental -0.3% -0.007% -0.5% -0.2%
typeorm check +1.1% -0.002% -5.5% +0.5%
typeorm incremental -0.8% -0.003% -0.6% -0.1%
date-fns check +2.7% +0.006% +1.8% +1.4%
date-fns incremental +0.5% +0.008% -3.5% -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 9.665 β†’ 10.423 82,265,702,789 β†’ 82,266,730,426.5 2.335 β†’ 2.292 1837.6 β†’ 1843.4
vscode incremental 9.634 β†’ 9.366 84,684,242,375 β†’ 84,683,161,931 1.783 β†’ 1.803 2159.5 β†’ 2160.3
xstate-main check 0.682 β†’ 0.684 5,566,845,258.5 β†’ 5,566,783,439.5 0.171 β†’ 0.175 243.1 β†’ 242.8
xstate-main incremental 0.570 β†’ 0.567 5,728,523,645.5 β†’ 5,728,511,324 0.165 β†’ 0.167 244.0 β†’ 243.5
webpack check 0.917 β†’ 0.929 10,885,386,701.5 β†’ 10,885,738,917.5 0.196 β†’ 0.195 405.1 β†’ 403.7
webpack incremental 0.992 β†’ 0.991 11,109,204,472 β†’ 11,109,435,027 0.298 β†’ 0.262 404.9 β†’ 403.2
mui-docs check 2.651 β†’ 2.669 33,107,278,444.5 β†’ 33,106,082,574.5 0.968 β†’ 0.997 1233.8 β†’ 1239.6
mui-docs incremental 3.718 β†’ 3.554 34,466,271,014 β†’ 34,460,702,409 1.274 β†’ 1.370 1163.7 β†’ 1161.7
Compiler check 0.182 β†’ 0.189 1,775,534,691 β†’ 1,775,536,573 0.094 β†’ 0.091 76.2 β†’ 76.7
Compiler incremental 0.166 β†’ 0.182 1,789,925,656.5 β†’ 1,789,925,212 0.069 β†’ 0.071 81.3 β†’ 79.6
Compiler-Unions check 0.262 β†’ 0.286 3,053,238,989.5 β†’ 3,053,239,147.5 0.114 β†’ 0.111 81.4 β†’ 81.7
Compiler-Unions incremental 0.306 β†’ 0.300 3,064,787,304 β†’ 3,064,792,794.5 0.158 β†’ 0.156 85.0 β†’ 84.8
cal-diy check 2.642 β†’ 2.653 28,974,827,284 β†’ 28,976,047,518.5 0.840 β†’ 0.830 1354.4 β†’ 1357.0
cal-diy incremental 3.252 β†’ 3.222 30,595,741,332 β†’ 30,596,910,733.5 1.289 β†’ 1.268 1269.7 β†’ 1265.1
formbricks-web check 3.762 β†’ 3.837 37,088,828,036 β†’ 37,087,846,716.5 0.884 β†’ 0.877 1582.0 β†’ 1580.0
formbricks-web incremental 3.912 β†’ 3.910 39,693,913,146.5 β†’ 39,693,961,361.5 1.371 β†’ 1.375 1624.7 β†’ 1624.0
supabase-studio check 4.702 β†’ 4.763 40,826,407,763.5 β†’ 40,825,616,783 1.187 β†’ 1.174 1306.6 β†’ 1305.6
supabase-studio incremental 4.923 β†’ 4.785 43,772,232,458.5 β†’ 43,771,691,237.5 1.214 β†’ 1.170 1364.3 β†’ 1366.0
t3code-server check 4.955 β†’ 5.109 41,058,410,017 β†’ 41,057,926,146 1.714 β†’ 1.792 1444.3 β†’ 1442.7
t3code-server incremental 4.625 β†’ 4.666 41,585,128,573.5 β†’ 41,583,562,474 1.519 β†’ 1.556 1306.9 β†’ 1303.8
mikro-orm check 4.515 β†’ 4.421 44,485,187,767.5 β†’ 44,484,620,628 0.899 β†’ 0.897 1274.9 β†’ 1278.3
mikro-orm incremental 4.878 β†’ 4.876 44,796,083,016.5 β†’ 44,796,715,778.5 1.187 β†’ 1.157 1260.9 β†’ 1258.7
next-packages-next check 1.458 β†’ 1.465 17,406,363,148.5 β†’ 17,406,145,755 0.392 β†’ 0.419 561.8 β†’ 559.5
next-packages-next incremental 2.028 β†’ 2.015 17,732,974,581.5 β†’ 17,732,750,951.5 0.512 β†’ 0.516 563.4 β†’ 565.4
next-root check 1.185 β†’ 1.191 13,996,206,720.5 β†’ 13,996,199,566.5 0.306 β†’ 0.307 432.4 β†’ 430.5
next-root incremental 1.318 β†’ 1.326 14,458,782,788 β†’ 14,458,895,595.5 0.396 β†’ 0.463 474.2 β†’ 474.8
storybook check 0.882 β†’ 0.876 8,867,567,588 β†’ 8,867,531,407 0.216 β†’ 0.216 398.0 β†’ 400.2
storybook incremental 0.892 β†’ 0.902 9,193,165,948 β†’ 9,192,694,555 0.287 β†’ 0.277 375.6 β†’ 375.7
nuxt check 1.018 β†’ 1.029 8,502,205,605.5 β†’ 8,502,128,323 0.251 β†’ 0.259 389.2 β†’ 391.3
nuxt incremental 1.172 β†’ 1.133 8,904,498,383 β†’ 8,904,760,852 0.256 β†’ 0.251 392.5 β†’ 393.0
playwright check 0.871 β†’ 0.889 7,403,222,875.5 β†’ 7,403,353,352 0.218 β†’ 0.226 362.5 β†’ 366.0
playwright incremental 1.505 β†’ 1.167 7,576,881,978.5 β†’ 7,576,906,248.5 0.323 β†’ 0.247 339.4 β†’ 340.2
drizzle-orm check 0.512 β†’ 0.512 5,948,826,876.5 β†’ 5,948,587,390.5 0.170 β†’ 0.166 380.2 β†’ 376.8
drizzle-orm incremental 0.531 β†’ 0.534 6,120,506,915.5 β†’ 6,120,147,708.5 0.276 β†’ 0.278 346.0 β†’ 345.3
typeorm check 0.671 β†’ 0.676 6,398,364,024 β†’ 6,398,289,389.5 0.149 β†’ 0.141 225.7 β†’ 226.8
typeorm incremental 0.878 β†’ 0.879 6,776,276,593 β†’ 6,776,059,643.5 0.239 β†’ 0.233 233.2 β†’ 232.9
date-fns check 0.313 β†’ 0.311 3,352,137,996 β†’ 3,352,489,859.5 0.099 β†’ 0.097 150.9 β†’ 153.0
date-fns incremental 0.327 β†’ 0.331 3,589,235,459 β†’ 3,590,210,349 0.170 β†’ 0.165 163.3 β†’ 162.7

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 +1.0% +3.3% -0.1% 35405, identical
webpack TSRS_FAST=1 +1.7% +1.7% 0.0% 35405, identical
drizzle-orm default -0.3% -1.4% -0.3% 7057, identical
drizzle-orm TSRS_FAST=1 -5.4% -1.9% 0.0% 7057, identical
xstate-main default -1.8% -2.1% -1.1% 6489, identical
xstate-main TSRS_FAST=1 0.0% +0.3% -0.2% 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.471 β†’ 0.490 2.376 β†’ 2.494 463.7 β†’ 463.1
webpack TSRS_FAST=1 0.466 β†’ 0.462 2.370 β†’ 2.355 463.0 β†’ 463.2
drizzle-orm default 0.247 β†’ 0.245 1.308 β†’ 1.287 404.0 β†’ 402.8
drizzle-orm TSRS_FAST=1 0.259 β†’ 0.249 1.344 β†’ 1.313 403.5 β†’ 403.3
xstate-main default 0.372 β†’ 0.356 1.626 β†’ 1.579 343.6 β†’ 339.9
xstate-main TSRS_FAST=1 0.360 β†’ 0.363 1.609 β†’ 1.592 343.8 β†’ 343.1

@camc314
camc314 added this pull request to the merge queue Nov 25, 2026
@codspeed

codspeed Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

Warning

oxc-project has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed.

1 warning

⚠️ 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

βœ… 8 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing fix/jsdoc-optional-this-arity (096dce0) with main (64bd6bf)

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. ↩

Merged via the queue into main with commit 1e17a12 Nov 25, 2026
71 checks passed
@camc314
camc314 deleted the fix/jsdoc-optional-this-arity branch November 25, 2026 14:54
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.

2 participants