CI: make-sqlite3 fails on ubuntu-latest
Maintainers usually reply within 11 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start by reading .github/workflows/sqlite3.yml and the make-sqlite3 job; the issue provides a reproduction in libsql-sqlite3 using testfixture and test/libsql_vector.test. Pin the job to ubuntu-24.04 as described, then confirm the workflow configuration reflects that runner. The issue notes this workflow only runs when libsql-sqlite3/** changes, so the isolated workflow edit will not trigger it.
Written by the indexing model from the issue text.
Description
Current origin/main has a bug.
The make-sqlite3 job ("Makefile CI with Wasm enabled", .github/workflows/sqlite3.yml) fails on current ubuntu-latest runners, which now resolve to Ubuntu 26.04.
One test out of 330,804 fails: vector-1-conversion-f8 in test/libsql_vector.test.
Note:
This is a different job and a different cause from #2315 / #2317, and #2317 does not cover it.
- Last green run, on ubuntu-24.04:
42522832842 - Failing run, on ubuntu-26.04 (image
20261111.196.1):43845107230
Symptom
One element prints as 1.63294 where 1.63295 is expected. In the same test one more value prints as 10.19 instead of 10.1899, and the f32/f64 hex of the converted vectors differs in the last bits.
Cause
The 26.04 runner image installs Ubuntu's amd64v3 packages (the job log shows tcl8.6-dev_..._amd64v3.deb). The gcc of that variant defaults to -march=x86-64-v3, which enables FMA. testfixture is built with plain gcc -g -O2, and gcc's default is -ffp-contract=fast, so this expression in vectorConvertFromF8() (libsql-sqlite3/src/vector.c) is compiled to one fused multiply-add:
dstF32[i] = alpha * src[i] + shift;
A fused multiply-add rounds once instead of twice, so the result differs in the last bit and the test's printed values change. The f8 blob itself is the same either way. Only the values decoded from it differ. Wasm and gcc 15 as such are not the cause.
How to reproduce
On any x86-64 machine with FMA, no container needed:
cd libsql-sqlite3 && mkdir bld && cd bld
CFLAGS="-g -O2 -march=x86-64-v3" ../configure && make testfixture
./testfixture ../test/libsql_vector.test # vector-1-conversion-f8 fails
With CFLAGS="-g -O2 -march=x86-64-v3 -ffp-contract=off" the test passes.
What I checked:
- In an
ubuntu:26.04container withAPT::Architecture-Variants "amd64v3", gcc 15.2.0 reports-march=x86-64-v3and defines__FMA__. The stockubuntu:26.04gcc reports-march=x86-64. - A
testfixturebuilt in that container with the default./configurefailsvector-1-conversion-f8, and its "got" output is byte-identical to the one in the CI log. - On my machine
-march=x86-64-v3gives the same output, and adding-ffp-contract=offmakes the test pass. - In an
ubuntu:24.04container (gcc 13.3,-march=x86-64) the test passes.
Not checked: I did not inspect the gcc on the runner itself, only that its apt installs amd64v3 packages. I ran only libsql_vector.test, not the full make test, and without --enable-wasm-runtime-dynamic.
Fix to unblock CI
Pin the job to ubuntu-24.04, the same approach as #2317. It could go into #2317 or be a PR of its own:
--- a/.github/workflows/sqlite3.yml
+++ b/.github/workflows/sqlite3.yml
@@ -19,7 +19,10 @@ concurrency:
jobs:
make-sqlite3:
- runs-on: ubuntu-latest
+ # The ubuntu-26.04 image uses amd64v3 packages, whose gcc defaults to
+ # -march=x86-64-v3. The resulting FMA contraction changes the floats
+ # expected by vector-1-conversion-f8 in test/libsql_vector.test.
+ runs-on: ubuntu-24.04
defaults:
run:
working-directory: libsql-sqlite3
Note that this workflow only runs when libsql-sqlite3/** changes, so a PR with only this change will not run it.
Longer-term options
The pin hides the fact that the result of vector_extract() on an f8 vector depends on the compiler's target flags. Anyone who builds libSQL with -march=x86-64-v3, -march=native, or on a distribution whose gcc defaults to it gets the other rounding. Options, for the maintainers to choose:
- Build with
-ffp-contract=off. That keeps today's output everywhere, but only for builds that use the flag. - Make the code independent of contraction. gcc ignores
#pragma STDC FP_CONTRACT, so that means something like storing the product in avolatiletemporary before the addition. It costs some speed, and the bundled amalgamations need regenerating. - Make the test tolerant of the last bit (round the printed values, drop the hex comparison).
- Dominant language
- C
- Stars
- 17.3k
- Forks
- 562
- Avg merge
- 10d 15h
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tursodatabase/libsql
-
`cloudflare` feature: hrana streams are never closedPossibly taken @pcbeingused333 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
tursodatabase/libsql#2312 ·
Maintainers usually reply within 11 days
-
bottomless: finished S3 upload tasks are never reaped, so sqld memory grows by ~10 KB per WAL batchPossibly taken @pavanmanishd claimed this 24 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
tursodatabase/libsql#2298 · 1 comment ·
Maintainers usually reply within 11 days
-
Rust local Row::get_value truncates embedded NUL TEXT and panics on malformed UTF-8 (0.9.30)Possibly taken @Sanjays2402 claimed this 35 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tursodatabase/libsql#2285 ·
Maintainers usually reply within 11 days
-
libsql-ffi: broken builds under Nix on macOSPossibly taken @frectonz claimed this 85 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
tursodatabase/libsql#2275 ·
Maintainers usually reply within 11 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
tursodatabase/libsql#2226 ·
Maintainers usually reply within 11 days
All issues in tursodatabase/libsql
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
libretro/parallel-n64#858 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Mbed-TLS/TF-PSA-Crypto#984 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day