The Padded Version: One Release Number Wearing Five Different Spellings
A version number looks like the most disciplined string in a software inventory. It is short, numeric, and governed by conventions everyone claims to...
A version number looks like the most disciplined string in a software inventory. It is short, numeric, and governed by conventions everyone claims to follow. Yet the same release can be written with a leading letter, with a missing final component, with a component padded by an extra zero, or with a spare component appended at the end. Each spelling is legitimate, and no two of them are the same string. This article measures what that variety does to a join between two inventories of the same releases, and how much of the damage each level of repair can undo.
What The Padded Version means
The Padded Version is the condition in which one semantic version, a triple of major, minor, and patch components, is stored in any of several surface spellings that differ in prefix, component count, or zero padding, so that equal versions carry unequal text. A row exhibits it when one inventory stores the standard three-segment spelling and the other stores any spelling that a reader must interpret rather than merely compare. Each source in the measurement held 300 records carrying 300 distinct semantic versions (Source: batch 21 SD measurement results, group AL1).
> Census: 300 records per source; an exact join matched 60 of 300, stripping a leading v matched 120 of 300, and full version parsing matched 300 of 300, with 0 false-merge pairs (Source: batch 21 SD measurement results, group AL1)
The Padded Version differs from its nearest neighbour, The Shortened Fingerprint, in what happens to the underlying information. In The Shortened Fingerprint, a hash digest was cut down to a short prefix, and the discarded digits were gone for good: distinct records could collide on the surviving prefix, and nothing in the stored text could separate them again, because truncation is irreversible information loss. Here nothing is discarded. Every spelling in this measurement encodes the complete version, and a parser that reads components as integers recovers the identical triple from each one. The Shortened Fingerprint is a story about information destroyed; The Padded Version is a story about information fully present and still unmatched, because the scatter lives in spelling alone and yields completely to parsing.
Five spellings, one exact survivor
The first source stored all 300 versions in standard three-segment form, while the second spread its rows evenly across five spellings, 60 apiece: the standard three-segment form, a v-prefixed form, a two-segment form, a zero-padded segment form, and a four-segment form (Source: batch 21 SD measurement results, group AL1). Joining on the stored string matched 60 of 300 rows and failed on 240 (Source: batch 21 SD measurement results, group AL1). The survivors were exactly the rows where the second writer happened to choose the same spelling as the first, which means the exact join was not measuring agreement about versions at all. It was measuring agreement about typography, and on four fifths of the file the two writers simply made different, equally reasonable choices.
Each failing spelling fails for its own mechanical reason, and the reasons matter because they predict which repairs can work. The v-prefixed rows add one character ahead of an otherwise identical string. The two-segment rows omit the patch component entirely, which is safe only because that block was constructed with the patch component always equal to zero, so the short spelling and the full spelling denote the same triple (Source: batch 21 SD measurement results, group AL1). The zero-padded rows insert a zero into the minor component, a block constructed with that component never exceeding a single digit, so the padding always shows (Source: batch 21 SD measurement results, group AL1). The four-segment rows append a trailing zero build component that carries no version information at all (Source: batch 21 SD measurement results, group AL1).
Stripping the v recovers one block and no more
The obvious first repair is to delete a single leading v before comparing, and it performs exactly as narrowly as it sounds. That pass matched 120 of 300 rows and failed on 180 (Source: batch 21 SD measurement results, group AL1). It recovered the entire v-prefixed block, doubling the exact result, and it changed nothing anywhere else, because none of the remaining three spellings differs from the standard form by a prefix. The two-segment rows still lack a component, the zero-padded rows still carry their extra zero, and the four-segment rows still carry their extra component. A repair aimed at one mechanism rescues the rows that mechanism produced and leaves the rest untouched, so the improved headline rate conceals an unchanged failure rate inside three of the four problem blocks.
Parsing the components recovers everything
The complete repair stopped treating the version as text and read it as a small structure instead: each segment converted to an integer, a missing patch segment filled with zero, and a trailing zero build segment discarded (Source: batch 21 SD measurement results, group AL1). Integer conversion is what dissolves the zero padding, since a padded component and its plain form are the same number; the fill and discard rules are what reconcile the two component counts. That join matched 300 of 300 rows with 0 failures and 0 false-merge pairs (Source: batch 21 SD measurement results, group AL1).
The construction supplies an independent check that parsing preserved every value rather than merely forcing matches. Summed component by component, the first source totals 1494 for major, 2652 for minor, and 2517 for patch, and the second source, after full parsing, totals exactly the same triple of sums (Source: batch 21 SD measurement results, group AL1). The guarantee the repair offers is therefore stronger than coverage: the recovered key is the version itself, recovered reversibly from every spelling, with nothing rounded, truncated, or guessed.
Assembling the five spellings
The test file was assembled backwards, from meaning to spelling. A generator working from seed 42 drew 300 distinct semantic versions, wrote them plainly into one source, and then re-expressed them in the second source in five equal blocks, engineering each block so its spelling trick would always be visible: short spellings only where the omitted component was zero, padding only where it changed the text, and a spare segment that was always zero (Source: batch 21 SD measurement results, group AL1). Three joins were then run over the same pair of files, on raw text, after prefix stripping, and after component parsing, with collisions among parsed keys counted separately. The exercise is a deterministic synthetic measurement driven by hand-written parsing rules in the standard library; it audits no commercial product.
Questions, answered
Why does an exact join match only the standard spelling block? Because equality of strings requires equality of every character, and four of the five spellings differ from the standard form in a prefix, a component, or a padded digit. The exact join matched 60 of 300 rows, precisely the block where both sources chose the standard three-segment spelling (Source: batch 21 SD measurement results, group AL1).
Is removing the leading v a good enough repair on its own? It helps exactly one block. Stripping the prefix lifted the match to 120 of 300 rows, while 180 rows still failed (Source: batch 21 SD measurement results, group AL1), because the two-segment, zero-padded, and four-segment spellings differ from the standard form in structure, not in prefix.
Can full parsing ever merge two different versions by accident? Not in this file. Full parsing produced 0 false-merge pairs (Source: batch 21 SD measurement results, group AL1), because the 300 semantic versions were distinct and each spelling maps back to exactly one triple of components.
Summary
The Padded Version scatters one release number across five legitimate spellings and lets an exact join recognise only one of them: 60 of 300 rows matched as stored, prefix stripping reached 120 of 300, and component parsing recovered all 300 rows with 0 false merges (Source: batch 21 SD measurement results, group AL1). The double check is the component totals, 1494, 2652, and 2517 from both sources alike (Source: batch 21 SD measurement results, group AL1). Against The Shortened Fingerprint, where cutting a digest down destroyed information that no later step could restore, every spelling here keeps the whole version intact. The fault is reversible from end to end, and parsing, not tidying, is what reverses it.
Sources
- Batch 21 SD measurement results, group AL1: 300 records per source, 300 distinct semantic versions; source B spellings 60 each across standard three-segment, v-prefixed, two-segment, zero-padded, and four-segment forms; exact join 60 matched, 240 failed; v-strip repair 120 matched, 180 failed; full parsing 300 matched, 0 failed, 0 false-merge pairs; component sums 1494, 2652, and 2517 from both sources.
- Measurement script sd_batch21_measurements.py, group AL1: deterministic synthetic construction, seed 42, self-written parsing rules, pure standard library; not a commercial product measurement.