glam 0.33.7

A simple and fast 3D math library for games and graphics
Documentation
name: Bench
on:
  workflow_dispatch:
  push:
    branches: [main]
  pull_request:
    branches: [main]
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  # Instruction counts depend on codegen, so the toolchain is pinned. Bump it
  # together with a baseline update (see bench-update.yml).
  BENCH_TOOLCHAIN: 1.98.0

jobs:
  # Skip the push-to-main compare when a `bench-update`-labeled PR was
  # merged: the update workflow rewrites the baselines for that commit, so
  # comparing against them is pointless and would race. Other events always
  # compare. Runs on every event (no job `if`) so gungraun never depends on a
  # skipped job.
  skip-update:
    name: Skip if baselines were updated for this commit
    runs-on: ubuntu-latest
    outputs:
      baselines-updated: ${{ steps.check.outputs.updated }}
    permissions:
      pull-requests: read # find the merged PR for this commit and its labels
    steps:
      - name: Check for merged bench-update PR
        id: check
        # Only pushes to main can be merges.
        if: github.event_name == 'push' && github.ref == 'refs/heads/main'
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          # A squash-merged PR is returned for its single commit on main.
          labels="$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/pulls" \
            --jq '[.[].labels[].name] | unique | join(",")' || true)"
          if grep -q 'bench-update' <<<"$labels"; then
            echo "updated=true" >> "$GITHUB_OUTPUT"
          else
            echo "updated=false" >> "$GITHUB_OUTPUT"
          fi
        # Fail-open: a broken check still compares instead of silently
        # skipping.
        continue-on-error: true

  gungraun:
    name: gungraun (${{ matrix.os }})
    needs: skip-update
    # Compare unless a `bench-update`-merged PR was found for this commit.
    if: needs.skip-update.outputs.baselines-updated != 'true'
    strategy:
      fail-fast: false
      matrix:
        # The ci tool saves/compares the sse2 and scalar-math baselines on
        # x86_64 Linux and the neon and scalar-math baselines on aarch64
        # Linux. Valgrind doesn't support macOS, so there are no macOS
        # baselines.
        os: [ubuntu-latest, ubuntu-24.04-arm]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true
      - uses: actions/checkout@v7
        with:
          repository: bitshifter/glam-bench-baselines
          path: benches/gungraun-baselines
      - uses: Swatinem/rust-cache@v2
      - run: rustup update --no-self-update ${{ env.BENCH_TOOLCHAIN }}
      - run: rustup default ${{ env.BENCH_TOOLCHAIN }}
      - name: Install valgrind
        run: sudo apt-get update && sudo apt-get install -y valgrind
      - run: cargo run --release -p ci -- bench