COMP: Gate VXL svd and matrix_inverse tests under ITK_FUTURE_LEGACY_REMOVE#6662
Merged
hjmjohnson merged 1 commit intoJul 20, 2026
Conversation
…EMOVE Commit 232a2ad excludes the LINPACK-svdc-backed vnl_svd family and vnl_solve_qp from the build under ITK_FUTURE_LEGACY_REMOVE but left their tests, so the vnl_algo_test_all driver fails to link in that configuration. Exclude test_{svd,svd_fixed,solve_qp} from the driver sources and the add_test registrations, and skip their testlib DECLARE/REGISTER via a CMake-defined VNL_SVD_REMOVED macro. test_algo and test_complex_algo guarded their removed-API use with #ifndef ITK_FUTURE_LEGACY_REMOVE, but itkConfigure.h is not on the include path of the vendored VXL compile, so that macro is never defined there and the guard never fired. Convey the state as VNL_SVD_REMOVED and VNL_MATRIX_INVERSE_REMOVED compile definitions instead, and gate the vnl_svd-backed rank checks in test_rank the same way.
hjmjohnson
marked this pull request as ready for review
July 18, 2026 21:25
Contributor
|
| Filename | Overview |
|---|---|
| Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/tests/CMakeLists.txt | Gates SVD and solve_qp test sources and CTest registration under ITK_FUTURE_LEGACY_REMOVE. |
| Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/tests/test_algo.cxx | Uses VNL-specific compile definitions around SVD and matrix-inverse test coverage. |
| Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/tests/test_complex_algo.cxx | Applies the same VNL-specific guards to complex SVD and matrix-inverse test code. |
| Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/tests/test_driver.cxx | Omits declarations and registrations for SVD-backed tests when the SVD family is removed. |
| Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/tests/test_rank.cxx | Skips SVD rank cross-checks when SVD is removed while keeping vnl_rank checks active. |
Sequence Diagram
%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant CMake as CMake configure
participant Target as vnl_algo_test_all
participant Driver as test_driver.cxx
participant Tests as VNL algo tests
CMake->>CMake: Check ITK_FUTURE_LEGACY_REMOVE
alt future legacy removal OFF
CMake->>Target: Add SVD/eigensystem/solve_qp test sources
CMake->>Driver: No removed-API compile definitions
Driver->>Tests: Register all vnl_algo tests
else future legacy removal ON
CMake->>Target: Omit removed SVD/eigensystem/solve_qp test sources
CMake->>Driver: Define VNL_EISPACK_REMOVED, VNL_SVD_REMOVED, VNL_MATRIX_INVERSE_REMOVED
Driver->>Tests: Register only linkable tests
Tests->>Tests: Compile out removed SVD/matrix_inverse references
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant CMake as CMake configure
participant Target as vnl_algo_test_all
participant Driver as test_driver.cxx
participant Tests as VNL algo tests
CMake->>CMake: Check ITK_FUTURE_LEGACY_REMOVE
alt future legacy removal OFF
CMake->>Target: Add SVD/eigensystem/solve_qp test sources
CMake->>Driver: No removed-API compile definitions
Driver->>Tests: Register all vnl_algo tests
else future legacy removal ON
CMake->>Target: Omit removed SVD/eigensystem/solve_qp test sources
CMake->>Driver: Define VNL_EISPACK_REMOVED, VNL_SVD_REMOVED, VNL_MATRIX_INVERSE_REMOVED
Driver->>Tests: Register only linkable tests
Tests->>Tests: Compile out removed SVD/matrix_inverse references
end
Reviews (1): Last reviewed commit: "COMP: Gate VXL svd and matrix_inverse te..." | Re-trigger Greptile
dzenanz
approved these changes
Jul 20, 2026
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.
vnl_algo_test_allfails to link underITK_FUTURE_LEGACY_REMOVEbecause commit 232a2ad excluded the LINPACK-svdc-backedvnl_svdfamily andvnl_solve_qpfrom the library but left their tests. This gates those tests, which is the only build failure in that configuration.This is the same defect 434a420 fixed for the eispack
vnl_*_eigensystemsolvers, and it is what breaks all five RogueResearch Mac Debug nightlies.Root cause — two mechanisms, not one
1. Tests left behind for removed APIs.
Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/CMakeLists.txtdropsvnl_svd{,_economy,_fixed},vnl_solve_qpand theirTemplates/vnl_svd*+*instantiations underITK_FUTURE_LEGACY_REMOVE, buttests/CMakeLists.txtgated only the eigensystem tests. Six test objects still referenced the removed symbols:test_svd_fixed.cxx.otest_svd.cxx.otest_solve_qp.cxx.otest_complex_algo.cxx.otest_algo.cxx.otest_rank.cxx.o2. Guards that never fired.
test_algo.cxxandtest_complex_algo.cxxalready guarded their removed-API use with#ifndef ITK_FUTURE_LEGACY_REMOVE. That macro is never defined in those translation units:itkConfigure.his generated at<build>/Modules/Core/Common/itkConfigure.h, but it is not on the include path of the vendored VXL subtree. Verified fromcompile_commands.json:itkConfigure.hTemplates/vnl_svd+double-.cxx)test_algo.cxx)ITKCommonHeaderTest1.cxx)<build>/Modules/Core/CommonThat asymmetry is correct for the headers — the
__has_include(<itkConfigure.h>)guard is meant to stay inert for VXL's own compiles and for standalone VXL builds, while firing for ITK modules and downstream consumers. But it means any#ifndef ITK_FUTURE_LEGACY_REMOVEwritten inside a VXL test source is dead code. The removed-API state is therefore conveyed asVNL_SVD_REMOVED/VNL_MATRIX_INVERSE_REMOVEDcompile definitions, mirroring the existingVNL_EISPACK_REMOVED.Verification
Debug, AppleClang, arm64, macOS 26.5 SDK.
ITK_LEGACY_REMOVE=ON+ITK_FUTURE_LEGACY_REMOVE=ONFull-tree build under
ITK_FUTURE_LEGACY_REMOVE: exactly one of 5550 targets failed before this change (vnl_algo_test_all); 0 failures after. No other failure class exists in that configuration.Coverage is not silently dropped —
itkMathSVD.handitkMathSVDGTest.cxxalready exercise the Eigen-backed replacement, so the deprecation policy's scavenge step was already complete; only the test gating was missing.test_rank.cxxroutes its SVD checks through aTEST_SVD_RANKmacro that compiles away when removed; itsvnl_rank()checks are untouched.VXL fork carry-through
The identical change is already on the extraction branch so the next
UpdateFromUpstream.shdoes not revert it:InsightSoftwareConsortium/vxlfor/itk-vxl-master:c8c2e0555c..8d91974ab0(fast-forward)for/itk-vxl-master-8d91974All five files were byte-identical between ITK
mainand the fork before the change, and are byte-identical after it, so the two trees cannot drift. Standalone VXL is unaffected: with noITK_FUTURE_LEGACY_REMOVECMake variable, every test is built and the new macros are never defined, leaving all source guards inert.Modules/ThirdParty/VNL/UpdateFromUpstream.shstill pinsfor/itk-vxl-master-ae2f579(2026-07-06), which predates bothc8c2e05and this commit; bumping that pin is left to a separate change.