Repository navigation
Conversation
hjmjohnson
left a comment
There was a problem hiding this comment.
Max review (Standards and Spec): no should-fix findings. The guard and test match the main commit from #6991; the change is limited to counts that previously truncated, with no API or ABI change, which fits a patch release. One optional placement nit below.
Optional nits
- The backport note in the commit message has one 73-column line.
itkObjectToObjectMetric.hxx:133,136computes the same maximum twice; that would change onmainfirst, so leave it here.
|
@greptileai review |
[Medium impact] The PR appears safe to merge; no blocking issues remain.
|
ObjectToObjectMetric::GetNumberOfParameters returned the moving transform's 64-bit IdentifierType count through the metric's unsigned int NumberOfParametersType, so a dense displacement field with more than 2^32 - 1 parameters was silently truncated. Callers then sized the derivative from the truncated count and wrote past its end. Throw instead when the count does not fit. This makes the overflow a clear error; widening the metric API remains open. Addresses InsightSoftwareConsortium#6949. (cherry picked from commit cc15831) release-5.4 had no GoogleTest driver for ITKOptimizersv4, so the backport adds one for itkObjectToObjectMetricGTest.cxx and adds ITKGoogleTest to the module's TEST_DEPENDS.
96d6e57 to
f0a7a01
Compare
|
Force-push
The minimal release-5.4 build's |
|
@greptileai review |
Backport of #6991 to
release-5.4. A metric with more than 2^32 − 1 transform parameters now throws instead of truncating the count and writing past the derivative buffer. SyN hits this above about 1.43 billion voxels in 3-D (#6949).Backport notes
cc15831d0aby @jdotc1, with the author kept.release-5.4has no GoogleTest driver for ITKOptimizersv4, so this adds one foritkObjectToObjectMetricGTest.cxxand keeps the existing CTest entries.NumberOfParametersType, stays amain-only follow-up.Testing
On
release-5.4(6e154ce644), GCC 15, a minimal registration build withModule_ITKGoogleTestandModule_ITKOptimizersv4on:ObjectToObjectMetric.PreservesRepresentableParameterCountsand.RejectsParameterCountOverflowpass.RejectsParameterCountOverflowfails.ctest -L ITKOptimizersv4: 31/32 pass. The one not run isITKOptimizersv4KWStyleTest, because KWStyle is not installed locally.AI assistance