Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests do not pass on 32bit (i386) platform #1453

Open
yarikoptic opened this issue Sep 5, 2018 · 4 comments
Open

tests do not pass on 32bit (i386) platform #1453

yarikoptic opened this issue Sep 5, 2018 · 4 comments
Assignees
Milestone

Comments

@yarikoptic
Copy link

I thought that they just might be too stringent, but some large differences (e.g. 45.718 vs 43.3306) listed below suggest that there might be more to the story:

neurodebian@smaug ..lds/mrtrix3/3.0~rc3+git86-g4b523b413-1 % grep ERROR mrtrix3_3.0~rc3+git86-g4b523b413-1~nd+1_i386.build
running "dwidenoise"... 4 of 6 passed    <-------- ERROR
running "tckresample"... 4 of 5 passed    <-------- ERROR
running "transformcompose"... 2 of 4 passed    <-------- ERROR
# command: dwidenoise dwi.mif - | testing_diff_image - dwidenoise/dwi.mif -voxel 1e-4 [ ERROR ]
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-iEV7VJ.mif" and "dwidenoise/dwi.mif" do not match within 0.0001 of maximal voxel value (7.45948 vs 7.45437)
testing_diff_image: [ERROR] exception thrown from one or more threads "loop threads"
# command: dwidenoise dwi.mif -noise tmp-noise.mif - | testing_diff_image - dwidenoise/dwi.mif -voxel 1e-4 && testing_diff_image tmp-noise.mif dwidenoise/noise.mif -image $(mrcalc dwi_mean.mif -abs 1e-4 -mult - | mrfilter - smooth -) [ ERROR ]
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-iEV7VJ.mif" and "dwidenoise/dwi.mif" do not match within 0.0001 of maximal voxel value (7.45948 vs 7.45437)
testing_diff_image: [ERROR] exception thrown from one or more threads "loop threads"
## ERROR: 2 tests failed for "dwidenoise"
# command: tckresample tracks.tck tmp.tck -upsample 2 -force && testing_diff_tck tmp.tck tckresample/upsample.tck 1e-5 [ ERROR ]
testing_diff_tck: [ERROR] 22 mismatched streamlines - test FAILED
## ERROR: 1 tests failed for "tckresample"
# command: transformcompose rotatez.txt unit_warp.mif - | testing_diff_image - transformcompose/out2.mif -frac 0.001 [ ERROR ]
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (45.718 vs 43.3306)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (40.7681 vs 40.0306)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (36.1681 vs 35.4306)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (43.3306 vs 42.5931)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (38.7306 vs 36.3431)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (45.9709 vs 43.5834)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (50.318 vs 47.1931)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (41.021 vs 40.2835)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (34.8489 vs 34.771)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (47.5238 vs 47.4459)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (38.4585 vs 37.721)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (38.7114 vs 38.6335)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (42.5739 vs 42.496)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (45.621 vs 44.8835)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (33.4518 vs 33.3739)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out2.mif" do not match within fractional precision of 0.001 (38.7114 vs 37.9739)
testing_diff_image: [ERROR] exception thrown from one or more threads "loop threads"
# command: transformcompose rotatez_warp.mif rotatez_warp.mif - | testing_diff_image - transformcompose/out4.mif -frac 0.001 [ ERROR ]
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (38.9317 vs 37.5226)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (52.3795 vs 52.5734)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (45.1265 vs 43.7174)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (38.8342 vs 36.7693)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (47.1001 vs 45.1265)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (45.2241 vs 43.8149)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (43.0831 vs 41.674)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (46.9477 vs 47.1416)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (49.6636 vs 49.8575)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (43.1807 vs 41.7715)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (49.3755 vs 47.9663)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (41.0398 vs 39.6306)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (45.1696 vs 43.1047)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (33.452 vs 33.3741)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (41.693 vs 41.8869)
testing_diff_image: [ERROR] images "/tmp/mrtrix-tmp-vLrMvI.mif" and "transformcompose/out4.mif" do not match within fractional precision of 0.001 (47.3321 vs 45.923)
testing_diff_image: [ERROR] exception thrown from one or more threads "loop threads"
## ERROR: 2 tests failed for "transformcompose"

full build logs with dumps are available from http://neuro.debian.net/_files/_buildlogs/mrtrix3/3.0~rc3+git86-g4b523b413, see e.g. http://neuro.debian.net/_files/_buildlogs/mrtrix3/3.0~rc3+git86-g4b523b413/mrtrix3_3.0~rc3+git86-g4b523b413-1~nd+1_i386.build

Also, may be build flags should include -mmmx -msse -msse2 -mfpmath=sse to guarantee more consistent operation across x86 platforms? (we ended up using them for dcm2niix to provide desired consistent operation)

@yarikoptic
Copy link
Author

ha! with those build options tests seems to pass on i386! waiting for amd64 build to finish (I apply them on all x86 platforms, so will be fun to see if works on x32 in debian proper) to make sure that there is no side effects.

@yarikoptic
Copy link
Author

FWIW, tests pass consistently. I've uploaded mrtrix3 to debian proper (will need to get through NEW queue first), and also backport builds to NeuroDebian, which should get listed at http://neuro.debian.net/pkgs/mrtrix3.html soonish

Leaving it open so you could decide either to include those compile flags in general (for x86 only please) or not

@jdtournier
Copy link
Member

Sorry about the late response - lots on at the moment. This is interesting (I haven't looked at 32 bits for a loooong time...). I'd be happy to add these flags for x86, just not sure what the best way might be to detect this - currently we leave everything to defaults. We could detect whether the build script is running on a x86 CPU, but I'm not sure whether we can always assume this is always what was intended (particularly if the user specifies a different CPU architecture via the ARCH variable, which feeds through to -march). Open to opinions...

Also, maybe we can just use these options by default? I note from the GCC docs for -mfpmath that these are enabled by default on x86-64:

For the x86-32 compiler, you must use -march=cpu-type, -msse or -msse2 switches to enable SSE extensions and make this option effective. For the x86-64 compiler, these extensions are enabled by default.

So maybe we can just make this the default in general...? We can simply check whether we can invoke the compiler with these options, and remove them if not to support other architectures.

Alternatively, we can invoke the compiler with all the current options, adding the -Q --help=target option, grab the output and look for the lines (this is actually what shows up on my x86-64 system):

  -mfpmath=                   		sse
  -msse                       		[enabled]
  -msse2                      		[enabled]

Only issue is that doesn't work on clang...

@jdtournier jdtournier added this to the 3.0_RC4 release milestone Jan 30, 2019
@jdtournier jdtournier self-assigned this Jan 30, 2019
@jdtournier
Copy link
Member

@yarikoptic: can we close this off? Are you happy to set the flags on your side for the Debian 32-bit builds? Or do we need to change the defaults in the configure script? Might be a good idea to do that anyway, to be fair...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants