Skip to content

COMP: Update VXL to 2026-05-07 (64265ec3)#6251

Closed
hjmjohnson wants to merge 8 commits intoInsightSoftwareConsortium:mainfrom
hjmjohnson:vxl-update-vxl-7.0
Closed

COMP: Update VXL to 2026-05-07 (64265ec3)#6251
hjmjohnson wants to merge 8 commits intoInsightSoftwareConsortium:mainfrom
hjmjohnson:vxl-update-vxl-7.0

Conversation

@hjmjohnson
Copy link
Copy Markdown
Member

Routine VXL third-party sync from upstream vxl/vxl tip 64265ec3 (2026-05-07).

Commits
  • 466960466d VXL 2026-05-07 (64265ec3) — subtree update from upstream-VXL tracking branch
  • f425aebbeb Merge branch 'upstream-VXL' into vxl-update-vxl-7.0 — two-parent merge preserves upstream blame
Test plan
  • CI: Linux / macOS / Windows green
  • CI: Python wrapping green
  • No new compiler warnings in Modules/ThirdParty/VNL/

VXL Maintainers and others added 2 commits May 10, 2026 14:04
Code extracted from:

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

at commit 64265ec33cacea4f11f7b1308612bbd89f986c7d (master).
# By VXL Maintainers
* upstream-VXL:
  VXL 2026-05-07 (64265ec3)
@github-actions github-actions Bot added type:Compiler Compiler support or related warnings type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:ThirdParty Issues affecting the ThirdParty module labels May 10, 2026
VXL Maintainers and others added 2 commits May 10, 2026 15:06
Code extracted from:

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

at commit 892e08a69c5b82b395966fab09edd82914e32ebe (integration/all-open-prs-2026-05-10).
* upstream-VXL:
  VXL 2026-05-10 (892e08a6)
@github-actions github-actions Bot added the area:Python wrapping Python bindings for a class label May 10, 2026
@hjmjohnson hjmjohnson marked this pull request as ready for review May 10, 2026 20:11
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 10, 2026

Greptile Summary

Routine sync of VXL third-party to upstream commit 64265ec3 (2026-05-07), bumping the bundled library to version 7.0.0.0 with a C++17 minimum and several modernisation passes across the vnl core.

  • VXL 7.0 / C++17 minimum: cmake_minimum_required raised to 3.22.1, C++ standard floor moved from 11 to 17, version number bumped to 7.0.0.0, and the deprecated VXL_LEGACY_FUTURE_REMOVE CMake option removed; VXL_USE_HISTORICAL_IMPLICIT_CONVERSIONS and VXL_USE_HISTORICAL_PROTECTED_IVARS both flip their defaults to OFF (ITK's wrapper already forces them OFF, so no build impact for ITK itself).
  • Thread-safety band-aid for iterative solvers: vnl_lbfgsb and vnl_sparse_symmetric_eigensystem each gain an internal std::mutex; the sparse eigensystem holds the lock for the full CalculateNPairs invocation, while lbfgsb holds it only around each individual setulb_() call (interleaving risk documented in the new README_threading.md).
  • Modern C++ clean-up: raw C arrays replaced with std::array, typedef aliases converted to using, [[nodiscard]] applied to size/predicate accessors throughout vnl_matrix and vnl_vector, and a new vxl_platform_math INTERFACE CMake target centralises -lm linking logic.

Confidence Score: 4/5

The sync is largely safe for ITK builds; the one actionable gap is that the ITK wrapper CMakeLists.txt still sets the now-retired VNL_CONFIG_LEGACY_METHODS cache variable, which will emit a CMake warning on every clean configuration until the wrapper is updated.

All of ITK's forced-off historical-compatibility options are handled correctly in the wrapper, the C++17 bump aligns with ITK's own requirements, and the lbfgsb band-aid mutex limitation is documented as a known issue. The stale VNL_CONFIG_LEGACY_METHODS set in the unchanged wrapper will produce a noisy CMake deprecation warning on fresh builds but does not break compilation or runtime behaviour.

Modules/ThirdParty/VNL/CMakeLists.txt (wrapper still sets the retired VNL_CONFIG_LEGACY_METHODS variable) and Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_lbfgsb.cxx (mutex scope known limitation).

Important Files Changed

Filename Overview
Modules/ThirdParty/VNL/UpdateFromUpstream.sh Points repo and tag to hjmjohnson's personal integration fork/branch instead of the canonical vxl/vxl master — already flagged in a prior review thread.
Modules/ThirdParty/VNL/src/vxl/CMakeLists.txt Major VXL version bump to 7.0.0.0: raises C++ minimum to 17, removes policy boilerplate, flips VXL_USE_HISTORICAL_* defaults to OFF, and drops VXL_LEGACY_FUTURE_REMOVE option. ITK wrapper already forces both historical options OFF so the default flip is a no-op for ITK builds.
Modules/ThirdParty/VNL/src/vxl/core/vnl/CMakeLists.txt Retires VNL_CONFIG_LEGACY_METHODS option with a deprecation warning+unset block, but the ITK wrapper CMakeLists.txt (unchanged in this PR) still force-sets this variable, triggering the warning on every ITK CMake configuration.
Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_lbfgsb.cxx Replaces raw C arrays with std::array and wraps each setulb_() call in a band-aid mutex. The mutex is released between reverse-communication iterations, leaving the SAVE'd state partially protected — documented in README_threading.md and tracked as issue #23.
Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_sparse_symmetric_eigensystem.cxx Adds a function-entry mutex guard (held for the full CalculateNPairs invocation) around the dnlaso/dsaupd/dseupd f2c paths and the static current_system shim; modernises casts and copy loops.
Modules/ThirdParty/VNL/src/vxl/config/cmake/Modules/ConfigurePlatformMathTarget.cmake New file creating the vxl_platform_math INTERFACE target with implicit-math probe. Contains a CMAKE_VERSION VERSION_LESS 3.14.0 dead-code branch already flagged in a prior review thread.
Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/README_threading.md New documentation cataloguing thread-safety status of all vnl_algo solver paths; accurately describes the band-aid mutex strategy and the outstanding issue #23.
Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix.h Modernises typedef→using aliases, adds [[nodiscard]] to size/shape/predicate accessors, and adds a protected swap_memory_management helper for subclasses.
Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_vector.h Mirrors vnl_matrix.h modernisation: typedef→using, [[nodiscard]] on size/predicate accessors, and adds swap_memory_management helper.

Sequence Diagram

sequenceDiagram
    participant ThreadA as Thread A (minimize)
    participant Mutex as lbfgsb_call_mutex
    participant setulb as setulb_() SAVE state
    participant CostFn as f_->compute()
    participant ThreadB as Thread B (minimize)

    ThreadA->>Mutex: lock_guard acquire
    ThreadA->>setulb: "call setulb_ task=FG"
    ThreadA->>Mutex: lock_guard release
    Note over ThreadA,Mutex: Cost function runs WITHOUT lock
    ThreadB->>Mutex: lock_guard acquire
    ThreadB->>setulb: call setulb_ corrupts A SAVE state
    ThreadB->>Mutex: lock_guard release
    ThreadA->>CostFn: compute x f gradient
    ThreadA->>Mutex: lock_guard acquire next iteration
    ThreadA->>setulb: call setulb_ reads corrupted state
Loading

Reviews (2): Last reviewed commit: "COMP: Export vxl_platform_math interface..." | Re-trigger Greptile

Comment thread Modules/ThirdParty/VNL/UpdateFromUpstream.sh
Comment thread Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_lbfgsb.cxx Outdated
@hjmjohnson hjmjohnson closed this May 10, 2026
@hjmjohnson hjmjohnson reopened this May 10, 2026
Bumps the subtree source from vxl/vxl:master to
hjmjohnson/vxl:integration/all-open-prs-2026-05-10, which combines
the 5 open vxl PRs (InsightSoftwareConsortium#1038-InsightSoftwareConsortium#1042) into a single integration tip:

  InsightSoftwareConsortium#1038 Retire legacy scaffolding (vxl 7.0)
  InsightSoftwareConsortium#1039 Add top-level LICENSE
  InsightSoftwareConsortium#1040 Bump CMake floor to 3.22.1
  InsightSoftwareConsortium#1041 Fix singleton races, serialize f2c iterative-solver paths
  InsightSoftwareConsortium#1042 Drop bundled v3p/dcmtk and vil_dicom
VXL 7.0 introduces an INTERFACE library 'vxl_platform_math' that itkvcl
and itkv3p_netlib link against. With VXL_NO_EXPORT=ON (the ITK build
configuration), VXL's own install(TARGETS vxl_platform_math EXPORT ...)
is skipped, so the install(EXPORT ITKTargets) step fails with:

  CMake Error: install(EXPORT "ITKTargets" ...) includes target
  "itkvcl" which requires target "vxl_platform_math" that is not
  in any export set.

Add the INTERFACE target to ITKTargets so consumers of installed ITK
find a complete export set.
@hjmjohnson hjmjohnson force-pushed the vxl-update-vxl-7.0 branch from c34c52b to 4fb342d Compare May 10, 2026 20:30
Comment on lines +18 to +23
if(DEFINED CACHE{VNL_CONFIG_LEGACY_METHODS} OR DEFINED VNL_CONFIG_LEGACY_METHODS)
message(WARNING
"VNL_CONFIG_LEGACY_METHODS is no longer a valid configuration flag and has no effect. "
"Please remove it from your CMake cache or configuration scripts.")
unset(VNL_CONFIG_LEGACY_METHODS CACHE)
endif()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Stale VNL_CONFIG_LEGACY_METHODS set in wrapper will trigger warning on every ITK build

The inner core/vnl/CMakeLists.txt now warns and unsets VNL_CONFIG_LEGACY_METHODS when the variable is defined in cache (DEFINED CACHE{VNL_CONFIG_LEGACY_METHODS}). The ITK wrapper at Modules/ThirdParty/VNL/CMakeLists.txt:29-35 still force-sets that cache variable (CACHE BOOL … FORCE), so every clean CMake configuration of ITK will produce this deprecation warning and an unnecessary cache mutation. The set(VNL_CONFIG_LEGACY_METHODS OFF CACHE BOOL … FORCE) block in the wrapper should be removed now that the variable is retired upstream.

The L-BFGS-B f2c-translated driver in v3p_netlib_setulb_ has SAVE'd
locals that are shared across calls. Acquiring the mutex per setulb_
call leaves a window between reverse-communication iterations where
a second thread can interleave its own setulb_ sequence and corrupt
the global state.

Hold the mutex across the entire driver loop in minimize() so one
invocation completes before another begins. This matches the pattern
already used by vnl_sparse_symmetric_eigensystem::CalculateNPairs.

A matching fix should land upstream at vxl/vxl; this in-tree change
keeps ITK CI/Greptile clean until the next third-party sync.
vxl's cmake_minimum_required is 3.22.1, so the legacy '-lm only'
branch in ConfigurePlatformMathTarget.cmake was unreachable. Keep
only the probe logic.

Mirrors a cleanup that should also land upstream at vxl/vxl.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Python wrapping Python bindings for a class area:ThirdParty Issues affecting the ThirdParty module type:Compiler Compiler support or related warnings type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant