Roadmap / std.math functions the corpus kernels call

std.math.min on SIMD values: llvm.smin on signed integers

Area
std.math functions the corpus kernels call
Kind
construct
Level
L1 (modelled in Lean). Next: L2 needs a recorded GPU run (a conformance test, not a proof).
Evidence present above the level
None above the level.
Reference
modular/modular@bbc13a71:Mojo/stdlib/std/math/math.mojo:3335
Quote
Gets the elementwise minimum of x and y.
Lean declarations
  • MojoProof.Sem.intMinMax
Corpus files

37 kernel files (.ll) in the corpus.

Tests
  • MojoProofTest.Rule
Upstream issue
None filed.
Depends on
llvm-ir/intrinsic-minmax

Rule

min on two SIMD values (math.mojo:3334) asserts a numeric or boolean type (lines 3354-3356) and is the MLIR operation pop.min (line 3358). The corpus IR has llvm.smin.i64 (the 34 layer-norm files and the 3 split-K GEMM files) and no llvm.minnum. The contract on integers is exact: the smaller of the two as signed integers (MojoProof.Sem.intMinMax).

In scope

i64 smin, as the corpus IR calls it.

Out of scope

Float min (llvm.minnum), which the corpus does not call. As for max, which source call produced each smin is not traced, since the lowering is the compiler's.

Open

L2 needs a recorded GPU run of a test of the construct; there is none.