Implementation / sbcl-simd
Common Lisp (SBCL SIMD)2.5.10
An inspectable measurement, with the exact build and environment evidence retained from this run.
01 / Measurements
Every sample matters.
Individual wall times in seconds. Three samples show observed spread; they do not establish a statistically reliable winner between close results.
02 / Build & protocol
How this was run.
Commands and settings are evidence from the measured revision. They can differ from today’s implementation.
Browse measured source ↗Compile
sbcl --noinform --load leibniz-sbcl-simd.lisp --eval '(sb-ext:save-lisp-and-die "leibniz" :executable t :toplevel (quote cl-user::main) :purify t)'
Execute
./leibniz
Historical protocol recovered from the measured driver. These fields were not embedded in the original result. The raw JSON remains unchanged.
03 / The implementation
Read what ran.
The implementation and supporting files at the measured revision. Highlighting is added for readability; the source text is unchanged.
Recovered from the measured Git revision; not embedded in the original raw results
Browse this revision ↗src/leibniz-sbcl-simd.lisp45 lines
#-sbcl (error "SBCL only!")
(declaim (optimize (speed 3) (safety 0) (debug 0))) ; only speed matters
(require 'sb-simd)
;; adapted from leibniz_avx2.cpp.
(defun leibniz (rounds)
(declare (optimize (speed 3) (safety 0) (debug 0))
(fixnum rounds))
(incf rounds 2) ; do this outside the loop
(let ((unroll 4)
(x (sb-simd-avx:make-f64.4 -1.0 1.0 -1.0 1.0))
(den (sb-simd-avx:make-f64.4 0.0 0.0 0.0 0.0))
(inc (sb-simd-avx:make-f64.4 4.0 4.0 4.0 4.0))
(two (sb-simd-avx:make-f64.4 2.0 2.0 2.0 2.0))
(mone (sb-simd-avx:make-f64.4 -1.0 -1.0 -1.0 -1.0))
(ivec (sb-simd-avx:make-f64.4 2.0 3.0 4.0 5.0))
(pivec (sb-simd-avx:make-f64.4 0.0 0.0 0.0 0.0)))
(let ((vec-end (- rounds (mod rounds unroll))))
(loop for i from 2 below vec-end by unroll do
;; compute den = (2 * i - 1)
(setf den (sb-simd-avx:f64.4+ (sb-simd-avx:f64.4* two ivec) mone)
;; increment ivec, so ivec +=inc
ivec (sb-simd-avx:f64.4+ ivec inc)
;; compute partial sums
pivec (sb-simd-avx:f64.4+ pivec (sb-simd-avx:f64.4/ x den))))
;; gather the partial sums
(let ((underscore-pi (+ 1.0d0 (sb-simd-avx:f64.4-horizontal+ pivec))))
;; now the wind-down loop
(loop with underscore-x = 1.0d0 for i from vec-end below rounds do
(setf underscore-x (- underscore-x)
underscore-pi (+ underscore-pi (* underscore-x (/ (- (* 2.0 i) 1.0))))))
(* underscore-pi 4.0d0)))))
(defun main ()
(with-open-file (in "rounds.txt")
(declare (optimize (speed 3) (safety 0) (debug 0)))
(let ((*read-default-float-format* 'double-float)
(n (parse-integer (read-line in))))
(princ (leibniz n))
(fresh-line))))
SHA-256 · bd2b874f06f55ccf2b0d49b896d6fece6b423fdae693186a28b77727f5f4a0f3
04 / Package provenance
Beyond a version number.
Resolved Nix revisions and store paths identify the packages in the recorded Devbox lock. Other platforms listed by the resolver are alternatives, not machines used in this run.
github:NixOS/nixpkgs/nixpkgs-unstableflake reference
Complete package record
{
"last_modified": "2026-09-03T10:26:31Z",
"resolved": "github:NixOS/nixpkgs/9b9402b959a2276982ddd5ad3652a38b97f7c40b?lastModified=1788431191&narHash=sha256-MFClkboDeW56feBCAeAV3Z3J2quGSZFlAOXQ4JjIlIA%3D"
}hyperfine@1.18.01.18.0
aarch64-darwin
{
"outputs": [
{
"name": "out",
"path": "/nix/store/9xndv63zi1n8i42l4fy4kdjw8rs8gnhf-hyperfine-1.18.0",
"default": true
}
],
"store_path": "/nix/store/9xndv63zi1n8i42l4fy4kdjw8rs8gnhf-hyperfine-1.18.0"
}aarch64-linux
{
"outputs": [
{
"name": "out",
"path": "/nix/store/klirs2wv0wm9p7rkp6v70v5770x73bgf-hyperfine-1.18.0",
"default": true
}
],
"store_path": "/nix/store/klirs2wv0wm9p7rkp6v70v5770x73bgf-hyperfine-1.18.0"
}x86_64-darwin
{
"outputs": [
{
"name": "out",
"path": "/nix/store/zvpjdyck0vj7w4piicfxbskv8fw7ik4i-hyperfine-1.18.0",
"default": true
}
],
"store_path": "/nix/store/zvpjdyck0vj7w4piicfxbskv8fw7ik4i-hyperfine-1.18.0"
}x86_64-linux Matching architecture / OS
{
"outputs": [
{
"name": "out",
"path": "/nix/store/7hj45kx7ln0ncn0i984zbh0gmbliya5j-hyperfine-1.18.0",
"default": true
}
],
"store_path": "/nix/store/7hj45kx7ln0ncn0i984zbh0gmbliya5j-hyperfine-1.18.0"
}Complete package record
{
"last_modified": "2024-11-03T14:18:04Z",
"resolved": "github:NixOS/nixpkgs/4ae2e647537bcdbb82265469442713d066675275#hyperfine",
"source": "devbox-search",
"version": "1.18.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/9xndv63zi1n8i42l4fy4kdjw8rs8gnhf-hyperfine-1.18.0",
"default": true
}
],
"store_path": "/nix/store/9xndv63zi1n8i42l4fy4kdjw8rs8gnhf-hyperfine-1.18.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/klirs2wv0wm9p7rkp6v70v5770x73bgf-hyperfine-1.18.0",
"default": true
}
],
"store_path": "/nix/store/klirs2wv0wm9p7rkp6v70v5770x73bgf-hyperfine-1.18.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/zvpjdyck0vj7w4piicfxbskv8fw7ik4i-hyperfine-1.18.0",
"default": true
}
],
"store_path": "/nix/store/zvpjdyck0vj7w4piicfxbskv8fw7ik4i-hyperfine-1.18.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/7hj45kx7ln0ncn0i984zbh0gmbliya5j-hyperfine-1.18.0",
"default": true
}
],
"store_path": "/nix/store/7hj45kx7ln0ncn0i984zbh0gmbliya5j-hyperfine-1.18.0"
}
}
}micropython@1.24.11.24.1
aarch64-darwin
{
"outputs": [
{
"name": "out",
"path": "/nix/store/g4dz2lvzzhggnxkavi1jiiiy1dpa8c4p-micropython-1.24.1",
"default": true
}
],
"store_path": "/nix/store/g4dz2lvzzhggnxkavi1jiiiy1dpa8c4p-micropython-1.24.1"
}aarch64-linux
{
"outputs": [
{
"name": "out",
"path": "/nix/store/3yggs5nl5pavnxh8k4adiq09s1f0ppry-micropython-1.24.1",
"default": true
}
],
"store_path": "/nix/store/3yggs5nl5pavnxh8k4adiq09s1f0ppry-micropython-1.24.1"
}x86_64-darwin
{
"outputs": [
{
"name": "out",
"path": "/nix/store/gav96yf4pxhj59idrs67z59cw3zfimfd-micropython-1.24.1",
"default": true
}
],
"store_path": "/nix/store/gav96yf4pxhj59idrs67z59cw3zfimfd-micropython-1.24.1"
}x86_64-linux Matching architecture / OS
{
"outputs": [
{
"name": "out",
"path": "/nix/store/vhfgy8vnd904mlzw35z61rh177cvcb40-micropython-1.24.1",
"default": true
}
],
"store_path": "/nix/store/vhfgy8vnd904mlzw35z61rh177cvcb40-micropython-1.24.1"
}Complete package record
{
"last_modified": "2025-04-10T20:20:34Z",
"resolved": "github:NixOS/nixpkgs/d19cf9dfc633816a437204555afeb9e722386b76#micropython",
"source": "devbox-search",
"version": "1.24.1",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/g4dz2lvzzhggnxkavi1jiiiy1dpa8c4p-micropython-1.24.1",
"default": true
}
],
"store_path": "/nix/store/g4dz2lvzzhggnxkavi1jiiiy1dpa8c4p-micropython-1.24.1"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/3yggs5nl5pavnxh8k4adiq09s1f0ppry-micropython-1.24.1",
"default": true
}
],
"store_path": "/nix/store/3yggs5nl5pavnxh8k4adiq09s1f0ppry-micropython-1.24.1"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/gav96yf4pxhj59idrs67z59cw3zfimfd-micropython-1.24.1",
"default": true
}
],
"store_path": "/nix/store/gav96yf4pxhj59idrs67z59cw3zfimfd-micropython-1.24.1"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/vhfgy8vnd904mlzw35z61rh177cvcb40-micropython-1.24.1",
"default": true
}
],
"store_path": "/nix/store/vhfgy8vnd904mlzw35z61rh177cvcb40-micropython-1.24.1"
}
}
}sbcl@2.5.102.5.10
aarch64-darwin
{
"outputs": [
{
"name": "out",
"path": "/nix/store/h3i8q1wdsg9gppkpvcs2sq2yzv8ldd5w-sbcl-2.5.10",
"default": true
}
],
"store_path": "/nix/store/h3i8q1wdsg9gppkpvcs2sq2yzv8ldd5w-sbcl-2.5.10"
}aarch64-linux
{
"outputs": [
{
"name": "out",
"path": "/nix/store/9q3q5way4slj45r0vx4kj4rm6x9qgi1p-sbcl-2.5.10",
"default": true
}
],
"store_path": "/nix/store/9q3q5way4slj45r0vx4kj4rm6x9qgi1p-sbcl-2.5.10"
}x86_64-darwin
{
"outputs": [
{
"name": "out",
"path": "/nix/store/fpjjn2v5nl9svjhsaj9xp08r9rmwvv3v-sbcl-2.5.10",
"default": true
}
],
"store_path": "/nix/store/fpjjn2v5nl9svjhsaj9xp08r9rmwvv3v-sbcl-2.5.10"
}x86_64-linux Matching architecture / OS
{
"outputs": [
{
"name": "out",
"path": "/nix/store/yviqz1h87nysyy2i500wkmaqbdr4x1bz-sbcl-2.5.10",
"default": true
}
],
"store_path": "/nix/store/yviqz1h87nysyy2i500wkmaqbdr4x1bz-sbcl-2.5.10"
}Complete package record
{
"last_modified": "2026-01-02T14:39:32Z",
"resolved": "github:NixOS/nixpkgs/16c7794d0a28b5a37904d55bcca36003b9109aaa#sbcl",
"source": "devbox-search",
"version": "2.5.10",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/h3i8q1wdsg9gppkpvcs2sq2yzv8ldd5w-sbcl-2.5.10",
"default": true
}
],
"store_path": "/nix/store/h3i8q1wdsg9gppkpvcs2sq2yzv8ldd5w-sbcl-2.5.10"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/9q3q5way4slj45r0vx4kj4rm6x9qgi1p-sbcl-2.5.10",
"default": true
}
],
"store_path": "/nix/store/9q3q5way4slj45r0vx4kj4rm6x9qgi1p-sbcl-2.5.10"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/fpjjn2v5nl9svjhsaj9xp08r9rmwvv3v-sbcl-2.5.10",
"default": true
}
],
"store_path": "/nix/store/fpjjn2v5nl9svjhsaj9xp08r9rmwvv3v-sbcl-2.5.10"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/yviqz1h87nysyy2i500wkmaqbdr4x1bz-sbcl-2.5.10",
"default": true
}
],
"store_path": "/nix/store/yviqz1h87nysyy2i500wkmaqbdr4x1bz-sbcl-2.5.10"
}
}
}Complete Devbox configuration
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json",
"packages": [
"sbcl@2.5.10",
"hyperfine@1.18.0",
"micropython@1.24.1"
],
"shell": {
"init_hook": [
"echo 'Welcome to devbox!' > /dev/null"
],
"scripts": {
"test": [
"echo \"Error: no test specified\" && exit 1"
]
}
}
}05 / Environment & limits
The machine behind
the measurement.
Container-visible resources are not necessarily dedicated resources. Hypervisor CPU flags indicate virtualization; CPU counts do not prove exclusive CPU allocation.
All recorded environment fields
{
"arch": "x86_64",
"kernel": "6.18.38-talos",
"cpu_model": "AMD EPYC-Genoa Processor",
"cpu_flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl xtopology cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core pti ssbd ibrs ibpb stibp ibrs_enhanced vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves avx512_bf16 clzero xsaveerptr wbnoinvd arat avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq la57 rdpid fsrm",
"cpu_threads": "4",
"runner": "homelab-argo"
}“Not recorded” means unknown, not unlimited. Historical data cannot establish CPU isolation, host contention, thermal state or frequency stability.
Declared scheduler settings
Retained Argo stored workflow template; declared settings, not an observation of effective cgroup limits. A CPU request does not reserve exclusive hardware.
06 / Evidence
Take the data with you.
Original bytes are preserved. The checksum below identifies this exact raw JSON file.
All other recorded result fields
{
"Mean": "0.30340262424s",
"Max": "0.3056732982400001s",
"Target": "sbcl-simd",
"Stddev": "0.002436282021993979s",
"Version": "2.5.10",
"Language": "Common Lisp (SBCL SIMD)",
"UserTime": "0.28726644s",
"SystemTime": "0.01372962s",
"Median": "0.3037055152400001s",
"Command": "./leibniz",
"TimesPerRun": [
0.3037055152400001,
0.3056732982400001,
0.30082905924
],
"Accuracy": 9.4973117657337,
"Min": "0.30082905924s",
"ExitCodesPerRun": [
0,
0,
0
],
"CalculatedPi": "3.14159265458942",
"BuildSource": "native-devbox",
"DevboxImage": "jetpackio/devbox:0.16.0@sha256:0475601f3ddbc1d06be7f7d4d51143dcc005400593407d5e3627fdf7edf6c7dd",
"AllowNativeFlags": true,
"MathMode": "compiler-default",
"ExplicitSIMD": true,
"Algorithm": "leibniz-series",
"Rounds": 1000000000,
"Compile": "sbcl --noinform --load leibniz-sbcl-simd.lisp --eval '(sb-ext:save-lisp-and-die \"leibniz\" :executable t :toplevel (quote cl-user::main) :purify t)'",
"Run": "./leibniz",
"Nixpkgs": [
"sbcl@2.5.10"
],
"NixFlakes": [],
"Category": "functional"
}