Skip to content

ENH: Update vendored VNL to for/itk-vxl-master-7829892 (vnl_math:: deprecation + sqrteps fix)#6431

Merged
hjmjohnson merged 3 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:update-vnl-fd75e8b
Jun 11, 2026
Merged

ENH: Update vendored VNL to for/itk-vxl-master-7829892 (vnl_math:: deprecation + sqrteps fix)#6431
hjmjohnson merged 3 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:update-vnl-fd75e8b

Conversation

@hjmjohnson

@hjmjohnson hjmjohnson commented Jun 10, 2026

Copy link
Copy Markdown
Member

Repoint ITK's vendored VNL to the protected isc/vxl branch for/itk-vxl-master-7829892, advancing the pin from for/itk-vxl-master-272c3f1. This brings in the vnl_math:: deprecation campaign, the sqrteps precision fix, and a vnl_error.h warning fix from the ITK fork of VXL.

Rebuilt on current main. The two prerequisites are now merged and present in the base: #6427 (decouple itk::Math from vnl_math) and #6430 (remove the default -Wno-deprecated). This PR no longer stacks on either — it is a clean re-vendor on top of them.

What's in this re-vendor (272c3f1 → 7829892)
  • vnl_math:: deprecation campaign — the public vnl_math:: surface is now [[deprecated]] for external consumers, with the real implementations relocated to undeprecated internal namespaces (vnl_math::detail, vnl_math::numeric_predicates) that vnl uses internally. Macro-gated (default on) so consumers can opt out per-category. Covers:
    • numeric constants (pi, e, sqrt2, …)
    • isnan/isinf/isfinite/isnormal predicates
    • 14 numeric functions (angle_0_to_2pi, rnd, floor, ceil, sgn, sqr, cube, remainder_*, squared_magnitude, …)
    • std:: re-exports (max/min/cbrt/hypot) and vnl_huge_val
    • abs — nudges ITK users toward itk::Math::Absolute()
  • sqrteps precision fix1.490116119384766e-08 → the exact power-of-two 0x1p-26.
  • vnl_huge_val deprecation message correction — advises std::numeric_limits<T>::infinity() for floating-point T and std::numeric_limits<T>::max() for integral T (integral types have no infinity).
  • vnl_error.h -Wunused-parameter fixvnl_error_assert_int_range's parameter is unused under NDEBUG; now [[maybe_unused]]. This warning appeared in every TU that includes vnl_vector.h in Release CI builds.
Downstream validation

Built against a pixi/ccache testbed of open-source ITK consumers (ITK @ this vendored vnl). 11/11 buildable consumers compiled clean with no vnl-related breakage: elastix, SimpleITK, RTK, Cleaver, PerformanceBenchmarking, SimpleITKFilters, TractographyTRX, VkFFTBackend, ANTs, BRAINSTools (+ ITK itself). Slicer/SlicerExtensions are not buildable in that conda testbed for environment reasons orthogonal to vnl.

With #6427 merged, ITK's own headers no longer route through the now-deprecated vnl_math:: surface, so this vendored update does not reintroduce internal deprecation warnings.

Fork provenance

The pin targets the branch anchor for/itk-vxl-master-7829892 on InsightSoftwareConsortium/vxl — a protected branch, not a tag. The fork's overlay commits are anchored by branches only (a same-named branch and tag would make the ref ambiguous and break update-third-party.bash). See the fork-convention clarifications in #6432.

@github-actions github-actions Bot added type:Enhancement Improvement of existing methods or implementation area:ThirdParty Issues affecting the ThirdParty module labels Jun 10, 2026
@hjmjohnson hjmjohnson force-pushed the update-vnl-fd75e8b branch from 1a0e902 to 7e780e9 Compare June 11, 2026 01:42
@hjmjohnson hjmjohnson changed the title ENH: Update vendored VNL to for/itk-vxl-master-fd75e8b (vnl_math:: deprecation + sqrteps fix) ENH: Update vendored VNL to for/itk-vxl-master-7829892 (vnl_math:: deprecation + sqrteps fix) Jun 11, 2026
@hjmjohnson

Copy link
Copy Markdown
Member Author

Repointed the pin fd75e8b → 7829892: same content plus a [[maybe_unused]] fix for the vnl_error.h:49 -Wunused-parameter warning that appeared in every Release TU (one of the two CI-failure causes). The remaining ARM warnings come from itkMath.h's own vnl_math:: uses and resolve when #6427 merges — merge order is #6427 first, then this PR.

@hjmjohnson hjmjohnson marked this pull request as ready for review June 11, 2026 02:01
@greptile-apps

This comment was marked as low quality.

Comment thread Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h
Comment thread Modules/ThirdParty/VNL/src/vxl/core/vnl/tests/test_math.cxx
Comment thread Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h
@hjmjohnson hjmjohnson marked this pull request as draft June 11, 2026 10:02
@hjmjohnson hjmjohnson changed the title ENH: Update vendored VNL to for/itk-vxl-master-7829892 (vnl_math:: deprecation + sqrteps fix) WIP: (BLOCKED ON PR 6427 FIXES) ENH: Update vendored VNL to for/itk-vxl-master-7829892 (vnl_math:: deprecation + sqrteps fix) Jun 11, 2026
@blowekamp

Copy link
Copy Markdown
Member

@hjmjohnson What you are doing in ITK's forks is not following the documentation in the welcome. The documentation does not mention creating a tag. Also the SHA using in the branch name per the the documentation is suppose to be from the upstream.

I don't know if what is documented is the best procedure. I did have an issue trying to follow a the documentation in a fork where there was both a tag and a branch.

Please review the documentation, and refine the procedure we should do in ITK forks.

@hjmjohnson hjmjohnson force-pushed the update-vnl-fd75e8b branch from 7e780e9 to a55ea13 Compare June 11, 2026 10:50
@github-actions github-actions Bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:Python wrapping Python bindings for a class type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module area:Documentation Issues affecting the Documentation module and removed type:Enhancement Improvement of existing methods or implementation labels Jun 11, 2026
@hjmjohnson

hjmjohnson commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

@hjmjohnson What you are doing in ITK's forks is not following the documentation in the welcome. The documentation does not mention creating a tag. Also the SHA using in the branch name per the the documentation is suppose to be from the upstream.

I don't know if what is documented is the best procedure. I did have an issue trying to follow a the documentation in a fork where there was both a tag and a branch.

Please review the documentation, and refine the procedure we should do in ITK forks.

I caught this in an earlier iteration, and I thought I had implemented a durable fix :(. Working through the entire tree looking for what I did wrong and trying a different, more aggressive durable fix.

See

hjmjohnson and others added 3 commits June 11, 2026 12:18
Advance the VNL overlay pin from 272c3f1 to 7829892 (vnl_math:: deprecation
campaign + sqrteps 0x1p-26). The subtree update follows in the merge produced
by UpdateFromUpstream.sh.
Code extracted from:

    https://github.com/InsightSoftwareConsortium/vxl.git

at commit 7829892c34f6b9cf3a85be8c2a4b5a1afbe1f99b (for/itk-vxl-master-7829892).
* upstream-VXL:
  VXL 2026-06-10 (7829892c)
@hjmjohnson hjmjohnson force-pushed the update-vnl-fd75e8b branch from 206dba2 to 574c34b Compare June 11, 2026 17:20
@github-actions github-actions Bot removed the type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots label Jun 11, 2026
@github-actions github-actions Bot removed area:Python wrapping Python bindings for a class type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module area:Documentation Issues affecting the Documentation module labels Jun 11, 2026
@hjmjohnson hjmjohnson changed the title WIP: (BLOCKED ON PR 6427 FIXES) ENH: Update vendored VNL to for/itk-vxl-master-7829892 (vnl_math:: deprecation + sqrteps fix) ENH: Update vendored VNL to for/itk-vxl-master-7829892 (vnl_math:: deprecation + sqrteps fix) Jun 11, 2026
@hjmjohnson

Copy link
Copy Markdown
Member Author

Downstream build verification — built this exact PR head (574c34bf7a6, vendored vnl for/itk-vxl-master-7829892, on current main with #6427/#6430 merged) against an open-source consumer forest. All 11 buildable consumers compiled clean with the vnl_math:: deprecations live — no vnl-related breakage:

ITK, elastix, SimpleITK, RTK, Cleaver, PerformanceBenchmarking, SimpleITKFilters, TractographyTRX, VkFFTBackend, ANTs, BRAINSTools.

@hjmjohnson hjmjohnson marked this pull request as ready for review June 11, 2026 17:38
@hjmjohnson hjmjohnson requested a review from dzenanz June 11, 2026 18:58

@dzenanz dzenanz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on a glance.

@dzenanz

dzenanz commented Jun 11, 2026

Copy link
Copy Markdown
Member

I thought that VNL would be put into ITK, and maintained there, without referencing any external repository. I now see it has to be this way, as VNL has very different style from ITK.

@hjmjohnson

Copy link
Copy Markdown
Member Author

@dzenanz We may someday choose to put VXL directly in ITK (keep it in the Third party so it does not need to be formatted like itk) but for the moment I wanted to keep some git tracking so that as I uncover bugs/failures that should be on VXL/VXL that I can cherry-pick as a good citizen (not that ITK will be using VXL any more).

It was also a lot easier to the 100+ commits in vxl with tests and rollback capabilities rather than have 100 ITK prs :). This was an easy way to "bundle" 100+ commits into 2 ITK PR's (and only 2 merges).

========
This PR was a major milestone goal of mine. I have a laundry list of other "purges" and "cleanups" and "shift away from vxl's netlib (circa 1999 codebase). I am pretty sure that a large swath of the netlib code is not needed, or easily replaced.

@hjmjohnson hjmjohnson merged commit 57ff6c6 into InsightSoftwareConsortium:main Jun 11, 2026
17 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ThirdParty Issues affecting the ThirdParty module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants