← Run 2026-09-05T193245

Implementation / swift-simd

Swift (SIMD)5.8

An inspectable measurement, with the exact build and environment evidence retained from this run.

systemscompiler-defaultExplicit SIMD
Median wall time661.68 ms
Fastest sample657.91 ms
Slowest sample664.70 ms
Samples retained3

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.

Sample 10.657906875 s
Sample 20.664700010 s
Sample 30.661680118 s

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

env -u NIX_CC swiftc -tools-directory "$(dirname $(command -v clang))" -target x86_64-unknown-linux-gnu -O -o leibniz leibniz-simd.swift

Execute

. ./.swift-env && ./leibniz < rounds.txt

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-simd.swift26 lines
var rounds = UInt64(readLine()!)!

var pi: Double = 1.0

let roundsRemainder = rounds % 4
rounds -= roundsRemainder

rounds += 2 // do this outside the loop

var i: UInt = 2
while i < rounds {
    let xVec = SIMD4<Double>(-1.0, 1.0, -1.0, 1.0)
    let iVec = SIMD4<Double>(Double(i) + 0, Double(i) + 1, Double(i) + 2, Double(i) + 3)
    pi += (xVec / (2.0 * iVec - 1.0)).sum()
    i += 4
}

for _ in 0..<roundsRemainder {
    let x = -1.0 + 2.0 * Double(i & 1)
    pi += x / Double(2 * i - 1)
    i += 1
}

pi *= 4.0
print(pi)

SHA-256 · 43b0bda63605134b949a0ce3583ad780174241dc24630b3fd2ae0bc1f91c2946

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/b134951a4c9f3c995fd7be05f3243f8ecd65d798#gccflake reference
Complete package record
{
  "last_modified": "1970-01-01T00:00:00Z",
  "resolved": "github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#gcc"
}
github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#llvmPackages_15.clangflake reference
Complete package record
{
  "last_modified": "1970-01-01T00:00:00Z",
  "resolved": "github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#llvmPackages_15.clang"
}
github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#swiftflake reference
Complete package record
{
  "last_modified": "1970-01-01T00:00:00Z",
  "resolved": "github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#swift"
}
github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#swiftPackages.Dispatchflake reference
Complete package record
{
  "last_modified": "1970-01-01T00:00:00Z",
  "resolved": "github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#swiftPackages.Dispatch"
}
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"
    }
  }
}
Complete Devbox configuration
{
  "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json",
  "packages": [
    "github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#swift",
    "github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#gcc",
    "github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#llvmPackages_15.clang",
    "github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#swiftPackages.Dispatch",
    "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.

Download raw JSON ↓
All other recorded result fields
                    {
  "Mean": "0.66142900064s",
  "Max": "0.6647000096399999s",
  "Target": "swift-simd",
  "Stddev": "0.003403522527150809s",
  "Version": "5.8",
  "Language": "Swift (SIMD)",
  "UserTime": "0.6528581733333332s",
  "SystemTime": "0.00725056s",
  "Median": "0.66168011764s",
  "Command": ". ./.swift-env && ./leibniz < rounds.txt",
  "TimesPerRun": [
    0.65790687464,
    0.6647000096399999,
    0.66168011764
  ],
  "Accuracy": 8.692759762017342,
  "Min": "0.65790687464s",
  "ExitCodesPerRun": [
    0,
    0,
    0
  ],
  "CalculatedPi": "3.141592659963471",
  "BuildSource": "native-devbox",
  "DevboxImage": "jetpackio/devbox:0.16.0@sha256:0475601f3ddbc1d06be7f7d4d51143dcc005400593407d5e3627fdf7edf6c7dd",
  "AllowNativeFlags": true,
  "MathMode": "compiler-default",
  "ExplicitSIMD": true,
  "Algorithm": "leibniz-series",
  "Rounds": 1000000000,
  "Compile": "env -u NIX_CC swiftc -tools-directory \"$(dirname $(command -v clang))\" -target x86_64-unknown-linux-gnu -O -o leibniz leibniz-simd.swift",
  "Run": ". ./.swift-env && ./leibniz < rounds.txt",
  "Nixpkgs": [],
  "NixFlakes": [
    "github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#swift",
    "github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#gcc",
    "github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#llvmPackages_15.clang",
    "github:NixOS/nixpkgs/b134951a4c9f3c995fd7be05f3243f8ecd65d798#swiftPackages.Dispatch"
  ],
  "Category": "systems"
}