Parents: #475, #460 Related: #580, #528
Problem
A public differential against system JavaScriptCore found two independent Collator ordering gaps while freezing the #580 performance corpus:
- German phonebook collation reverses the
Öl/Oelordering. - Thai Collators default
ignorePunctuationto true, but zig-js currently lets that option suppress later accent/case distinctions wholesale rather than ignoring punctuation characters only.
Exact sign-normalized repros on 2026-08-15:
Math.sign(new Intl.Collator("de-DE-u-co-phonebk").compare("Öl", "Oel"))
// before: -1
// system JSC / after: +1
Math.sign(new Intl.Collator("th").compare("Alpha", "alpha"))
// before: 0
// system JSC / after: +1
Math.sign(new Intl.Collator("th").compare("resume", "résumé"))
// before: 0
// system JSC / after: -1The #580 scored workloads include only pair/config combinations whose public signs match JSC, so their performance checksums do not conceal these differences.
Scope
- Make
ignorePunctuationremove only locale-recognized punctuation at the relevant collation level; it must not discard accent or case weights. - Correct the effective German
phonebkordering for umlaut expansions versus literal digraphs. - Cover both explicit and locale-default punctuation behavior, both argument directions, sensitivity levels,
usage: "sort"/"search", and locale-extension versus options resolution. - Preserve left-to-right coercion/abrupt completion and the bounded invocation-local key ownership established by #580.
- Differentially validate sign results against system JSC and add focused engine tests for every repaired class.
Security and no-workaround rules
Inputs and locale/options are attacker-controlled. Do not special-case the repro strings, recognize benchmark source, cache unbounded comparison pairs/keys, skip coercion, or weaken OOM/GC accounting. The repair must operate in the general collation-key/weight pipeline.
Acceptance
- German phonebook umlaut/digraph fixtures match system JSC in both directions.
- Thai default and explicit
ignorePunctuationignore punctuation without collapsing case/accent differences. - Other sensitivity, numeric, caseFirst, search/sort, and locale-extension behavior has no regression.
- Focused OOM/bounded-heap and TSan coverage passes.
test/intl402/Collator, full Intl402, and full sharded units have no regressions.