Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-gfloat for openSUSE:Factory 
checked in at 2026-11-20 14:46:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-gfloat (Old)
 and      /work/SRC/openSUSE:Factory/.python-gfloat.new.1251 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-gfloat"

Fri Nov 20 14:46:48 2026 rev:3 rq:1398849 version:0.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-gfloat/python-gfloat.changes      
2026-05-28 17:28:08.690713397 +0200
+++ /work/SRC/openSUSE:Factory/.python-gfloat.new.1251/python-gfloat.changes    
2026-11-20 14:49:51.435331233 +0100
@@ -1,0 +2,11 @@
+Wed Nov 18 04:30:05 UTC 2026 - Steve Kowalik <[email protected]>
+
+- Update to 0.5:
+  * Use array-api for cross-framework compatibility
+  * Fix rounding issue for large bfloat16s
+  * Replace microxscaling with torchao
+  * Update IEEE P3109 implementation to Interim Report v3
+- Add patch fix-signed-zero-overflow.patch:
+  * Fix binary64 signed-zero overflow in encode_ndarray
+
+-------------------------------------------------------------------

Old:
----
  gfloat-0.4.tar.gz

New:
----
  fix-signed-zero-overflow.patch
  gfloat-0.5.tar.gz

----------(New B)----------
  New:  * Update IEEE P3109 implementation to Interim Report v3
- Add patch fix-signed-zero-overflow.patch:
  * Fix binary64 signed-zero overflow in encode_ndarray
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-gfloat.spec ++++++
--- /var/tmp/diff_new_pack.f7eqHh/_old  2026-11-20 14:49:52.512376746 +0100
+++ /var/tmp/diff_new_pack.f7eqHh/_new  2026-11-20 14:49:52.513376788 +0100
@@ -17,25 +17,30 @@
 
 
 Name:           python-gfloat
-Version:        0.4
+Version:        0.5
 Release:        0
 Summary:        Generic floating point handling in Python
 License:        MIT
 URL:            https://github.com/graphcore-research/gfloat
 Source:         
https://files.pythonhosted.org/packages/source/g/gfloat/gfloat-%{version}.tar.gz
 Patch1:         no-nbval.patch
-BuildRequires:  %{python_module ml-dtypes}
+# PATCH-FIX-UPSTREAM gh#graphcore-research#64
+Patch2:         fix-signed-zero-overflow.patch
 BuildRequires:  %{python_module pip}
-BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools_scm}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module wheel}
 BuildRequires:  python-rpm-macros
 # SECTION test requirements
 BuildRequires:  %{python_module more-itertools}
+BuildRequires:  %{python_module array-api-compat}
+BuildRequires:  %{python_module array-api-strict}
+BuildRequires:  %{python_module ml-dtypes}
 BuildRequires:  %{python_module numpy}
+BuildRequires:  %{python_module pytest}
 # /SECTION
 BuildRequires:  fdupes
+Requires:       python-array-api-compat
 Requires:       python-more-itertools
 Requires:       python-numpy
 BuildArch:      noarch
@@ -56,7 +61,7 @@
 
 %check
 # reduce dependencies
-rm -v test/test_jax.py test/test_microxcaling.py
+rm -v test/test_jax.py test/test_microxcaling.py test/test_torch.py
 %pytest
 
 %files %{python_files}

++++++ fix-signed-zero-overflow.patch ++++++
>From 575ceff2babe3e54795ec4ce441ec8e981462f9b Mon Sep 17 00:00:00 2001
From: Andrew Fitzgibbon <[email protected]>
Date: Fri, 18 Sep 2026 15:58:51 +0100
Subject: [PATCH] Fix binary64 ndarray encoding overflow for signed zero

---
 src/gfloat/encode_ndarray.py |  5 ++++-
 test/test_encode.py          | 17 +++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/gfloat/encode_ndarray.py b/src/gfloat/encode_ndarray.py
index af883e4..3d5981c 100644
--- a/src/gfloat/encode_ndarray.py
+++ b/src/gfloat/encode_ndarray.py
@@ -51,7 +51,10 @@ def encode_ndarray(fi: FormatInfo, v: npt.NDArray) -> 
npt.NDArray:
 
     if fi.has_zero:
         if fi.has_nz:
-            code[v == 0] = np.where(sign[v == 0], fi.code_of_negzero, 
fi.code_of_zero)
+            # binary64's negative-zero code exceeds the signed int64 range.
+            code[v == 0] = np.where(
+                sign[v == 0], np.uint64(fi.code_of_negzero), 
np.uint64(fi.code_of_zero)
+            )
         else:
             code[v == 0] = fi.code_of_zero
 
diff --git a/test/test_encode.py b/test/test_encode.py
index efdaa1f..8ab344f 100644
--- a/test/test_encode.py
+++ b/test/test_encode.py
@@ -62,3 +62,20 @@ def test_encode_edges(fi: FormatInfo, enc: Callable) -> None:
             if fi.domain == Domain.Extended
             else fi.code_of_nan if fi.num_nans > 0 else fi.code_of_min
         )
+
+
[email protected](
+    "values",
+    [
+        [0.0, -0.0],
+        [[-0.0, 0.0], [1.0, -1.0]],
+        [1.0, -1.0],  # The zero selection is empty, as in issue #63.
+        [],
+    ],
+)
+def test_encode_binary64_signed_zero(values: npt.ArrayLike) -> None:
+    v = np.array(values, dtype=np.float64)
+    codes = encode_ndarray(format_info_binary64, v)
+    assert codes.dtype == np.dtype(np.uint64)
+    assert codes.shape == v.shape
+    np.testing.assert_array_equal(codes, v.view(np.uint64))

++++++ gfloat-0.4.tar.gz -> gfloat-0.5.tar.gz ++++++
++++ 19830 lines of diff (skipped)

Reply via email to