TECHNOLOGY

Locale collation and range shards: keep record membership stable across environments

In this article
THE QUICK TAKE

Keep collation identity, boundary rules and a selected-key membership manifest.

A corpus is partitioned by sorted text keys. Changing the locale or collation configuration moves accented and case-sensitive keys across shard boundaries, invalidating a release that assumes stable range membership.

The mechanism that changes the example

Collation defines an ordering relation, not simply text encoding. Range boundaries inherit that relation, so identical visible boundary strings can select different records under another collation.

Define the comparison boundary

Capture the collator implementation, locale and comparison options as part of range construction. The intended ordering can distinguish accents or case at different comparison strengths. Do not assume that preserving UTF-8 bytes alone preserves the order used by the partitioner.

If the comparison regards distinct source keys as equal, define a stable tie-breaker before cutting ranges. Otherwise the physical input order can decide which side of a boundary receives a record even under an unchanged collation setting.

Compare selected keys rather than only the number of records per shard. Equal-sized shards can exchange examples unnoticed. Cached sort keys or boundary artifacts require their own version qualification when the collator changes; successful binary reading of the old artifact does not establish compatibility with the replacement ordering rule.

A constructed test case

Place accented and unaccented keys near the intended range boundary. Compare the exact assigned keys under the release collation and another environment; a changed ordering must invalidate assumed range equivalence even when every file remains readable.

A reproducible validation procedure

Use multilingual fixture keys around planned boundaries. Run shard assignment under the declared collation and a deliberately different configuration. Compare exact membership and reject readers that cannot reproduce the release ordering contract.

Include an unchanged control and a deliberately invalid case. Verify that the checker distinguishes them before testing the complete release.

Exercise the actual preparation path, including later serialization and reload. Limit retained diagnostic content to the evidence required for this comparison.

Evidence needed for acceptance

Keep collation identity, boundary rules and a selected-key membership manifest.

Containment and recovery

Stable ordering does not decide whether linguistically equivalent keys denote the same entity.

Quarantine an invalid release candidate or use an explicit partial-release rule. Preserve the last approved artifact and record corrections without silently rewriting historical inputs.

Interpretation and references

Implementation references: ICU collation rules; Arrow dataset reading and writing.

This is a proposed engineering validation, not an executed Retrivium benchmark. Documentation specifies interfaces; dataset acceptance needs its own evidence and must be repeated after relevant dependency changes.

Continue with Unicode comparison keys need a chosen equivalence rule; GroupKFold versus StratifiedGroupKFold: group isolation and class balance. These guides supply adjacent context; the decision in this article remains the specific example-preservation check above.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles