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
188 of 7,246 cases · 130 true · 58 false
| Case | Name | Expected | Note | Size |
|---|---|---|---|---|
| 006750 | generated/1482 Generated | false | 179 B | |
| 006757 | generated/1489 Generated | true | 131 B | |
| 006758 | generated/1490 Generated | true | 170 B | |
| 006765 | generated/1497 Generated | true | 13 B | |
| 006773 | generated/1506 Generated | false | 170 B | |
| 006780 | generated/1513 Generated | false | 159 B | |
| 006791 | generated/1526 Generated | true | 47 B | |
| 006798 | generated/1534 Generated | true | 47 B | |
| 006855 | generated/1593 Generated | false | 3 B | |
| 006874 | generated/1612 Generated | true | 12 B | |
| 006878 | generated/1616 Generated | false | 9 B | |
| 006911 | generated/1653 Generated | true | 99 B | |
| 006920 | generated/1662 Generated | true | 13 B | |
| 006939 | generated/1681 Generated | true | 13 B | |
| 006951 | generated/1694 Generated | false | 8 B | |
| 006960 | generated/1703 Generated | true | 72 B | |
| 006974 | generated/1717 Generated | true | 12 B | |
| 006978 | generated/1721 Generated | true | 24 B | |
| 007017 | generated/1760 Generated | true | 176 B | |
| 007025 | generated/1768 Generated | false | 56 B | |
| 007035 | generated/1779 Generated | true | 13 B | |
| 007081 | generated/1825 Generated | true | 5 B | |
| 007082 | generated/1826 Generated | false | 4 B | |
| 007112 | generated/1856 Generated | true | 15 B | |
| 007117 | generated/1861 Generated | true | 162 B | |
| 007128 | generated/1873 Generated | false | 65 B | |
| 007150 | generated/1897 Generated | true | 47 B | |
| 007155 | generated/1902 Generated | true | 248 B | |
| 007157 | generated/1905 Generated | true | 94 B | |
| 007162 | generated/1910 Generated | true | 14 B | |
| 007193 | generated/1944 Generated | false | 237 B | |
| 007208 | generated/1960 Generated | false | 3 B | |
| 007209 | generated/1961 Generated | true | 37 B | |
| 007218 | generated/1971 Generated | true | 246 B | |
| 007220 | generated/1973 Generated | true | 48 B | |
| 007227 | generated/1980 Generated | false | 3 B | |
| 007230 | generated/1983 Generated | false | 159 B | |
| 007231 | generated/1984 Generated | true | 32 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