fix: sort compatibility matrices for deterministic output#3006
Merged
Conversation
The compatibility matrix update workflow was opening PRs even when the underlying data hadn't changed because the output was not idempotent. - CUDA was already sorted correctly - PyTorch was non-deterministic because fetchCurrentTorchVersions iterates over a Go map with random iteration order - TensorFlow was non-deterministic because it iterates over HTML table rows in document order Add stable sorting to both PyTorch and TensorFlow generators before serializing the JSON output, plus tests verifying deterministic sorting. Fixes non-idempotent compatibility matrix PRs.
Contributor
|
The tests pass and there are no linting issues. This is a well-crafted PR that:
LGTM |
pull Bot
pushed a commit
to Mu-L/cog
that referenced
this pull request
May 7, 2026
…icate#3009) torchGPUPackage picks the best match by CUDA version but never compared torch versions when CUDA was equal -- so iteration order determined which patch won. After replicate#3006 sorted the matrix ascending, torch==2.3 started resolving to 2.3.0 instead of 2.3.1. Break ties by preferring the higher torch patch version, consistent with baseImageComponentNormalisation which already does this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the compatibility matrix update workflow opening PRs even when the underlying data has not changed.
Problem
The scheduled update-compatibility-matrices workflow was creating PRs on days when no new CUDA/PyTorch/TensorFlow versions were released. This happened because the generated JSON was not deterministic.
Root Cause
Changes
This should make the workflow idempotent: if the upstream data has not changed, the generated JSON will be byte-for-byte identical and no PR will be opened.