[GH-ISSUE #567] Looking for representative SemVer string databases. #5529

Closed
opened 2026-06-15 12:00:11 -05:00 by GiteaMirror · 16 comments
Owner

Originally created by @jwdonahue on GitHub (May 18, 2020).
Original GitHub issue: https://github.com/semver/semver/issues/567

@isaacs, @anangaur, you represent the two largest caches of SemVer version strings, can you assist me with this?

I am trying to look at the distribution of character counts in each of the five fields and the distribution of prerelease/meta identifier counts. I'll find a place to publish all the results and point to them from this thread eventually. I think there's a lot of code out there for processing SemVer strings that is non-optimal, and knowing the global distribution of character counts could help tool makers make more informed decisions.

I've already mined one small database used to track rust buckets (err..um..crates?) and found the following distributions (based on this 3 week old data) from 11152 version strings:

Count %major %minor %patch
1 93.2209469154 81.6266140603 72.7941176471
2 5.0304878049 16.8669296987 21.5925394548
3 1.3898852224 0.3228120516 4.1696556671
4 0.3138450502 0.4483500717 0.0807030129
5 0 0 0.6635581062

If anyone has a database of SemVer version strings they can dump to a file and send my way, I'd really appreciate it. For the smaller online data sets, just point me to the correct UI/API's and I can probably run the queries myself, but the larger ones are going to be problematic for me, as I am currently running tethered to my phone here on the Navojo Nation, and will be for months. I can post process any compressed text data into a CSV for analysis. I don't need package names or any PII.

If it's gigs of version strings, then I'll need counts of unique strings or just the field distributions to reduce the data load. I'll post a C# program on my github account shortly.

If there's any volunteers who have fat enough pipes to gather/summarize this data for me, that would be most appreciated.

Originally created by @jwdonahue on GitHub (May 18, 2020). Original GitHub issue: https://github.com/semver/semver/issues/567 @isaacs, @anangaur, you represent the two largest caches of SemVer version strings, can you assist me with this? I am trying to look at the distribution of character counts in each of the five fields and the distribution of prerelease/meta identifier counts. I'll find a place to publish all the results and point to them from this thread eventually. I think there's a lot of code out there for processing SemVer strings that is non-optimal, and knowing the global distribution of character counts could help tool makers make more informed decisions. I've already mined one small database used to track rust buckets (err..um..crates?) and found the following distributions (based on [this 3 week old data](https://pastebin.com/XWfLk8RQ)) from 11152 version strings: Count | %major | %minor | %patch -- | -- | -- | -- 1 | 93.2209469154 | 81.6266140603 | 72.7941176471 2 | 5.0304878049 | 16.8669296987 | 21.5925394548 3 | 1.3898852224 | 0.3228120516 | 4.1696556671 4 | 0.3138450502 | 0.4483500717 | 0.0807030129 5 | 0 | 0 | 0.6635581062 If anyone has a database of SemVer version strings they can dump to a file and send my way, I'd really appreciate it. For the smaller online data sets, just point me to the correct UI/API's and I can probably run the queries myself, but the larger ones are going to be problematic for me, as I am currently running tethered to my phone here on the Navojo Nation, and will be for months. I can post process any compressed text data into a CSV for analysis. I don't need package names or any PII. If it's gigs of version strings, then I'll need counts of unique strings or just the field distributions to reduce the data load. I'll post a C# program on my github account shortly. If there's any volunteers who have fat enough pipes to gather/summarize this data for me, that would be most appreciated.
GiteaMirror added the question label 2026-06-15 12:00:11 -05:00
Author
Owner

@ljharb commented on GitHub (May 18, 2020):

I'd suggest including absolute numbers as well; 0.08% of npm, for example, is still a massive number.

<!-- gh-comment-id:630333892 --> @ljharb commented on GitHub (May 18, 2020): I'd suggest including absolute numbers as well; `0.08%` of npm, for example, is still a massive number.
Author
Owner

@jwdonahue commented on GitHub (May 18, 2020):

Project repo: https://github.com/jwdonahue/SemVerStatsAnalysis

References:

theory/pg-semver#52
jwdonahue/SemVerStatsAnalysis#1

<!-- gh-comment-id:630421809 --> @jwdonahue commented on GitHub (May 18, 2020): Project repo: https://github.com/jwdonahue/SemVerStatsAnalysis References: theory/pg-semver#52 jwdonahue/SemVerStatsAnalysis#1
Author
Owner

@Seldaek commented on GitHub (May 19, 2020):

Here you go, the 1.7million versions (I excluded dev ones as they represent branches and are thus not very relevant here) from https://packagist.org

versions.zip

<!-- gh-comment-id:630644597 --> @Seldaek commented on GitHub (May 19, 2020): Here you go, the 1.7million versions (I excluded dev ones as they represent branches and are thus not very relevant here) from https://packagist.org [versions.zip](https://github.com/semver/semver/files/4648897/versions.zip)
Author
Owner

@jwdonahue commented on GitHub (May 19, 2020):

Sweet! Thank you. I would actually like to see the dev strings as well. Part of what I am planning on doing is documenting the most common types of errors in usage.

<!-- gh-comment-id:630869502 --> @jwdonahue commented on GitHub (May 19, 2020): Sweet! Thank you. I would actually like to see the dev strings as well. Part of what I am planning on doing is documenting the most common types of errors in usage.
Author
Owner

@Seldaek commented on GitHub (May 19, 2020):

The dev ones are a bit of a particularity in composer/packagist as they are automatically created versions tracking branches, e.g. a 1.10 branch creates a 1.10.x-dev version, while the master branch or any non-numeric branch results in dev-branchname so dev-master etc. These are most definitely not semver and also not really part of the releases of the projects, so as such I don't really think they're relevant for you? All tagged releases are included in the file. We do not allow using the dev suffix in tags as this would conflict with our automatic versioning of branches. You'll find RC/beta/alpha/patch stuff in there though.

<!-- gh-comment-id:630882615 --> @Seldaek commented on GitHub (May 19, 2020): The dev ones are a bit of a particularity in composer/packagist as they are automatically created versions tracking branches, e.g. a 1.10 branch creates a `1.10.x-dev` version, while the master branch or any non-numeric branch results in dev-branchname so dev-master etc. These are most definitely not semver and also not really part of the releases of the projects, so as such I don't really think they're relevant for you? All tagged releases are included in the file. We do not allow using the `dev` suffix in tags as this would conflict with our automatic versioning of branches. You'll find RC/beta/alpha/patch stuff in there though.
Author
Owner

@jwdonahue commented on GitHub (May 19, 2020):

Okay, I am already aware of the -dev pot-hole, but the other stats
actually matter to me.   Would it be possible to randomize the PII
portions of the strings?  I can make adjustments to my tooling
https://github.com/jwdonahue/SemVerStatsAnalysis and make that
available to you.

If they were using -a.dev, or some other sensible tag, then these would
be legitimate strings that a high-rate shop might produce and therefore
the stats on sizes of strings are important for tool
developers/maintainers.  I've worked in many shops where dev bits seem
to always find there way off the dev's box, so while not intended for
public consumption, they are often effectively published, or all they'd
really need is a devName-timestamp for a version.


Correction: devName-ticket#-timestamp version number.

<!-- gh-comment-id:631128279 --> @jwdonahue commented on GitHub (May 19, 2020): Okay, I am already aware of the -dev pot-hole, but the other stats actually matter to me.   Would it be possible to randomize the PII portions of the strings?  I can make adjustments to my tooling <https://github.com/jwdonahue/SemVerStatsAnalysis> and make that available to you. If they were using -a.dev, or some other sensible tag, then these would be legitimate strings that a high-rate shop might produce and therefore the stats on sizes of strings are important for tool developers/maintainers.  I've worked in many shops where dev bits seem to always find there way off the dev's box, so while not intended for public consumption, they are often effectively published, or all they'd really need is a devName-timestamp for a version. ----- Correction: devName-ticket#-timestamp version number.
Author
Owner

@Seldaek commented on GitHub (May 20, 2020):

I'm really not quite sure what you are saying/asking, but if it helps here is the full unfiltered data set of 2.2million versions

versions.zip

<!-- gh-comment-id:631272934 --> @Seldaek commented on GitHub (May 20, 2020): I'm really not quite sure what you are saying/asking, but if it helps here is the full unfiltered data set of 2.2million versions [versions.zip](https://github.com/semver/semver/files/4655059/versions.zip)
Author
Owner

@jwdonahue commented on GitHub (May 24, 2020):

Okay, here's some results from the data so far:

Results.zip

<!-- gh-comment-id:633266706 --> @jwdonahue commented on GitHub (May 24, 2020): Okay, here's some results from the data so far: [Results.zip](https://github.com/semver/semver/files/4674076/Results.zip)
Author
Owner

@jwdonahue commented on GitHub (May 24, 2020):

Rust crate distributions:

Char Count Major Minor Patch Prerelease PrereleaseFields Meta MetaFields
0 0 0 0 0 4240 0 4027
1 221495 205819 210152 155 4849 10 3
2 1111 21792 17068 207 14 5 58
3 5104 52 451 507 2 12 55
4 80 50 8 814 0 4 0
5 16 16 87 864 0 31 0
6 0 0 1 2155 0 31 0
7 17 17 16 3040 0 8 0
8 0 77 24 708 0 3963 0
9 17 17 16 76 0 3 0
10 0 0 5 15 0 50 0
11 0 0 0 209 0 3 0
12 0 0 0 8 0 6 0
13 0 0 0 8 0 2 0
14 0 0 12 2 0 1 0
15 0 0 0 7 0 5 0
16 0 0 0 15 0 0 0
18 0 0 0 5 0 0 0
19 0 0 0 4 0 1 0
20 3 3 3 2 0 1 0
22 0 0 0 0 0 1 0
24 0 0 0 1 0 0 0
26 0 0 0 0 0 1 0
27 0 0 0 1 0 1 0
30 0 0 0 1 0 0 0
31 0 0 0 1 0 0 0
37 0 0 0 300 0 0 0
40 0 0 0 0 0 4 0
               
  227843 227843 227843 9105 9105 4143 4143
        3.9961728032 3.9961728032 1.8183573777 1.8183573777
<!-- gh-comment-id:633266762 --> @jwdonahue commented on GitHub (May 24, 2020): Rust crate distributions: Char Count | Major | Minor | Patch | Prerelease | PrereleaseFields | Meta | MetaFields -- | -- | -- | -- | -- | -- | -- | -- 0 | 0 | 0 | 0 | 0 | 4240 | 0 | 4027 1 | 221495 | 205819 | 210152 | 155 | 4849 | 10 | 3 2 | 1111 | 21792 | 17068 | 207 | 14 | 5 | 58 3 | 5104 | 52 | 451 | 507 | 2 | 12 | 55 4 | 80 | 50 | 8 | 814 | 0 | 4 | 0 5 | 16 | 16 | 87 | 864 | 0 | 31 | 0 6 | 0 | 0 | 1 | 2155 | 0 | 31 | 0 7 | 17 | 17 | 16 | 3040 | 0 | 8 | 0 8 | 0 | 77 | 24 | 708 | 0 | 3963 | 0 9 | 17 | 17 | 16 | 76 | 0 | 3 | 0 10 | 0 | 0 | 5 | 15 | 0 | 50 | 0 11 | 0 | 0 | 0 | 209 | 0 | 3 | 0 12 | 0 | 0 | 0 | 8 | 0 | 6 | 0 13 | 0 | 0 | 0 | 8 | 0 | 2 | 0 14 | 0 | 0 | 12 | 2 | 0 | 1 | 0 15 | 0 | 0 | 0 | 7 | 0 | 5 | 0 16 | 0 | 0 | 0 | 15 | 0 | 0 | 0 18 | 0 | 0 | 0 | 5 | 0 | 0 | 0 19 | 0 | 0 | 0 | 4 | 0 | 1 | 0 20 | 3 | 3 | 3 | 2 | 0 | 1 | 0 22 | 0 | 0 | 0 | 0 | 0 | 1 | 0 24 | 0 | 0 | 0 | 1 | 0 | 0 | 0 26 | 0 | 0 | 0 | 0 | 0 | 1 | 0 27 | 0 | 0 | 0 | 1 | 0 | 1 | 0 30 | 0 | 0 | 0 | 1 | 0 | 0 | 0 31 | 0 | 0 | 0 | 1 | 0 | 0 | 0 37 | 0 | 0 | 0 | 300 | 0 | 0 | 0 40 | 0 | 0 | 0 | 0 | 0 | 4 | 0   |   |   |   |   |   |   |     | 227843 | 227843 | 227843 | 9105 | 9105 | 4143 | 4143   |   |   |   | 3.9961728032 | 3.9961728032 | 1.8183573777 | 1.8183573777
Author
Owner

@jwdonahue commented on GitHub (May 24, 2020):

Char Count Major Minor Patch Prerelease PrereleaseFields Meta MetaFields
0 0 0 0 0 29678 0 72
1 994466 946814 824963 75 8179 24 2
2 3303 52281 142860 1099 202 6 2
3 1217 1071 31405 6795 22 4 0
4 1215 0 293 5414 0 5 0
5 0 0 63 10263 0 4 0
6 0 3 218 10373 0 5 0
7 0 0 0 2796 0 3 0
8 0 32 396 424 0 21 0
9 0 0 0 83 0 2 0
10 0 0 0 132 0 2 0
11 0 0 0 38 0 0 0
12 0 0 0 17 0 0 0
14 0 0 3 0 0 0 0
16 0 0 0 572 0 0 0
               
  1000201 1000201 1000201 38081 38081 76 76
        3.8073347257 3.8073347257 0.0075984727 0.0075984727
<!-- gh-comment-id:633266951 --> @jwdonahue commented on GitHub (May 24, 2020): Char Count | Major | Minor | Patch | Prerelease | PrereleaseFields | Meta | MetaFields -- | -- | -- | -- | -- | -- | -- | -- 0 | 0 | 0 | 0 | 0 | 29678 | 0 | 72 1 | 994466 | 946814 | 824963 | 75 | 8179 | 24 | 2 2 | 3303 | 52281 | 142860 | 1099 | 202 | 6 | 2 3 | 1217 | 1071 | 31405 | 6795 | 22 | 4 | 0 4 | 1215 | 0 | 293 | 5414 | 0 | 5 | 0 5 | 0 | 0 | 63 | 10263 | 0 | 4 | 0 6 | 0 | 3 | 218 | 10373 | 0 | 5 | 0 7 | 0 | 0 | 0 | 2796 | 0 | 3 | 0 8 | 0 | 32 | 396 | 424 | 0 | 21 | 0 9 | 0 | 0 | 0 | 83 | 0 | 2 | 0 10 | 0 | 0 | 0 | 132 | 0 | 2 | 0 11 | 0 | 0 | 0 | 38 | 0 | 0 | 0 12 | 0 | 0 | 0 | 17 | 0 | 0 | 0 14 | 0 | 0 | 3 | 0 | 0 | 0 | 0 16 | 0 | 0 | 0 | 572 | 0 | 0 | 0   |   |   |   |   |   |   |     | 1000201 | 1000201 | 1000201 | 38081 | 38081 | 76 | 76   |   |   |   | 3.8073347257 | 3.8073347257 | 0.0075984727 | 0.0075984727
Author
Owner

@jwdonahue commented on GitHub (May 24, 2020):

So basically, a majority of the version triple fields are single digit, with patch having a broader range out to 20 digits, but still weighted heavily in the 1 & 2 digit range. With only the two sources of data at this point, I am seeing some interesting variations in the non-semver strings. A very large set of 'v' prefixed strings that would otherwise qualify as SemVer and lots of single and double field numeric versions as well as some mostly alpha strings.

I'll try to characterize the non-semver strings next.

<!-- gh-comment-id:633268729 --> @jwdonahue commented on GitHub (May 24, 2020): So basically, a majority of the version triple fields are single digit, with patch having a broader range out to 20 digits, but still weighted heavily in the 1 & 2 digit range. With only the two sources of data at this point, I am seeing some interesting variations in the non-semver strings. A very large set of 'v' prefixed strings that would otherwise qualify as SemVer and lots of single and double field numeric versions as well as some mostly alpha strings. I'll try to characterize the non-semver strings next.
Author
Owner

@ljharb commented on GitHub (May 24, 2020):

A semver version with a preceding v is still valid; are you not counting those in these numbers?

<!-- gh-comment-id:633269078 --> @ljharb commented on GitHub (May 24, 2020): A semver version with a preceding v is still valid; are you not counting those in these numbers?
Author
Owner

@Seldaek commented on GitHub (May 24, 2020):

Yeah at least in the packagist dataset, the v prefix is completely ignored when normalizing versions before doing dependency resolution, so it probably should be ignored too before counting anything.

<!-- gh-comment-id:633269560 --> @Seldaek commented on GitHub (May 24, 2020): Yeah at least in the packagist dataset, the `v` prefix is completely ignored when normalizing versions before doing dependency resolution, so it probably should be ignored too before counting anything.
Author
Owner

@jwdonahue commented on GitHub (May 25, 2020):

The 'v' prefix was part of SemVer 1.0.0 and -beta, but only for use in version control systems (ie; git tags). No idea why they thought that it was ever a good idea, but it was removed in SemVer 2.0.0.

So, no I do not count v1.0.0 as a legal semver string. I did mark it as a near-miss and then automatically processed the cleaned up near-misses in a separate step.

I suffered some angst over the decision to relegate the SemVer 1.0.0 strings to the non-semver category. The 'v' designation was never unique to SemVer and only allowed in a special class of tooling. Therefore, it is my view, that it was an implementation detail that should never have been allowed in the spec to begin with. But that's not as relevant as the fact that I am not processing VCS tags, I am working with SemVer strings, and those clearly do not include the 'v' prefix, as-per all of the published SemVer specs.

One thing that SemVer has lacked from the beginning is a means to disambiguate SemVer v1 from v2 strings or from similar looking strings that are not based on the specified semantics. I have taken the position that v1 is essentially defunct/useless, by virtue of the existence of v2. The spec doesn't say that explicitly, but the lack of any robust means to disambiguate between them, suggests no other interpretation.

<!-- gh-comment-id:633396548 --> @jwdonahue commented on GitHub (May 25, 2020): The 'v' prefix was part of [SemVer 1.0.0](https://semver.org/spec/v1.0.0.html) and [-beta](https://semver.org/spec/v1.0.0-beta.html), but only for use in version control systems (ie; git tags). No idea why they thought that it was ever a good idea, but it was removed in SemVer 2.0.0. So, no I do not count v1.0.0 as a legal semver string. I did mark it as a near-miss and then automatically processed the cleaned up near-misses in a separate step. I suffered some angst over the decision to relegate the SemVer 1.0.0 strings to the non-semver category. The 'v' designation was never unique to SemVer and only allowed in a special class of tooling. Therefore, it is my view, that it was an implementation detail that should never have been allowed in the spec to begin with. But that's not as relevant as the fact that I am not processing VCS tags, I am working with SemVer strings, and those clearly do not include the 'v' prefix, as-per all of the published SemVer specs. One thing that SemVer has lacked from the beginning is a means to disambiguate SemVer v1 from v2 strings or from similar looking strings that are not based on the specified semantics. I have taken the position that v1 is essentially defunct/useless, by virtue of the existence of v2. The spec doesn't say that explicitly, but the lack of any robust means to disambiguate between them, suggests no other interpretation.
Author
Owner

@ljharb commented on GitHub (May 25, 2020):

@jwdonahue sure but if your goal is to determine usage, you should be liberal in what you accept, because it's not particularly useful to gauge usage of strictly spec-compatible versions.

<!-- gh-comment-id:633410427 --> @ljharb commented on GitHub (May 25, 2020): @jwdonahue sure but if your goal is to determine usage, you should be liberal in what you accept, because it's not particularly useful to gauge usage of strictly spec-compatible versions.
Author
Owner

@jwdonahue commented on GitHub (May 25, 2020):

I did include the near-misses and intend to expand on not just identifying those, but also stats on the entire range of version strings that I can find in the wild. I just treat them as a special class. The results are all keyed to the data source, so combining them for a look at the 'big picture' shouldn't be too difficult.

It's a prototype tool developed during my 7 mo. old grand-daughter's increasingly infrequent naps. My daughter is a pediatrician on the Navajo reservation, and I am her only viable child-care option at the moment.

I'll improve on it later. What I need right now is data from more sources, so I can get a better idea of the range of "almost semver" and all the other non-semver variations. I'll also add prerelease and meta token counters (# of alpha, beta, rc, etc) and create a dictionary of most common symbols.

By end of next month, I should have a fairly descent internet connection at the house. Currently tethered to my cell phone in a very low service availability/quality area.

<!-- gh-comment-id:633628678 --> @jwdonahue commented on GitHub (May 25, 2020): I did include the near-misses and intend to expand on not just identifying those, but also stats on the entire range of version strings that I can find in the wild. I just treat them as a special class. The results are all keyed to the data source, so combining them for a look at the 'big picture' shouldn't be too difficult. It's a prototype tool developed during my 7 mo. old grand-daughter's increasingly infrequent naps. My daughter is a pediatrician on the Navajo reservation, and I am her only viable child-care option at the moment. I'll improve on it later. What I need right now is data from more sources, so I can get a better idea of the range of "almost semver" and all the other non-semver variations. I'll also add prerelease and meta token counters (# of alpha, beta, rc, etc) and create a dictionary of most common symbols. By end of next month, I should have a fairly descent internet connection at the house. Currently tethered to my cell phone in a very low service availability/quality area.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#5529