Compliance cases
These are the 7,246 inputs a submission must answer.
A conforming implementation returns true
for the 2,791 valid ones and false
for the 4,455 invalid ones.
You can run the suite without reading it, or open any case to see its input and where its first ill-formed byte is.
Well-formed means Table 3-7 of the Unicode Standard, as RFC 3629 restates it: no overlong forms, surrogates, code points above U+10FFFF, stray continuation bytes or sequences cut short. The compliance suite combines Markus Kuhn's UTF-8 stress test, WPT's fatal TextDecoder tests, every lead byte against the edges of its allowed ranges, errors at every offset around 16-, 32- and 64-byte blocks and at the end of every length up to 130 bytes, large inputs, and seeded random text. simdutf, Python and a Table 3-7 reference agree on every answer.
Run the full compliance suite locally. Replace your-component.wasm
with your compiled component.
Download the suite
curl -fLo validate_utf8.comply.wasm https://calculated.world/comply/validate_utf8.wasm
npx qipok your-component.wasm --suite validate_utf8.comply.wasm
311 of 7,246 cases · 154 true · 157 false
| Case | Name | Expected | Note | Size |
|---|---|---|---|---|
| 002822 | regression/ED BF BF at 33 in ASCII Focused regression | false | 128 B | |
| 002823 | regression/ED BF BF at 44 in ASCII Focused regression | false | 128 B | |
| 002824 | regression/ED BF BF at 45 in ASCII Focused regression | false | 128 B | |
| 002825 | regression/ED BF BF at 46 in ASCII Focused regression | false | 128 B | |
| 002826 | regression/ED BF BF at 47 in ASCII Focused regression | false | 128 B | |
| 002827 | regression/ED BF BF at 48 in ASCII Focused regression | false | 128 B | |
| 002828 | regression/ED BF BF at 49 in ASCII Focused regression | false | 128 B | |
| 002829 | regression/ED BF BF at 60 in ASCII Focused regression | false | 128 B | |
| 002830 | regression/ED BF BF at 61 in ASCII Focused regression | false | 128 B | |
| 002831 | regression/ED BF BF at 62 in ASCII Focused regression | false | 128 B | |
| 002832 | regression/ED BF BF at 63 in ASCII Focused regression | false | 128 B | |
| 002833 | regression/ED BF BF at 64 in ASCII Focused regression | false | 128 B | |
| 002834 | regression/ED BF BF at 65 in ASCII Focused regression | false | 128 B | |
| 002835 | regression/ED BF BF at 76 in ASCII Focused regression | false | 128 B | |
| 002836 | regression/ED BF BF at 77 in ASCII Focused regression | false | 128 B | |
| 002837 | regression/ED BF BF at 78 in ASCII Focused regression | false | 128 B | |
| 002838 | regression/ED BF BF at 79 in ASCII Focused regression | false | 128 B | |
| 002839 | regression/ED BF BF at 80 in ASCII Focused regression | false | 128 B | |
| 002840 | regression/ED BF BF at 81 in ASCII Focused regression | false | 128 B | |
| 002841 | regression/ED BF BF at 92 in ASCII Focused regression | false | 128 B | |
| 002842 | regression/ED BF BF at 93 in ASCII Focused regression | false | 128 B | |
| 002843 | regression/ED BF BF at 94 in ASCII Focused regression | false | 128 B | |
| 002844 | regression/ED BF BF at 95 in ASCII Focused regression | false | 128 B | |
| 002845 | regression/ED BF BF at 96 in ASCII Focused regression | false | 128 B | |
| 002846 | regression/ED BF BF at 97 in ASCII Focused regression | false | 128 B | |
| 002847 | regression/ED BF BF at 108 in ASCII Focused regression | false | 128 B | |
| 002848 | regression/ED BF BF at 109 in ASCII Focused regression | false | 128 B | |
| 002849 | regression/ED BF BF at 110 in ASCII Focused regression | false | 128 B | |
| 002850 | regression/ED BF BF at 111 in ASCII Focused regression | false | 128 B | |
| 002851 | regression/ED BF BF at 112 in ASCII Focused regression | false | 128 B | |
| 002852 | regression/ED BF BF at 113 in ASCII Focused regression | false | 128 B | |
| 002853 | regression/ED BF BF at 124 in ASCII Focused regression | false | 128 B | |
| 003292 | regression/U+D7FF at 0 in mixed Focused regression | true | 128 B | |
| 003293 | regression/U+D7FF at 1 in mixed Focused regression | true | 128 B | |
| 003294 | regression/U+D7FF at 12 in mixed Focused regression | true | 128 B | |
| 003295 | regression/U+D7FF at 13 in mixed Focused regression | true | 128 B | |
| 003296 | regression/U+D7FF at 15 in mixed Focused regression | true | 128 B | |
| 003297 | regression/U+D7FF at 16 in mixed Focused regression | true | 128 B | |
| 003298 | regression/U+D7FF at 17 in mixed Focused regression | true | 128 B | |
| 003299 | regression/U+D7FF at 28 in mixed Focused regression | true | 128 B | |
| 003300 | regression/U+D7FF at 29 in mixed Focused regression | true | 128 B | |
| 003301 | regression/U+D7FF at 32 in mixed Focused regression | true | 128 B | |
| 003302 | regression/U+D7FF at 36 in mixed Focused regression | true | 128 B | |
| 003303 | regression/U+D7FF at 44 in mixed Focused regression | true | 128 B | |
| 003304 | regression/U+D7FF at 48 in mixed Focused regression | true | 128 B | |
| 003305 | regression/U+D7FF at 49 in mixed Focused regression | true | 128 B | |
| 003306 | regression/U+D7FF at 60 in mixed Focused regression | true | 128 B | |
| 003307 | regression/U+D7FF at 61 in mixed Focused regression | true | 128 B | |
| 003308 | regression/U+D7FF at 63 in mixed Focused regression | true | 128 B | |
| 003309 | regression/U+D7FF at 64 in mixed Focused regression | true | 128 B |
Where these rules come from
Well-formed UTF-8 is defined by Table 3-7 of
the Unicode Standard, chapter 3
, which
RFC 3629
restates as ABNF. Every answer is agreed by
simdutf
9.4.0, Python’s strict codec and a direct reading of the table; the
suite’s own tests add Node.js’s buffer.isUtf8
and a fatal TextDecoder.
- UTF-8 decoder capability and stress test — Markus Kuhn’s file, the source of the 80 Kuhn cases
-
WPT textdecoder-fatal tests
— what browsers must reject when decoding with
fatal: true - Validating UTF-8 In Less Than One Instruction Per Byte — John Keiser and Daniel Lemire’s vectorised algorithm, which simdutf uses