Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/asv-benchmarking-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Download benchmark results artifact
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: asv-benchmark-results-Linux
path: asv-results
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/yac-optional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ on:

jobs:
yac-optional:
name: YAC core v3.14.0_p1 (Ubuntu)
name: YAC core v3.18.0 (Ubuntu)
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
YAC_VERSION: v3.14.0_p1
YAC_VERSION: v3.18.0
YAXT_VERSION: v0.11.5.1
MPIEXEC: /usr/bin/mpirun
MPIRUN: /usr/bin/mpirun
Expand All @@ -36,7 +36,7 @@ jobs:
with:
activate-environment: uxarray_build
channel-priority: strict
python-version: "3.11"
python-version: "3.14"
channels: conda-forge
environment-file: ci/environment.yml
miniforge-variant: Miniforge3
Expand Down Expand Up @@ -65,8 +65,9 @@ jobs:
mpif90 --version
- name: Install Python build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install cython wheel
# Cython and wheel are needed to build YAC's Python bindings from source.
conda install --yes -c conda-forge "cython>=3.1" wheel
python -m cython --version
- name: Build and install YAXT
run: |
set -euxo pipefail
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.15.20
rev: v0.15.21
hooks:
- id: ruff
name: lint with ruff
Expand Down
41 changes: 23 additions & 18 deletions benchmarks/geometry_samebody.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,21 +201,28 @@ def _unit(v):
return v / np.linalg.norm(v)


def _make_cases(n, seed):
"""Random great-circle arcs paired with a latitude their arc actually crosses."""
def _make_cases(n, seed, frac_cross=0.7):

rng = np.random.default_rng(seed)
cases = []
while len(cases) < n:
a = _unit(rng.standard_normal(3))
b = _unit(rng.standard_normal(3))
if abs(np.dot(a, b)) > 0.999: # near-degenerate arc, skip
continue
# pick a latitude strictly between the two endpoints' z so an
# intersection is likely to exist
zlo, zhi = sorted((a[2], b[2]))
if zhi - zlo < 1e-6:
continue
const_z = zlo + (zhi - zlo) * rng.uniform(0.2, 0.8)
mid = _unit(rng.standard_normal(3))
tan = _unit(np.cross(mid, _unit(rng.standard_normal(3))))
half = 0.5 * math.radians(10.0 ** rng.uniform(math.log10(0.2), math.log10(8.0)))
ca, sa = math.cos(half), math.sin(half)
a = _unit(mid * ca - tan * sa)
b = _unit(mid * ca + tan * sa)
zlo, zhi = (a[2], b[2]) if a[2] <= b[2] else (b[2], a[2])
if rng.random() < frac_cross and zhi - zlo > 1e-9:
const_z = zlo + (zhi - zlo) * rng.uniform(0.15, 0.85)
else:
# a latitude the arc does not span -> empty-return path
room_above = 0.999 - zhi
room_below = zlo + 0.999
if room_above >= room_below:
const_z = zhi + min(room_above, rng.uniform(0.02, 0.3))
else:
const_z = zlo - min(room_below, rng.uniform(0.02, 0.3))
cases.append((np.stack([a, b]), float(const_z)))
return cases

Expand Down Expand Up @@ -324,10 +331,8 @@ def main():
if np.isfinite(d):
max_out_diff = max(max_out_diff, d)

# ---- timing: replicate the 200 cases into a large batch (~200k points) ----
reps = 1000
big = base_cases * reps
A, B, Z, gcas = _pack(big)
# ---- timing: a large batch of DISTINCT cases (no replication) ----
A, B, Z, gcas = _pack(_make_cases(100_000, seed=20251105))
n = A.shape[0]

t_direct = _time_batch(_batch_fp64_kernel, (A, B, Z))
Expand All @@ -341,7 +346,7 @@ def main():
print("Same-body FP64-vs-AccuX diagnostic — GCA/ConstLat (PR #1513)")
print("=" * 70)
print(f"baseline cases: {len(base_cases)} with-result: {n_with_result}")
print(f"timing batch : {n} points ({reps}x replication), best of 7")
print(f"timing batch : {n} distinct points, best of 7")
print()
print("CORRECTNESS (same-body FP64 dispatcher vs real AccuX dispatcher)")
print(f" status mismatches : {status_mismatch}")
Expand Down Expand Up @@ -391,7 +396,7 @@ class SameBodyConstLat:
"""asv: same-body FP64 vs real AccuX at kernel (L1) and dispatch (L3) levels."""

def setup(self):
cases = _make_cases(200, seed=20251104) * 100
cases = _make_cases(20_000, seed=20251104)
self.A, self.B, self.Z, self.gcas = _pack(cases)
_batch_fp64_kernel(self.A, self.B, self.Z)
_batch_accux_kernel(self.A, self.B, self.Z)
Expand Down
Loading