Race the UTF-8 decoder against coreutils

Every case in the suite pinned LC_ALL=C, so the multibyte path - the one
whose counts go wrong quietly rather than crashing - had no contract
behind it at all. genfile grew a --utf8 mode that writes mixed CJK,
ASCII words, a tab, an ideographic space, a no-break space and a
combining accent, and the words suite now races -w, -m and -L over 300k
lines of it under en_US.UTF-8 (C.UTF-8 as a fallback), against coreutils.

The case runs the locale on both sides rather than inheriting the C pin,
because the oracle's own decoder is the reference. It prints SKIP rather
than passing when the host has no UTF-8 locale: a multibyte count cannot
be checked in a single-byte one.
This commit is contained in:
2026-11-15 14:00:07 -05:00
parent 9b68ad4c6c
commit c45de29b0c
5 changed files with 164 additions and 5 deletions
+7
View File
@@ -287,6 +287,13 @@ make bench # build release + run every suite
./benchmarks/test-all.sh # words, lines (monsters included), stdin
```
The words suite ends with `-w`, `-m` and `-L` over 300k lines of mixed
UTF-8 under `en_US.UTF-8` (or `C.UTF-8`), raced against coreutils. The
suite pins the C locale for every other case, so without these the
decoder had no contract at all; the case skips with a printed note on a
host with no UTF-8 locale, because a multibyte count cannot be checked in
a single-byte one.
The lines suite races `-L` as well as `-l`, and ends by counting 128
files of about 1.1 MB each, which is the worker pool's case: both sides
finish in well over a second's worth of work, so the row is a race and