Skip to content

feat(lib): define TypedArray interface - #59205

Closed
Mark Fulton (mfulton26) wants to merge 6 commits into
microsoft:mainfrom
mfulton26:typed-array-interface
Closed

feat(lib): define TypedArray interface#59205
Mark Fulton (mfulton26) wants to merge 6 commits into
microsoft:mainfrom
mfulton26:typed-array-interface

Conversation

@mfulton26

Copy link
Copy Markdown
Contributor

Each concrete typed array type and constructor share common interfaces.

Library types can be defined extending base interfaces:

  1. higher code reuse
  2. less duplication
  3. easier maintenance (less error prone)

Closes#15402
Fixes#45198

Each concrete typed array type and constructor share common interfaces.
Library types can be defined extending base interfaces:
1. higher code reuse
2. less duplication
3. easier maintenance (less error prone)
Closesmicrosoft#15402Fixesmicrosoft#45198
@typescript-botTypeScript Bot (typescript-bot) added For Backlog Bug PRs that fix a backlog bug For Milestone Bug PRs that fix a bug with a specific milestone labels Jul 9, 2024
@typescript-bot

Copy link
Copy Markdown
Contributor

The TypeScript team hasn't accepted the linked issue #15402. If you can get it accepted, this PR will have a better chance of being reviewed.

@DanielRosenwasser

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) test it

@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 9, 2024

Copy link
Copy Markdown
Contributor

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

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

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Daniel Rosenwasser (@DanielRosenwasser), the results of running the DT tests are ready.

There were interesting changes:

Branch only errors:

Package: pouchdb-core
Error:

Error: /mnt/vss/_work/1/DefinitelyTyped/types/pouchdb-core/index.d.ts
11:11 error TypeScript@local compile error: Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
The types returned by 'slice(...)' are incompatible between these types.
Type 'Buffer' is not assignable to type 'this'.
'Buffer' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Buffer' @definitelytyped/expect
✖ 1 problem (1 error, 0 warnings)
at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

Package: node/v16
Error:

Error: /mnt/vss/_work/1/DefinitelyTyped/types/node/v16/buffer.d.ts
552:19 error TypeScript@local tsconfig.dom.json, local tsconfig.non-dom.json compile error: Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
The types returned by 'slice(...)' are incompatible between these types.
Type 'Buffer' is not assignable to type 'this'.
'Buffer' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Buffer' @definitelytyped/expect
✖ 1 problem (1 error, 0 warnings)
at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

Package: node/v18
Error:

Error: /mnt/vss/_work/1/DefinitelyTyped/types/node/v18/buffer.d.ts
622:19 error TypeScript@local tsconfig.dom.json, local tsconfig.non-dom.json compile error: Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
The types returned by 'slice(...)' are incompatible between these types.
Type 'Buffer' is not assignable to type 'this'.
'Buffer' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Buffer' @definitelytyped/expect
✖ 1 problem (1 error, 0 warnings)
at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

Package: node
Error:

Error: /mnt/vss/_work/1/DefinitelyTyped/types/node/buffer.d.ts
632:19 error TypeScript@local tsconfig.dom.json, local tsconfig.non-dom.json compile error: Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
The types returned by 'slice(...)' are incompatible between these types.
Type 'Buffer' is not assignable to type 'this'.
'Buffer' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Buffer' @definitelytyped/expect
✖ 1 problem (1 error, 0 warnings)
at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

You can check the log here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser) Here are the results of running the user tests with tsc comparing main and refs/pull/59205/merge:

Something interesting changed - please have a look.

Details

azure-sdk

/mnt/ts_downloads/_/m/azure-sdk/build.sh

  • [NEW] error TS2430: Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
    • /mnt/ts_downloads/_/temp/node_modules/.pnpm/Types (@types)+node@18.19.39/node_modules/@types/node/buffer.d.ts(622,19)
  • [NEW] error TS2416: Property 'slice' in type 'Buffer' is not assignable to the same property in base type 'Uint8Array'.
    • /mnt/ts_downloads/_/temp/node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.d.ts(9,5)
  • [MISSING] error TS2322: Type 'string' is not assignable to type 'never'.
    • /mnt/ts_downloads/_/m/azure-sdk/test/narrowedTypes.ts(59,9)
    • /mnt/ts_downloads/_/m/azure-sdk/test/narrowedTypes.ts(213,9)
    • /mnt/ts_downloads/_/m/azure-sdk/test/narrowedTypes.ts(254,11)

xterm.js

src/tsconfig-library-base.json

  • [NEW] error TS2430: Interface 'Buffer' incorrectly extends interface 'Uint8Array'.

@typescript-bot

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15360,988-1,165 (- 1.87%)~~p=0.001 n=6
Types50,24250,046-196 (- 0.39%)~~p=0.001 n=6
Memory used192,803k (± 0.71%)191,430k (± 0.74%)-1,373k (- 0.71%)190,764k194,308kp=0.045 n=6
Parse Time1.58s (± 0.57%)1.57s (± 0.48%)~1.56s1.58sp=0.149 n=6
Bind Time0.86s (± 0.64%)0.84s (± 1.06%)-0.02s (- 1.75%)0.83s0.85sp=0.015 n=6
Check Time11.25s (± 0.58%)11.13s (± 0.36%)-0.11s (- 1.01%)11.08s11.20sp=0.013 n=6
Emit Time3.28s (± 0.74%)3.23s (± 1.42%)-0.05s (- 1.42%)3.14s3.27sp=0.023 n=6
Total Time16.96s (± 0.42%)16.78s (± 0.40%)-0.18s (- 1.08%)16.66s16.86sp=0.005 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,114942,466-1,648 (- 0.17%)~~p=0.001 n=6
Types407,050407,109+59 (+ 0.01%)~~p=0.001 n=6
Memory used1,218,374k (± 0.00%)1,216,623k (± 0.00%)-1,751k (- 0.14%)1,216,558k1,216,661kp=0.005 n=6
Parse Time7.92s (± 0.54%)7.79s (± 0.54%)-0.13s (- 1.62%)7.74s7.86sp=0.005 n=6
Bind Time2.22s (± 0.40%)2.20s (± 0.55%)~2.19s2.22sp=0.058 n=6
Check Time35.71s (± 0.57%)35.71s (± 0.15%)~35.65s35.78sp=1.000 n=6
Emit Time16.09s (± 0.89%)16.12s (± 1.39%)~15.92s16.52sp=0.873 n=6
Total Time61.95s (± 0.19%)61.81s (± 0.41%)~61.62s62.25sp=0.172 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,130,3422,128,539-1,803 (- 0.08%)~~p=0.001 n=6
Types927,684927,705+21 (+ 0.00%)~~p=0.001 n=6
Memory used2,107,655k (± 0.05%)2,105,511k (± 0.01%)-2,144k (- 0.10%)2,105,317k2,105,773kp=0.005 n=6
Parse Time9.67s (± 0.46%)9.67s (± 0.57%)~9.62s9.77sp=0.872 n=6
Bind Time3.39s (± 0.85%)3.38s (± 1.07%)~3.33s3.44sp=0.624 n=6
Check Time100.59s (± 1.61%)102.01s (± 0.77%)+1.42s (+ 1.41%)100.40s102.40sp=0.045 n=6
Emit Time0.60s (±102.48%)0.19s🟩-0.41s (-68.25%)~~p=0.009 n=6
Total Time114.25s (± 1.11%)115.24s (± 0.62%)~113.80s115.61sp=0.066 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,225,7731,200,843-24,930 (- 2.03%)~~p=0.001 n=6
Types261,518261,573+55 (+ 0.02%)~~p=0.001 n=6
Memory used2,343,177k (± 0.06%)2,317,266k (± 0.03%)-25,910k (- 1.11%)2,316,368k2,318,306kp=0.005 n=6
Parse Time7.52s (± 0.25%)7.51s (± 0.93%)~7.42s7.61sp=0.575 n=6
Bind Time2.79s (± 0.71%)2.78s (± 0.45%)~2.77s2.80sp=0.105 n=6
Check Time49.37s (± 0.26%)49.83s (± 0.62%)+0.46s (+ 0.94%)49.51s50.35sp=0.008 n=6
Emit Time3.85s (± 5.82%)4.00s (± 2.87%)~3.90s4.20sp=0.078 n=6
Total Time63.54s (± 0.38%)64.14s (± 0.54%)+0.61s (+ 0.95%)63.83s64.70sp=0.013 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,225,7731,200,843-24,930 (- 2.03%)~~p=0.001 n=6
Types261,518261,573+55 (+ 0.02%)~~p=0.001 n=6
Memory used2,416,134k (± 0.03%)2,391,213k (± 0.03%)-24,921k (- 1.03%)2,390,424k2,392,500kp=0.005 n=6
Parse Time7.77s (± 0.34%)7.82s (± 0.73%)~7.75s7.89sp=0.229 n=6
Bind Time2.52s (± 0.74%)2.81s (± 0.73%)🔻+0.28s (+11.22%)2.78s2.83sp=0.005 n=6
Check Time50.34s (± 0.88%)49.95s (± 0.68%)~49.63s50.50sp=0.173 n=6
Emit Time3.95s (± 2.85%)3.93s (± 2.03%)~3.79s4.02sp=0.873 n=6
Total Time64.61s (± 0.85%)64.51s (± 0.62%)~64.15s65.15sp=0.575 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols258,268256,645-1,623 (- 0.63%)~~p=0.001 n=6
Types104,775104,755-20 (- 0.02%)~~p=0.001 n=6
Memory used427,606k (± 0.02%)426,074k (± 0.03%)-1,533k (- 0.36%)425,962k426,296kp=0.005 n=6
Parse Time3.29s (± 0.60%)3.28s (± 0.42%)~3.27s3.30sp=1.000 n=6
Bind Time1.31s (± 1.04%)1.30s (± 0.63%)~1.30s1.32sp=0.127 n=6
Check Time17.85s (± 0.23%)17.78s (± 0.43%)~17.69s17.91sp=0.092 n=6
Emit Time1.26s (± 1.42%)1.26s (± 1.42%)~1.24s1.29sp=0.871 n=6
Total Time23.71s (± 0.18%)23.63s (± 0.36%)~23.52s23.76sp=0.148 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3536+1 (+ 2.86%)~~p=0.001 n=6
Symbols224,565222,993-1,572 (- 0.70%)~~p=0.001 n=6
Types93,73493,747+13 (+ 0.01%)~~p=0.001 n=6
Memory used369,530k (± 0.04%)367,882k (± 0.04%)-1,648k (- 0.45%)367,680k368,026kp=0.005 n=6
Parse Time2.77s (± 1.00%)2.75s (± 0.96%)~2.72s2.78sp=0.198 n=6
Bind Time1.58s (± 0.89%)1.55s (± 1.00%)-0.03s (- 1.90%)1.53s1.56sp=0.010 n=6
Check Time15.46s (± 0.21%)15.41s (± 0.59%)~15.28s15.51sp=0.423 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time19.81s (± 0.25%)19.70s (± 0.49%)~19.58s19.83sp=0.077 n=6
vscode - node (v18.15.0, x64)
Errors02🔻+2 (+ ∞%)~~p=0.001 n=6
Symbols2,887,2872,886,770-517 (- 0.02%)~~p=0.001 n=6
Types977,035976,981-54 (- 0.01%)~~p=0.001 n=6
Memory used3,051,421k (± 0.00%)3,049,926k (± 0.00%)-1,495k (- 0.05%)3,049,865k3,049,953kp=0.005 n=6
Parse Time16.85s (± 0.45%)16.88s (± 0.07%)~16.87s16.90sp=0.452 n=6
Bind Time5.19s (± 2.24%)5.08s (± 0.41%)-0.11s (- 2.22%)5.04s5.10sp=0.010 n=6
Check Time90.35s (± 2.29%)89.48s (± 0.25%)~89.18s89.83sp=0.378 n=6
Emit Time28.40s (± 6.92%)29.25s (± 0.27%)~29.12s29.32sp=0.469 n=6
Total Time140.79s (± 0.23%)140.68s (± 0.14%)~140.41s140.95sp=0.378 n=6
webpack - node (v18.15.0, x64)
Errors01🔻+1 (+ ∞%)~~p=0.001 n=6
Symbols267,117266,606-511 (- 0.19%)~~p=0.001 n=6
Types108,775108,743-32 (- 0.03%)~~p=0.001 n=6
Memory used411,579k (± 0.02%)410,134k (± 0.01%)-1,445k (- 0.35%)410,039k410,195kp=0.005 n=6
Parse Time3.19s (± 0.46%)3.16s (± 0.37%)-0.03s (- 0.94%)3.14s3.17sp=0.008 n=6
Bind Time1.41s (± 0.37%)1.39s (± 1.26%)-0.02s (- 1.42%)1.37s1.42sp=0.040 n=6
Check Time14.21s (± 0.44%)14.11s (± 0.21%)-0.10s (- 0.69%)14.06s14.15sp=0.036 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time18.81s (± 0.29%)18.66s (± 0.08%)-0.15s (- 0.80%)18.64s18.68sp=0.005 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols525,251523,540-1,711 (- 0.33%)~~p=0.001 n=6
Types178,574178,634+60 (+ 0.03%)~~p=0.001 n=6
Memory used462,948k (± 0.09%)460,961k (± 0.07%)-1,987k (- 0.43%)460,626k461,370kp=0.005 n=6
Parse Time3.17s (± 1.01%)3.17s (± 0.92%)~3.14s3.22sp=1.000 n=6
Bind Time1.17s1.16s (± 0.45%)-0.01s (- 1.14%)1.15s1.16sp=0.002 n=6
Check Time17.98s (± 0.28%)17.96s (± 0.31%)~17.91s18.04sp=0.514 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.33s (± 0.33%)22.30s (± 0.22%)~22.23s22.36sp=0.514 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@rubiesonthesky

Copy link
Copy Markdown

This PR does partly the same I think, #58188 - but is less breaking?

@mfulton26

Copy link
Copy Markdown
ContributorAuthor

This PR does partly the same I think, #58188 - but is less breaking?

This PR does address #45198, I'm not sure if it addresses #45199 though. Oh, on second look though, this might address it too. I can try grabbing the test changes from https://github.com/microsoft/TypeScript/pull/58188/files#diff-259a5a5be5d9d2b11bd636646375791a0d37a60f80c1871b6b97c9f1cde672ee to confirm.

@mfulton26

Mark Fulton (mfulton26) commented Jul 9, 2024

Copy link
Copy Markdown
ContributorAuthor

This PR does partly the same I think, #58188 - but is less breaking?

The main objective of this PR is more to create a common interface for all TypedArray prototypes and constructors for use in code (userland and TS project itself) that acts on any TypedArray instance (and to reduce duplication in the lib d.ts files.

@typescript-bot

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser) Here are the results of running the top 400 repos with tsc comparing main and refs/pull/59205/merge:

Something interesting changed - please have a look.

Details

Chocobozzz/PeerTube

6 of 12 projects failed to build with the old tsc and were ignored

packages/types-generator/tsconfig.types.json

  • error TS2430: Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
  • error TS2416: Property 'slice' in type 'Buffer' is not assignable to the same property in base type 'Uint8Array'.

@typescript-bot

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser) Here are some more interesting changes from running the top 400 repos suite

Details

jupyterlab/jupyterlab

46 of 59 projects failed to build with the old tsc and were ignored

packages/ui-components/examples/simple-windowed-list/tsconfig.json

@typescript-bot

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser) Here are some more interesting changes from running the top 400 repos suite

Details

mattermost/mattermost

2 of 4 projects failed to build with the old tsc and were ignored

webapp/platform/client/tsconfig.build.json

vercel/hyper

2 of 3 projects failed to build with the old tsc and were ignored

tsconfig.json

  • error TS2430: Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
    • file:///mnt/ts_downloads/_/m/hyper/node_modules/@types/node/buffer.d.ts#L622 in app/tsconfig.json
    • file:///mnt/ts_downloads/_/m/hyper/node_modules/@types/node/buffer.d.ts#L622 in tsconfig.json
  • error TS2416: Property 'slice' in type 'Buffer' is not assignable to the same property in base type 'Uint8Array'.
    • file:///mnt/ts_downloads/_/m/hyper/node_modules/buffer/index.d.ts#L9 in app/tsconfig.json
    • file:///mnt/ts_downloads/_/m/hyper/node_modules/buffer/index.d.ts#L9 in tsconfig.json

Changes TypedArray methods to receive/return the concrete subclass or `this` rather than only `this` which breaks `Buffer` in `@types/node` (e.g. `slice()` in `Buffer` returns `Buffer` and not `this`).
@mfulton26

Copy link
Copy Markdown
ContributorAuthor

@mfulton26

Copy link
Copy Markdown
ContributorAuthor

TypeScript Bot (@typescript-bot) test it

Daniel Rosenwasser (@DanielRosenwasser), I've pushed a potential fix for Buffer extends Uint8Array. Can we re-test?

@sandersn

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) test it

@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 18, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
test top400❌ Error: Error: {"$id":"1","innerException":null,"message":"TF400898: An Internal Error Occurred.","typeName":"Microsoft.VisualStudio.Services.CircuitBreaker.CircuitBreakerShortCircuitException, Microsoft.VisualStudio.Services.Common","typeKey":"CircuitBreakerShortCircuitException","errorCode":0,"eventId":3000}
user test this❌ Error: Error: {"$id":"1","innerException":null,"message":"TF400898: An Internal Error Occurred.","typeName":"Microsoft.VisualStudio.Services.CircuitBreaker.CircuitBreakerShortCircuitException, Microsoft.VisualStudio.Services.Common","typeKey":"CircuitBreakerShortCircuitException","errorCode":0,"eventId":3000}
run dt❌ Error: Error: TF10216: Azure DevOps services are currently unavailable. Try again later. Activity Id: 5d706515-d449-4fd3-a5da-e2588365ebfd
perf test this faster❌ Error: Error: {"$id":"1","innerException":null,"message":"TF400898: An Internal Error Occurred.","typeName":"Microsoft.VisualStudio.Services.CircuitBreaker.CircuitBreakerExceededConcurrencyException, Microsoft.VisualStudio.Services.Common","typeKey":"CircuitBreakerExceededConcurrencyException","errorCode":0,"eventId":3000}

@sandersn

Copy link
Copy Markdown
Member

I'm also interested to see what performance looks like with a second sample.

@jakebailey

Copy link
Copy Markdown
Member

There are merge conflicts, so the bot can't run anything.

@jakebailey

Copy link
Copy Markdown
Member

That and there's an Azure DevOps outage....

@mfulton26

Copy link
Copy Markdown
ContributorAuthor

There are merge conflicts, so the bot can't run anything.

merge conflicts resolved; this branch is now up to date with main

TypeScript Bot (@typescript-bot) test it

can we try again Nathan Shively-Sanders (@sandersn)?

@jakebailey

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) test it

@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 19, 2024

Copy link
Copy Markdown
Contributor

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

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

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey) Here are the results of running the user tests with tsc comparing main and refs/pull/59205/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15360,989-1,164 (- 1.87%)~~p=0.001 n=6
Types50,24250,056-186 (- 0.37%)~~p=0.001 n=6
Memory used194,713k (± 0.98%)191,647k (± 0.79%)-3,066k (- 1.57%)190,884k194,712kp=0.013 n=6
Parse Time1.30s (± 1.93%)1.30s (± 0.76%)~1.28s1.31sp=0.676 n=6
Bind Time0.71s0.70s (± 0.58%)-0.01s (- 1.17%)0.70s0.71sp=0.007 n=6
Check Time9.52s (± 0.36%)9.46s (± 0.25%)-0.06s (- 0.60%)9.43s9.49sp=0.019 n=6
Emit Time2.76s (± 0.67%)2.73s (± 1.34%)~2.68s2.79sp=0.147 n=6
Total Time14.28s (± 0.31%)14.19s (± 0.34%)-0.09s (- 0.62%)14.13s14.25sp=0.029 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,250942,607-1,643 (- 0.17%)~~p=0.001 n=6
Types407,076407,146+70 (+ 0.02%)~~p=0.001 n=6
Memory used1,218,703k (± 0.00%)1,217,056k (± 0.00%)-1,647k (- 0.14%)1,217,012k1,217,146kp=0.005 n=6
Parse Time6.68s (± 0.41%)6.63s (± 0.15%)-0.05s (- 0.82%)6.62s6.64sp=0.007 n=6
Bind Time1.87s (± 0.73%)1.84s (± 0.56%)-0.02s (- 1.25%)1.83s1.86sp=0.018 n=6
Check Time30.93s (± 0.46%)31.01s (± 0.49%)~30.86s31.17sp=0.335 n=6
Emit Time15.01s (± 0.37%)15.01s (± 0.41%)~14.93s15.08sp=1.000 n=6
Total Time54.49s (± 0.34%)54.50s (± 0.38%)~54.29s54.71sp=0.810 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,276,1562,274,358-1,798 (- 0.08%)~~p=0.001 n=6
Types948,845948,867+22 (+ 0.00%)~~p=0.001 n=6
Memory used2,207,588k (± 0.00%)2,205,841k (± 0.00%)-1,747k (- 0.08%)2,205,784k2,205,895kp=0.005 n=6
Parse Time6.62s (± 0.21%)6.60s (± 0.21%)-0.03s (- 0.40%)6.58s6.61sp=0.019 n=6
Bind Time2.33s (± 0.24%)2.33s (± 1.38%)~2.30s2.39sp=0.228 n=6
Check Time73.06s (± 0.45%)72.65s (± 1.24%)~70.99s73.62sp=0.471 n=6
Emit Time0.14s0.14s (± 4.51%)~0.13s0.15sp=1.000 n=6
Total Time82.14s (± 0.40%)81.71s (± 1.07%)~80.10s82.67sp=0.378 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,227,3321,202,472-24,860 (- 2.03%)~~p=0.001 n=6
Types261,851261,951+100 (+ 0.04%)~~p=0.001 n=6
Memory used2,341,496k (± 0.03%)2,317,151k (± 0.02%)-24,346k (- 1.04%)2,316,417k2,317,629kp=0.005 n=6
Parse Time5.08s (± 1.19%)5.09s (± 0.75%)~5.05s5.16sp=0.688 n=6
Bind Time1.90s (± 0.43%)1.89s (± 0.27%)-0.02s (- 0.88%)1.88s1.89sp=0.009 n=6
Check Time34.50s (± 0.13%)34.52s (± 0.26%)~34.42s34.64sp=0.936 n=6
Emit Time3.26s (± 2.11%)3.24s (± 0.93%)~3.21s3.28sp=0.520 n=6
Total Time44.77s (± 0.29%)44.73s (± 0.22%)~44.63s44.85sp=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,227,3321,202,472-24,860 (- 2.03%)~~p=0.001 n=6
Types261,851261,951+100 (+ 0.04%)~~p=0.001 n=6
Memory used2,533,758k (± 7.20%)2,391,258k (± 0.02%)🟩-142,501k (- 5.62%)2,390,566k2,391,583kp=0.005 n=6
Parse Time6.35s (± 0.50%)6.32s (± 0.65%)~6.28s6.40sp=0.107 n=6
Bind Time2.05s (± 0.96%)2.29s (± 0.28%)🔻+0.25s (+11.98%)2.28s2.30sp=0.005 n=6
Check Time40.93s (± 0.41%)40.76s (± 0.32%)~40.51s40.86sp=0.128 n=6
Emit Time3.94s (± 1.09%)3.93s (± 1.62%)~3.86s4.04sp=0.936 n=6
Total Time53.28s (± 0.35%)53.31s (± 0.30%)~53.03s53.47sp=0.689 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols258,516256,898-1,618 (- 0.63%)~~p=0.001 n=6
Types104,901104,891-10 (- 0.01%)~~p=0.001 n=6
Memory used427,882k (± 0.03%)425,908k (± 0.02%)-1,975k (- 0.46%)425,793k426,103kp=0.005 n=6
Parse Time4.14s (± 0.47%)4.14s (± 0.45%)~4.12s4.17sp=0.625 n=6
Bind Time1.63s (± 1.27%)1.58s (± 1.36%)-0.04s (- 2.66%)1.54s1.60sp=0.016 n=6
Check Time22.19s (± 0.16%)22.30s (± 0.59%)~22.12s22.44sp=0.149 n=6
Emit Time2.01s (± 0.49%)2.00s (± 1.21%)~1.96s2.02sp=0.797 n=6
Total Time29.96s (± 0.19%)30.03s (± 0.46%)~29.88s30.23sp=0.466 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,565223,063-1,502 (- 0.67%)~~p=0.001 n=6
Types93,73493,821+87 (+ 0.09%)~~p=0.001 n=6
Memory used369,610k (± 0.03%)367,982k (± 0.03%)-1,628k (- 0.44%)367,845k368,136kp=0.005 n=6
Parse Time3.45s (± 0.75%)3.45s (± 0.44%)~3.43s3.46sp=0.935 n=6
Bind Time1.94s (± 0.89%)1.91s (± 1.26%)-0.03s (- 1.72%)1.88s1.94sp=0.028 n=6
Check Time19.34s (± 0.31%)19.32s (± 0.24%)~19.26s19.37sp=0.568 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time24.73s (± 0.30%)24.67s (± 0.18%)~24.60s24.74sp=0.296 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,973,4942,973,844+350 (+ 0.01%)~~p=0.001 n=6
Types1,021,2071,021,632+425 (+ 0.04%)~~p=0.001 n=6
Memory used3,097,873k (± 0.00%)3,097,234k (± 0.00%)-639k (- 0.02%)3,097,090k3,097,337kp=0.005 n=6
Parse Time13.89s (± 0.16%)13.96s (± 0.22%)+0.06s (+ 0.47%)13.90s13.99sp=0.016 n=6
Bind Time4.31s (± 2.17%)4.32s (± 2.79%)~4.23s4.50sp=0.294 n=6
Check Time79.31s (± 0.46%)77.46s (± 2.60%)-1.84s (- 2.32%)74.61s79.08sp=0.013 n=6
Emit Time20.43s (± 0.79%)21.67s (± 8.50%)~20.38s24.06sp=0.128 n=6
Total Time117.93s (± 0.34%)117.41s (± 0.20%)-0.52s (- 0.44%)117.04s117.66sp=0.045 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols267,370267,657+287 (+ 0.11%)~~p=0.001 n=6
Types108,862109,265+403 (+ 0.37%)~~p=0.001 n=6
Memory used411,932k (± 0.01%)411,259k (± 0.02%)-673k (- 0.16%)411,178k411,347kp=0.005 n=6
Parse Time3.83s (± 0.73%)3.85s (± 0.55%)~3.83s3.88sp=0.329 n=6
Bind Time1.69s (± 0.48%)1.67s (± 0.91%)-0.02s (- 1.28%)1.64s1.68sp=0.016 n=6
Check Time16.88s (± 0.29%)16.78s (± 0.25%)-0.09s (- 0.55%)16.72s16.84sp=0.008 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.40s (± 0.28%)22.30s (± 0.21%)-0.10s (- 0.44%)22.25s22.36sp=0.016 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols510,573508,867-1,706 (- 0.33%)~~p=0.001 n=6
Types161,621161,682+61 (+ 0.04%)~~p=0.001 n=6
Memory used448,305k (± 0.10%)446,460k (± 0.07%)-1,845k (- 0.41%)446,017k446,739kp=0.005 n=6
Parse Time3.90s (± 0.60%)3.89s (± 0.85%)~3.86s3.95sp=0.517 n=6
Bind Time1.46s (± 1.26%)1.43s (± 1.23%)-0.03s (- 2.17%)1.40s1.44sp=0.009 n=6
Check Time21.22s (± 0.20%)21.17s (± 0.33%)~21.03s21.22sp=0.171 n=6
Emit Time0.00s (±244.70%)0.00s~~~p=0.405 n=6
Total Time26.58s (± 0.15%)26.49s (± 0.32%)-0.09s (- 0.33%)26.34s26.59sp=0.045 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey) Here are the results of running the top 400 repos with tsc comparing main and refs/pull/59205/merge:

Everything looks good!

@mfulton26

Copy link
Copy Markdown
ContributorAuthor

What do you think of these changes Nathan Shively-Sanders (@sandersn)? This branch is currently up to date with main. I've noticed various changes to iterators, iterables, and typed arrays (e.g. bug fixes) that would have been easier/avoided with root TypedArray and TypedArrayConstructor types.

@DanielRosenwasser

Copy link
Copy Markdown
Member

Ron Buckton (@rbuckton) How much of this intersects with the work at #58573?

@rbuckton

Copy link
Copy Markdown
Contributor

Ron Buckton (@rbuckton) How much of this intersects with the work at #58573?

They are essentially the same, except for the generic Buffer type argument.

@rbuckton

Copy link
Copy Markdown
Contributor

They are essentially the same, except for the generic Buffer type argument.

Sorry, I misspoke. I mistakenly thought you were referencing #59407, which is similar except that #59407 allows the individual typed arrays to be generic over ArrayBufferLike which requires a bit more complexity to enable than is present in this PR.

The only way this PR intersects with #58573 would be in what paths are used.

@mfulton26

Copy link
Copy Markdown
ContributorAuthor

Should this PR be closed in favor of #59407? My main goal is to get a common TypedArray and TypedArrayConstructor to reference, extend, etc. Both PRs do this but #59407 does more.

@rbuckton

Copy link
Copy Markdown
Contributor

Should this PR be closed in favor of #59407? My main goal is to get a common TypedArray and TypedArrayConstructor to reference, extend, etc. Both PRs do this but #59407 does more.

Possibly, but I'm not certain #59407 is the best solution either. While I'd like to introduce TypedArray/TypedArrayConstructor, TypedArrayConstructor needs a higher-kinded types mechanism to be defined cleanly. It's more likely that we'll end up taking #59417 in the near term (5.7 or later) and will need to postpone TypedArray/TypedArrayConstructor for now.

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog BugPRs that fix a backlog bugFor Milestone BugPRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion: a built-in TypedArray interface Big(Int|Uint)64ArrayConstructor: missing from Iterable

7 participants

@mfulton26@typescript-bot@DanielRosenwasser@rubiesonthesky@sandersn@jakebailey@rbuckton