Skip to content

perf: s390x float32 Max/Min (VFMAXSB, z14+) - #69

Merged
tannevaled merged 1 commit into
mainfrom
s390x-extrema32
Oct 26, 2026
Merged

tannevaled merged 1 commit into
mainfrom
s390x-extrema32

Conversation

@tannevaled

@tannevaled tannevaled commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

s390x float32 Max/Min, and the first real-hardware measurements of the z14 float32 kernels.

Kernel. max32VXE/min32VXE use VFMAXSB/VFMINSB in mode 1 (Java's Math.max/min), so a NaN operand gives NaN and −0 orders below +0. Four four-lane accumulators are folded by an 8-byte VSLDB rotation, then lane 1 onto lane 0. They run behind useVXE (z14), from 16 elements up.

Measured on a real IBM Z (LinuxONE, abbench, 6 rounds, alternated, pinned core):

float32 2¹⁴ 2²⁰ base
Max −98.3% −97.2% v0.22.0 (Go loop)
Add −80.2% −85.3% v0.17.0
AddInto −91.9% −89.1% v0.17.0
Sqrt −81.7% −82.7% v0.17.0

The float64 controls are flat in both runs. The z machine had been unreachable since 2026-10-25 because of a local SSH agent problem; see docs/perf.md. So the v0.18.0/v0.19.0 float32 kernels had been tested there but never timed.

Proof the tests can fail.

  • The first push of this PR was a deliberate sabotage, one VFMINSB lane in max32VXE. CI's s390x qemu lane failed exactly there (TestExtrema32MatchSequential: special Max32 n=32: -0, sequential 0). That lane runs VXE since ci: run the s390x qemu lane with VXE, and require it #68.
  • The same sabotaged binary fails on the real machine.
  • With the real kernel, the kernel suite passes there with NDARRAY_REQUIRE_VXE=1, and so does the root suite.

The local coverage gate (covblocks) reports 0 uncovered blocks.

A minor release, v0.23.0.

🤖 Generated with Claude Code

…measured

max32VXE/min32VXE: VFMAXSB/VFMINSB in mode 1 (Java: NaN-propagating,
-0 below +0), four four-lane accumulators folded by an 8-byte VSLDB
rotation, behind useVXE, from 16 elements up.

Measured on a real IBM Z (abbench, 6 rounds, alternated): float32 Max
-98.3% (2^14) / -97.2% (2^20) against v0.22.0; and, against v0.17.0,
the float32 kernels that had only been tested there: Add -80/-85%,
AddInto -92/-89%, Sqrt -82/-83%. float64 controls flat.

A sabotaged kernel (one VFMINSB lane) fails the sequential-oracle test
on the real machine and, in a first push of this PR, in CI's s390x qemu
lane (TestExtrema32MatchSequential, same message).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled marked this pull request as ready for review October 26, 2026 12:48
@tannevaled
tannevaled merged commit 4d8d5cd into main Oct 26, 2026
12 checks passed
@tannevaled
tannevaled deleted the s390x-extrema32 branch October 26, 2026 13:00
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.

1 participant