Sapphire Rapids: Enable buckets for seven-name counts

perfloop-oss/casei · INEFFICIENT ALGORITHM

https://perfloop.ai/t/oss/case_0t04tgewvq

Verdict

VERIFIED · settled 2026-10-06

What happened: The paired measurements met the required improvement.

Hypothesis

Speed up the required seven-name Sherlock count-spans operation on Sapphire Rapids using its existing bucket filter. This addresses the largest recovered loss as a compiler prerequisite; field leadership remains unproved.

At514b165, the594933-byte retained-Matcher fixture produces nine forms but seven ASCII prefixes. The Shufti cap makes makeTripleBucketFilter refuse it; generic Each uses findFiltered/tripleSkip64. Baseline countMatches samples put2.52/3.52 seconds in that scanner, the largest CPU cost on this ordinary route.

The provisional5.770 ratio needs82.7% removal. Compiler-only exploration changed366-371us to135-142us, about62% and roughly75% of the provisional absolute gap; about2.2x remains. This is known conservative bucket practice reimplemented from casei tokens, not copied. Only official Case pairs establish savings. No public API is added; report construction and the private514-byte bucket's retained cost.

Broader conservative coverage unblocks the material eligibility barrier; extra high-byte nominations cost less than per-form scanning.

Prove stored-form/fold containment, no installation on prefix overflow, bucket selection and no root Each for seven names. On model143 pair the complete required count against pristine514b165: no repeatable ns/op reduction, any independent folding/order/ID/width mismatch or guard regression rejects it. Guard Russian/six-to-eight-pattern operations, preserve existing BenchmarkBar wins and witness feature-off fallback; disclose the residual ratio.

No new timing ran. The retained prototype was broader; validate the6-8 restriction. Grouped pass1 overlapped an obsolete three-name assertion, not another benchmark; passes2/3 did not. Feature-off logs warn avx512vbmi is unknown, so success is not a fallback witness. CPU2 affinity is not physical exclusivity.

Change to test: On Sapphire Rapids, enable buckets for complete six-to-eight-pattern plans exceeding eight raw forms but fitting eight ASCII prefixes. Install conservative shared-slot coverage only after bounded prefix collection succeeds; preserve Each eligibility and decoded authority.

Where it lives

perfloop-oss/casei · audit/rebar/runner/main.go

Evidence

Rebar imported/sherlock/name-alt3-casei count-spans over the pinned Sherlock corpus with one retained seven-pattern Matcher on Sapphire Rapids model 143 · 10 sample pairs

metric baseline candidate paired median change confidence range required result
ns/op 352982 135204 −60.9% (−215006) −227982 to −211767 < −17649 PASSED
MB/s 1686 4400 +161.9% (+2729) +2642 to +2783 ≥ −84.28 PASSED

Rebar curated/02-literal-alternate/sherlock-casei-ru five-name Russian count guard on the pinned input and Sapphire Rapids model 143 · 10 sample pairs

metric baseline candidate paired median change confidence range required result
ns/op 519260 518277 −0.4% (−2122) −18128 to +10819 ≤ 25963 PASSED
MB/s 3025 3030 +0.4% (+12.24) −64.37 to +102.7 ≥ −151.2 PASSED

Six-pattern Sherlock count-spans boundary guard over the pinned Sherlock fixture with a retained Matcher on Sapphire Rapids model 143 · 10 sample pairs

metric baseline candidate paired median change confidence range required result
ns/op 342617 72953 −78.9% (−270180) −276857 to −264918 ≤ 17131 PASSED
MB/s 1736 8155 +369% (+6408) +6163 to +6672 ≥ −86.82 PASSED

BenchmarkBar multi_N8_hit_log_1mb Matcher.Find guard against the pinned native field on Sapphire Rapids model 143 · 10 sample pairs

metric baseline candidate paired median change confidence range required result
ns/op 112571 48101 −57.3% (−64497) −66861 to −62754 ≤ 5629 PASSED
candidate_active 1 1 0 0 to 0 ≥ −0.05 PASSED
candidate_vector_bits 512 512 0 0 to 0 ≥ −25.6 PASSED
competitors 4 4 0 0 to 0 ≥ −0.2 PASSED
entrants 6 6 0 0 to 0 ≥ −0.3 PASSED
go_ac_active 1 1 0 0 to 0 ≥ −0.05 PASSED
go_ac_vector_bits 0 0 0 0 to 0 ≥ 0 PASSED
pcre2_active 1 1 0 0 to 0 ≥ −0.05 PASSED
pcre2_vector_bits 128 128 0 0 to 0 ≥ −6.4 PASSED
regexp_active 1 1 0 0 to 0 ≥ −0.05 PASSED
regexp_vector_bits 0 0 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
rustac_active 0 0 0 0 to 0 ≥ 0 PASSED
rustac_vector_bits 0 0 0 0 to 0 ≥ 0 PASSED
stringzilla_active 1 1 0 0 to 0 ≥ −0.05 PASSED
stringzilla_vector_bits 512 512 0 0 to 0 ≥ −25.6 PASSED
vectorscan_active 1 1 0 0 to 0 ≥ −0.05 PASSED
vectorscan_vbmi 1 1 0 0 to 0 ≥ −0.05 PASSED
vectorscan_vector_bits 512 512 0 0 to 0 ≥ −25.6 PASSED
veloz_active 0 0 0 0 to 0 ≥ 0 PASSED
veloz_vector_bits 0 0 0 0 to 0 ≥ 0 PASSED
x_vs_best 0.4484 0.1979 −55.9% (−0.2508) −0.2629 to −0.2342 ≤ 0.02242 PASSED

Checks: 10 of 10 passed. Verification: no defect found.

Timeline