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
24 changes: 14 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ permissions:
# So every line is either statement-covered by the gate or executed by a
# per-arch job; the gate is never lowered and there is no coverage-gaming knob.
# amd64/arm64/ppc64le/loong64 ship SIMD kernels (ppc64le's and loong64's were
# run on real POWER8/POWER9 and a Loongson 3C5000L; under qemu here loong64
# takes its scalar fallback unless the emulated CPU reports LASX);
# riscv64 ships RVV kernels (used when the CPU reports V) and s390x
# vector-facility kernels (used when AT_HWCAP reports it).
# also run on real POWER8/POWER9 and a Loongson 3C5000L); riscv64 ships RVV
# kernels (used when the CPU reports V) and s390x vector-facility kernels (used
# when AT_HWCAP reports it). Under qemu the riscv64 lane runs with V and the
# loong64 lane on la464 (LSX+LASX), and each FAILS if its CPU does not report
# the extension (NDARRAY_REQUIRE_RVV / _LASX): until 2026-10-26 both lanes ran
# qemu's default CPUs and so only ever tested the scalar fallbacks.
jobs:
test:
name: test (${{ matrix.os }})
Expand Down Expand Up @@ -104,11 +106,11 @@ jobs:
go build ./...
go test ./...

# qemu-user execution for the four targets without a hosted runner. They keep
# the validated scalar reduction path (no vector-double SIMD kernel shipped),
# so for them this job is the endianness/word-size guard plus the
# TestSumSIMD scalar-alias check; the amd64 SSE2 kernel is additionally
# cross-validated here under qemu-x86_64.
# qemu-user execution for the targets without a hosted runner, plus 32-bit
# arm. It runs their SIMD kernels where qemu emulates the extension: RVV on
# riscv64, LSX/LASX on loong64, VSX on ppc64le, and the vector facility on
# s390x (when the emulated CPU reports it). It is also the endianness and
# word-size guard.
arch-qemu:
name: arch ${{ matrix.goarch }} (qemu)
runs-on: ubuntu-latest
Expand All @@ -120,7 +122,9 @@ jobs:
# went untested here until 2026-10-26. NDARRAY_REQUIRE_RVV makes a
# CPU without V fail the lane (TestRVVWhenRequired).
- { goarch: riscv64, qemu: qemu-riscv64-static, cpu: "rv64,v=true,vlen=256", require: NDARRAY_REQUIRE_RVV }
- { goarch: loong64, qemu: qemu-loongarch64-static }
# la464 has LSX and LASX; NDARRAY_REQUIRE_LASX makes a CPU that does
# not report LASX fail the lane (TestLASXWhenRequired).
- { goarch: loong64, qemu: qemu-loongarch64-static, cpu: "la464", require: NDARRAY_REQUIRE_LASX }
- { goarch: ppc64le, qemu: qemu-ppc64le-static }
- { goarch: s390x, qemu: qemu-s390x-static }
# 32-bit: int is 32 bits, so shape/size overflow paths differ.
Expand Down
17 changes: 17 additions & 0 deletions internal/kernels/lasx_required_loong64_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package kernels

import (
"os"
"testing"
)

// TestLASXWhenRequired fails when NDARRAY_REQUIRE_LASX is set and the CPU does
// not report LASX. CI sets it on the loong64 qemu lane, so the LSX and LASX
// kernels cannot go untested behind a green tick there, the way the RVV ones
// did on riscv64 until 2026-10-26.
func TestLASXWhenRequired(t *testing.T) {
t.Logf("useLASX = %v", useLASX)
if os.Getenv("NDARRAY_REQUIRE_LASX") != "" && !useLASX {
t.Fatal("NDARRAY_REQUIRE_LASX is set but the CPU does not report LASX: the LSX/LASX kernels did not run")
}
}
Loading