Function projection_ids_round_trip_by_bytes
pub async fn projection_ids_round_trip_by_bytes<F: ProjectionFixture>(
open: impl AsyncFn() -> F,
) -> RuleOutcomeExpand description
Every id ProjectionId::new accepts names its own checkpoint, kept by
its exact bytes through commit, checkpoint and reset.
PS-39, and VT-35’s store half: the constructor promises it folds,
trims and normalises nothing, and that promise is worth nothing if the
store keying the checkpoint does any of it. Seven pairs of ids, each two
ids distinct by bytes and equal under one plausible lossy key mapping:
case, two MAX_PROJECTION_ID_LEN-byte ids differing only in their
final codepoint, Persian with U+200C against U+200D, two emoji ZWJ
sequences, - against _, a trailing space against none, and U+00E9
against e + U+0301. The first id of each pair commits at an
earlier position and the second at a later one, every position strictly
above the last, so no commit can be refused as a regression and the
only way to read a wrong checkpoint is to have filed two ids as one.
Then the second id of each pair is reset, and the first must not move.
Rejects: CaseFoldingKeyStore (COLLATE NOCASE, citext),
TruncatingKeyStore (VARCHAR(64) under a truncating server),
AsciiOnlyKeyStore (a latin1 column behind a lossy conversion),
SluggedKeyStore (an id mapped onto a SQL identifier or a file name),
TrailingSpaceKeyStore (a CHAR(n) column, or a trim before binding)
and CanonicalEquivalenceKeyStore (a nondeterministic ICU collation, or
NFC normalisation before binding).
SingleRowCheckpointStore and UncommittedTransactionStore fail it too,
for their own defects, and their registry rows say so.
What no fixed set of ids can reject: a store keyed on a cryptographic or wide hash of the id. It is lossy and this clause forbids it, but showing it needs two ids that collide, and finding them is the hash’s whole purpose. The mutant registry names it rather than registering it.