BUG: Compare NIfTI test output by content, not by compressed bytes - #96
Open
hjmjohnson wants to merge 1 commit into
Open
hjmjohnson wants to merge 1 commit into
hjmjohnson wants to merge 1 commit into
Conversation
nifti_c22_copy_image has been failing on this machine since before any of
this work started. It converts an image i16 -> i64 -> i16 and asserts
the result matches the original, using
cmp out.c22.0.i16.nii.gz out.c22.2.0.i16.nii.gz
That compares gzip output, which is not reproducible across zlib
implementations. The system zlib here is zlib-ng 1.3.1, which Arch,
CachyOS and a growing number of distributions ship in place of stock
zlib; it encodes the same input differently. Both files come out at
exactly 642454 bytes and differ from byte 321594 on.
The conversion itself is fine. Decompressed, the two files are
byte-identical at 1114768 bytes each, so the round-trip through int64 and
back preserves the data exactly, which is what the test set out to check.
Confirmed the other way too: in an Ubuntu 24.04 container with stock
zlib 1.3, the test passes unmodified.
The test now decompresses before comparing, via a small nii_cmp helper
that falls back to plain cmp for uncompressed files. With this the suite
is 92 of 92 on both zlib-ng and stock zlib; previously it was 91 of 92
on any zlib-ng system.
(cherry picked from commit 7d92f16)
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.
Re-submission of #31, reverted from
masteron 2026-09-24 so it can bereviewed before merging. Content is unchanged from the original.
Base:
master. Independent: nothing has to land before it.Commits
Ordering for all the re-submitted work is tracked in #84.