Closed Bug 2077040 Opened 2 months ago Closed 1 month ago

[wpt-sync] Sync PR 63151 - Fix WebNN binary16 helper rounding

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox160 fixed)

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Attachments

(1 file)

Sync web-platform-tests PR 63151 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/63151
Details from upstream follow.

Matt Hargett <plaztiksyke@gmail.com> wrote:

Fix WebNN binary16 helper rounding

The WebNN helper currently rounds binary16 midpoint ties upward and first narrows JavaScript Numbers to float32. That also misclassifies values just above the underflow midpoint and just below the overflow midpoint, and double-rounds values on either side of a binary16 midpoint. These errors affect both test tensors and expected results, obscuring precision regressions in real model integrations.

Convert directly from binary64 with ties-to-even, preserving signed zero and NaN class as required by the WebNN floating-point conversion algorithm.

  • Five new browser helper tests fail before the fix; all 14 helper tests pass afterward.
  • An independent encoding/midpoint audit passes all 65,536 binary16 encodings and 190,464 signed midpoint/adjacent-binary64 checks.
  • WPT lint, JavaScript syntax checks, and git diff --check pass.

Separate from the ULP-distance fixes in #63150.

Attached file Notable wpt changes —

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 589 tests and 10 subtests

Status Summary

Firefox

OK : 318
PASS : 468
FAIL : 1211
ERROR : 30
NOTRUN: 150

Chrome

OK : 348
PASS : 9499
FAIL : 160

Safari

OK : 318
PASS : 468
FAIL : 1211
ERROR : 30
NOTRUN: 150

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

(See attachment for full changes)

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: