ENH: Update vendored Eigen3 fork tag (closes #6239 durably, supersedes #6247)#6249
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
SimpleITK has three distinct ways it can consume ITK. The new root build with content fetch, the default superbuild from an installed directory, and superbuild with "ITK_USE_BUILD_DIR". It is important to test using ITK from a build and installation directory. Additionally, there were some oddities/additional requirements with building a wrapped ITK remote module against an ITK build directory. This took me a lot of time to get the updated cmake instructor working in these difference configuration and figuring out some issue with ThirdParty libraries export specification. unfortunately, the ThirdParty library would done several different ways and there was not way to document on the intricate details, and there may be leftover incorrect comments in places. |
Greptile P1 finding on PR InsightSoftwareConsortium/ITK#6249: the 8-line comment block at CMakeLists.txt:971-981 and the 3-line block in Eigen3Config.cmake.in:7-9 violate ITK's prose-budget cap of 1 short line per in-source comment. Both reduce to a single load-bearing line carrying the issue reference; the rest of the rationale lives in the commit message and PR body, per AGENTS.md → prose-budget.md. Issue: InsightSoftwareConsortium/ITK#6239 Reviewer: greptile P1 on InsightSoftwareConsortium/ITK#6249
Code extracted from:
https://github.com/InsightSoftwareConsortium/eigen
at commit d477c5cf9f76583054b9efddaecce1b3c1a5962f (for/itk-20260509-599d71ab-p2-prose).
* upstream-Eigen3: Eigen3 2026-05-10 (d477c5cf) # Conflicts: # Modules/ThirdParty/Eigen3/src/itkeigen/cmake/Eigen3Config.cmake.in
f4f5880 to
02a74a0
Compare
|
Thanks @blowekamp. Acknowledging the three SimpleITK consumption modes and the wrapped-remote-module-against-build-tree gotcha. Kicking off the matrix locally now; will report results back here. Test matrix (3 SimpleITK modes × 2 ITK Eigen modes + 1 wrapped-module test)
Acknowledging your note that the ThirdParty libraries export specification has multiple historical paths and there may be leftover incorrect comments. The current PR contains a follow-up commit (02a74a0) that already trimmed two over-budget comment blocks per greptile's prose-budget finding; if the matrix surfaces additional incorrect-comment hotspots in the install/build/use paths, I'll fix those as fixup commits and call them out explicitly. Cleanup of the dual install ruleThe current Will post matrix results once builds complete. |
Build matrix results — three SimpleITK consumption modes against this PR's tipAll three modes Brad called out pass cleanly with the new fork tag content. eigen_internal is correctly registered in
Mechanical detail for M3 (the build-dir consumer Brad noted as the tricky one)
In the build-tree Pending: M4-M6
Reproducer state preserved
|
M6 result — ITKTotalVariation against ITK build directory ✅Reproduced the canonical "wrapped remote module against ITK build directory" case using ITKTotalVariation PR #57 (@blowekamp's "Update for ITK Interface Modules and use ITK targets and installation"). This is also the canonical proxTV cmake -G Ninja -S ~/src/ITKTotalVariation -B /tmp/m6-itktotalvariation-bld \
-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \
-DITK_DIR=~/src/ITK-eigen-fork-verify-bld # ← ITK BUILD tree, not install
cmake --build /tmp/m6-itktotalvariation-bld -j8
Net build matrix for PR #6249
All four consumer modes pass with the new fork tag. eigen_internal lands in Reproducer state preserved at |
Bumps vendored Eigen3 to fork tag
for/itk-20260509-599d71ab-p2and re-runs the subtree import. Closes #6239 durably (theeigen_internalinstall rule now lives in the fork itself, surviving future subtree updates) and supersedes the post-import-overlay approach in PR #6247.The fork tag carries Eigen libeigen/master tip (
599d71aba, today) plus four ITK overlay commits. All ITK-side post-import patches that previously lived only in ITK proper are now in the fork — verified by byte-equivalence test against the merged subtree (0 files differ).What changed in this PR
Two-line
UpdateFromUpstream.shedit (repo + tag pin) plus the auto-generatedModules/ThirdParty/Eigen3/src/itkeigen/subtree merge fromfor/itk-20260509-599d71ab-p2(1712 files, +23942/-4620 representing 13,299 commits of Eigen libeigen master since the priorfor/itk-20260501-879885e1baseline).The fork tag's commit-set on top of libeigen/master:
2ab8a8274.gitattributesdbda523183c2ad9c)aa172d562fbbe66203ae53bfe8f#[[ ]]block-comment, duplicate option cleanup)Why this supersedes #6247
PR #6247 fixed #6239 by patching
Modules/ThirdParty/Eigen3/src/itkeigen/CMakeLists.txtafter subtree import. That patch is vulnerable to silent revert on the next subtree update (which is exactly how #6239 was introduced — the original ITK-proper-side overlay reverted when Eigen 5 was imported asfor/itk-20260501-879885e1).Audit of the subtree vs the new fork tag confirms zero ITK-proper-side overlays remain — both
${ITK3P_INSTALL_EXPORT_NAME}install rule and@EIGEN3_TARGETS_FILE@parametrization now ride along in the fork and will survive subsequent subtree updates as no-ops.Verification matrix (13 tests)
Local verification on macOS arm64 / Apple Clang 21.0, against latest SimpleITK (
853c78a9) and BRAINSTools (67acae44):eigen_internalin mainITKTargets.cmake(vendored install)ITK_EIGEN(Core)shimtrace=3 EIGEN=3.5.0extern "C")ITK Eigen 5.0.1 trace=3, Sys Eigen 3.4.0 trace=3(both coexist)Module_GenericLabelInterpolator— environmental, NOT Eigen-related (same as #6247 verification)itkResampleInPlaceImageFilterTest.cxx:37 'abs' is ambiguous— Apple Clang environmental, NOT Eigen-relatedUpdateFromUpstream.shEigen3Config.cmake.in(theirs/ours both add@EIGEN3_TARGETS_FILE@); resolved bygit checkout --theirs. Subsequent imports clean.${ITK3P_INSTALL_EXPORT_NAME}install +@EIGEN3_TARGETS_FILE@parametrization)dbda52318/aa172d562, upstream-mergeda15767e08/-Wshadow, byte-preserved.gitattributescontent)libITKCommon-6.0.aand that'sitk::SymmetricEigenAnalysisEnums::EigenValueOrder— ITK's own enum, not Eigen libraryfind_package(ITK + Eigen3 3.4 in same consumer)ITK_EIGEN(Core)resolves to ITK vendored,Eigen3::Eigenavailable for consumer usefind_package(ITKInternalEigen3)standalone consumerITKInternalEigen3::ITK::eigen_internaldue toitk_module_targetrewriting EXPORT_NAME); identical in pre-#6247 baseline. Out of scope — see #6230 architectural discussion ("questionable feature").Detailed evidence
Test 4 (SimpleITK) — exact
find_package(ITK)+<itkeigen/Eigen/Core>smoke from #6239 reproducer:Test 6 (tree-equivalence) — byte-compare merged ITK subtree vs fork tag:
$ diff -rq /tmp/fork-tag-content-final \ ~/src/ITK-eigen-fork-verify/Modules/ThirdParty/Eigen3/src/itkeigen \ | grep '^Files .* differ' | wc -l 0Test 11 (symbol export):
Empirical dual-Eigen evidence base (posted to #6230 separately):
redefinition of 'gebp_traits<float, float>'(expected, header-guard collision)extern "C"boundary): ✅ PASS — both Eigen 5.0.1 and 3.4.0 coexist cleanlyWhat this enables for #6230 design discussion
The "no-mangling" position is now empirically supported (Scenario 2 — TU-local Eigen coexists cleanly without symbol mangling). The "no public-API exposure" architectural commitment from this thread on 2026-05-09 makes future updates safer:
ITK_EIGEN(X)macro for ITK internals; bare<Eigen/X>external exposure is harmful (proxTV use case is implementation-only, not a principled API requirement)Eigen3::Eigenconsumer exposure): no, useITK::ITKEigen3Module