public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Antonio Trande <sagitter@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/avogadro2-libs] f45: Release 2.1.0
Date: Thu, 12 Nov 2026 10:09:32 GMT [thread overview]
Message-ID: <179447817215.1.7169758503835575510.rpms-avogadro2-libs-4d715cc02d37@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/avogadro2-libs
Branch : f45
Commit : 4d715cc02d375b387df405090bea19e8ee631ccf
Author : Antonio Trande <sagitter@fedoraproject.org>
Date : 2026-11-11T20:32:55+01:00
Stats : +310/-7 in 4 file(s)
URL : https://src.fedoraproject.org/rpms/avogadro2-libs/c/4d715cc02d375b387df405090bea19e8ee631ccf?branch=f45
Log:
Release 2.1.0
---
diff --git a/.gitignore b/.gitignore
index a85ef90..4102530 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,3 +45,9 @@
/crystals-2.0.0.tar.gz
/fragments-2.0.0.tar.gz
/molecules-2.0.0.tar.gz
+/avogadrodata-2.1.0.tar.gz
+/avogadrolibs-2.1.0.tar.gz
+/avogenerators-2.1.0.tar.gz
+/crystals-2.1.0.tar.gz
+/fragments-2.1.0.tar.gz
+/molecules-2.1.0.tar.gz
diff --git a/avogadro2-libs-bug3287.patch b/avogadro2-libs-bug3287.patch
new file mode 100644
index 0000000..38902d0
--- /dev/null
+++ b/avogadro2-libs-bug3287.patch
@@ -0,0 +1,294 @@
+From 323a7132dcafbe815b588fd34960caf83fa1e8a7 Mon Sep 17 00:00:00 2001
+From: Geoff Hutchison <geoff.hutchison@gmail.com>
+Date: Thu, 5 Nov 2026 20:23:25 -0500
+Subject: [PATCH] Fix struct byte order and FD tolerance on big-endian hosts
+
+thirdparty/struct chose the byte layout by comparing the requested order
+to the host's, so on big-endian hosts '>' data was decoded little-endian
+and TRR files were misread; the layout now follows the requested order.
+The edge-case gradient tests now allow for finite-difference roundoff,
+which for the large LJ energies exceeded the fixed 1e-3 floor.
+
+Fixes #3287
+
+Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
+---
+ tests/calc/forcefieldedgecasetest.cpp | 19 ++++++++++++++++---
+ thirdparty/struct/struct.c | 20 +++++++++++---------
+ 2 files changed, 27 insertions(+), 12 deletions(-)
+
+diff --git a/tests/calc/forcefieldedgecasetest.cpp b/tests/calc/forcefieldedgecasetest.cpp
+index 4797f03f0be..3b5b4f3c997 100644
+--- a/tests/calc/forcefieldedgecasetest.cpp
++++ b/tests/calc/forcefieldedgecasetest.cpp
+@@ -14,6 +14,7 @@
+ #include <avogadro/core/molecule.h>
+ #include <avogadro/core/unitcell.h>
+
++#include <algorithm>
+ #include <cmath>
+ #include <limits>
+ #include <memory>
+@@ -49,12 +50,14 @@ void expectAllFinite(const Eigen::VectorXd& v, const char* what)
+ << what << " component " << i << " is not finite: " << v[i];
+ }
+
++constexpr Real finiteDifferenceStep = 1e-6;
++
+ // Central finite-difference gradient, independent of
+ // EnergyCalculator::finiteGradient(), for cross-checking analytic gradients
+ // on smooth geometries.
+ Eigen::VectorXd centralDifferenceGradient(EnergyCalculator& calc,
+ const Eigen::VectorXd& x,
+- Real h = 1e-6)
++ Real h = finiteDifferenceStep)
+ {
+ Eigen::VectorXd grad = Eigen::VectorXd::Zero(x.size());
+ for (Eigen::Index i = 0; i < x.size(); ++i) {
+@@ -67,6 +70,16 @@ Eigen::VectorXd centralDifferenceGradient(EnergyCalculator& calc,
+ return grad;
+ }
+
++// Tolerance for comparing an analytic gradient component against
++// centralDifferenceGradient(). Besides the relative error, allow for
++// roundoff in E(x+h) - E(x-h): a few ULPs of a large energy, divided by 2h.
++Real gradientTolerance(Real analytic, Real energy)
++{
++ const Real roundoff = 8.0 * std::numeric_limits<Real>::epsilon() *
++ std::fabs(energy) / (2.0 * finiteDifferenceStep);
++ return std::max(1e-3, 0.05 * std::fabs(analytic)) + roundoff;
++}
++
+ } // namespace
+
+ class ForceFieldEdgeCaseTest : public ::testing::TestWithParam<CalculatorKind>
+@@ -255,7 +268,7 @@ TEST_P(ForceFieldEdgeCaseTest, PlanarFormaldehydeZeroOutOfPlane)
+ const Eigen::VectorXd numeric = centralDifferenceGradient(*calc, x);
+ for (Eigen::Index i = 0; i < x.size(); ++i) {
+ EXPECT_NEAR(analytic[i], numeric[i],
+- std::max(1e-3, 0.05 * std::fabs(analytic[i])));
++ gradientTolerance(analytic[i], energy));
+ }
+ }
+
+@@ -300,7 +313,7 @@ TEST_P(ForceFieldEdgeCaseTest, PlanarEthyleneZeroOutOfPlane)
+ const Eigen::VectorXd numeric = centralDifferenceGradient(*calc, x);
+ for (Eigen::Index i = 0; i < x.size(); ++i) {
+ EXPECT_NEAR(analytic[i], numeric[i],
+- std::max(1e-3, 0.05 * std::fabs(analytic[i])));
++ gradientTolerance(analytic[i], energy));
+ }
+ }
+
+diff --git a/thirdparty/struct/struct.c b/thirdparty/struct/struct.c
+index 01f54f3f403..af16bcd1bb8 100644
+--- a/thirdparty/struct/struct.c
++++ b/thirdparty/struct/struct.c
+@@ -120,9 +120,11 @@ static long double unpack_ieee754(unsigned long long int i, unsigned int bits,
+ return result;
+ }
+
++// The byte layout follows the requested order, not the host's (comparing
++// against myendian broke big-endian hosts).
+ static void pack_int16_t(unsigned char** bp, uint16_t val, int endian)
+ {
+- if (endian == myendian) {
++ if (endian == STRUCT_ENDIAN_LITTLE) {
+ *((*bp)++) = val;
+ *((*bp)++) = val >> 8;
+ } else {
+@@ -133,7 +135,7 @@ static void pack_int16_t(unsigned char** bp, uint16_t val, int endian)
+
+ static void pack_int32_t(unsigned char** bp, uint32_t val, int endian)
+ {
+- if (endian == myendian) {
++ if (endian == STRUCT_ENDIAN_LITTLE) {
+ *((*bp)++) = val;
+ *((*bp)++) = val >> 8;
+ *((*bp)++) = val >> 16;
+@@ -148,7 +150,7 @@ static void pack_int32_t(unsigned char** bp, uint32_t val, int endian)
+
+ static void pack_int64_t(unsigned char** bp, uint64_t val, int endian)
+ {
+- if (endian == myendian) {
++ if (endian == STRUCT_ENDIAN_LITTLE) {
+ *((*bp)++) = val;
+ *((*bp)++) = val >> 8;
+ *((*bp)++) = val >> 16;
+@@ -184,7 +186,7 @@ static void pack_double(unsigned char** bp, double val, int endian)
+ static void unpack_int16_t(const unsigned char** bp, int16_t* dst, int endian)
+ {
+ uint16_t val;
+- if (endian == myendian) {
++ if (endian == STRUCT_ENDIAN_LITTLE) {
+ val = *((*bp)++);
+ val |= (uint16_t)(*((*bp)++)) << 8;
+ } else {
+@@ -200,7 +202,7 @@ static void unpack_int16_t(const unsigned char** bp, int16_t* dst, int endian)
+
+ static void unpack_uint16_t(const unsigned char** bp, uint16_t* dst, int endian)
+ {
+- if (endian == myendian) {
++ if (endian == STRUCT_ENDIAN_LITTLE) {
+ *dst = *((*bp)++);
+ *dst |= (uint16_t)(*((*bp)++)) << 8;
+ } else {
+@@ -212,7 +214,7 @@ static void unpack_uint16_t(const unsigned char** bp, uint16_t* dst, int endian)
+ static void unpack_int32_t(const unsigned char** bp, int32_t* dst, int endian)
+ {
+ uint32_t val;
+- if (endian == myendian) {
++ if (endian == STRUCT_ENDIAN_LITTLE) {
+ val = *((*bp)++);
+ val |= (uint32_t)(*((*bp)++)) << 8;
+ val |= (uint32_t)(*((*bp)++)) << 16;
+@@ -232,7 +234,7 @@ static void unpack_int32_t(const unsigned char** bp, int32_t* dst, int endian)
+
+ static void unpack_uint32_t(const unsigned char** bp, uint32_t* dst, int endian)
+ {
+- if (endian == myendian) {
++ if (endian == STRUCT_ENDIAN_LITTLE) {
+ *dst = *((*bp)++);
+ *dst |= (uint32_t)(*((*bp)++)) << 8;
+ *dst |= (uint32_t)(*((*bp)++)) << 16;
+@@ -248,7 +250,7 @@ static void unpack_uint32_t(const unsigned char** bp, uint32_t* dst, int endian)
+ static void unpack_int64_t(const unsigned char** bp, int64_t* dst, int endian)
+ {
+ uint64_t val;
+- if (endian == myendian) {
++ if (endian == STRUCT_ENDIAN_LITTLE) {
+ val = *((*bp)++);
+ val |= (uint64_t)(*((*bp)++)) << 8;
+ val |= (uint64_t)(*((*bp)++)) << 16;
+@@ -276,7 +278,7 @@ static void unpack_int64_t(const unsigned char** bp, int64_t* dst, int endian)
+
+ static void unpack_uint64_t(const unsigned char** bp, uint64_t* dst, int endian)
+ {
+- if (endian == myendian) {
++ if (endian == STRUCT_ENDIAN_LITTLE) {
+ *dst = *((*bp)++);
+ *dst |= (uint64_t)(*((*bp)++)) << 8;
+ *dst |= (uint64_t)(*((*bp)++)) << 16;
+From ec90f0319a0ffec57d19d24b425904b6ed40a333 Mon Sep 17 00:00:00 2001
+From: Geoff Hutchison <geoff.hutchison@gmail.com>
+Date: Sun, 8 Nov 2026 10:44:59 -0500
+Subject: [PATCH] Decode DCD test record markers as little-endian
+
+byteSwapDcd read Fortran record markers with a host-order memcpy, so on
+big-endian hosts (s390x) the length was byte-swapped and the swap loops ran
+far past the string, segfaulting DcdTest.villinByteSwapped. Decode with
+unpackInt32 and bound-check the length.
+
+Thanks to Claude Opus 5.5 for helping with the debugging
+
+Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
+---
+ tests/io/dcdtest.cpp | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/tests/io/dcdtest.cpp b/tests/io/dcdtest.cpp
+index 35b02e3a6c0..ddb400d26b0 100644
+--- a/tests/io/dcdtest.cpp
++++ b/tests/io/dcdtest.cpp
+@@ -9,6 +9,7 @@
+
+ #include <avogadro/core/molecule.h>
+ #include <avogadro/core/unitcell.h>
++#include <avogadro/core/utilities.h>
+ #include <avogadro/core/vector.h>
+ #include <avogadro/io/dcdformat.h>
+
+@@ -295,16 +296,20 @@ std::string byteSwapDcd(const std::string& in)
+ size_t pos = 0;
+ int record = 0;
+ while (pos + 4 <= s.size()) {
+- uint32_t len;
+- std::memcpy(&len, s.data() + pos, 4); // little-endian host assumed
+- swapBytes(s, pos, 4);
++ // The input is little-endian; decode independent of the host.
++ const size_t len = static_cast<uint32_t>(Avogadro::Core::unpackInt32(
++ s.data() + pos, Avogadro::Core::ByteOrder::LittleEndian));
+ size_t payload = pos + 4;
++ // A bad length must never index past the string.
++ if (len > s.size() || payload + len + 4 > s.size())
++ break;
++ swapBytes(s, pos, 4);
+ size_t width = 4;
+ size_t first = payload;
+ size_t count;
+ if (record == 0) {
+ first = payload + 4; // skip "CORD"
+- count = (len - 4) / 4;
++ count = len >= 4 ? (len - 4) / 4 : 0;
+ } else if (record == 1) {
+ count = 1; // NTITLE; the rest is text
+ } else if (len == 48) {
+From 57e19cef6e2581dc99daadbfc932146f8f128850 Mon Sep 17 00:00:00 2001
+From: Geoff Hutchison <geoff.hutchison@gmail.com>
+Date: Tue, 10 Nov 2026 19:32:06 -0500
+Subject: [PATCH] Fix race in threaded BackgroundFileFormat test
+
+QSignalSpy::wait() only counts emissions that arrive while it waits,
+so if the worker emitted finished() before the main thread reached
+wait(), the test timed out. Wait on a queued connection instead, which
+delivers an early emission once the event loop runs.
+
+Fixes #3321
+
+Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
+---
+ tests/qtgui/backgroundfileformattest.cpp | 27 +++++++++++++++++++-----
+ 1 file changed, 22 insertions(+), 5 deletions(-)
+
+diff --git a/tests/qtgui/backgroundfileformattest.cpp b/tests/qtgui/backgroundfileformattest.cpp
+index 7a27069a721..25b6379d104 100644
+--- a/tests/qtgui/backgroundfileformattest.cpp
++++ b/tests/qtgui/backgroundfileformattest.cpp
+@@ -10,10 +10,12 @@
+ #include <avogadro/qtgui/backgroundfileformat.h>
+
+ #include <QCoreApplication>
++#include <QEventLoop>
+ #include <QFile>
+ #include <QSignalSpy>
+ #include <QTemporaryDir>
+ #include <QThread>
++#include <QTimer>
+
+ using Avogadro::Core::Molecule;
+ using Avogadro::Io::XyzFormat;
+@@ -213,14 +215,29 @@ TEST_F(BackgroundFileFormatTest, Read_OnWorkerThread_ViaQueuedInvoke)
+ QObject::connect(thread, &QThread::finished, bff, &QObject::deleteLater);
+ thread->start();
+
+- QSignalSpy finishedSpy(bff, &BackgroundFileFormat::finished);
++ // read() runs as soon as the worker picks up the queued call, so finished()
++ // may be emitted before this thread starts waiting. A queued connection to
++ // a receiver on this thread turns the emission into a posted event, which
++ // is delivered once the loop below runs, however early it was emitted.
++ // (QSignalSpy::wait() only counts emissions that arrive during the wait.)
++ QEventLoop loop;
++ bool finished = false;
++ QObject::connect(
++ bff, &BackgroundFileFormat::finished, &loop,
++ [&]() {
++ finished = true;
++ loop.quit();
++ },
++ Qt::QueuedConnection);
++ QTimer::singleShot(5000, &loop, &QEventLoop::quit);
++
+ QMetaObject::invokeMethod(bff, "read", Qt::QueuedConnection);
++ loop.exec();
+
+- ASSERT_TRUE(finishedSpy.wait(5000));
++ ASSERT_TRUE(finished);
+
+- // The worker thread has returned to its event loop by the time the queued
+- // finished() signal is delivered here, so reading bff's state from the
+- // main thread is safe.
++ // read() sets its results before emitting finished(), and the queued
++ // delivery orders those writes before this thread's reads below.
+ EXPECT_TRUE(bff->success());
+ EXPECT_EQ(mol.atomCount(), 2u);
+
diff --git a/avogadro2-libs.spec b/avogadro2-libs.spec
index daa7916..1ddf331 100644
--- a/avogadro2-libs.spec
+++ b/avogadro2-libs.spec
@@ -1,7 +1,7 @@
%bcond check 1
Name: avogadro2-libs
-Version: 2.0.0
+Version: 2.1.0
Release: %autorelease
Summary: Avogadro2 libraries
@@ -20,6 +20,9 @@ Source5: https://github.com/OpenChemistry/avogadrodata/archive/refs/tags/%{versi
# Do not download "fragments" files
Patch0: avogadro2-libs-avoid_downloading.patch
+# https://github.com/OpenChemistry/avogadrolibs/issues/3287
+Patch1: avogadro2-libs-bug3287.patch
+
BuildRequires: boost-devel
BuildRequires: python3-devel
BuildRequires: python3-pybind11
diff --git a/sources b/sources
index dc67e62..1357638 100644
--- a/sources
+++ b/sources
@@ -1,6 +1,6 @@
-SHA512 (avogadrodata-2.0.0.tar.gz) = 248d17e711f992de8548ed41d4fa982d3ab67fc3a95571423a1368acf68c20049af27de7ba7ce040a319b6cf82d8aaa8673291b455c73d7341cda763123312a5
-SHA512 (avogadrolibs-2.0.0.tar.gz) = 622ccc67362ec3f6fb51ce36f12503e338757102c07c0306516b6995c28ab08ebf7b79d4f4e9a6813f65254034f0dafab626437141d0532ed6366997b603756e
-SHA512 (avogenerators-2.0.0.tar.gz) = b261b07fa32fc56e570335e2cef16d531caa7efe86b6653ae831cefeb66ce0523818df1145bbfc811c4f241384843bbf56bb43ecfd8e31b0ea3bf929972d8730
-SHA512 (crystals-2.0.0.tar.gz) = 9565c9bf13863b14705bbc556b480df82aa4284817b8cf4443e62c49d65c5b52e9fe456c246ceb39d027cf3badcc31a4a57598dce4ce1d4f8a14f94fb3264553
-SHA512 (fragments-2.0.0.tar.gz) = 5b53b01661fb79b8cdd9b9a49cefacdfae1ef84de44a7a011782091528bad631da1a582787ca65c35b15aeaf782014025c9e16c9a9238eb1626fb29e6b8d1f9b
-SHA512 (molecules-2.0.0.tar.gz) = 885b682e1e61e4358c65e945c9feb6d9154b1a044c85f0d89242ea54b509fb20610fcd645ccb9803ce5f01cbdbcccfbcf55fd20445381404705e633de73e31b8
+SHA512 (avogadrodata-2.1.0.tar.gz) = 424ef715757d386d2d770268f95f425fc0152b6cf40a296331c5a3cc39c8b06ba892688b2e3f870ba4cb9a8b2b6c6365e6cb5c2160e564047b73f2ecd1e5016b
+SHA512 (avogadrolibs-2.1.0.tar.gz) = 202ae3d423924bdcbb5437f95c17c14b9b9488595052e5a4f078528dc1dc5cce1e79dea28449ea135dd91e8f804f4727abcec7c1ceb8e7378795a3c2335cf980
+SHA512 (avogenerators-2.1.0.tar.gz) = c11ae302b834d75237898734bdd69c0297fe18a4017ad61cf46cde4b65dd9b0d9a946d42d13e8c7be614b57b37e53ef531f5e24467dc410d3a7de2adf2fbdf8a
+SHA512 (crystals-2.1.0.tar.gz) = 7f6b444443dc3f24f60a4f32d67c4c81262d5f9ba3798d9928da8669a15aed7adfdae881667712675122b3e8395dfb0471133b14dfb74da1a78d2761ebb7fc61
+SHA512 (fragments-2.1.0.tar.gz) = fd0dc5262659954646db7a07a881eca094b3da238108093b81dcf390c6f793a16c78ab508eaf6e555b0722db21defe6eaead20ef0d3c8f0f33eb8b620f4b9def
+SHA512 (molecules-2.1.0.tar.gz) = 4ebac3d48839bee69c5cf811f7c9bce1adc96a24d8a80905afb58fcc1711275d2a97ff98adbd75a2394ce9c11a09fa8520b4e3cc35ea94a5433befaf5d8b036b
reply other threads:[~2026-11-12 10:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179447817215.1.7169758503835575510.rpms-avogadro2-libs-4d715cc02d37@fedoraproject.org \
--to=sagitter@fedoraproject.org \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox