Skip to content

[0.8] MOD-14130 Fix build failures on focal cross-compilation and x86 with old binutils - #1126

Merged
raz-mon merged 4 commits into
0.8from
backport-912-to-0.8
Nov 17, 2026
Merged

raz-mon merged 4 commits into
0.8from
backport-912-to-0.8

Conversation

@raz-mon

@raz-mon raz-mon commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Backport of #912 to 0.8 (hand-ported; the original does not cherry-pick cleanly).

Why now: RediSearchEnterprise snapshot builds for RSE 2.10 fail on the Ubuntu Focal x86_64 job (Build + Pack (RoR)) with Error: no such instruction: vfmadd231ph .... The job builds with a newer GCC inside the focal container, whose binutils is 2.34. GCC accepts -mavx512fp16, so CMake enables the FP16 kernels, but the assembler cannot emit them. RediSearch 2.10 pins VecSim 0.8, so the fix must land here before the Search pin can be bumped.

What changes: the hardcoded Ubuntu 18.04 check in cmake/x86_64InstructionFlags.cmake is replaced by a binutils version check (CXX_AVX512BF16 off below 2.34, CXX_AVX512FP16 off below 2.38); src/VecSim/spaces/CMakeLists.txt gates on CMAKE_SYSTEM_PROCESSOR instead of the host's.

Adapted for 0.8: the guard lives one level deeper in the flags file (inside the x86 if), so the hunk was re-indented. The SVE benchmark hunk is dropped because bm_spaces_int8.cpp / bm_spaces_uint8.cpp do not exist on this branch.

Validation: ran the cmake flags file under cmake -P with a stubbed compiler check and a fake as reporting a chosen version. FP16 and BF16 both off at 2.30; FP16 off, BF16 on at 2.34; both on at 2.38 and 2.42.

Follow-up: bump deps/VectorSimilarity on RediSearch 2.10, then RSE 2.10 picks it up via the daily bump.

CI note: GitHub moved ubuntu-latest to Ubuntu 26.04 (GCC 15, binutils 2.44, clang-format 18) and this branch's PR CI had not run on it before. The PR therefore also carries two CI-only cherry-picks from main, both unrelated to the binutils change:

🤖 Generated with Claude Code

… with old binutils (#912)

Backport of #912 to 0.8. The binutils check replaces the Ubuntu 18.04
special case: GCC accepts -mavx512fp16 while focal's binutils 2.34 cannot
assemble the FP16 instructions, so CXX_AVX512FP16 is turned off below
binutils 2.38 and CXX_AVX512BF16 below 2.34. Spaces are gated on the target
architecture (CMAKE_SYSTEM_PROCESSOR) rather than the host's.

Adapted by hand: the guard sits one level deeper on this branch, and the
SVE benchmark fix does not apply because the INT8/UINT8 space benchmarks
do not exist here.

(cherry picked from commit e5784b1)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@raz-mon
raz-mon requested a review from GuyAv46 November 16, 2026 17:09
@CLAassistant

CLAassistant commented Nov 16, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.16%. Comparing base (940d4a6) to head (1f09c3a).

Additional details and impacted files
@@           Coverage Diff           @@
##              0.8    #1126   +/-   ##
=======================================
  Coverage   97.16%   97.16%           
=======================================
  Files          91       91           
  Lines        4896     4896           
=======================================
  Hits         4757     4757           
  Misses        139      139           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add Ubuntu 26.04 install script for the new ubuntu-latest runner

GitHub's ubuntu-latest image moved to Ubuntu 26.04, and install_script.sh
failed with "ubuntu_26.04.sh: No such file or directory".

apt.llvm.org has no LLVM 18 repo for 26.04 (resolute), so install
clang-format-18 from the Ubuntu archive and point the unversioned
clang-format used by check-format.sh at it.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 4d9e4d2)
@raz-mon

raz-mon commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

CI status: basic tests and sanitizer were failing in the install step because ubuntu-latest is now Ubuntu 26.04 and this branch had no .install/ubuntu_26.04.sh (same failure that hit #1117 on 8.8). Pushed a cherry-pick of 4d9e4d2 from main, which adds that installer; CI is re-running. The binutils change itself is unaffected.

gdesmott and others added 2 commits November 17, 2026 09:48
Fix std::vector::swap assertion failure with GCC 15

GCC 15 (Fedora 43) auto-enables _GLIBCXX_ASSERTIONS in unoptimized
builds (-O0). This activates a runtime check in std::vector::swap
(stl_vector.h:1847) that requires either propagate_on_container_swap
to be true_type, or the two allocators to compare equal.

TieredHNSW_BatchIterator::getNextResults swaps result vectors across
allocator boundaries: flat_results (management-layer allocator) is
swapped with the VecSimQueryReply returned by the frontend BF index
(frontend allocator), and similarly for hnsw_results. These allocators
are distinct VecSimAllocator instances, so operator== returns false,
triggering __glibcxx_assert_fail -> abort().

Adding propagate_on_container_swap = true_type to VecsimSTLAllocator
is safe because all VecSimAllocator instances use the same underlying
allocation functions — they differ only in memory-tracking bookkeeping,
not in actual alloc/free behavior.

(cherry picked from commit 5bcc53e)
ubuntu-latest now runs Ubuntu 26.04, whose archive ships clang-format 18, and
it wants a space before the empty constructor body in three places.
@raz-mon

raz-mon commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

After the installer fix, two more pre-existing failures surfaced on the 26.04 image, both unrelated to the binutils change: the sanitizer run aborts in std::vector::swap (GCC 15 enables _GLIBCXX_ASSERTIONS), fixed by cherry-picking 5bcc53e (MOD-14977, #938); and clang-format 18 flags three ){}; constructors in files this PR did not otherwise touch, fixed in 1f09c3a. CI re-running.

@raz-mon
raz-mon enabled auto-merge November 17, 2026 12:21
@raz-mon
raz-mon disabled auto-merge November 17, 2026 12:26
@raz-mon
raz-mon added this pull request to the merge queue Nov 17, 2026
Merged via the queue into 0.8 with commit d08670a Nov 17, 2026
16 checks passed
@raz-mon
raz-mon deleted the backport-912-to-0.8 branch November 17, 2026 12:34
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

Successfully merging this pull request may close these issues.

5 participants