Files
sousa-gecko/testing/web-platform/tests/webnn/tools
BruceDai aeb7574c54 Bug 2051663 [wpt PR 61003] - webnn: generate required data types and ranks JSON from the Spec, a=testonly
Automatic update from web-platform-tests
webnn: generate required data types and ranks JSON from the Spec

Previously, the per-operator minimum data type / rank limits used by the
WebNN WPT conformance harness were hand-maintained in
`minimum_datatype_set.json`, this CL replaces the hand-written file with
a generated one and adds the tooling to regenerate it:

- Add `tools/generate-required-datatypes-ranks.py`, which fetches
  `index.bs` from the WebNN spec (the `minimum_datatype_rankrange`
  branch) and parses every `tensor-limits-*` table to extract each
  operand's required data types and rank range, then writes
  `resources/required_datatypes_ranks.json`.
- Rename `minimum_datatype_set.json` -> `required_datatypes_ranks.json`
  and regenerate its contents from the spec. The new file covers
  95 operators / 184 operands.
- In `resources/utils.js`, rename `minimumDataTypeSet` ->
  `requiredDataTypesAndRanks` and `getMinimumDataTypeSetJson` ->
  `getRequiredDataTypesAndRanks`, and point the fetch at the new
  resource path.
- In `conformance_tests/is_infinite.https.any.js` and
  `is_nan.https.any.js`, update the operator argument key from
  `'input'` to `'a'` to match the spec's actual parameter name for
  these element-wise unary ops.

Bug: 434735286
Change-Id: Ib5b83c568ae34d4d8bb7c0df52f90f6f7565ef4d
Cq-Include-Trybots: luci.chromium.try​:win11-blink-rel, mac14.arm64-blink-rel, mac14-blink-rel, mac15.arm64-blink-rel, mac15-blink-rel, linux-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7936012
Commit-Queue: Hu, Ningxin <ningxin.hu@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Hu, Ningxin <ningxin.hu@intel.com>
Cr-Commit-Position: refs/heads/main@{#1654974}

--

wpt-commits: 6237d26f48fa1059a5fe6855a92b9343cbc05021
wpt-pr: 61003
2026-07-10 09:22:53 +00:00
..