Resume safe ASCII probing after sparse exception clusters
perfloop/casei · DATA PARALLEL GAP
https://perfloop.ai/t/oss/case_gc5hfnthag
Verdict
VERIFIED · settled 2026-09-01 · merged as tsenart/casei#15
Hypothesis
`Sherlock` and `Sherlock Holmes` are ASCII source literals, but simple folding admits width-changing long-s and Kelvin spellings. The current long letter-only gate therefore cannot use its existing ASCII-only probe; when a high byte is encountered, the all-or-nothing route hands the full suffix back to the general Unicode-capable plan. The proposed executor does not speculate over the full haystack and restart it. It keeps the existing vector candidate probe over proven-safe ASCII gaps, gives only coalesced source-width halos around exceptional spans to the exact decoded plan, and continues after a cluster. This is an adaptation of a known staged-search shape, not a new matcher or a claim that external folding code can be ported. Its correctness proof is specifically about source-width halos and `Each` semantics, and its performance value remains unproven until the bounded Case measures the losing rows.
Change to test: Add and dispatch one AVX-512 N=1 `findASCIIOnlyPartitioned` executor from `findWithWidth` for long eligible `p.asciiOnly` plans: retain the existing probe on clean ASCII gaps, exact-decode coalesced `p.maxBytes` halos around exceptional-byte clusters, and resume after each cluster.
Where it lives
perfloop/casei · audit/rebar/runner/main.go
Evidence
1 MiB haystack of ASCII x bytes with valid UTF-8 ſK exception clusters every 16 KiB from byte 4096, clean 64-byte tail; ASCII Sherlock Holmes literal; repeated single-query first-match miss; AVX-512 field comparison; the leading S has a width-changing simple-fold mate, so the fixed-width ASCII probe is unavailable and the partition coordinator decodes halos and resumes after clusters · 10 sample pairs
| metric | baseline | candidate | paired median change | confidence range | required | result |
|---|---|---|---|---|---|---|
ns/op |
102745 |
68930 |
−32.7% (−33558) |
−52655 to −19664 |
≤ 0 |
PASSED |
x_vs_best |
1.266 |
0.924 |
−26.9% (−0.3409) |
−0.363 to −0.3325 |
< −0.06328 |
PASSED |
competitors |
4 |
4 |
0 |
0 to 0 |
≥ 0 |
PASSED |
entrants |
5 |
5 |
0 |
0 to 0 |
≥ 0 |
PASSED |
candidate_active |
1 |
1 |
0 |
0 to 0 |
≥ 0 |
PASSED |
candidate_vector_bits |
512 |
512 |
0 |
0 to 0 |
≥ 0 |
PASSED |
regexp_active |
1 |
1 |
0 |
0 to 0 |
≥ 0 |
PASSED |
regexp_vector_bits |
0 |
0 |
0 |
0 to 0 |
≥ 0 |
PASSED |
pcre2_active |
1 |
1 |
0 |
0 to 0 |
≥ 0 |
PASSED |
pcre2_vector_bits |
128 |
128 |
0 |
0 to 0 |
≥ 0 |
PASSED |
rure_active |
0 |
0 |
0 |
0 to 0 |
≥ 0 |
PASSED |
rure_vector_bits |
0 |
0 |
0 |
0 to 0 |
≥ 0 |
PASSED |
vectorscan_active |
1 |
1 |
0 |
0 to 0 |
≥ 0 |
PASSED |
vectorscan_vector_bits |
512 |
512 |
0 |
0 to 0 |
≥ 0 |
PASSED |
vectorscan_vbmi |
1 |
1 |
0 |
0 to 0 |
≥ 0 |
PASSED |
stringzilla_active |
1 |
1 |
0 |
0 to 0 |
≥ 0 |
PASSED |
stringzilla_vector_bits |
512 |
512 |
0 |
0 to 0 |
≥ 0 |
PASSED |
veloz_active |
0 |
0 |
0 |
0 to 0 |
≥ 0 |
PASSED |
veloz_vector_bits |
0 |
0 |
0 |
0 to 0 |
≥ 0 |
PASSED |
Checks: 10 of 10 passed. Verification: no defect found.