Thin JavaScript WebNN test shim on top of RustNN for upstream WPT conformance execution.
- Uses upstream WPT WebNN conformance files (
webnn/conformance_tests/*.https.any.js) - Extracts raw test cases from those JS files
- Sends each graph execution to a Rust subprocess (
wpt-runner) backed by RustNN backends - Compares outputs with lightweight tolerance checks
This is intentionally test-oriented and not a production WebNN runtime.
- Node.js >= 20
- Rust toolchain
- RustNN checked out at
../rustnnrelative to this repo (/Users/tarek/Dev/rustnn)
# Fetch/update WPT into .cache/wpt
npm run test:wpt:fetch
# Build runner once
npm run build:runner
# Run one operation file (default backend+device = onnx+cpu)
npm run test:wpt:run -- --op add --limit-tests 20
# Run CoreML (macOS) using backend feature flag
npm run test:wpt:run -- --op add --backend coreml --variants npu --runner-features backend-onnx,backend-coreml
# Run TensorRT mock backend
npm run test:wpt:run -- --op add --backend trtx --variants gpu --runner-features backend-onnx,backend-trtx-mock
# Generate machine-readable + HTML conformance report
npm run test:wpt:report -- --op add --limit-tests 20 --backends onnx,coreml --variants cpu,npu --runner-features backend-onnx,backend-coremlReport outputs:
reports/conformance.json(full structured execution data)reports/conformance.html(styled dashboard with summary/failures/skips)
- Defaults are
backend=onnxandvariant=cpuwhen flags are omitted. - Available backend names:
onnx,coreml,trtx. --runner-featurescontrols which Rust backend features are enabled when spawningcargo run.- Conformance-only scope in v1 (validation tests are out of scope).
- Numeric comparison currently uses pragmatic tolerances, not full WPT testharness parity.