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

Array subtypes inherit special array variance #55880

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

weswigham
Copy link
Member

No description provided.

@weswigham
Copy link
Member Author

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 26, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 26, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 26, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 26, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 26, 2023

Hey @weswigham, 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/157949/artifacts?artifactName=tgz&fileId=1C525A6A066DC0D78947723C8F8893323D202C3397E26B624DA138468A3AB06702&fileName=/typescript-5.3.0-insiders.20230926.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.3.0-pr-55880-5".;

@fatcerberus
Copy link

Wait, Array is special-cased to be covariant? That kind of shoots down the argument that method parameters are bivariant just “to ensure arrays continue to relate covariantly”…

@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 2 instances of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

webpack

tsconfig.types.json

  • [NEW] error TS2322: Type 'undefined' is not assignable to type 'Pick<ArgumentConfig, "values" | "type">'.
  • [MISSING] error TS2322: Type 'undefined' is not assignable to type 'Pick<ArgumentConfig, "type" | "values">'.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 294,969k (± 0.01%) 295,272k (± 0.01%) +303k (+ 0.10%) 295,250k 295,305k p=0.005 n=6
Parse Time 2.62s (± 0.34%) 2.63s (± 0.75%) ~ 2.60s 2.66s p=0.801 n=6
Bind Time 0.83s (± 1.00%) 0.84s (± 1.17%) ~ 0.83s 0.85s p=0.588 n=6
Check Time 8.05s (± 0.27%) 8.05s (± 0.41%) ~ 8.01s 8.11s p=0.936 n=6
Emit Time 7.05s (± 0.28%) 7.04s (± 0.33%) ~ 7.00s 7.06s p=0.935 n=6
Total Time 18.55s (± 0.17%) 18.56s (± 0.40%) ~ 18.44s 18.67s p=0.518 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 193,488k (± 1.33%) 190,719k (± 0.03%) ~ 190,612k 190,763k p=0.109 n=6
Parse Time 1.34s (± 1.30%) 1.35s (± 1.52%) ~ 1.33s 1.38s p=0.416 n=6
Bind Time 0.73s (± 0.00%) 0.73s (± 0.56%) ~ 0.72s 0.73s p=0.405 n=6
Check Time 9.09s (± 0.32%) 9.14s (± 0.39%) +0.05s (+ 0.59%) 9.10s 9.20s p=0.023 n=6
Emit Time 2.63s (± 0.65%) 2.65s (± 0.70%) ~ 2.63s 2.67s p=0.168 n=6
Total Time 13.79s (± 0.29%) 13.87s (± 0.47%) +0.08s (+ 0.56%) 13.78s 13.97s p=0.036 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,212k (± 0.00%) 347,219k (± 0.01%) ~ 347,192k 347,294k p=0.689 n=6
Parse Time 2.45s (± 0.40%) 2.46s (± 0.31%) ~ 2.45s 2.47s p=0.300 n=6
Bind Time 0.94s (± 0.00%) 0.94s (± 0.00%) ~ 0.94s 0.94s p=1.000 n=6
Check Time 6.88s (± 0.54%) 6.85s (± 0.54%) ~ 6.82s 6.92s p=0.257 n=6
Emit Time 4.01s (± 0.10%) 4.03s (± 0.36%) +0.02s (+ 0.50%) 4.01s 4.05s p=0.021 n=6
Total Time 14.28s (± 0.29%) 14.29s (± 0.35%) ~ 14.24s 14.36s p=1.000 n=6
TFS - node (v18.15.0, x64)
Memory used 302,486k (± 0.01%) 302,489k (± 0.00%) ~ 302,477k 302,510k p=0.936 n=6
Parse Time 1.99s (± 1.62%) 2.00s (± 1.03%) ~ 1.98s 2.03s p=0.280 n=6
Bind Time 1.00s (± 1.21%) 1.01s (± 1.20%) ~ 0.99s 1.02s p=0.680 n=6
Check Time 6.23s (± 0.44%) 6.25s (± 0.36%) ~ 6.23s 6.28s p=0.372 n=6
Emit Time 3.53s (± 0.28%) 3.52s (± 0.29%) -0.01s (- 0.42%) 3.50s 3.53s p=0.028 n=6
Total Time 12.75s (± 0.20%) 12.77s (± 0.15%) ~ 12.75s 12.80s p=0.126 n=6
material-ui - node (v18.15.0, x64)
Memory used 470,449k (± 0.00%) 470,686k (± 0.00%) +236k (+ 0.05%) 470,652k 470,716k p=0.005 n=6
Parse Time 2.56s (± 0.57%) 2.57s (± 0.70%) ~ 2.55s 2.60s p=0.289 n=6
Bind Time 0.99s (± 0.82%) 0.99s (± 1.34%) ~ 0.97s 1.01s p=0.866 n=6
Check Time 16.52s (± 0.42%) 16.55s (± 0.40%) ~ 16.47s 16.66s p=0.688 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.08s (± 0.38%) 20.11s (± 0.37%) ~ 20.00s 20.21s p=0.573 n=6
xstate - node (v18.15.0, x64)
Memory used 512,553k (± 0.01%) 512,586k (± 0.02%) ~ 512,490k 512,715k p=0.810 n=6
Parse Time 3.27s (± 0.16%) 3.26s (± 0.16%) -0.01s (- 0.31%) 3.26s 3.27s p=0.018 n=6
Bind Time 1.56s (± 0.35%) 1.55s (± 0.49%) ~ 1.54s 1.56s p=0.137 n=6
Check Time 2.83s (± 0.55%) 2.83s (± 0.37%) ~ 2.82s 2.85s p=0.514 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 9.60%) ~ 0.07s 0.09s p=0.598 n=6
Total Time 7.73s (± 0.22%) 7.73s (± 0.13%) ~ 7.72s 7.75s p=0.626 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)
  • 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,355ms (± 0.78%) 2,368ms (± 0.80%) ~ 2,341ms 2,388ms p=0.261 n=6
Req 2 - geterr 5,345ms (± 1.68%) 5,308ms (± 1.60%) ~ 5,230ms 5,421ms p=0.378 n=6
Req 3 - references 329ms (± 1.56%) 328ms (± 2.11%) ~ 324ms 342ms p=0.231 n=6
Req 4 - navto 277ms (± 0.91%) 278ms (± 1.15%) ~ 274ms 281ms p=0.567 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 (± 8.51%) 82ms (± 7.74%) ~ 75ms 90ms p=0.746 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,467ms (± 0.59%) 2,465ms (± 1.09%) ~ 2,414ms 2,484ms p=1.000 n=6
Req 2 - geterr 4,094ms (± 1.45%) 4,118ms (± 1.67%) ~ 4,058ms 4,209ms p=0.689 n=6
Req 3 - references 338ms (± 1.83%) 339ms (± 1.46%) ~ 334ms 344ms p=0.685 n=6
Req 4 - navto 284ms (± 0.36%) 283ms (± 0.35%) ~ 282ms 284ms p=0.437 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 81ms (± 8.88%) 81ms (± 7.92%) ~ 74ms 87ms p=1.000 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,598ms (± 0.52%) 2,591ms (± 0.54%) ~ 2,573ms 2,605ms p=0.230 n=6
Req 2 - geterr 1,674ms (± 1.38%) 1,691ms (± 2.29%) ~ 1,650ms 1,740ms p=0.471 n=6
Req 3 - references 107ms (± 0.98%) 123ms (± 7.19%) ~ 105ms 128ms p=0.053 n=6
Req 4 - navto 359ms (± 0.21%) 359ms (± 0.27%) ~ 357ms 360ms p=0.858 n=6
Req 5 - completionInfo count 2,071 (± 0.00%) 2,071 (± 0.00%) ~ 2,071 2,071 p=1.000 n=6
Req 5 - completionInfo 305ms (± 2.00%) 309ms (± 2.83%) ~ 299ms 318ms p=0.378 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 151.70ms (± 0.16%) 151.72ms (± 0.15%) ~ 150.72ms 155.30ms p=0.284 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 227.66ms (± 0.16%) 227.58ms (± 0.17%) -0.08ms (- 0.03%) 226.14ms 234.58ms p=0.017 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 228.94ms (± 0.17%) 228.96ms (± 0.16%) ~ 227.15ms 233.83ms p=0.367 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 228.63ms (± 0.15%) 228.50ms (± 0.17%) -0.13ms (- 0.06%) 227.03ms 235.34ms p=0.000 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

@RyanCavanaugh
Copy link
Member

That kind of shoots down the argument that method parameters are bivariant just “to ensure arrays continue to relate covariantly”

No, it's still exactly that -- without method bivariance, you can't make arrayish things that are covariant, which means types like Omit<Array<T>, "sort"> would be measured as invariant

interface Arrayish1<out T> {
    indexOf(arg: T): number;
    [n: number]: T;
}

interface Arrayish2<out T> { // <-- error
    indexOf: (arg: T) => number;
    [n: number]: T;
}

@DanielRosenwasser
Copy link
Member

@typescript-bot test top300

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 26, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@sandersn sandersn requested a review from ahejlsberg October 27, 2023 22:11
@sandersn sandersn added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 1, 2023
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: Waiting on reviewers
Development

Successfully merging this pull request may close these issues.

6 participants