Conversation
- Add tests/legacy/ with checkpoint_versions.txt (1.4.0–1.6.0), generate_checkpoint.py (creates a .pth from the installed rfdetr version), and test_checkpoint_compat.py (18 parametrized tests; auto-skip locally when checkpoint files absent) - Add .github/workflows/ci-legacy-checkpoints.yml: reads versions file → parallel matrix jobs install old rfdetr and generate checkpoints → test-compat job loads all with current code - Exclude tests/legacy/ from ci-tests-cpu and ci-tests-gpu via --ignore --- Co-authored-by: Claude Code <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (80%) is below the target coverage (95%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #994 +/- ##
======================================
Coverage 80% 80%
======================================
Files 100 100
Lines 8392 8392
======================================
Hits 6676 6676
Misses 1716 1716 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a dedicated CI workflow and accompanying test/scripts to continuously validate that the current RF-DETR code can load checkpoints produced by older released versions, helping prevent backward-compatibility regressions for users upgrading across releases.
Changes:
- Added a new GitHub Actions workflow that builds a version matrix, generates per-version checkpoints, and runs compatibility tests against current source.
- Introduced
tests/legacy/tooling: a checkpoint generator script, a parametrized compatibility test suite, and a versions matrix file. - Updated existing CPU/GPU test workflows to exclude the legacy compatibility tests from standard CI runs.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/legacy/test_checkpoint_compat.py |
New pytest suite to load legacy-generated checkpoints with current code. |
tests/legacy/generate_checkpoint.py |
Script to generate minimal checkpoints using an installed historical rfdetr version. |
tests/legacy/checkpoint_versions.txt |
Version list driving the backward-compat matrix. |
.github/workflows/ci-legacy-checkpoints.yml |
New CI workflow to generate legacy checkpoints and run compat tests. |
.github/workflows/ci-tests-cpu.yml |
Excludes tests/legacy from standard CPU test jobs. |
.github/workflows/ci-tests-gpu.yml |
Excludes tests/legacy from standard GPU test jobs. |
.gitignore |
Ignores .developments/ directory. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add a scoped transformers.pytorch_utils compatibility shim so old RF-DETR releases, including 1.4, can import during checkpoint generation. Co-authored-by: Codex <codex@openai.com>
Add scoped transformers compatibility shims so old RF-DETR releases, including 1.4, can import removed pruning and backbone helpers during checkpoint generation. Co-authored-by: Codex <codex@openai.com>
…uild_model, generate_checkpoint - TestGetStateDict: three-level layout, legacy two-level fallback, RuntimeError on invalid model - TestGetPatchSize: model_config path, config fallback, default-16 fallback - TestBuildModel: preferred-class missing falls through to RFDETRBase; all candidates absent raises RuntimeError - TestGenerateCheckpoint: integration smoke-test verifies model/args/epoch/rfdetr_version keys [resolve #4] /review finding by foundry:qa-specialist (report: .temp/output-review-ci-legacy-2026-04-24.md): "No test for generate_checkpoint.py — _get_state_dict, _get_patch_size, _build_model, generate_checkpoint have no unit tests" --- Co-authored-by: Claude Code <noreply@anthropic.com>
v1.6.5 is the version reported broken in #990 (PE interpolation shape mismatch). Including it catches the specific regression class. Comments explain why 1.1.0–1.3.0 remain disabled (pretrain_weights=None not supported before 1.4.0). [resolve #6] /review finding by foundry:qa-specialist (report: .temp/output-review-ci-legacy-2026-04-24.md): "Version matrix omits 1.6.5 (the reported broken release); no comment on why 1.1–1.3 disabled" --- Co-authored-by: Claude Code <noreply@anthropic.com>
…ons unit tests - _pytest_params: locally skip missing checkpoints; in CI (CI=true) run the test so artifact download failures cause a visible assertion error instead of a silent skip - _read_versions: accept optional path parameter so callers can inject a file directly — removes need for module-level monkeypatching in tests - TestReadVersions: five parametrized cases covering blank lines, comment lines, surrounding whitespace, empty file, and non-existent file [resolve #2] @Copilot inline (gh): "missing checkpoints silently skipped in CI masks regressions" (test_checkpoint_compat.py:81) [resolve #8] /review finding by foundry:qa-specialist (report: .temp/output-review-ci-legacy-2026-04-24.md): "No test for _read_versions() with malformed input" --- Co-authored-by: Claude Code <noreply@anthropic.com>
Adds test_generate_checkpoint.py to the pytest invocation so unit tests for the generation helpers (_get_state_dict, _get_patch_size, _build_model, generate_checkpoint) also run in CI against the installed dev package. --- Co-authored-by: Claude Code <noreply@anthropic.com>
…formers v5 - Add _init_backbone_shim that sets stage_names, _out_features, _out_indices, num_features from config — mirrors the v4 BackboneMixin method that transformers v5 removed (replaced by cooperative-MRO __init__ → _init_transformers_backbone) - _install_transformers_compat() patches the shim onto BackboneMixin if absent, alongside the existing find_pruneable_heads_and_indices and get_aligned_output_features_output_indices shims - Add unit test verifying the shim is installed and sets expected attributes --- Co-authored-by: Claude Code <noreply@anthropic.com>
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.
This pull request introduces a robust system for automated backward-compatibility testing of RF-DETR model checkpoints across historical releases. It adds a new GitHub Actions workflow that generates checkpoints using past package versions and verifies that the current codebase can load them, ensuring seamless upgrades for users. The implementation includes test infrastructure, configuration files, and scripts for checkpoint generation and validation.
The most important changes are:
Continuous Integration: Backward-Compatibility Workflow
.github/workflows/ci-legacy-checkpoints.yml, a new GitHub Actions workflow that (1) reads a list of historical versions, (2) generates a checkpoint with each version, (3) uploads artifacts, and (4) runs compatibility tests with the current codebase..github/workflows/ci-tests-cpu.ymland.github/workflows/ci-tests-gpu.ymlto exclude the new legacy tests from standard test jobs, ensuring they only run in the dedicated compatibility workflow. [1] [2]Test Infrastructure: Checkpoint Generation and Validation
tests/legacy/generate_checkpoint.py, a script that generates minimal checkpoints using a specified released version ofrfdetr, handling API differences across versions.tests/legacy/test_checkpoint_compat.py, a test suite that loads each generated checkpoint with the current codebase, verifying successful loading and expected model structure.Configuration: Version Matrix
tests/legacy/checkpoint_versions.txtto specify which historicalrfdetrversions are included in the compatibility test matrix.closes #990