# wgsl-conformance — WGSL's integer semantics on a GPU The vectors an adapter passes before it runs a graph of a decode at `decode-equivalence` ([`extensions/determinism-tiers.md`](../extensions/determinism-tiers.md) §5, *Claiming the tier on a GPU*, item 5): every integer operation a kernel may use (the rules check's rule 7 keeps the kernels inside the suite), on `i32`, `u32` and two-component vectors of them where a kernel uses those, at the cases WGSL defines at run time and the languages it is translated into leave open — wrapping addition, subtraction, multiplication and negation; division and remainder by zero and of the most negative `i32` by −1; shift amounts from 0 to 40 and past them; `clamp` with its bounds in and out of order; `abs`, `sign`, the bit counts and positions; bit fields at and past the word; the conversions between `i32`, `u32` and `bool`. **Provenance.** Written by `wai/wai-ops-gpu`'s `wai-wgsl-vectors` binary from `wai_ops_gpu::semantics::reference`, which states each result from the text of WGSL (W3C Candidate Recommendation Draft, 21 October 2026, §8.8, §8.10, §17.5), not from a shader. No case comes from a device. ## Layout - `integer.jsonl` — one JSON object per operation, in the order of its `code`: `op`, its name; `code`, the operation's number in `wai-ops-gpu/src/wgsl/semantics.wgsl`; `wgsl`, the expression evaluated, with `a`, `b`, `c`, `d` the operands as `u32` and `ia` … `id` their bits as `i32`; and `cases`, each `[a, b, c, d, result]` as eight lowercase hexadecimal digits, followed by `"unguarded"` for a case the module of item 4 never reaches (a shift amount of 32 or more, `clamp` bounds out of order). A vector operation's result is its two components folded into one word, `x ^ (y × 0x9E3779B9)` modulo 2^32. ## Equivalence An adapter conforms when, for every case not marked `unguarded`, the word it computes for the operation on the operands, read from memory at run time, is `result`. Results on `unguarded` cases are reported, and do not decide conformance. The file is checked against the reference natively (`wai-ops-gpu/tests/semantics.rs`), under Node (`wai-ops-gpu/browser/semantics_reference.mjs`) and in a browser page (`wai-ops-gpu/browser/run.mjs`), the last two running the reference compiled to wasm32.