Commit c6fd3a7
committed
Align fold_haswell, upper_haswell, upper_ice to fold_ice canonical ordering
Use fold_ice's branch ordering as the canonical pipeline (most mature
path from upstream). Apply the same priority sequence to all three
derivative functions for maintainability and consistency.
Canonical pipeline:
ASCII β Latin-1 (C3) β Cyrillic basic (D0/D1) β Greek (CE/CF)
β Caseless 2-byte D7-DF (Ice only) β Cyrillic Supplement (D1-ext/D2/D3/D4)
β Universal 2-byte (Ice only) β 3-byte caseless
β Nuskhuri/Asomtavruli (E2 B4 β E1 82/83)
β Mkhedruli/Mtavruli (E1 83 β E1 B2)
β Latin Extended Additional (E1 B8-BB) β Fullwidth (EF BC/BD)
β Serial drain
Per-function moves:
fold_haswell:
- Swap Cyrillic Supplement β Greek (Greek first).
- Move 3-byte caseless from tail to after Cyrillic Supplement.
upper_haswell:
- Same swap and same 3-byte caseless move.
- Swap Mkhedruli β Nuskhuri so Nuskhuri runs first.
upper_ice:
- Move 3-byte caseless from position 2 (right after ASCII) to
position 9 (after all 2-byte branches).
- Move Greek from after Cyrillic Supplement to before it.
- Swap Mkhedruli β Nuskhuri so Nuskhuri runs first.
Verified bit-perfect haswell-vs-serial and ice-vs-serial across all
1.1M codepoints β 0 diffs.
Bench (Intel Xeon Platinum 8375C, 32 MiB, best of 7):
ASCII upper: serial 1.21 β haswell 9.79 (Γ8.1), ice 9.08 (Γ7.5)
Cyrillic upper: serial 0.29 β haswell 3.78 (Γ13.1), ice 4.50 (Γ15.5)
Greek upper: serial 0.43 β haswell 2.82 (Γ6.6), ice 3.84 (Γ9.0)
Mixed upper: serial 0.78 β haswell 5.38 (Γ6.9), ice 6.24 (Γ8.0)
CJK upper: serial 0.29 β haswell 3.27 (Γ11.2), ice 2.45 (Γ8.4)
Note: heavily-interleaved scripts (a pattern alternating D2/D3/D4
Cyrillic Supplement leads byte-by-byte) make every chunk advance only
2-4 bytes through the per-lead fast paths, and the per-iteration
pre-checks dominate. This is a pipeline-architecture property, not a
regression β pure D2-only Cyrillic Supplement still runs at 3.5 GB/s
in Ice.1 parent 5404ddd commit c6fd3a7
1 file changed
Lines changed: 445 additions & 468 deletions
0 commit comments