open-standards/wai/wai-pack-gpu/Cargo.toml
Transaction Science d135df38a4
All checks were successful
WAI breaking changes and the conformance runner / WAI breaking · does this change touch WAI (push) Successful in 7s
WAI breaking changes and the conformance runner / WAI breaking · wire, record and API against main · linux (push) Successful in 36s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (push) Successful in 4m15s
WAI breaking changes and the conformance runner / WAI breaking and conform · their tests, and the independent verifiers through wai conform · linux (push) Successful in 5m1s
wai-pack-gpu: the packer's kernels held to integer types on naga's IR
packaging §11.6 item 1 forbids running a step on a backend that computes it
otherwise than its definition, in floating point among them. tests/integer_only.rs
holds the motion search, SSE and BLAKE3 kernels, on the IR of naga 30.0.1 (the
translator wgpu compiles them with), to the first two conditions of
determinism-tiers §5, Claiming the tier on a GPU, as wai-ops-gpu's wgsl_rules.rs
holds the decoders' kernels: each validates with every flag and no capability (no
f16, no 64-bit type, no subgroup or quad operation, no extension), and every type,
every expression's type and every literal is bool, i32 or u32. The kernels checked
are every .wgsl file under src/wgsl, each the text Sources::shipped compiles. Six
planted violations are refused by the rule they break.

Re-landed from PR #459 (c0c4816fb), whose test scanned the kernels' source text;
this reads them on naga's IR instead, as main checks the decoders' kernels. naga is
a dev-dependency at the release wgpu already uses, so the lockfile gains one
dependency line and no package. wai-pack.yml's macOS leg, which builds the crate,
requires the test's lines. packaging §11.6's informative note names the test.

Tested on the M3 Ultra build host (Metal): clippy --all-targets -D warnings; the
macOS step as written (every wai-pack-gpu test with WAI_PACK_GPU_REQUIRE=1, its
greps); a float planted in the shipped sse.wgsl fails the test (rule 2), and a
.wgsl file the crate does not compile fails it too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-10 02:09:05 -05:00

40 lines
1.7 KiB
TOML

# The steps of WAI's packaging extension that a GPU computes exactly, as WGSL compute
# kernels through wgpu (shown exact on Metal only; Vulkan and DX12 built, not run): the
# integer encoder's motion search, the
# sum of squared differences, and BLAKE3's chunk function. Every kernel is integer, in
# 32-bit words, so a device that runs it gives the CPU's result for every input
# (extensions/packaging.md §11.6).
#
# A SEPARATE crate with its own lockfile, as wai-ops-gpu is, so that wai-pack builds
# without wgpu by default; wai-pack's `gpu` feature is the only way it enters a pack.
[package]
name = "wai-pack-gpu"
version = "0.1.0"
edition = "2024"
license = "Apache-2.0"
publish = false
description = "WAI packaging steps on GPUs: the integer motion search, SSE and BLAKE3's chunk function as WGSL kernels through wgpu, exact in 32-bit words"
repository = "https://git.transaction.science/Transaction-Science/open-standards"
# Its own workspace and Cargo.lock.
[workspace]
[lib]
name = "wai_pack_gpu"
path = "src/lib.rs"
[dependencies]
wgpu = { version = "30.0.1", default-features = false, features = ["std", "wgsl", "metal", "vulkan", "dx12"] }
# The parent nodes of a message of several chunks are merged on the host, by the BLAKE3
# reference crate's subtree functions (`blake3::hazmat`); the device computes the chunks.
blake3 = "1"
# The integer rule test (tests/integer_only.rs) reads the kernels on the IR of the
# translator wgpu compiles them with: naga, the same release wgpu 30.0.1 depends on, so
# the lockfile gains no package.
[dev-dependencies]
naga = { version = "30.0.1", default-features = false, features = ["wgsl-in"] }
[profile.release]
debug = false
overflow-checks = true