From 74993acc39e500885060fb5b9013f8d207876b6a Mon Sep 17 00:00:00 2001 From: tannevaled Date: Mon, 26 Oct 2026 12:19:25 +0100 Subject: [PATCH 1/2] ci: run the loong64 lane on la464 and require LASX Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 4 +++- internal/kernels/lasx_required_loong64_test.go | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 internal/kernels/lasx_required_loong64_test.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46db1ad..6489d8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,7 +120,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. diff --git a/internal/kernels/lasx_required_loong64_test.go b/internal/kernels/lasx_required_loong64_test.go new file mode 100644 index 0000000..c5fd828 --- /dev/null +++ b/internal/kernels/lasx_required_loong64_test.go @@ -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") + } +} From d87cde163421cb8453b3e9f026f9ff15fb618d4c Mon Sep 17 00:00:00 2001 From: tannevaled Date: Mon, 26 Oct 2026 12:31:43 +0100 Subject: [PATCH 2/2] ci: the qemu lanes run the SIMD kernels; correct the comments Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6489d8c..496e710 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }}) @@ -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