Skip to content

lib: narrow Atomics.wait* target to SharedArrayBuffer views #61817

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

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

Conversation

Renegade334
Copy link
Contributor

The Atomics.wait* methods only accept views over SharedArrayBuffers, and will throw a TypeError if passed a view on an ArrayBuffer. Since #59417, it's now possible to express this in the method declarations.

This change seems like it should have a favourable utility-to-annoyance ratio, but it would be interesting to see what the user tests say.

(The same does not apply to Atomics.notify(), since although it's a no-op if passed a non-shared view, it accepts the argument and completes gracefully.)

@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Jun 4, 2025
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jun 4, 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.

@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 4, 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 Here are the results of running the user tests with tsc comparing main and refs/pull/61817/merge:

Everything looks good!

@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,121k (± 0.94%) 192,930k (± 0.01%) -1,191k (- 0.61%) 192,903k 192,943k p=0.020 n=6
Parse Time 1.31s (± 0.79%) 1.32s (± 0.42%) ~ 1.31s 1.32s p=0.138 n=6
Bind Time 0.73s 0.73s ~ ~ ~ p=1.000 n=6
Check Time 9.74s (± 0.15%) 9.72s (± 0.24%) ~ 9.69s 9.74s p=0.192 n=6
Emit Time 2.72s (± 0.50%) 2.74s (± 0.88%) ~ 2.71s 2.77s p=0.363 n=6
Total Time 14.50s (± 0.20%) 14.50s (± 0.16%) ~ 14.46s 14.53s p=0.683 n=6
angular-1 - node (v18.15.0, x64)
Errors 56 56 ~ ~ ~ p=1.000 n=6
Symbols 949,240 949,240 ~ ~ ~ p=1.000 n=6
Types 411,065 411,065 ~ ~ ~ p=1.000 n=6
Memory used 1,225,111k (± 0.00%) 1,225,067k (± 0.00%) ~ 1,225,027k 1,225,111k p=0.173 n=6
Parse Time 6.60s (± 0.86%) 6.63s (± 0.79%) ~ 6.57s 6.68s p=0.224 n=6
Bind Time 1.88s (± 0.55%) 1.89s (± 0.40%) ~ 1.88s 1.90s p=0.351 n=6
Check Time 31.83s (± 0.12%) 31.76s (± 0.55%) ~ 31.50s 31.96s p=0.375 n=6
Emit Time 14.87s (± 0.20%) 14.86s (± 0.72%) ~ 14.77s 15.00s p=0.374 n=6
Total Time 55.18s (± 0.11%) 55.14s (± 0.45%) ~ 54.77s 55.52s p=0.748 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,577,125 2,577,125 ~ ~ ~ p=1.000 n=6
Types 892,437 892,437 ~ ~ ~ p=1.000 n=6
Memory used 2,856,018k (± 0.00%) 2,856,052k (± 0.00%) ~ 2,855,997k 2,856,183k p=0.810 n=6
Parse Time 9.08s (± 0.22%) 9.09s (± 0.41%) ~ 9.03s 9.12s p=0.519 n=6
Bind Time 2.29s (± 0.53%) 2.29s (± 0.18%) ~ 2.28s 2.29s p=0.863 n=6
Check Time 87.67s (± 0.41%) 87.65s (± 0.27%) ~ 87.27s 87.94s p=0.748 n=6
Emit Time 0.30s 0.30s ~ ~ ~ p=1.000 n=6
Total Time 99.33s (± 0.36%) 99.32s (± 0.28%) ~ 98.88s 99.63s p=0.810 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,521 1,228,521 ~ ~ ~ p=1.000 n=6
Types 267,368 267,368 ~ ~ ~ p=1.000 n=6
Memory used 2,665,319k (±13.48%) 2,360,198k (± 0.03%) 🟩-305,121k (-11.45%) 2,359,609k 2,360,834k p=0.045 n=6
Parse Time 5.27s (± 1.76%) 5.20s (± 0.67%) ~ 5.13s 5.22s p=0.297 n=6
Bind Time 1.81s (± 1.43%) 1.81s (± 0.76%) ~ 1.78s 1.82s p=0.934 n=6
Check Time 35.38s (± 0.82%) 35.51s (± 0.49%) ~ 35.29s 35.70s p=0.377 n=6
Emit Time 3.01s (± 1.18%) 2.99s (± 0.34%) ~ 2.98s 3.01s p=0.376 n=6
Total Time 45.46s (± 0.72%) 45.51s (± 0.45%) ~ 45.21s 45.72s p=0.748 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,521 1,228,521 ~ ~ ~ p=1.000 n=6
Types 267,368 267,368 ~ ~ ~ p=1.000 n=6
Memory used 2,794,253k (±14.30%) 2,794,249k (±14.27%) ~ 2,428,992k 3,159,223k p=0.936 n=6
Parse Time 6.82s (± 1.91%) 6.80s (± 1.13%) ~ 6.71s 6.91s p=0.936 n=6
Bind Time 2.19s (± 1.10%) 2.21s (± 1.89%) ~ 2.15s 2.26s p=0.572 n=6
Check Time 42.77s (± 0.55%) 42.80s (± 0.45%) ~ 42.51s 43.02s p=0.873 n=6
Emit Time 3.58s (± 2.97%) 3.57s (± 2.42%) ~ 3.46s 3.69s p=0.873 n=6
Total Time 55.38s (± 0.30%) 55.39s (± 0.40%) ~ 55.11s 55.61s p=0.936 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 263,435 263,435 ~ ~ ~ p=1.000 n=6
Types 107,110 107,110 ~ ~ ~ p=1.000 n=6
Memory used 441,763k (± 0.02%) 441,723k (± 0.01%) ~ 441,658k 441,776k p=0.471 n=6
Parse Time 3.54s (± 0.52%) 3.55s (± 0.93%) ~ 3.51s 3.59s p=1.000 n=6
Bind Time 1.32s (± 0.89%) 1.32s (± 1.39%) ~ 1.30s 1.35s p=0.934 n=6
Check Time 18.95s (± 0.26%) 18.96s (± 0.61%) ~ 18.82s 19.13s p=0.809 n=6
Emit Time 1.54s (± 0.97%) 1.53s (± 1.23%) ~ 1.51s 1.56s p=0.121 n=6
Total Time 25.36s (± 0.22%) 25.36s (± 0.55%) ~ 25.15s 25.52s p=0.872 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 71 71 ~ ~ ~ p=1.000 n=6
Symbols 225,981 225,981 ~ ~ ~ p=1.000 n=6
Types 94,356 94,356 ~ ~ ~ p=1.000 n=6
Memory used 371,320k (± 0.05%) 371,309k (± 0.04%) ~ 371,204k 371,616k p=0.936 n=6
Parse Time 2.89s (± 1.45%) 2.89s (± 0.83%) ~ 2.87s 2.92s p=1.000 n=6
Bind Time 1.60s (± 1.02%) 1.58s (± 1.11%) ~ 1.57s 1.61s p=0.256 n=6
Check Time 16.46s (± 0.34%) 16.50s (± 0.20%) ~ 16.47s 16.56s p=0.148 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.94s (± 0.26%) 20.98s (± 0.30%) ~ 20.91s 21.08s p=0.470 n=6
vscode - node (v18.15.0, x64)
Errors 38 38 ~ ~ ~ p=1.000 n=6
Symbols 3,495,222 3,495,222 ~ ~ ~ p=1.000 n=6
Types 1,180,280 1,180,282 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,536,957k (± 0.00%) 3,536,933k (± 0.01%) ~ 3,536,756k 3,537,255k p=0.630 n=6
Parse Time 14.89s (± 0.61%) 14.89s (± 0.23%) ~ 14.83s 14.92s p=0.572 n=6
Bind Time 4.83s (± 0.24%) 4.83s (± 0.52%) ~ 4.79s 4.86s p=0.807 n=6
Check Time 95.95s (± 2.63%) 99.31s (± 2.64%) ~ 94.10s 101.14s p=0.066 n=6
Emit Time 31.32s (±10.75%) 30.35s (± 1.96%) ~ 29.16s 30.74s p=0.810 n=6
Total Time 146.99s (± 3.73%) 149.38s (± 2.14%) ~ 143.00s 151.59s p=0.298 n=6
webpack - node (v18.15.0, x64)
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 320,086 320,086 ~ ~ ~ p=1.000 n=6
Types 140,412 140,414 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 474,322k (± 0.03%) 474,350k (± 0.02%) ~ 474,218k 474,502k p=0.575 n=6
Parse Time 4.34s (± 0.84%) 4.32s (± 0.54%) ~ 4.28s 4.35s p=0.252 n=6
Bind Time 1.78s (± 0.98%) 1.76s (± 1.17%) ~ 1.73s 1.79s p=0.373 n=6
Check Time 20.72s (± 0.23%) 20.71s (± 0.32%) ~ 20.62s 20.79s p=0.469 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 26.83s (± 0.33%) 26.80s (± 0.23%) ~ 26.71s 26.89s p=0.466 n=6
xstate-main - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 571,458 571,458 ~ ~ ~ p=1.000 n=6
Types 191,798 191,798 ~ ~ ~ p=1.000 n=6
Memory used 501,863k (± 0.01%) 501,795k (± 0.05%) ~ 501,463k 502,137k p=0.378 n=6
Parse Time 3.43s (± 0.59%) 3.42s (± 1.00%) ~ 3.37s 3.46s p=0.570 n=6
Bind Time 1.24s (± 0.83%) 1.24s (± 0.79%) ~ 1.23s 1.25s p=0.452 n=6
Check Time 20.02s (± 0.38%) 20.42s (± 3.26%) ~ 20.01s 21.68s p=0.230 n=6
Emit Time 0.00s 0.00s (±244.70%) ~ 0.00s 0.01s p=0.405 n=6
Total Time 24.69s (± 0.34%) 25.08s (± 2.55%) ~ 24.65s 26.28s p=0.170 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 top 400 repos with tsc comparing main and refs/pull/61817/merge:

Everything looks good!

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: Not started
Development

Successfully merging this pull request may close these issues.

3 participants