UTF-8 validation in x86-64: a scalar reference and an AVX2 version that checks 32 bytes per step. Every build fuzzes one against the other.
utf8-check
UTF-8 validation in x86-64 assembly. For now there is the reference: one byte at a time, with every range of Unicode table 3-7 spelled out.
int utf8_valid_scalar(const uint8_t *buf, size_t len); // 1 = valid, 0 = nottest/test.c checks it against the edges of the table: the first and last code point of every length, both sides of the surrogates, overlongs, and bytes that never appear.