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

Add Float16Array #1398

Merged
merged 4 commits into from
Apr 8, 2024
Merged

Add Float16Array #1398

merged 4 commits into from
Apr 8, 2024

Conversation

bakkot
Copy link
Contributor

@bakkot bakkot commented Mar 29, 2024

The Float16Array proposal for JavaScript adds a new TypedArray type holding IEEE binary16 floats. This PR adds it to all of the lists of TypedArray types in WebIDL.

Implementations of the proposal are underway in at least Chrome and Firefox, though it'll be some time before they're shippable. I don't know what the appropriate time to merge this is but I figured I should at least open it.

This is a JS feature, but adding it to ArrayBufferView has implications for any API which takes a generic TypedArray, which is quite a few of them. Does that imply they all need new tests? Hopefully not?

Fixes #1310.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! I think it would be good to also add web-platform-tests coverage. We have a couple tests that check if each of the typed arrays are supported by postMessage(), fetch(), and the like and it would be good to add Float16Array there. A grep for one of the rarer types will likely return those tests.

@bakkot
Copy link
Contributor Author

bakkot commented Apr 3, 2024

OK, opened a PR with tests.

@annevk
Copy link
Member

annevk commented Apr 3, 2024

Thanks @bakkot, I think the one thing remaining is that we should probably link the proposal if we are to merge this. Similar to how HTML has "[JSIMPORTATTRIBUTES]" and such. With that nit addressed I'd be willing to merge this Friday, barring any other feedback.

@bakkot
Copy link
Contributor Author

bakkot commented Apr 3, 2024

I stuck a link to the proposal in the table which defines the types, but I'm not sure that's the best way to do it. Happy to take suggestions for alternative ways to include the link.

@annevk
Copy link
Member

annevk commented Apr 3, 2024

I think the placement is good, but you want to use something akin to https:/whatwg/fetch/blob/4c3750d3277e3df5ad452f48314eb29ca43b6461/fetch.bs#L58-L115 to add an official looking reference which you'd then reference from there.

@bakkot
Copy link
Contributor Author

bakkot commented Apr 3, 2024

Neat, done.

annevk pushed a commit to web-platform-tests/wpt that referenced this pull request Apr 8, 2024
@annevk annevk merged commit ca9d63d into whatwg:main Apr 8, 2024
2 checks passed
@bakkot bakkot deleted the float16array branch April 8, 2024 15:05
tidoust added a commit to w3c/strudy that referenced this pull request Apr 10, 2024
Added to Web IDL in whatwg/webidl#1398 and already used
in the definition of `ArrayBufferView`.

The test is not fantastically useful but will allow to make the test fail next
time we need to add a basic type to the list.
tidoust added a commit to w3c/strudy that referenced this pull request Apr 10, 2024
Added to Web IDL in whatwg/webidl#1398 and already used
in the definition of `ArrayBufferView`.

The test is not fantastically useful but will allow to make the test fail next
time we need to add a basic type to the list.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Apr 15, 2024
…l TypedArrays for Float16Array, a=testonly

Automatic update from web-platform-tests
Update tests which are generic across all TypedArrays for Float16Array

For whatwg/webidl#1398.
--

wpt-commits: 5aa50dd4151b5bc1d04d5505366c6e27df30af5b
wpt-pr: 45483
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this pull request Apr 16, 2024
…l TypedArrays for Float16Array, a=testonly

Automatic update from web-platform-tests
Update tests which are generic across all TypedArrays for Float16Array

For whatwg/webidl#1398.
--

wpt-commits: 5aa50dd4151b5bc1d04d5505366c6e27df30af5b
wpt-pr: 45483
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Float16Array integration
2 participants