Repository navigation
WIP: PERF: Call tensorstoreToITKComponentType at compile-time, by constexpr (supersedes #68) - #81
Draft
hjmjohnson wants to merge 5 commits into
Draft
hjmjohnson wants to merge 5 commits into
hjmjohnson wants to merge 5 commits into
Conversation
GitHub retired the macos-13 runner image and retires macos-14 on November 2, 2026 (actions/runner-images#13518). Use macos-15-intel and macos-15 with Xcode 16.2, matching ITKRemoteModuleBuildTestPackageAction; the Xcode 14.3.1 and 15.0.1 selections do not exist on those images. Xcode 16 reports new ranlib and ld warnings for the bundled third-party libraries, and the dashboard script fails on any warning, so add them to the warning exceptions.
The prebuilt ITK 5.4.0 Python build that the macOS wheel jobs download was made on Xcode 15.0.1, and its build.ninja names that SDK's libiconv.tbd, which the macos-15 image does not have. The 5.4.7 build and ITKPythonPackage scripts exist, and later 5.4 releases build with Xcode 16.2 in ITKRemoteModuleBuildTestPackageAction, so move the ITK checkout, the wheel build, and the packaging scripts together. The 5.4.7 wheels cover Python 3.9 to 3.11 only, so drop 3.8 from the Linux and Windows wheel matrices, remove the macOS steps that skipped 3.8, and require Python 3.9.
GitHub is forcing the Node 20 actions onto Node 24. Use the versions that ITKRemoteModuleBuildTestPackageAction uses for checkout, setup-python, get-cmake, upload-artifact, and download-artifact.
Following Scott Meyers, Effective Modern C++, 2014, "Use `constexpr` whenever possible".
A variable template makes the compiler evaluate the conversion of each supported pixel type to an ITK component type at compile-time, instead of calling the function each time a read or write tries a pixel type.
hjmjohnson
force-pushed
the
takeover-68-constexpr
branch
from
November 3, 2026 21:51
cd1f4c7 to
0828703
Compare
Member
Author
|
Marked WIP: |
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.
Blocked: this does not compile with the TensorStore pinned on
main(a 2023 commit). GCC reportstensorstore::dtype_v<T>as "not usable in a constant expression" (MakeDataTypeOperations<...>::operations), so the Ubuntu build fails. It needs a newer TensorStore, which is why #74 was opened as "triggered by #68". Not to be merged until that update lands.Evaluates the conversion of each supported pixel type to an ITK component type at compile-time, with
constexpr. This takes over #68 by Niels Dekker, updated for theTypeListcode that replaced the macros his second commit edited. The branch includes the commits of #78, which it builds on.What changes
tensorstoreToITKComponentTypeanditkToTensorstoreComponentTypeare declaredconstexpr(Niels Dekker's first commit, unchanged).toITKComponentType<T>forces compile-time evaluation, andReadFromStoreIfTypesMatchandWriteToStoreIfTypesMatchuse it instead of calling the function withtensorstore::dtype_v<TPixel>on each attempt. His second commit did the same inside theREAD_ELEMENT_IFandELEMENT_WRITEmacros, which no longer exist onmain.ReadArrayMetadata, where the dtype comes from the file, is unchanged.Testing
Built and ran locally on macOS arm64 (Release) against a TensorStore updated to v0.1.86: the module builds and its 15 tests pass. CI on the TensorStore pin from
mainfails on GCC, as described above; that is the expected outcome of this change on that pin. The file is clean under the repository'sclang-format.AI assistance