Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ jobs:
# pinned toolchain too (dtolnay installs for `stable`, which may differ).
- run: rustup target add aarch64-unknown-linux-gnu
- name: install aarch64 cross toolchain + qemu-user
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user-static
run: scripts/install-qemu-user.sh gcc-aarch64-linux-gnu
- name: NEON SIMD parity (cross-build + qemu run)
run: ./scripts/neon-parity.sh

Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/simd-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ jobs:
with:
key: cpu-guard-library
- name: install qemu-user
run: sudo apt-get update && sudo apt-get install -y qemu-user-static
run: scripts/install-qemu-user.sh
- name: library warns, executable exits 132 (qemu -cpu Haswell)
run: bash scripts/cpu-guard-library-probe.sh

Expand All @@ -250,7 +250,12 @@ jobs:
# AVX2 for this target, so any `vp*` on a ymm register other than the
# AVX1 `vptest` came from an intrinsic that escaped its gate), and the
# SIMD unit tests under emulation.
runs-on: ubuntu-latest
# Pinned to 24.04: the ubuntu-latest image (Ubuntu 26.04, amd64v3) ships a
# glibc built for x86-64-v3, so no host-linked binary starts on an emulated
# pre-AVX2 CPU ("Fatal glibc error: CPU does not support x86-64-v3"). This
# arm's whole point is running on such a CPU. Move it off 24.04 only with a
# static (musl) build of both binaries it runs.
runs-on: ubuntu-24.04
name: realization/avx × x86_64
steps:
- uses: actions/checkout@v4
Expand All @@ -261,7 +266,7 @@ jobs:
with:
key: avx
- name: install qemu-user
run: sudo apt-get update && sudo apt-get install -y qemu-user-static
run: scripts/install-qemu-user.sh
- name: masking parity (sandybridge build, qemu -cpu SandyBridge)
run: bash scripts/masking-parity.sh avx-qemu
- name: no AVX2 instruction in the parity binary
Expand Down Expand Up @@ -295,7 +300,12 @@ jobs:
# Nehalem`, so any AVX instruction on the executed path faults. Three
# rungs, as for `avx`: parity, an assembly witness that the parity binary
# has no AVX encoding at all, and the SIMD unit tests under emulation.
runs-on: ubuntu-latest
# Pinned to 24.04: the ubuntu-latest image (Ubuntu 26.04, amd64v3) ships a
# glibc built for x86-64-v3, so no host-linked binary starts on an emulated
# pre-AVX2 CPU ("Fatal glibc error: CPU does not support x86-64-v3"). This
# arm's whole point is running on such a CPU. Move it off 24.04 only with a
# static (musl) build of both binaries it runs.
runs-on: ubuntu-24.04
name: realization/v2 × x86_64
steps:
- uses: actions/checkout@v4
Expand All @@ -306,7 +316,7 @@ jobs:
with:
key: v2
- name: install qemu-user
run: sudo apt-get update && sudo apt-get install -y qemu-user-static
run: scripts/install-qemu-user.sh
- name: masking parity (x86-64-v2 build, qemu -cpu Nehalem)
run: bash scripts/masking-parity.sh v2-qemu
- name: no AVX instruction in the parity binary
Expand Down Expand Up @@ -349,7 +359,7 @@ jobs:
with:
key: aarch64
- name: install aarch64 cross toolchain + qemu-user
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user-static
run: scripts/install-qemu-user.sh gcc-aarch64-linux-gnu
- name: masking parity (neon, qemu)
run: bash scripts/masking-parity.sh neon-qemu
- name: codegen witness (neon)
Expand Down
21 changes: 15 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,23 @@ available here" and is in fact a **missing linker**, then a missing
interpreter, in two separate steps:

```sh
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user-static
scripts/install-qemu-user.sh gcc-aarch64-linux-gnu
```

`qemu-user` alone is NOT enough: the script invokes `qemu-aarch64-static`,
and the dynamic `qemu-aarch64` from `qemu-user` leaves a second, differently
worded failure (`command not found`) that looks like a fresh problem rather
than the same one. Install `qemu-user-static`.
The scripts invoke `qemu-aarch64-static` / `qemu-x86_64-static`, so plain
`qemu-user` alone leaves a second, differently worded failure
(`command not found`) that looks like a fresh problem rather than the same one.

> ⊘ **CORRECTED 2026-11-05.** This read *"Install `qemu-user-static`"* with
> `sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user-static`. Ubuntu 26.04
> (the GitHub `ubuntu-latest` image since early November) dropped that package:
> it is now virtual with no installation candidate and `apt-get install` exits
> 100, which turned `neon-simd/parity-qemu` red on PR #408 before anything was
> built. `scripts/install-qemu-user.sh` installs `qemu-user-static` where it
> still exists, else `qemu-user` plus links for the `-static` names; every CI
> qemu step calls it. Both branches were run on Ubuntu 24.04
> (`QEMU_INSTALL_FORCE_PLAIN=1` takes the 26.04 branch), and
> `scripts/neon-parity.sh` passed through the linked plain `qemu-aarch64`.

**And `native` is the HOST arm — it names no tier at all.**

Expand Down
30 changes: 30 additions & 0 deletions scripts/install-qemu-user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Install the qemu user-mode emulators so `qemu-aarch64-static` and
# `qemu-x86_64-static` resolve on every Ubuntu runner image.
#
# Ubuntu 26.04 dropped the `qemu-user-static` package (it is now a virtual
# package with no installation candidate, and `apt-get install` exits 100).
# There, `qemu-user` carries the emulators under their plain names, so this
# script links the `-static` names the parity scripts call. On images that
# still ship `qemu-user-static` it installs that, as before.
#
# Usage: scripts/install-qemu-user.sh [extra apt packages...]
# Set QEMU_INSTALL_FORCE_PLAIN=1 to take the `qemu-user` path on any image.
set -euo pipefail

sudo apt-get update
if [ "${QEMU_INSTALL_FORCE_PLAIN:-0}" != 1 ] \
&& apt-cache show qemu-user-static 2>/dev/null | grep -q '^Filename:'; then
sudo apt-get install -y "$@" qemu-user-static
else
sudo apt-get install -y "$@" qemu-user
fi

for arch in aarch64 x86_64; do
if [ "${QEMU_INSTALL_FORCE_PLAIN:-0}" = 1 ] || ! command -v "qemu-$arch-static" >/dev/null; then
real=$(command -v "qemu-$arch") || { echo "qemu-$arch is not installed" >&2; exit 1; }
sudo ln -sf "$real" "/usr/local/bin/qemu-$arch-static"
fi
echo "qemu-$arch-static -> $(readlink -f "$(command -v "qemu-$arch-static")")"
"qemu-$arch-static" --version | head -1
done
2 changes: 1 addition & 1 deletion src/simd_stride.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub fn lut_u8(values: &[u8], table: &[u8; 256], out: &mut [u8]) {
/// authorization or alpha-claim from these bits.
///
/// # Panics
/// If table[0] != 0 or input/output slices are too short.
/// If `table[0] != 0` or input/output slices are too short.
///
/// # Examples
/// ```
Expand Down
Loading