Skip to content

Speed up output-stage post-processing: hoist redundant per-surface trig recompute #1065

Speed up output-stage post-processing: hoist redundant per-surface trig recompute

Speed up output-stage post-processing: hoist redundant per-surface trig recompute #1065

name: C++ TSAN tests
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
# Cancel currently running job if a new one comes along for the same branch or tag.
# From https://stackoverflow.com/a/72408109.
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
tsan:
name: Build and run tsan tests
runs-on: ubuntu-22.04
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@v4
with:
lfs: true # for the mgrid test data
# The TSAN image (clang/libomp with ThreadSanitizer support) takes ~1h to
# build, so it is prebuilt and pushed to GHCR by build_tsan_image.yaml and
# only rebuilt when src/vmecpp/cpp/docker/tsan/ changes. Here we just pull
# the cached image.
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull TSAN Docker image
run: |
IMAGE=ghcr.io/${{ github.repository_owner }}/vmecpp-tsan:latest
docker pull "${IMAGE,,}"
docker tag "${IMAGE,,}" proximafusion/tsan
- name: Mount bazel cache
uses: actions/cache@v4
with:
path: "~/.cache/bazel"
key: bazel-tsan
- name: Run TSAN tests in Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/vmecpp \
-v ~/.cache/bazel:/root/.cache/bazel \
proximafusion/tsan \
bash -c "cd /vmecpp/src/vmecpp/cpp && bazel test --config=tsan_archer_in_docker --jobs=1 --test_output=errors -- //vmecpp/... -//vmecpp/vmec/pybind11/..."