[med-svn] [Git][med-team/bart][master] 2 commits: try to fix floating point errors on i386

Martin Uecker (@uecker-guest) gitlab at salsa.debian.org
Fri Jun 12 15:02:20 BST 2026



Martin Uecker pushed to branch master at Debian Med / bart


Commits:
dc673202 by Martin Uecker at 2026-06-12T15:45:07+02:00
try to fix floating point errors on i386

- - - - -
fbbeb4a3 by Martin Uecker at 2026-06-12T16:01:14+02:00
add fix for 32 bit warnings / issues

- - - - -


3 changed files:

- + debian/patches/0009-32-bit-issues.patch
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/patches/0009-32-bit-issues.patch
=====================================
@@ -0,0 +1,135 @@
+From: Martin Uecker <uecker at tugraz.at>
+Date: Fri, 5 Jun 2026 11:35:17 +0200
+Subject: 32 bit issues
+
+---
+ src/misc/stream_protocol.c | 6 +++---
+ src/noncart/nufft.c        | 3 ++-
+ src/num/delayed.c          | 2 ++
+ src/num/mem.c              | 3 ++-
+ src/num/vptr.c             | 4 ++--
+ src/twixread.c             | 3 +--
+ 6 files changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/src/misc/stream_protocol.c b/src/misc/stream_protocol.c
+index 2b2fb32..ca05838 100644
+--- a/src/misc/stream_protocol.c
++++ b/src/misc/stream_protocol.c
+@@ -20,7 +20,7 @@ enum stream_param { NO_PARAMS = 0, LONG_PARAM };
+ struct typeinfo {
+ 
+ 	const char* keyword;
+-	unsigned int keylen;
++	ssize_t keylen;
+ 	bool ext;
+ 	enum stream_param param;
+ };
+@@ -28,7 +28,7 @@ struct typeinfo {
+ #define TOKEN "\n# "
+ const int token_len = strlen(TOKEN);
+ #define KW_PADDED(x) x "\n"
+-#define KW(x) .keyword = KW_PADDED(x), .keylen = (unsigned int)strlen(KW_PADDED(x))
++#define KW(x) .keyword = KW_PADDED(x), .keylen = (ssize_t)strlen(KW_PADDED(x))
+ 
+ // Max keyword len: MSG_HDR_SIZE - 1 - token_len
+ static const struct typeinfo types[] = {
+@@ -79,7 +79,7 @@ bool stream_decode(struct stream_msg* msg, int l, const char buf[l])
+ 	memcpy(str, buf + token_len, MSG_HDR_SIZE - token_len - 1);
+ 
+ 	for (msg->type = ARRAY_SIZE(types) - 1; msg->type > STREAM_MSG_INVALID; msg->type--)
+-		if (0 == strncmp(types[msg->type].keyword, str, types[msg->type].keylen))
++		if (0 == strncmp(types[msg->type].keyword, str, (size_t)types[msg->type].keylen))
+ 			break;
+ 
+ 	if (STREAM_MSG_INVALID == msg->type)
+diff --git a/src/noncart/nufft.c b/src/noncart/nufft.c
+index aec8382..a0736be 100644
+--- a/src/noncart/nufft.c
++++ b/src/noncart/nufft.c
+@@ -200,7 +200,8 @@ static complex float* compute_linphases(int N, long lph_dims[N + 1], unsigned lo
+ 	float shifts[1 << T][T];
+ 
+ 	int s = 0;
+-	for (unsigned long i = 0; i < (1ul << T); i++) {
++
++	for (unsigned long i = 0; i < (1UL << T); i++) {
+ 
+ 		bool skip = false;
+ 
+diff --git a/src/num/delayed.c b/src/num/delayed.c
+index 2fdd2aa..2985d44 100644
+--- a/src/num/delayed.c
++++ b/src/num/delayed.c
+@@ -336,6 +336,7 @@ void debug_delayed_queue(int dl, list_t ops_queue, bool nested)
+ 
+ 		queue->compute = false;
+ 		bart_unlock(queue->lock);
++
+ 	} else {
+ 
+ 		delayed_nested_level++;
+@@ -578,6 +579,7 @@ static struct delayed_op_arg_s arg_create(int N, const long dims[N], const long
+ 			tsize += (tdims[i] - 1) * tstrs[i];
+ 
+ 	assert(tsize <= md_calc_size(arg.N, arg.mdims) * (long)arg.msize);
++
+ 	if (tsize == md_calc_size(arg.N, arg.mdims) * (long)arg.msize)
+ 		arg.full_access = true;
+ 
+diff --git a/src/num/mem.c b/src/num/mem.c
+index 781db24..f67bbf4 100644
+--- a/src/num/mem.c
++++ b/src/num/mem.c
+@@ -233,7 +233,8 @@ void memcache_clear(void (*device_free)(const void* x, bool host))
+ 
+ 	while (NULL != nptr) {
+ 
+-		debug_printf(DP_DEBUG3, "Freeing %ld bytes.\n", nptr->len);
++		debug_printf(DP_DEBUG3, "Freeing %zd bytes.\n", nptr->len);
++
+ 		if (!nptr->host)
+ 			freed += nptr->len;
+ 
+diff --git a/src/num/vptr.c b/src/num/vptr.c
+index 90bedcd..0776ad5 100644
+--- a/src/num/vptr.c
++++ b/src/num/vptr.c
+@@ -415,7 +415,7 @@ static void vptr_debug_mem(int dl, const struct mem_s* mem)
+ 
+ 	if (0 < mem->shape.N) {
+ 
+-		debug_printf(dl, "size: %lu, dims: ", mem->shape.size);
++		debug_printf(dl, "size: %zu, dims: ", mem->shape.size);
+ 		debug_print_dims(dl, mem->shape.N, mem->shape.dims);
+ 	}
+ 
+@@ -425,7 +425,7 @@ static void vptr_debug_mem(int dl, const struct mem_s* mem)
+ 
+ 		for (int i = 0; i < mem->range.D; i++) {
+ 
+-			debug_printf(dl, "%d: %p size: %lu, dims: ", i, mem->range.sub_ptr[i]->ptr, mem->range.sub_ptr[i]->shape.size);
++			debug_printf(dl, "%d: %p size: %zu, dims: ", i, mem->range.sub_ptr[i]->ptr, mem->range.sub_ptr[i]->shape.size);
+ 			debug_print_dims(dl, mem->range.sub_ptr[i]->shape.N, mem->range.sub_ptr[i]->shape.dims);
+ 		}
+ 	}
+diff --git a/src/twixread.c b/src/twixread.c
+index 9d9cf70..0459a2f 100644
+--- a/src/twixread.c
++++ b/src/twixread.c
+@@ -188,7 +188,6 @@ enum adc_flags {
+ 	WIP_1,
+ 	WIP_2,
+ 	WIP_3,
+-
+ };
+ 
+ 
+@@ -268,7 +267,7 @@ static bool is_image_adc(uint64_t adc_flag)
+ 	uint64_t non_image = MD_BIT(ACQEND) | MD_BIT(SYNCDATA) |
+ 		MD_BIT(RTFEEDBACK) | MD_BIT(HPFEEDBACK) | MD_BIT(REFPHASESTABSCAN) |
+ 		MD_BIT(PHASESTABSCAN) | MD_BIT(PHASCOR) | MD_BIT(NOISEADJSCAN) |
+-		MD_BIT(unused60);
++		(1ULL < unused60);
+ 
+ 	if (adc_flag & non_image)
+ 		return false;


=====================================
debian/patches/series
=====================================
@@ -6,3 +6,4 @@
 0006-remove-exec-command-mechanism.patch
 0007-fix-initialization-for-direct-call-of-tools.patch
 0008-do-not-delete-command.txt.patch
+0009-32-bit-issues.patch


=====================================
debian/rules
=====================================
@@ -15,22 +15,24 @@ ifneq (,$(filter $(NOEXPOPT_ARCHS), $(DEB_BUILD_ARCH)))
 export DEB_CFLAGS_MAINT_APPEND = -fno-expensive-optimizations
 endif
 
-export AR_LOCK_NEEDED=0
+# i385
+NOIEEE_ARCHS=i386 hurd-i386
 
-# Some tests fail on the following architectures probably
-# due to minor differences in floating point processing.
-# For now, just turn it off...
-NOTEST_ARCHS=i386 hurd-i386
+ifneq (,$(filter $(NOIEEE_ARCHS), $(DEB_BUILD_ARCH)))
+export DEB_CFLAGS_MAINT_APPEND = -msse2 -mfpmath=sse
+endif
+
+# this is required for reproducible builds (and needs recent version of make)
+export AR_LOCK_NEEDED=0
 
 # For this architesture the test will be run but it will pass in any case even when errors occure
-PRINT_ERRORS_WHEN_TESTING=sh4 m68k alpha
+PRINT_ERRORS_WHEN_TESTING=sh4 m68k
 
 %:
 	dh $@
 
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-ifeq (,$(filter $(NOTEST_ARCHS), $(DEB_BUILD_ARCH)))
 ifeq (,$(filter $(PRINT_ERRORS_WHEN_TESTING), $(DEB_BUILD_ARCH)))
 	make utest
 else
@@ -38,4 +40,3 @@ else
 	make utest || true
 endif
 endif
-endif



View it on GitLab: https://salsa.debian.org/med-team/bart/-/compare/3fe00c9efda6e8c788d8138a4481b17e76b725ce...fbbeb4a3fffd316761e84b0d797e18971dfd4a3f

-- 
View it on GitLab: https://salsa.debian.org/med-team/bart/-/compare/3fe00c9efda6e8c788d8138a4481b17e76b725ce...fbbeb4a3fffd316761e84b0d797e18971dfd4a3f
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260612/79636506/attachment-0001.htm>


More information about the debian-med-commit mailing list