Skip to content

Handle multiple levels of substitutions and indexed accesses in getActualTypeVariable #52848

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

Merged
merged 3 commits into from
Feb 21, 2023

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Feb 19, 2023

Fixes #49556

#48837 added a special case to getConditionalFlowTypeOfType that adds a constraint of number | `${number}` to K in a homomorphic mapped type like { [K in keyof T]: XXX } when T is a tuple or array. This resulted in a substitution within the indexed access to account for the constraint.

getActualTypeVariable was already equipped to handle a substitution within an indexed access, so most things worked fine. All good so far.

However, in inference, we end up with the opposite; there's an indexed access within a substitution, but getActualTypeVariable didn't handle that case. So, when inference went to try and add an inference, it'd getActualTypeVariable the target, but then fail to find the type variable in the inference context because the intended type variable was still one more level deep.

So, let getActualTypeVariable recurse on substitutions too, ensuring the inference gets added, allowing the code in #49556 to continue working as it did before TS 4.7.


(To find this, I just partially reverted #48837 and compared the inference by stepping through; in the good case, I had the right inference and it added it, but in the bad case, it still had the right inference but couldn't find where to add it; comparing the __debugTypeToString() showed that they looked the same, and I just tried running getActualTypeVariable again and surprise, they had the same ID.)

@jakebailey
Copy link
Member Author

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 19, 2023

Heya @jakebailey, I've started to run the tarball bundle task on this PR at 58ccfee. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 19, 2023

Heya @jakebailey, I've started to run the extended test suite on this PR at 58ccfee. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 19, 2023

Heya @jakebailey, I've started to run the parallelized Definitely Typed test suite on this PR at 58ccfee. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 19, 2023

Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at 58ccfee. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 19, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 19, 2023

Heya @jakebailey, I've started to run the diff-based user code test suite (tsserver) on this PR at 58ccfee. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 19, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 19, 2023

Heya @jakebailey, I've started to run the perf test suite on this PR at 58ccfee. You can monitor the build here.

Update: The results are in!

@jakebailey jakebailey changed the title Handle multiple levesl of substitutions and indexed accesses in getActualTypeVariable Handle multiple levels of substitutions and indexed accesses in getActualTypeVariable Feb 19, 2023
@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 19, 2023

Hey @jakebailey, 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/146965/artifacts?artifactName=tgz&fileId=425189B15A735779FE2CBCA3F3CF37C49047475B17A90FE1F371025960868D0D02&fileName=/typescript-5.0.0-insiders.20230219.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/[email protected]".;

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

Heya @jakebailey, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here.

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..52848
Metric main 52848 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 359,691k (± 0.01%) 359,669k (± 0.02%) ~ 359,621k 359,764k p=0.471 n=6
Parse Time 3.49s (± 0.80%) 3.48s (± 1.03%) ~ 3.43s 3.53s p=0.687 n=6
Bind Time 1.18s (± 0.88%) 1.17s (± 0.54%) ~ 1.16s 1.18s p=0.203 n=6
Check Time 8.77s (± 0.31%) 8.74s (± 0.44%) ~ 8.69s 8.79s p=0.293 n=6
Emit Time 7.58s (± 0.56%) 7.56s (± 0.45%) ~ 7.49s 7.58s p=0.629 n=6
Total Time 21.01s (± 0.41%) 20.95s (± 0.40%) ~ 20.81s 21.05s p=0.422 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 189,913k (± 0.03%) 189,897k (± 0.03%) ~ 189,835k 189,963k p=0.575 n=6
Parse Time 1.48s (± 0.55%) 1.48s (± 0.70%) ~ 1.47s 1.50s p=0.932 n=6
Bind Time 0.79s (± 0.69%) 0.80s (± 0.79%) ~ 0.79s 0.81s p=0.201 n=6
Check Time 9.46s (± 0.44%) 9.46s (± 0.51%) ~ 9.40s 9.53s p=1.000 n=6
Emit Time 2.78s (± 0.58%) 2.80s (± 1.21%) ~ 2.76s 2.86s p=0.325 n=6
Total Time 14.51s (± 0.38%) 14.53s (± 0.58%) ~ 14.45s 14.69s p=0.936 n=6
Monaco - node (v18.10.0, x64)
Memory used 344,065k (± 0.02%) 344,051k (± 0.01%) ~ 344,005k 344,121k p=0.748 n=6
Parse Time 2.64s (± 1.26%) 2.62s (± 0.75%) ~ 2.60s 2.65s p=0.294 n=6
Bind Time 1.04s (± 0.72%) 1.04s (± 0.39%) ~ 1.04s 1.05s p=0.389 n=6
Check Time 7.10s (± 0.29%) 7.13s (± 0.59%) ~ 7.07s 7.18s p=0.420 n=6
Emit Time 4.32s (± 0.63%) 4.32s (± 0.79%) ~ 4.28s 4.36s p=0.466 n=6
Total Time 15.10s (± 0.18%) 15.10s (± 0.34%) ~ 15.01s 15.17s p=0.744 n=6
TFS - node (v18.10.0, x64)
Memory used 300,067k (± 0.01%) 300,063k (± 0.01%) ~ 300,029k 300,090k p=1.000 n=6
Parse Time 2.04s (± 0.82%) 2.06s (± 0.71%) +0.02s (+ 1.06%) 2.04s 2.08s p=0.049 n=6
Bind Time 1.17s (± 0.35%) 1.17s (± 0.64%) ~ 1.16s 1.18s p=1.000 n=6
Check Time 6.58s (± 0.53%) 6.56s (± 0.46%) ~ 6.52s 6.60s p=0.294 n=6
Emit Time 3.91s (± 0.50%) 3.91s (± 0.50%) ~ 3.89s 3.94s p=0.627 n=6
Total Time 13.70s (± 0.43%) 13.70s (± 0.36%) ~ 13.63s 13.76s p=0.936 n=6
material-ui - node (v18.10.0, x64)
Memory used 476,422k (± 0.01%) 476,454k (± 0.01%) ~ 476,431k 476,503k p=0.054 n=6
Parse Time 3.15s (± 0.48%) 3.14s (± 0.86%) ~ 3.10s 3.18s p=0.324 n=6
Bind Time 0.96s (± 0.57%) 0.96s (± 0.42%) ~ 0.96s 0.97s p=0.282 n=6
Check Time 17.26s (± 1.02%) 17.22s (± 0.47%) ~ 17.07s 17.31s p=0.470 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.38s (± 0.87%) 21.32s (± 0.46%) ~ 21.13s 21.41s p=0.422 n=6
xstate - node (v18.10.0, x64)
Memory used 548,614k (± 0.03%) 548,661k (± 0.03%) ~ 548,429k 548,809k p=0.689 n=6
Parse Time 4.06s (± 0.42%) 4.07s (± 0.34%) ~ 4.05s 4.09s p=0.223 n=6
Bind Time 1.73s (± 0.85%) 1.73s (± 0.79%) ~ 1.71s 1.75s p=0.568 n=6
Check Time 2.81s (± 1.05%) 2.82s (± 0.57%) ~ 2.80s 2.84s p=0.418 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 4.99%) ~ 0.08s 0.09s p=0.405 n=6
Total Time 8.69s (± 0.36%) 8.70s (± 0.27%) ~ 8.67s 8.73s p=0.376 n=6
Angular - node (v16.17.1, x64)
Memory used 359,047k (± 0.01%) 359,055k (± 0.01%) ~ 358,993k 359,086k p=0.419 n=6
Parse Time 3.73s (± 0.36%) 3.73s (± 0.38%) ~ 3.71s 3.75s p=0.934 n=6
Bind Time 1.22s (± 0.33%) 1.23s (± 0.66%) ~ 1.22s 1.24s p=0.056 n=6
Check Time 9.55s (± 0.43%) 9.58s (± 0.67%) ~ 9.49s 9.68s p=0.520 n=6
Emit Time 8.08s (± 0.86%) 8.05s (± 0.49%) ~ 8.01s 8.12s p=0.520 n=6
Total Time 22.57s (± 0.41%) 22.59s (± 0.46%) ~ 22.47s 22.72s p=0.810 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 191,616k (± 0.03%) 191,534k (± 0.02%) -82k (- 0.04%) 191,470k 191,571k p=0.031 n=6
Parse Time 1.55s (± 1.39%) 1.56s (± 0.94%) ~ 1.54s 1.58s p=1.000 n=6
Bind Time 0.84s (± 0.48%) 0.84s (± 0.48%) ~ 0.84s 0.85s p=1.000 n=6
Check Time 10.14s (± 0.33%) 10.11s (± 0.47%) ~ 10.05s 10.18s p=0.334 n=6
Emit Time 3.06s (± 0.73%) 3.06s (± 0.92%) ~ 3.03s 3.10s p=0.512 n=6
Total Time 15.59s (± 0.33%) 15.56s (± 0.32%) ~ 15.49s 15.61s p=0.573 n=6
Monaco - node (v16.17.1, x64)
Memory used 343,342k (± 0.00%) 343,338k (± 0.01%) ~ 343,288k 343,372k p=0.936 n=6
Parse Time 2.79s (± 0.63%) 2.80s (± 0.50%) ~ 2.78s 2.82s p=0.677 n=6
Bind Time 1.11s (± 0.73%) 1.11s (± 0.47%) ~ 1.10s 1.11s p=0.140 n=6
Check Time 7.79s (± 0.80%) 7.81s (± 0.19%) ~ 7.78s 7.82s p=0.747 n=6
Emit Time 4.52s (± 0.38%) 4.50s (± 0.98%) ~ 4.44s 4.56s p=0.627 n=6
Total Time 16.21s (± 0.47%) 16.22s (± 0.41%) ~ 16.15s 16.31s p=1.000 n=6
TFS - node (v16.17.1, x64)
Memory used 299,423k (± 0.00%) 299,428k (± 0.00%) ~ 299,413k 299,438k p=0.297 n=6
Parse Time 2.20s (± 0.34%) 2.19s (± 0.41%) ~ 2.18s 2.20s p=0.149 n=6
Bind Time 1.25s (± 0.51%) 1.26s (± 0.65%) ~ 1.25s 1.27s p=0.177 n=6
Check Time 7.25s (± 0.30%) 7.23s (± 0.47%) ~ 7.18s 7.27s p=0.257 n=6
Emit Time 4.22s (± 0.31%) 4.22s (± 0.96%) ~ 4.16s 4.28s p=0.570 n=6
Total Time 14.92s (± 0.22%) 14.88s (± 0.49%) ~ 14.79s 15.00s p=0.229 n=6
material-ui - node (v16.17.1, x64)
Memory used 475,701k (± 0.00%) 475,701k (± 0.01%) ~ 475,665k 475,733k p=0.873 n=6
Parse Time 3.33s (± 0.70%) 3.33s (± 0.16%) ~ 3.32s 3.33s p=0.931 n=6
Bind Time 1.02s (± 0.00%) 1.02s (± 0.51%) ~ 1.01s 1.02s p=0.174 n=6
Check Time 18.16s (± 0.32%) 18.22s (± 0.41%) ~ 18.10s 18.30s p=0.227 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.51s (± 0.25%) 22.56s (± 0.36%) ~ 22.43s 22.66s p=0.228 n=6
xstate - node (v16.17.1, x64)
Memory used 546,057k (± 0.01%) 546,101k (± 0.01%) ~ 546,031k 546,175k p=0.298 n=6
Parse Time 4.26s (± 0.43%) 4.26s (± 0.35%) ~ 4.24s 4.28s p=0.684 n=6
Bind Time 1.80s (± 0.45%) 1.80s (± 0.67%) ~ 1.79s 1.82s p=1.000 n=6
Check Time 3.06s (± 0.65%) 3.08s (± 0.33%) +0.02s (+ 0.76%) 3.07s 3.10s p=0.046 n=6
Emit Time 0.09s (± 4.45%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=0.405 n=6
Total Time 9.21s (± 0.25%) 9.23s (± 0.19%) ~ 9.20s 9.25s p=0.195 n=6
Angular - node (v14.15.1, x64)
Memory used 352,565k (± 0.01%) 352,514k (± 0.05%) ~ 352,143k 352,636k p=0.378 n=6
Parse Time 3.74s (± 0.81%) 3.71s (± 0.64%) ~ 3.67s 3.74s p=0.168 n=6
Bind Time 1.28s (± 0.32%) 1.28s (± 0.64%) ~ 1.26s 1.28s p=0.218 n=6
Check Time 9.82s (± 0.45%) 9.83s (± 0.56%) ~ 9.76s 9.90s p=0.873 n=6
Emit Time 8.38s (± 0.91%) 8.37s (± 0.28%) ~ 8.35s 8.41s p=1.000 n=6
Total Time 23.22s (± 0.48%) 23.19s (± 0.26%) ~ 23.11s 23.26s p=0.748 n=6
Compiler-Unions - node (v14.15.1, x64)
Memory used 187,716k (± 0.90%) 186,660k (± 0.03%) ~ 186,580k 186,698k p=1.000 n=6
Parse Time 1.58s (± 0.40%) 1.58s (± 0.48%) ~ 1.57s 1.59s p=0.718 n=6
Bind Time 0.85s (± 0.64%) 0.86s (± 0.88%) ~ 0.85s 0.87s p=0.476 n=6
Check Time 10.21s (± 0.38%) 10.24s (± 0.31%) ~ 10.20s 10.28s p=0.090 n=6
Emit Time 3.17s (± 0.63%) 3.17s (± 1.50%) ~ 3.11s 3.23s p=1.000 n=6
Total Time 15.81s (± 0.28%) 15.85s (± 0.28%) ~ 15.79s 15.89s p=0.370 n=6
Monaco - node (v14.15.1, x64)
Memory used 338,186k (± 0.00%) 338,196k (± 0.01%) ~ 338,172k 338,216k p=0.422 n=6
Parse Time 2.90s (± 0.59%) 2.91s (± 0.18%) ~ 2.90s 2.91s p=0.352 n=6
Bind Time 1.11s (± 0.75%) 1.11s (± 1.10%) ~ 1.10s 1.13s p=0.928 n=6
Check Time 8.13s (± 0.51%) 8.13s (± 0.44%) ~ 8.08s 8.17s p=0.809 n=6
Emit Time 4.81s (± 0.51%) 4.80s (± 0.77%) ~ 4.76s 4.85s p=0.739 n=6
Total Time 16.96s (± 0.38%) 16.95s (± 0.37%) ~ 16.85s 17.02s p=0.872 n=6
TFS - node (v14.15.1, x64)
Memory used 294,343k (± 0.00%) 294,343k (± 0.00%) ~ 294,333k 294,356k p=0.688 n=6
Parse Time 2.38s (± 0.35%) 2.38s (± 0.78%) ~ 2.36s 2.40s p=0.546 n=6
Bind Time 1.10s (± 1.21%) 1.10s (± 1.15%) ~ 1.09s 1.12s p=0.788 n=6
Check Time 7.55s (± 0.49%) 7.56s (± 0.52%) ~ 7.50s 7.60s p=0.688 n=6
Emit Time 4.61s (± 0.56%) 4.61s (± 0.45%) ~ 4.59s 4.65s p=0.808 n=6
Total Time 15.64s (± 0.36%) 15.66s (± 0.17%) ~ 15.61s 15.68s p=0.467 n=6
material-ui - node (v14.15.1, x64)
Memory used 471,232k (± 0.00%) 471,217k (± 0.00%) -15k (- 0.00%) 471,202k 471,233k p=0.045 n=6
Parse Time 3.51s (± 0.59%) 3.51s (± 0.50%) ~ 3.48s 3.52s p=0.934 n=6
Bind Time 1.04s (± 0.39%) 1.04s (± 0.72%) ~ 1.03s 1.05s p=0.389 n=6
Check Time 19.19s (± 0.53%) 19.17s (± 0.50%) ~ 19.01s 19.31s p=1.000 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.73s (± 0.38%) 23.71s (± 0.40%) ~ 23.55s 23.84s p=1.000 n=6
xstate - node (v14.15.1, x64)
Memory used 534,487k (± 0.00%) 534,494k (± 0.01%) ~ 534,454k 534,555k p=1.000 n=6
Parse Time 4.60s (± 0.37%) 4.58s (± 0.29%) -0.02s (- 0.43%) 4.56s 4.60s p=0.048 n=6
Bind Time 1.72s (± 0.44%) 1.72s (± 0.30%) ~ 1.72s 1.73s p=0.784 n=6
Check Time 3.15s (± 0.52%) 3.17s (± 0.54%) ~ 3.15s 3.20s p=0.224 n=6
Emit Time 0.10s (± 4.01%) 0.10s (± 4.99%) ~ 0.10s 0.11s p=0.595 n=6
Total Time 9.58s (± 0.34%) 9.58s (± 0.35%) ~ 9.54s 9.63s p=1.000 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 52848 6
Baseline main 6

TSServer

Comparison Report - main..52848
Metric main 52848 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,383ms (± 1.04%) 2,381ms (± 0.32%) ~ 2,370ms 2,393ms p=0.521 n=6
Req 2 - geterr 5,385ms (± 0.58%) 5,369ms (± 0.49%) ~ 5,330ms 5,399ms p=0.471 n=6
Req 3 - references 340ms (± 1.40%) 337ms (± 0.47%) ~ 334ms 338ms p=0.253 n=6
Req 4 - navto 284ms (± 1.33%) 281ms (± 0.61%) ~ 279ms 284ms p=0.191 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 74ms (± 8.58%) 72ms (± 2.10%) ~ 70ms 74ms p=0.623 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,504ms (± 0.82%) 2,513ms (± 1.01%) ~ 2,489ms 2,545ms p=0.335 n=6
Req 2 - geterr 4,044ms (± 0.55%) 4,054ms (± 0.19%) ~ 4,048ms 4,069ms p=0.467 n=6
Req 3 - references 353ms (± 0.42%) 354ms (± 0.42%) ~ 352ms 356ms p=0.289 n=6
Req 4 - navto 289ms (± 0.81%) 289ms (± 0.63%) ~ 286ms 291ms p=0.934 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 68ms (± 0.81%) 69ms (± 4.63%) ~ 66ms 75ms p=0.498 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,194ms (± 0.81%) 3,188ms (± 0.42%) ~ 3,170ms 3,203ms p=1.000 n=6
Req 2 - geterr 1,647ms (± 0.97%) 1,640ms (± 0.82%) ~ 1,622ms 1,654ms p=0.261 n=6
Req 3 - references 104ms (± 1.44%) 104ms (± 1.54%) ~ 103ms 107ms p=0.655 n=6
Req 4 - navto 357ms (± 0.67%) 360ms (± 1.52%) ~ 354ms 368ms p=0.686 n=6
Req 5 - completionInfo count 3,136 (± 0.00%) 3,136 (± 0.00%) ~ 3,136 3,136 p=1.000 n=6
Req 5 - completionInfo 429ms (± 1.63%) 423ms (± 1.75%) ~ 414ms 434ms p=0.227 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,525ms (± 0.42%) 2,537ms (± 0.55%) ~ 2,517ms 2,557ms p=0.170 n=6
Req 2 - geterr 5,767ms (± 0.83%) 5,761ms (± 0.50%) ~ 5,710ms 5,791ms p=1.000 n=6
Req 3 - references 352ms (± 0.86%) 352ms (± 0.83%) ~ 349ms 357ms p=1.000 n=6
Req 4 - navto 279ms (± 0.82%) 278ms (± 1.09%) ~ 274ms 283ms p=0.361 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 82ms (± 4.49%) 80ms (± 5.39%) ~ 76ms 85ms p=0.328 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,697ms (± 0.44%) 2,670ms (± 0.90%) ~ 2,637ms 2,701ms p=0.078 n=6
Req 2 - geterr 4,390ms (± 0.37%) 4,376ms (± 0.65%) ~ 4,339ms 4,408ms p=0.575 n=6
Req 3 - references 362ms (± 1.04%) 362ms (± 0.69%) ~ 359ms 365ms p=1.000 n=6
Req 4 - navto 286ms (± 0.92%) 284ms (± 1.25%) ~ 279ms 288ms p=0.289 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 73ms (± 1.03%) 73ms (± 1.03%) ~ 72ms 74ms p=1.000 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,379ms (± 0.45%) 3,367ms (± 0.39%) ~ 3,351ms 3,387ms p=0.172 n=6
Req 2 - geterr 1,877ms (± 5.20%) 1,879ms (± 5.45%) ~ 1,780ms 2,012ms p=0.936 n=6
Req 3 - references 112ms (± 1.10%) 111ms (± 1.76%) ~ 108ms 113ms p=0.933 n=6
Req 4 - navto 344ms (± 1.79%) 342ms (± 0.54%) ~ 340ms 344ms p=0.291 n=6
Req 5 - completionInfo count 3,136 (± 0.00%) 3,136 (± 0.00%) ~ 3,136 3,136 p=1.000 n=6
Req 5 - completionInfo 431ms (± 0.79%) 431ms (± 0.63%) ~ 429ms 436ms p=0.809 n=6
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,602ms (± 0.41%) 2,608ms (± 0.67%) ~ 2,595ms 2,643ms p=0.810 n=6
Req 2 - geterr 6,046ms (± 0.41%) 6,073ms (± 0.66%) ~ 6,032ms 6,143ms p=0.423 n=6
Req 3 - references 368ms (± 1.18%) 367ms (± 1.11%) ~ 364ms 375ms p=0.747 n=6
Req 4 - navto 277ms (± 0.23%) 277ms (± 0.30%) ~ 275ms 277ms p=0.340 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 100ms (± 0.75%) 101ms (± 1.16%) ~ 100ms 103ms p=0.383 n=6
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,832ms (± 0.64%) 2,835ms (± 0.64%) ~ 2,811ms 2,851ms p=0.575 n=6
Req 2 - geterr 4,489ms (± 0.38%) 4,612ms (± 2.13%) ~ 4,482ms 4,694ms p=0.054 n=6
Req 3 - references 381ms (± 0.76%) 389ms (± 5.72%) ~ 376ms 434ms p=1.000 n=6
Req 4 - navto 297ms (± 0.41%) 294ms (± 1.94%) ~ 287ms 301ms p=0.683 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 99ms (± 7.29%) 84ms (± 6.93%) 🟩-14ms (-14.53%) 81ms 96ms p=0.009 n=6
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 3,676ms (± 0.47%) 3,687ms (± 0.77%) ~ 3,661ms 3,741ms p=0.810 n=6
Req 2 - geterr 1,848ms (± 1.86%) 1,850ms (± 2.21%) ~ 1,809ms 1,896ms p=1.000 n=6
Req 3 - references 126ms (± 2.69%) 125ms (± 1.75%) ~ 123ms 129ms p=0.805 n=6
Req 4 - navto 374ms (± 1.35%) 376ms (± 1.78%) ~ 365ms 384ms p=0.377 n=6
Req 5 - completionInfo count 3,136 (± 0.00%) 3,136 (± 0.00%) ~ 3,136 3,136 p=1.000 n=6
Req 5 - completionInfo 454ms (± 1.65%) 451ms (± 1.99%) ~ 438ms 464ms p=0.630 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
Benchmark Name Iterations
Current 52848 6
Baseline main 6

Startup

Comparison Report - main..52848
Metric main 52848 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 142.73ms (± 0.21%) 143.13ms (± 0.20%) +0.40ms (+ 0.28%) 142.16ms 147.04ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 227.65ms (± 0.16%) 228.54ms (± 0.39%) +0.89ms (+ 0.39%) 226.14ms 234.37ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 229.23ms (± 0.15%) 231.37ms (± 0.37%) +2.14ms (+ 0.93%) 228.29ms 238.10ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 210.16ms (± 0.16%) 212.03ms (± 0.36%) +1.88ms (+ 0.89%) 209.19ms 217.79ms p=0.000 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
Benchmark Name Iterations
Current 52848 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

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

Something interesting changed - please have a look.

Details

puppeteer/puppeteer

⚠️ Note that built had errors ⚠️
Req #3898 - completionEntryDetails
    at Object.getImportCompletionAction (/typescript-main/built/local/tsserver.js:141645:11)
    at getCompletionEntryCodeActionsAndSourceDisplay (/typescript-main/built/local/tsserver.js:149788:62)
    at Object.getCompletionEntryDetails (/typescript-main/built/local/tsserver.js:149673:46)
    at Object.getCompletionEntryDetails2 [as getCompletionEntryDetails] (/typescript-main/built/local/tsserver.js:135562:35)
    at /typescript-main/built/local/tsserver.js:179181:43
    at mapDefined (/typescript-main/built/local/tsserver.js:2628:22)
    at IOSession.getCompletionEntryDetails (/typescript-main/built/local/tsserver.js:179179:20)
    at completionEntryDetails (/typescript-main/built/local/tsserver.js:177525:43)
    at /typescript-main/built/local/tsserver.js:179869:69
    at IOSession.executeWithRequestId (/typescript-main/built/local/tsserver.js:179861:14)
    at IOSession.executeCommand (/typescript-main/built/local/tsserver.js:179869:29)
    at IOSession.onMessage (/typescript-main/built/local/tsserver.js:179911:51)
    at Interface.<anonymous> (/typescript-main/built/local/tsserver.js:181455:14)
Req #5797 - completionEntryDetails
    at getCompletionEntryCodeActionsAndSourceDisplay (/typescript-52848/built/local/tsserver.js:149802:9)
    at Object.getCompletionEntryDetails (/typescript-52848/built/local/tsserver.js:149673:46)
    at Object.getCompletionEntryDetails2 [as getCompletionEntryDetails] (/typescript-52848/built/local/tsserver.js:135562:35)
    at /typescript-52848/built/local/tsserver.js:179181:43
    at mapDefined (/typescript-52848/built/local/tsserver.js:2628:22)
    at IOSession.getCompletionEntryDetails (/typescript-52848/built/local/tsserver.js:179179:20)
    at completionEntryDetails (/typescript-52848/built/local/tsserver.js:177525:43)
    at /typescript-52848/built/local/tsserver.js:179869:69
    at IOSession.executeWithRequestId (/typescript-52848/built/local/tsserver.js:179861:14)
    at IOSession.executeCommand (/typescript-52848/built/local/tsserver.js:179869:29)
    at IOSession.onMessage (/typescript-52848/built/local/tsserver.js:179911:51)
    at Interface.<anonymous> (/typescript-52848/built/local/tsserver.js:181455:14)

That is a filtered view of the text. To see the raw error text, go to RepoResults1/puppeteer.puppeteer.rawError.txt in the artifact folder

Last few requests

{"seq":5794,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/packages/puppeteer-core/src/common/PierceQueryHandler.ts","line":16,"offset":1,"entryNames":[{"name":"before","source":"node:test","data":{"exportName":"before","exportMapKey":"before|17388|node:test","moduleSpecifier":"node:test","ambientModuleName":"node:test"}}]}}
{"seq":5795,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/packages/puppeteer-core/src/common/PierceQueryHandler.ts","line":16,"offset":1,"entryNames":[{"name":"beforeEach","source":"node:test","data":{"exportName":"beforeEach","exportMapKey":"beforeEach|17392|node:test","moduleSpecifier":"node:test","ambientModuleName":"node:test"}}]}}
{"seq":5796,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/packages/puppeteer-core/src/common/PierceQueryHandler.ts","line":16,"offset":1,"entryNames":[{"name":"BidiSerializer","source":"./bidi/Serializer.js","data":{"exportName":"BidiSerializer","exportMapKey":"BidiSerializer|97486|","moduleSpecifier":"./bidi/Serializer.js","fileName":"/mnt/ts_downloads/puppeteer/packages/puppeteer-core/src/common/bidi/Serializer.ts"}}]}}
{"seq":5797,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/packages/puppeteer-core/src/common/PierceQueryHandler.ts","line":16,"offset":1,"entryNames":[{"name":"BidiServer","source":"chromium-bidi/lib/cjs/bidiMapper/bidiMapper.js","data":{"exportName":"BidiServer","exportMapKey":"BidiServer|11542|","moduleSpecifier":"chromium-bidi/lib/cjs/bidiMapper/bidiMapper.js","fileName":"/mnt/ts_downloads/puppeteer/node_modules/chromium-bidi/lib/cjs/bidiMapper/bidiMapper.d.ts"}}]}}

Repro Steps

  1. git clone https://github.com/puppeteer/puppeteer --recurse-submodules
  2. In dir puppeteer, run git reset --hard fb0d405ee337cde900bd8e60e3f79d98752ed046
  3. Install packages (exact steps are below, but it might be easier to follow the repo readme)
    1. In dir puppeteer, run npm ci --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    2. In dir puppeteer/packages/browsers, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    3. In dir puppeteer/packages/ng-schematics, run npm ci --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    4. In dir puppeteer/packages/puppeteer-core, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    5. In dir puppeteer/packages/puppeteer, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    6. In dir puppeteer/packages/testserver, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    7. In dir puppeteer/test/installation, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    8. In dir puppeteer/test, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    9. In dir puppeteer/website, run npm ci --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
  4. Back in the initial folder, download RepoResults1/puppeteer.puppeteer.replay.txt from the artifact folder
  5. npm install --no-save @typescript/server-replay
  6. npx tsreplay ./puppeteer ./puppeteer.puppeteer.replay.txt path/to/tsserver.js
  7. npx tsreplay --help to learn about helpful switches for debugging, logging, etc

yangshun/tech-interview-handbook

⚠️ Note that built had errors ⚠️
Req #396 - completionEntryDetails
    at Object.getImportCompletionAction (/typescript-main/built/local/tsserver.js:141645:11)
    at getCompletionEntryCodeActionsAndSourceDisplay (/typescript-main/built/local/tsserver.js:149788:62)
    at Object.getCompletionEntryDetails (/typescript-main/built/local/tsserver.js:149673:46)
    at Object.getCompletionEntryDetails2 [as getCompletionEntryDetails] (/typescript-main/built/local/tsserver.js:135562:35)
    at /typescript-main/built/local/tsserver.js:179181:43
    at mapDefined (/typescript-main/built/local/tsserver.js:2628:22)
    at IOSession.getCompletionEntryDetails (/typescript-main/built/local/tsserver.js:179179:20)
    at completionEntryDetails (/typescript-main/built/local/tsserver.js:177525:43)
    at /typescript-main/built/local/tsserver.js:179869:69
    at IOSession.executeWithRequestId (/typescript-main/built/local/tsserver.js:179861:14)
    at IOSession.executeCommand (/typescript-main/built/local/tsserver.js:179869:29)
    at IOSession.onMessage (/typescript-main/built/local/tsserver.js:179911:51)
    at Interface.<anonymous> (/typescript-main/built/local/tsserver.js:181455:14)

🎉 New server no longer has errors 🎉

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@jakebailey jakebailey merged commit b579516 into microsoft:main Feb 21, 2023
@jakebailey jakebailey deleted the fix-49556 branch February 21, 2023 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type tuples no longer inferred properly from rest arguments with mapped generic type tuples.
4 participants