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

Infer from annotated return type nodes before assigning contextual parameter types #60964

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

Andarist
Copy link
Contributor

related to #60922 and #60544

It doesn't fix any of those issues but it addresses the gotcha observed in both threads, see #60922 (comment) and #60544 (comment)

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jan 13, 2025
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@Harpush
Copy link

Harpush commented Feb 17, 2025

Any chance this PR lands?

@jakebailey
Copy link
Member

This feels right to me; the info is right there after all.

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 20, 2025

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
test top400 ✅ Started ✅ Results
user test this ✅ Started ✅ Results
run dt ✅ Started ✅ Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@jakebailey
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
Compiler-Unions - node (v18.15.0, x64)
Errors 34 34 ~ ~ ~ p=1.000 n=6
Symbols 62,390 62,390 ~ ~ ~ p=1.000 n=6
Types 50,395 50,395 ~ ~ ~ p=1.000 n=6
Memory used 194,831k (± 1.02%) 193,499k (± 0.74%) ~ 192,884k 196,426k p=0.199 n=6
Parse Time 1.31s (± 0.75%) 1.31s (± 0.94%) ~ 1.29s 1.32s p=0.718 n=6
Bind Time 0.73s 0.73s ~ ~ ~ p=1.000 n=6
Check Time 9.74s (± 0.55%) 9.75s (± 0.29%) ~ 9.71s 9.78s p=0.871 n=6
Emit Time 2.73s (± 0.78%) 2.72s (± 0.31%) ~ 2.70s 2.72s p=0.277 n=6
Total Time 14.51s (± 0.39%) 14.50s (± 0.17%) ~ 14.47s 14.53s p=0.422 n=6
angular-1 - node (v18.15.0, x64)
Errors 37 37 ~ ~ ~ p=1.000 n=6
Symbols 948,488 948,488 ~ ~ ~ p=1.000 n=6
Types 411,006 411,006 ~ ~ ~ p=1.000 n=6
Memory used 1,224,336k (± 0.00%) 1,224,268k (± 0.00%) -68k (- 0.01%) 1,224,216k 1,224,305k p=0.044 n=6
Parse Time 8.04s (± 0.72%) 8.03s (± 0.60%) ~ 7.94s 8.07s p=0.326 n=6
Bind Time 2.29s (± 0.86%) 2.28s (± 0.33%) ~ 2.27s 2.29s p=0.357 n=6
Check Time 38.02s (± 0.25%) 37.84s (± 0.26%) -0.18s (- 0.47%) 37.71s 37.93s p=0.020 n=6
Emit Time 18.33s (± 0.42%) 18.26s (± 0.42%) ~ 18.16s 18.35s p=0.149 n=6
Total Time 66.67s (± 0.21%) 66.41s (± 0.26%) -0.26s (- 0.39%) 66.16s 66.61s p=0.044 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,347,891 2,347,891 ~ ~ ~ p=1.000 n=6
Types 845,644 845,644 ~ ~ ~ p=1.000 n=6
Memory used 2,120,472k (± 0.01%) 2,120,500k (± 0.00%) ~ 2,120,364k 2,120,622k p=0.521 n=6
Parse Time 8.88s (± 1.93%) 8.78s (± 0.56%) ~ 8.71s 8.84s p=0.108 n=6
Bind Time 2.84s (± 7.79%) 2.95s (± 0.69%) ~ 2.92s 2.98s p=0.081 n=6
Check Time 87.93s (± 2.76%) 86.88s (± 0.27%) ~ 86.55s 87.09s p=0.575 n=6
Emit Time 0.20s (± 7.40%) 0.20s (± 7.06%) ~ 0.18s 0.22s p=0.805 n=6
Total Time 99.86s (± 2.37%) 98.80s (± 0.23%) ~ 98.45s 99.02s p=0.378 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,510 1,228,513 +3 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,960 266,960 ~ ~ ~ p=1.000 n=6
Memory used 2,847,207k (±13.20%) 2,847,040k (±13.20%) ~ 2,360,772k 3,090,309k p=0.810 n=6
Parse Time 6.65s (± 1.57%) 6.64s (± 1.48%) ~ 6.50s 6.73s p=0.873 n=6
Bind Time 2.15s (± 2.21%) 2.15s (± 1.52%) ~ 2.11s 2.19s p=0.810 n=6
Check Time 42.65s (± 0.73%) 42.55s (± 0.26%) ~ 42.47s 42.75s p=0.471 n=6
Emit Time 3.46s (± 1.76%) 3.40s (± 2.23%) ~ 3.29s 3.51s p=0.230 n=6
Total Time 54.93s (± 0.67%) 54.77s (± 0.38%) ~ 54.58s 55.03s p=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,510 1,228,513 +3 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,960 266,960 ~ ~ ~ p=1.000 n=6
Memory used 2,425,763k (± 0.01%) 2,425,995k (± 0.02%) ~ 2,425,396k 2,426,523k p=0.378 n=6
Parse Time 5.49s (± 0.69%) 5.50s (± 0.41%) ~ 5.46s 5.52s p=0.521 n=6
Bind Time 1.80s (± 2.01%) 1.79s (± 1.44%) ~ 1.77s 1.82s p=0.935 n=6
Check Time 35.29s (± 0.21%) 35.29s (± 0.09%) ~ 35.26s 35.34s p=0.936 n=6
Emit Time 3.02s (± 1.11%) 3.02s (± 2.03%) ~ 2.97s 3.12s p=0.748 n=6
Total Time 45.60s (± 0.16%) 45.60s (± 0.21%) ~ 45.48s 45.73s p=1.000 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,816 262,819 +3 (+ 0.00%) ~ ~ p=0.001 n=6
Types 106,833 106,833 ~ ~ ~ p=1.000 n=6
Memory used 440,309k (± 0.01%) 440,292k (± 0.01%) ~ 440,219k 440,380k p=0.470 n=6
Parse Time 2.88s (± 0.65%) 2.90s (± 0.34%) ~ 2.89s 2.91s p=0.118 n=6
Bind Time 1.11s 1.11s ~ ~ ~ p=1.000 n=6
Check Time 15.76s (± 0.42%) 15.78s (± 0.37%) ~ 15.69s 15.83s p=0.748 n=6
Emit Time 1.28s (± 1.18%) 1.27s (± 1.44%) ~ 1.25s 1.30s p=0.623 n=6
Total Time 21.03s (± 0.30%) 21.06s (± 0.31%) ~ 20.96s 21.13s p=0.469 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 70 70 ~ ~ ~ p=1.000 n=6
Symbols 226,113 226,113 ~ ~ ~ p=1.000 n=6
Types 94,488 94,488 ~ ~ ~ p=1.000 n=6
Memory used 371,356k (± 0.02%) 371,352k (± 0.02%) ~ 371,276k 371,476k p=0.810 n=6
Parse Time 2.91s (± 1.13%) 2.89s (± 0.64%) ~ 2.86s 2.91s p=0.292 n=6
Bind Time 1.60s (± 1.00%) 1.60s (± 2.54%) ~ 1.57s 1.68s p=0.199 n=6
Check Time 16.46s (± 0.24%) 16.47s (± 0.23%) ~ 16.43s 16.54s p=1.000 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.97s (± 0.36%) 20.96s (± 0.22%) ~ 20.91s 21.03s p=1.000 n=6
vscode - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 3,220,984 3,220,984 ~ ~ ~ p=1.000 n=6
Types 1,092,532 1,092,533 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,296,383k (± 0.01%) 3,296,314k (± 0.01%) ~ 3,295,920k 3,296,720k p=0.471 n=6
Parse Time 14.36s (± 0.71%) 14.27s (± 0.40%) ~ 14.20s 14.36s p=0.148 n=6
Bind Time 4.58s (± 0.65%) 4.61s (± 0.60%) ~ 4.57s 4.64s p=0.147 n=6
Check Time 89.63s (± 1.29%) 87.99s (± 0.62%) -1.63s (- 1.82%) 87.35s 88.87s p=0.020 n=6
Emit Time 26.79s (± 6.64%) 26.04s (± 8.84%) ~ 22.98s 27.63s p=0.630 n=6
Total Time 135.36s (± 1.82%) 132.91s (± 1.56%) ~ 129.76s 134.75s p=0.066 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 293,866 293,866 ~ ~ ~ p=1.000 n=6
Types 119,617 119,617 ~ ~ ~ p=1.000 n=6
Memory used 447,146k (± 0.02%) 447,193k (± 0.02%) ~ 447,071k 447,308k p=0.230 n=6
Parse Time 4.10s (± 0.83%) 4.09s (± 0.59%) ~ 4.07s 4.13s p=0.514 n=6
Bind Time 1.76s (± 1.42%) 1.76s (± 1.27%) ~ 1.73s 1.79s p=0.627 n=6
Check Time 18.74s (± 0.27%) 18.76s (± 0.24%) ~ 18.72s 18.84s p=0.872 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.62s (± 0.31%) 24.60s (± 0.13%) ~ 24.55s 24.64s p=0.747 n=6
xstate-main - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 558,084 558,084 ~ ~ ~ p=1.000 n=6
Types 186,415 186,415 ~ ~ ~ p=1.000 n=6
Memory used 495,035k (± 0.01%) 494,974k (± 0.02%) ~ 494,808k 495,111k p=0.378 n=6
Parse Time 3.42s (± 0.40%) 3.42s (± 0.34%) ~ 3.41s 3.44s p=0.325 n=6
Bind Time 1.19s (± 1.27%) 1.19s (± 1.06%) ~ 1.18s 1.21s p=1.000 n=6
Check Time 19.59s (± 0.34%) 19.80s (± 2.38%) ~ 19.45s 20.58s p=0.873 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.20s (± 0.28%) 24.41s (± 1.92%) ~ 24.06s 25.18s p=0.810 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/60964/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparing main and refs/pull/60964/merge:

Everything looks good!

@jakebailey jakebailey merged commit 0d01692 into microsoft:main Feb 20, 2025
32 checks passed
@jakebailey
Copy link
Member

Wait, was this effectively #56460 in disguise? Are all of those now fixed?

@Andarist
Copy link
Contributor Author

Wait, was this effectively #56460 in disguise? Are all of those now fixed?

Not quite. This PR here is solely about the return type node and it doesn't change when this function is called. The other PR is solely about annotated parameters and it makes this function called in more places. So yes, there is a code area overlap between both but they are about different things and none of the other issues are fixed by this PR here.

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
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants