Skip to content

fix(ci): skip the benchmark PR comment on fork PRs - #103

Merged
kylebeggs merged 1 commit into
mainfrom
ci/benchmark-fork-prs
Sep 21, 2026
Merged

kylebeggs merged 1 commit into
mainfrom
ci/benchmark-fork-prs

Conversation

@kylebeggs

Copy link
Copy Markdown
Collaborator

A PR from a fork always gets a read-only GITHUB_TOKEN, whatever the workflow's permissions block asks for — GitHub does this so untrusted code can't write to the base repo. The benchmark job's last step posts a comment, so on a fork PR it 403s and turns the whole check red even though every benchmark ran fine (first seen on #102).

This gates the two comment steps on the head repo being this repo, and always appends the results table to the job summary, so fork PRs still get their numbers — just on the run page instead of in the thread.

It does not fix #102's current benchmark failure, which is separate: that PR bumps the package to 0.2.0 and sets MatrixFreeOperators = "0.2" in benchmark/Project.toml, and benchpkg reuses that env for the 0.1.0 baseline rev, so the baseline can't resolve. That has to be fixed on #102's own branch.

—
🤖 Filed by Claude, so Kyle's benchmark bot and Kyle's PR bot aren't just two tabs of the same person arguing.
claude-fable-5-1 (high) · claude-code 2.1.278 · unreviewed

A fork PR's GITHUB_TOKEN is read-only regardless of the permissions block, so
the comment step 403s and fails a check whose benchmarks all ran (PR #102).
Gate both comment steps on a same-repo head and always write the results
table to the job summary, so fork PRs still show it.

Agent-Harness: claude-code 2.1.278
Agent-Model: claude-opus-5[1m]
Agent-Review: unreviewed
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-21 21:18 UTC

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

Time

bcf3ad3... 977c59b... bcf3ad3... / 977c59b...
forest/2D 64×32²/halo_update! 19.8 ± 0.19 μs 21.4 ± 0.2 μs 0.926 ± 0.012
forest/2D 64×32²/laplacian mul! 0.116 ± 0.0067 ms 0.115 ± 0.0018 ms 1 ± 0.06
forest/2D 64×32²/laplacian mul! (packed) 0.101 ± 0.0016 ms 0.105 ± 0.0022 ms 0.968 ± 0.026
forest/2D 64×32²/prepare 0.0927 ± 0.024 ms 0.0903 ± 0.02 ms 1.03 ± 0.35
forest/2D refined/halo_update! 0.0919 ± 0.0013 ms 0.0914 ± 0.0014 ms 1.01 ± 0.021
forest/2D refined/halo_update_adjoint! 0.226 ± 0.009 ms 0.233 ± 0.0091 ms 0.967 ± 0.054
forest/2D refined/laplacian apply_adjoint! 1.47 ± 0.012 ms 1.47 ± 0.012 ms 0.997 ± 0.011
forest/3D refined/halo_update! 0.782 ± 0.0061 ms 0.833 ± 0.008 ms 0.938 ± 0.012
forest/3D refined/halo_update_adjoint! 3.09 ± 0.016 ms 3.15 ± 0.025 ms 0.98 ± 0.0093
grid/2D 256²/(∂x + ∂y)ᵀ adjoint 0.764 ± 0.0015 ms 0.765 ± 0.0013 ms 0.999 ± 0.0026
grid/2D 256²/2λ + κ·I mul! 0.116 ± 0.0016 ms 0.115 ± 0.0012 ms 1 ± 0.017
grid/2D 256²/adjoint(∂x + ∂y) mul! 0.8 ± 0.0071 ms 0.801 ± 0.0053 ms 0.998 ± 0.011
grid/2D 256²/advection mul! 0.0615 ± 0.0011 ms 0.0724 ± 0.0021 ms 0.851 ± 0.029
grid/2D 256²/diffusion mul! 0.0846 ± 0.0015 ms 0.095 ± 0.0011 ms 0.89 ± 0.018
grid/2D 256²/diffusion prepare 5.07 ± 4 μs 5.81 ± 4.4 μs 0.873 ± 0.95
grid/2D 256²/diffusion slab adjoint (β = 0) 0.0362 ± 0.00014 ms 0.0364 ± 0.00016 ms 0.995 ± 0.0058
grid/2D 256²/diffusion slab adjoint (β ≠ 0) 0.101 ± 0.00022 ms 0.102 ± 0.00062 ms 0.996 ± 0.0064
grid/2D 256²/diffusion slab apply! 25.9 ± 0.17 μs 25.8 ± 0.14 μs 1 ± 0.0086
grid/2D 256²/divergence mul! 0.107 ± 0.00079 ms 0.11 ± 0.0014 ms 0.973 ± 0.014
grid/2D 256²/divergenceᵀ adjoint (β ≠ 0) 0.204 ± 0.004 ms 0.204 ± 0.004 ms 1 ± 0.028
grid/2D 256²/gradient mul! 0.18 ± 0.0082 ms 0.179 ± 0.0076 ms 1.01 ± 0.063
grid/2D 256²/gradientᵀ adjoint (β ≠ 0) 0.361 ± 0.01 ms 0.362 ± 0.01 ms 0.999 ± 0.04
grid/2D 256²/laplacian mul! 0.0654 ± 0.0011 ms 0.0657 ± 0.0011 ms 0.995 ± 0.023
grid/2D 256²/laplacian prepare 5.27 ± 4.1 μs 5.24 ± 4 μs 1.01 ± 1.1
grid/2D 256²/∂x adjoint (β = 0) 0.377 ± 0.01 ms 0.357 ± 0.01 ms 1.06 ± 0.042
grid/2D 256²/∂x adjoint (β ≠ 0) 0.399 ± 0.01 ms 0.399 ± 0.01 ms 0.998 ± 0.037
grid/2D 256²/∇·(κ∇u) mul! 0.262 ± 0.0097 ms 0.254 ± 0.01 ms 1.03 ± 0.056
grid/2D 256²/∇·(κ∇u) prepare 19 ± 11 μs 18.2 ± 11 μs 1.04 ± 0.89
grid/3D 64³/diffusion mul! 0.548 ± 0.012 ms 0.559 ± 0.013 ms 0.979 ± 0.03
grid/3D 64³/diffusion slab adjoint (β = 0) 0.537 ± 0.011 ms 0.527 ± 0.011 ms 1.02 ± 0.03
grid/3D 64³/diffusion slab adjoint (β ≠ 0) 0.91 ± 0.0042 ms 0.903 ± 0.0041 ms 1.01 ± 0.0065
grid/3D 64³/diffusion slab apply! 0.198 ± 0.0049 ms 0.196 ± 0.0045 ms 1.01 ± 0.034
grid/3D 64³/laplacian mul! 0.349 ± 0.012 ms 0.352 ± 0.013 ms 0.991 ± 0.05
grid/3D 64³/laplacian prepare 0.116 ± 0.022 ms 0.114 ± 0.03 ms 1.02 ± 0.33
time_to_load 0.304 ± 0.0091 s 0.297 ± 0.0034 s 1.02 ± 0.033

Memory and allocations

bcf3ad3... 977c59b... bcf3ad3... / 977c59b...
forest/2D 64×32²/halo_update! 0 allocs: 0 B 0 allocs: 0 B
forest/2D 64×32²/laplacian mul! 0 allocs: 0 B 0 allocs: 0 B
forest/2D 64×32²/laplacian mul! (packed) 0 allocs: 0 B 0 allocs: 0 B
forest/2D 64×32²/prepare 0.582 k allocs: 1.72 MB 0.582 k allocs: 1.72 MB 1
forest/2D refined/halo_update! 0 allocs: 0 B 0 allocs: 0 B
forest/2D refined/halo_update_adjoint! 0 allocs: 0 B 0 allocs: 0 B
forest/2D refined/laplacian apply_adjoint! 0 allocs: 0 B 0 allocs: 0 B
forest/3D refined/halo_update! 0 allocs: 0 B 0 allocs: 0 B
forest/3D refined/halo_update_adjoint! 0 allocs: 0 B 0 allocs: 0 B
grid/2D 256²/(∂x + ∂y)ᵀ adjoint 0 allocs: 0 B 0 allocs: 0 B
grid/2D 256²/2λ + κ·I mul! 2 allocs: 0.0938 kB 2 allocs: 0.0938 kB 1
grid/2D 256²/adjoint(∂x + ∂y) mul! 2 allocs: 0.0938 kB 2 allocs: 0.0938 kB 1
grid/2D 256²/advection mul! 2 allocs: 0.0938 kB 2 allocs: 0.0938 kB 1
grid/2D 256²/diffusion mul! 2 allocs: 0.0938 kB 2 allocs: 0.0938 kB 1
grid/2D 256²/diffusion prepare 6 allocs: 1.02 MB 6 allocs: 1.02 MB 1
grid/2D 256²/diffusion slab adjoint (β = 0) 0 allocs: 0 B 0 allocs: 0 B
grid/2D 256²/diffusion slab adjoint (β ≠ 0) 0 allocs: 0 B 0 allocs: 0 B
grid/2D 256²/diffusion slab apply! 0 allocs: 0 B 0 allocs: 0 B
grid/2D 256²/divergence mul! 1 allocs: 0.0469 kB 1 allocs: 0.0469 kB 1
grid/2D 256²/divergenceᵀ adjoint (β ≠ 0) 0 allocs: 0 B 0 allocs: 0 B
grid/2D 256²/gradient mul! 1 allocs: 0.0469 kB 1 allocs: 0.0469 kB 1
grid/2D 256²/gradientᵀ adjoint (β ≠ 0) 0 allocs: 0 B 0 allocs: 0 B
grid/2D 256²/laplacian mul! 2 allocs: 0.0938 kB 2 allocs: 0.0938 kB 1
grid/2D 256²/laplacian prepare 6 allocs: 1.02 MB 6 allocs: 1.02 MB 1
grid/2D 256²/∂x adjoint (β = 0) 0 allocs: 0 B 0 allocs: 0 B
grid/2D 256²/∂x adjoint (β ≠ 0) 0 allocs: 0 B 0 allocs: 0 B
grid/2D 256²/∇·(κ∇u) mul! 2 allocs: 0.0938 kB 2 allocs: 0.0938 kB 1
grid/2D 256²/∇·(κ∇u) prepare 18 allocs: 5.08 MB 18 allocs: 5.08 MB 1
grid/3D 64³/diffusion mul! 2 allocs: 0.0938 kB 2 allocs: 0.0938 kB 1
grid/3D 64³/diffusion slab adjoint (β = 0) 0 allocs: 0 B 0 allocs: 0 B
grid/3D 64³/diffusion slab adjoint (β ≠ 0) 0 allocs: 0 B 0 allocs: 0 B
grid/3D 64³/diffusion slab apply! 0 allocs: 0 B 0 allocs: 0 B
grid/3D 64³/laplacian mul! 2 allocs: 0.0938 kB 2 allocs: 0.0938 kB 1
grid/3D 64³/laplacian prepare 6 allocs: 4.39 MB 6 allocs: 4.39 MB 1
time_to_load 0.149 k allocs: 11.2 kB 0.149 k allocs: 11.2 kB 1

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@kylebeggs
kylebeggs merged commit 25f9705 into main Sep 21, 2026
10 checks passed
@kylebeggs
kylebeggs deleted the ci/benchmark-fork-prs branch September 22, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant