Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed distributive conditional types with never intersections #57345

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Feb 8, 2024

fixes #57343

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Feb 8, 2024
@RyanCavanaugh
Copy link
Member

@typescript-bot test this
@typescript-bot test top200
@typescript-bot user test this
@typescript-bot user test tsserver
@typescript-bot test tsserver top200
@typescript-bot run dt
@typescript-bot perf test this
@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 8, 2024

Heya @RyanCavanaugh, I've started to run the diff-based top-repos suite (tsserver) on this PR at 91afaf5. You can monitor the build here.

Update: The results are in!

@typescript-bot

This comment was marked as resolved.

@typescript-bot

This comment was marked as resolved.

@typescript-bot

This comment was marked as resolved.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 8, 2024

Heya @RyanCavanaugh, I've started to run the regular perf test suite on this PR at 91afaf5. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 8, 2024

Heya @RyanCavanaugh, I've started to run the diff-based top-repos suite on this PR at 91afaf5. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 8, 2024

Heya @RyanCavanaugh, I've started to run the tarball bundle task on this PR at 91afaf5. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 8, 2024

Hey @RyanCavanaugh, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/159797/artifacts?artifactName=tgz&fileId=123FE79CD523A80733878DE1DDAE50032A4D6B311796B8C4DDB8FA02C552FE4302&fileName=/typescript-5.4.0-insiders.20240208.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.4.0-pr-57345-8".;

@typescript-bot
Copy link
Collaborator

@RyanCavanaugh Here are the results of running the user test suite comparing main and refs/pull/57345/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

puppeteer

packages/browsers/test/src/tsconfig.json

@typescript-bot
Copy link
Collaborator

@RyanCavanaugh Here are the results of running the user test suite comparing main and refs/pull/57345/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

@RyanCavanaugh
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 295,651k (± 0.00%) 295,664k (± 0.01%) ~ 295,649k 295,710k p=0.422 n=6
Parse Time 2.66s (± 0.00%) 2.67s (± 0.15%) +0.01s (+ 0.31%) 2.66s 2.67s p=0.007 n=6
Bind Time 0.83s (± 1.32%) 0.83s (± 1.18%) ~ 0.82s 0.84s p=0.738 n=6
Check Time 8.21s (± 0.15%) 8.21s (± 0.33%) ~ 8.18s 8.26s p=0.934 n=6
Emit Time 7.10s (± 0.34%) 7.09s (± 0.25%) ~ 7.07s 7.12s p=0.744 n=6
Total Time 18.79s (± 0.16%) 18.80s (± 0.15%) ~ 18.78s 18.86s p=0.569 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 192,482k (± 1.22%) 192,972k (± 1.26%) ~ 191,512k 197,444k p=0.261 n=6
Parse Time 1.36s (± 1.46%) 1.35s (± 0.77%) ~ 1.33s 1.36s p=0.213 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 0.00%) ~ 0.72s 0.72s p=1.000 n=6
Check Time 9.37s (± 0.32%) 9.36s (± 0.54%) ~ 9.31s 9.43s p=0.572 n=6
Emit Time 2.63s (± 0.63%) 2.61s (± 0.77%) ~ 2.59s 2.64s p=0.145 n=6
Total Time 14.07s (± 0.28%) 14.04s (± 0.35%) ~ 14.00s 14.11s p=0.172 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,454k (± 0.00%) 347,472k (± 0.01%) ~ 347,426k 347,515k p=0.199 n=6
Parse Time 2.48s (± 0.21%) 2.48s (± 0.42%) ~ 2.47s 2.50s p=0.242 n=6
Bind Time 0.93s (± 0.59%) 0.93s (± 0.56%) ~ 0.92s 0.93s p=0.640 n=6
Check Time 6.96s (± 0.44%) 6.96s (± 0.62%) ~ 6.92s 7.03s p=1.000 n=6
Emit Time 4.06s (± 0.70%) 4.06s (± 0.19%) ~ 4.05s 4.07s p=0.622 n=6
Total Time 14.42s (± 0.31%) 14.43s (± 0.27%) ~ 14.39s 14.48s p=0.519 n=6
TFS - node (v18.15.0, x64)
Memory used 302,861k (± 0.01%) 302,862k (± 0.01%) ~ 302,835k 302,891k p=0.873 n=6
Parse Time 2.01s (± 1.03%) 2.00s (± 0.52%) ~ 1.99s 2.02s p=0.459 n=6
Bind Time 1.01s (± 0.97%) 1.00s (± 0.41%) ~ 0.99s 1.00s p=0.056 n=6
Check Time 6.34s (± 0.56%) 6.34s (± 0.55%) ~ 6.31s 6.40s p=0.571 n=6
Emit Time 3.60s (± 0.32%) 3.60s (± 0.42%) ~ 3.58s 3.62s p=0.621 n=6
Total Time 12.95s (± 0.27%) 12.94s (± 0.32%) ~ 12.90s 12.99s p=0.809 n=6
material-ui - node (v18.15.0, x64)
Memory used 511,354k (± 0.00%) 511,373k (± 0.00%) ~ 511,352k 511,402k p=0.065 n=6
Parse Time 2.65s (± 0.57%) 2.66s (± 0.51%) ~ 2.63s 2.67s p=0.867 n=6
Bind Time 0.99s (± 0.83%) 0.99s (± 1.05%) ~ 0.97s 1.00s p=0.932 n=6
Check Time 17.33s (± 0.37%) 17.31s (± 0.38%) ~ 17.24s 17.42s p=0.574 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.98s (± 0.27%) 20.96s (± 0.31%) ~ 20.91s 21.07s p=0.747 n=6
mui-docs - node (v18.15.0, x64)
Memory used 2,269,076k (± 0.00%) 2,269,083k (± 0.00%) ~ 2,269,068k 2,269,113k p=0.810 n=6
Parse Time 11.91s (± 1.05%) 11.89s (± 0.74%) ~ 11.77s 12.02s p=0.936 n=6
Bind Time 2.64s (± 0.44%) 2.65s (± 0.28%) ~ 2.64s 2.66s p=0.150 n=6
Check Time 101.90s (± 1.05%) 101.77s (± 0.67%) ~ 100.89s 102.62s p=1.000 n=6
Emit Time 0.32s (± 1.28%) 0.32s (± 1.28%) ~ 0.31s 0.32s p=1.000 n=6
Total Time 116.76s (± 0.87%) 116.63s (± 0.56%) ~ 115.90s 117.50s p=0.936 n=6
self-build-src - node (v18.15.0, x64)
Memory used 2,413,744k (± 0.02%) 2,413,478k (± 0.03%) ~ 2,412,669k 2,414,386k p=0.688 n=6
Parse Time 4.93s (± 0.75%) 4.91s (± 0.92%) ~ 4.88s 5.00s p=0.470 n=6
Bind Time 1.88s (± 0.93%) 1.88s (± 0.29%) ~ 1.87s 1.88s p=0.663 n=6
Check Time 33.38s (± 0.34%) 33.45s (± 0.22%) ~ 33.35s 33.56s p=0.423 n=6
Emit Time 2.70s (± 0.76%) 2.70s (± 1.83%) ~ 2.64s 2.76s p=0.748 n=6
Total Time 42.90s (± 0.31%) 42.95s (± 0.28%) ~ 42.85s 43.12s p=0.810 n=6
self-compiler - node (v18.15.0, x64)
Memory used 418,736k (± 0.01%) 418,761k (± 0.01%) ~ 418,737k 418,818k p=0.199 n=6
Parse Time 2.80s (± 2.88%) 2.80s (± 2.48%) ~ 2.66s 2.84s p=0.627 n=6
Bind Time 1.10s (± 5.00%) 1.10s (± 5.44%) ~ 1.07s 1.22s p=0.796 n=6
Check Time 15.07s (± 0.31%) 15.13s (± 0.40%) ~ 15.04s 15.21s p=0.109 n=6
Emit Time 1.13s (± 0.48%) 1.14s (± 1.53%) ~ 1.12s 1.17s p=0.360 n=6
Total Time 20.11s (± 0.21%) 20.17s (± 0.27%) ~ 20.12s 20.25s p=0.077 n=6
vscode - node (v18.15.0, x64)
Memory used 2,827,237k (± 0.00%) 2,827,238k (± 0.00%) ~ 2,827,216k 2,827,258k p=1.000 n=6
Parse Time 10.73s (± 0.32%) 10.69s (± 0.14%) ~ 10.67s 10.71s p=0.073 n=6
Bind Time 3.42s (± 0.50%) 3.44s (± 0.60%) ~ 3.41s 3.47s p=0.292 n=6
Check Time 60.15s (± 0.42%) 60.19s (± 0.64%) ~ 59.61s 60.55s p=0.575 n=6
Emit Time 16.25s (± 0.36%) 16.13s (± 0.61%) ~ 16.01s 16.25s p=0.054 n=6
Total Time 90.55s (± 0.31%) 90.46s (± 0.45%) ~ 89.86s 90.92s p=0.936 n=6
webpack - node (v18.15.0, x64)
Memory used 393,463k (± 0.01%) 393,980k (± 0.02%) +517k (+ 0.13%) 393,897k 394,072k p=0.005 n=6
Parse Time 3.13s (± 0.52%) 3.12s (± 0.44%) ~ 3.10s 3.13s p=0.254 n=6
Bind Time 1.38s (± 0.92%) 1.38s (± 1.42%) ~ 1.36s 1.41s p=0.934 n=6
Check Time 14.05s (± 0.27%) 14.06s (± 0.35%) ~ 14.00s 14.12s p=0.418 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 18.55s (± 0.25%) 18.56s (± 0.31%) ~ 18.47s 18.64s p=0.809 n=6
xstate - node (v18.15.0, x64)
Memory used 513,387k (± 0.01%) 513,432k (± 0.02%) ~ 513,314k 513,596k p=0.298 n=6
Parse Time 3.28s (± 0.31%) 3.28s (± 0.23%) ~ 3.27s 3.29s p=0.437 n=6
Bind Time 1.54s (± 0.67%) 1.54s (± 0.00%) ~ 1.54s 1.54s p=0.599 n=6
Check Time 2.85s (± 0.59%) 2.86s (± 1.28%) ~ 2.81s 2.91s p=0.568 n=6
Emit Time 0.08s (± 4.99%) 0.08s (± 4.99%) ~ 0.08s 0.09s p=1.000 n=6
Total Time 7.75s (± 0.26%) 7.77s (± 0.49%) ~ 7.72s 7.83s p=0.371 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,347ms (± 0.62%) 2,337ms (± 0.73%) ~ 2,323ms 2,370ms p=0.335 n=6
Req 2 - geterr 5,555ms (± 1.52%) 5,584ms (± 1.10%) ~ 5,461ms 5,623ms p=0.810 n=6
Req 3 - references 324ms (± 1.34%) 324ms (± 0.96%) ~ 321ms 330ms p=0.507 n=6
Req 4 - navto 276ms (± 1.39%) 273ms (± 1.11%) ~ 271ms 279ms p=0.235 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 89ms (± 5.57%) 92ms (± 4.26%) ~ 84ms 94ms p=0.321 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,503ms (± 0.60%) 2,474ms (± 1.02%) ~ 2,444ms 2,508ms p=0.092 n=6
Req 2 - geterr 4,127ms (± 0.21%) 4,230ms (± 1.78%) +103ms (+ 2.50%) 4,129ms 4,285ms p=0.020 n=6
Req 3 - references 336ms (± 2.02%) 332ms (± 0.92%) ~ 329ms 338ms p=0.747 n=6
Req 4 - navto 285ms (± 0.18%) 284ms (± 0.41%) ~ 283ms 286ms p=0.078 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 82ms (±10.68%) 78ms (± 4.74%) ~ 74ms 84ms p=0.675 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,599ms (± 0.63%) 2,599ms (± 0.58%) ~ 2,578ms 2,623ms p=0.575 n=6
Req 2 - geterr 1,718ms (± 3.50%) 1,710ms (± 2.16%) ~ 1,666ms 1,748ms p=0.810 n=6
Req 3 - references 118ms (± 9.65%) 115ms (± 9.01%) ~ 107ms 128ms p=0.933 n=6
Req 4 - navto 370ms (± 0.28%) 370ms (± 0.97%) ~ 363ms 373ms p=0.459 n=6
Req 5 - completionInfo count 2,078 (± 0.00%) 2,078 (± 0.00%) ~ 2,078 2,078 p=1.000 n=6
Req 5 - completionInfo 311ms (± 1.31%) 307ms (± 1.98%) ~ 298ms 315ms p=0.217 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstateTSServer - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 154.12ms (± 0.20%) 153.98ms (± 0.18%) -0.13ms (- 0.09%) 152.87ms 158.06ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 229.48ms (± 0.17%) 229.42ms (± 0.17%) -0.06ms (- 0.03%) 228.12ms 234.76ms p=0.026 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 231.14ms (± 0.18%) 231.00ms (± 0.16%) -0.15ms (- 0.06%) 229.44ms 234.08ms p=0.002 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 231.02ms (± 0.20%) 230.95ms (± 0.18%) ~ 229.25ms 235.09ms p=0.172 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

Hey @RyanCavanaugh, the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@typescript-bot
Copy link
Collaborator

@RyanCavanaugh Here are the results of running the top-repos suite comparing main and refs/pull/57345/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

@RyanCavanaugh Here are the results of running the top-repos suite comparing main and refs/pull/57345/merge:

Something interesting changed - please have a look.

Details

Server exited prematurely with code unknown and signal SIGABRT

Server exited prematurely with code unknown and signal SIGABRT

Affected repos

calcom/cal.com Raw error text: RepoResults4/calcom.cal.com.rawError.txt in the artifact folder

Last few requests

{"seq":899,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/apps/storybook/tailwind.config.js","line":1,"offset":23,"entryNames":["eslint-preset"]}}
{"seq":900,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/apps/storybook/tailwind.config.js","line":2,"offset":5}}
{"seq":901,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/apps/api/test/jest-setup.js"],"openFiles":[]}}
{"seq":902,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/apps/swagger/lib/snippets.ts","projectRootPath":"@PROJECT_ROOT@"}]}}

Repro steps

  1. git clone https://github.com/calcom/cal.com --recurse-submodules
  2. In dir cal.com, run git reset --hard f06ef84f617b1682f15721918bcff09f56335544
  3. In dir cal.com, run yarn install --no-immutable --mode=skip-build
  4. Back in the initial folder, download RepoResults4/calcom.cal.com.replay.txt from the artifact folder
  5. npm install --no-save @typescript/server-replay
  6. npx tsreplay ./cal.com ./calcom.cal.com.replay.txt path/to/tsserver.js
  7. npx tsreplay --help to learn about helpful switches for debugging, logging, etc

Copy link
Member

@ahejlsberg ahejlsberg left a comment

Choose a reason for hiding this comment

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

Not sure what to make of the premature exit here, but otherwise looks good.

@Andarist
Copy link
Contributor Author

Andarist commented Feb 9, 2024

Not sure what to make of the premature exit #57345 (comment), but otherwise looks good.

I don't think this is related, we can see the same failure reported 4 days ago here

@RyanCavanaugh RyanCavanaugh merged commit e2bf8b4 into microsoft:main Feb 9, 2024
@RyanCavanaugh
Copy link
Member

How long before the first "I can't get this repro shorter than 60 lines" bug bisects to this PR? 😅

@Andarist
Copy link
Contributor Author

Andarist commented Feb 9, 2024

The time will tell 😅 If that happens you can count on me doing some quality investigation on what and why has happened 😉

@Andarist Andarist deleted the fix/distributive-conditional-never-intersection branch February 9, 2024 20:36
@RyanCavanaugh
Copy link
Member

A little under 3 months, as it turns out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Conditional type unexpectedly non-distributive with never
4 participants