casei: close the Unicode field gaps - #13
Merged
Merged
Conversation
The original arena omitted multi-pattern enumeration and the hard Unicode shapes that exposed decoded confirmation cost. Rebar found three same-contract losses, including a roughly ninefold gap. Add tagged multi-pattern candidates, width-aware raw confirmation, an exact common-byte origin gate, and wider AVX-512 schedules. Pair each field timing with its competitor and retain the two-host field, Rebar, ablation, and native-reachability receipts. The resulting source wins every current arena row and all five same-contract Rebar rows on Ice Lake and Sapphire Rapids while preserving the simple-fold contract and portable fallback.
The library supports Go 1.22, while testing.B.Loop was added in Go 1.24. Keep the diagnostic benchmark and its B.Loop timing semantics without making the ordinary amd64 test file require a newer toolchain.
Go vet checks assembly stack operands against the declaration names. Name the two multi-value results so the existing ret, width, and tags operands match the Go ABI without changing the generated instruction stream.
The scalar confirmation fix changed the source after the previous two-host evidence was captured. Re-run the pinned field and Rebar on qualifying Ice Lake and Sapphire Rapids hosts, and bind the public claims and checksum receipts to the repaired implementation.\n\nBoth hosts win all 36 BenchmarkBar rows across three passes and all five same-contract Rebar rows.
The variable-confirmation test called its internal full-block kernel directly even when runtime dispatch would reject that path. Linux runners without AVX-512 therefore executed a VBMI instruction and trapped.\n\nKeep portable behavior coverage on every host, but make the direct vector assertion conditional on the same feature predicate as production dispatch.
The VBMI-only test guard changed the signed source stream after the previous receipts were recorded. Re-run both qualifying hosts and refresh the field, Rebar, native reachability, checksum, and public summary artifacts.\n\nEvery BenchmarkBar sample remains below 1.0 across 36 rows and three passes per host. The same-contract Rebar selection remains 5 for 5 on both hosts with pinned Hyperscan 5.4.2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebar exposed two competitive workloads that the original arena did not
contain: complete enumeration of a compiled multi-pattern Unicode plan, and
raw variable-width confirmation under dense fold hazards. Casei lost those
same-contract rows.
This change closes them without adding a second engine. The existing compiled
plan now combines tagged interior anchors, exact pair replay, raw one-, two-,
and three-byte fold confirmation, and an exact common-byte origin gate. The
same state machine still decides single- and multi-needle results. The arena
adds the omitted shapes and grows to 36 rows.
The repository now carries the explanation, novelty argument, ablations,
native reachability checks, and hash-linked raw receipts needed to audit the
result.
On three complete passes of the pinned field:
speedup is 1.80x.
speedup is 1.56x.
per row. Casei and Vectorscan both dispatch at 512 bits with VBMI.
contract on both hosts.
The other 13 representable Rebar rows request ASCII-only folding. They remain
visible as different-contract stress data; casei wins 9/18 of the complete
set on each host and makes no all-18 claim.
The exact repaired source passed the full test suite, forced-scalar tests,
race tests, baseline isolation, native field agreement, GDB reachability for
all three changed kernels, receipt verification, and two independent final
reviews.
Perfloop case: https://app.perfloop.ai/t/oss/case_5pjer7jp50