Skip to content

Commit 9eda011

Browse files
seabbs-botseabbs
andauthored
fix(ad): close the AD backend/scenario coverage gap (#232)
Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
1 parent 011169f commit 9eda011

147 files changed

Lines changed: 4404 additions & 2437 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.JuliaFormatter.toml‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎.git-blame-ignore-revs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# managed:start
2+
# MANAGED by EpiAwarePackageTools.scaffold — do not edit between
3+
# the markers. Add a reformat commit's SHA after the closing
4+
# marker — it is preserved across updates.
5+
# Formatting-only commits (e.g. a Runic layout pass) touch every line without
6+
# changing behaviour, burying the real last-change commit under `git blame`.
7+
# List such a commit's SHA below this block to have it skipped. Configure git
8+
# to use this file once, locally:
9+
# git config blame.ignoreRevsFile .git-blame-ignore-revs
10+
# managed:end
11+
12+
# Reformat with Runic (no behaviour change)
13+
2dc7031665d8e24f50e4d10a4a34558402ae988d

‎.gitattributes‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# MANAGED by EpiAwarePackageTools.scaffold — do not edit by hand.
22
# Normalise line endings so checkouts are byte-identical across platforms.
3-
# Without this, a Windows runner with core.autocrlf can check out source files
4-
# with CRLF, which makes JuliaFormatter's `overwrite = false` check (and other
5-
# line-sensitive tooling) report spurious differences.
3+
# Without this, a Windows runner with core.autocrlf can check out CRLF
4+
# source, and JuliaFormatter's `overwrite = false` check (and other
5+
# line-sensitive tooling) reports spurious differences.
66
* text=auto eol=lf
77

88
# Binary files: never normalise.

‎.github/actions/increment-version/action.yaml‎

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,18 @@ runs:
4242
id: increment
4343
shell: bash
4444
run: |
45-
# Get current version
4645
CURRENT_VERSION=$(grep '^version = ' Project.toml | sed 's/version = "\(.*\)"/\1/')
4746
echo "Current version: $CURRENT_VERSION"
4847
49-
# Strip any pre-release/build suffix before parsing. A version like
50-
# "0.1.0-DEV" (everything the kit scaffolds starts life pre-release,
51-
# unregistered) has never been published, so the correct transition is
52-
# to RELEASE what the number already says — drop the suffix — not to
53-
# increment past it. Without this, `IFS='.'` leaves PATCH as "0-DEV" and
54-
# `$(( PATCH + 1 ))` coerces the "-DEV" to 0 and yields 1, so the maiden
55-
# published version would be 0.1.1 and 0.1.0 would be silently skipped
56-
# (#255).
48+
# Strip any pre-release/build suffix before parsing. Everything the
49+
# kit scaffolds starts pre-release ("0.1.0-DEV") and unpublished, so
50+
# the correct transition is to RELEASE what the number already says,
51+
# not increment past it. Without this, `IFS='.'` leaves PATCH as
52+
# "0-DEV" and `$(( PATCH + 1 ))` coerces it to 1, so the maiden
53+
# published version would be 0.1.1 and 0.1.0 silently skipped (#255).
5754
BASE_VERSION="${CURRENT_VERSION%%[-+]*}"
5855
59-
# Parse version parts from the released base, so PATCH is a clean number.
56+
# Parse version parts from the released base, so PATCH is clean.
6057
IFS='.' read -ra VERSION_PARTS <<< "$BASE_VERSION"
6158
MAJOR=${VERSION_PARTS[0]}
6259
MINOR=${VERSION_PARTS[1]}
@@ -68,7 +65,6 @@ runs:
6865
echo "Pre-release version '$CURRENT_VERSION' detected: releasing" \
6966
"$NEW_VERSION (suffix stripped, no increment)."
7067
else
71-
# A plain released version: apply the requested increment.
7268
case "${{ inputs.increment-type }}" in
7369
"major")
7470
NEW_MAJOR=$((MAJOR + 1))
@@ -93,7 +89,6 @@ runs:
9389
echo "old-version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
9490
echo "new-version=$NEW_VERSION" >> $GITHUB_OUTPUT
9591
96-
# Update Project.toml
9792
sed -i "s/version = \"$CURRENT_VERSION\"/version = \"$NEW_VERSION\"/" Project.toml
9893
9994
- name: Check for existing PR
@@ -103,7 +98,6 @@ runs:
10398
run: |
10499
NEW_VERSION="${{ steps.increment.outputs.new-version }}"
105100
106-
# Check if a PR already exists with the same version
107101
EXISTING_PR=$(gh pr list --state open --search "in:title \"${{ inputs.pr-title-prefix }} to $NEW_VERSION\"" --json number --jq '.[0].number // empty')
108102
109103
if [ -n "$EXISTING_PR" ]; then
@@ -120,19 +114,16 @@ runs:
120114
if: inputs.create-pr == 'true' && steps.check-pr.outputs.existing-pr == 'false'
121115
shell: bash
122116
run: |
123-
# Configure git
124117
git config --local user.email "action@github.com"
125118
git config --local user.name "GitHub Action"
126119
127120
OLD_VERSION="${{ steps.increment.outputs.old-version }}"
128121
NEW_VERSION="${{ steps.increment.outputs.new-version }}"
129122
INCREMENT_TYPE="${{ inputs.increment-type }}"
130123
131-
# Create new branch
132124
BRANCH_NAME="auto/version-increment-${NEW_VERSION}"
133125
git checkout -b "$BRANCH_NAME"
134126
135-
# Commit changes
136127
git add Project.toml
137128
git commit -m "${{ inputs.pr-title-prefix }} to $NEW_VERSION
138129
@@ -141,7 +132,6 @@ runs:
141132
Previous version: $OLD_VERSION
142133
New version: $NEW_VERSION"
143134
144-
# Push branch
145135
git push origin "$BRANCH_NAME"
146136
147137
# Only assign when a handle was configured. Assigning a bare org (the
@@ -152,7 +142,6 @@ runs:
152142
ASSIGNEE_ARGS=(--assignee "${{ inputs.assignee }}")
153143
fi
154144
155-
# Create PR using GitHub CLI
156145
PR_OUTPUT=$(gh pr create \
157146
--title "${{ inputs.pr-title-prefix }} to $NEW_VERSION" \
158147
--body "This PR automatically increments the version from \`$OLD_VERSION\` to \`$NEW_VERSION\` as a **$INCREMENT_TYPE** release.
@@ -176,7 +165,6 @@ runs:
176165
--head "$BRANCH_NAME" \
177166
"${ASSIGNEE_ARGS[@]}")
178167
179-
# Extract PR number
180168
PR_NUMBER=$(echo "$PR_OUTPUT" | grep -o '/pull/[0-9]*' | grep -o '[0-9]*')
181169
echo "pr-number=$PR_NUMBER" >> $GITHUB_OUTPUT
182170
echo "Created PR #$PR_NUMBER"
@@ -194,15 +182,13 @@ runs:
194182
if: inputs.create-pr == 'false'
195183
shell: bash
196184
run: |
197-
# Configure git
198185
git config --local user.email "action@github.com"
199186
git config --local user.name "GitHub Action"
200187
201188
OLD_VERSION="${{ steps.increment.outputs.old-version }}"
202189
NEW_VERSION="${{ steps.increment.outputs.new-version }}"
203190
INCREMENT_TYPE="${{ inputs.increment-type }}"
204191
205-
# Commit changes
206192
git add Project.toml
207193
git commit -m "${{ inputs.pr-title-prefix }} to $NEW_VERSION
208194
@@ -211,5 +197,4 @@ runs:
211197
Previous version: $OLD_VERSION
212198
New version: $NEW_VERSION"
213199
214-
# Push to current branch
215200
git pull && git push

‎.github/dependabot.yml‎

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ updates:
77
- package-ecosystem: "github-actions"
88
directory: "/"
99
schedule:
10-
interval: "weekly"
11-
# Bundle every github-actions bump (third-party actions + the EpiAware
12-
# reusable-workflow SHAs) into a single grouped PR per run, so one
13-
# EpiAware/.github change no longer spawns a separate PR per workflow file
14-
# that references it (#249).
10+
# Daily, so a fix in shared workflows arrives within a day rather than
11+
# a week. Grouping (below) makes this affordable: a daily run refreshes
12+
# the one open grouped PR instead of opening more, at the cost of more
13+
# CI runs than a weekly batch — a deliberate trade (#312).
14+
interval: "daily"
15+
# Bundle every github-actions bump into a single grouped PR per run, so
16+
# one EpiAware/.github change doesn't spawn a PR per referencing
17+
# workflow file (#249).
1518
groups:
1619
github-actions:
1720
patterns:
@@ -29,7 +32,11 @@ updates:
2932
- package-ecosystem: "julia"
3033
directory: "/"
3134
schedule:
32-
interval: "weekly"
35+
# Daily, as above (#312). This ecosystem's refresh costs the most CI
36+
# (the full test matrix reruns), so a package that would rather trade
37+
# latency for runner time can set this back to `weekly` — the grouping
38+
# below is what actually matters.
39+
interval: "daily"
3340
# One grouped PR per run for all Julia dependency bumps across the
3441
# workspace environments, rather than a separate PR per package (#249).
3542
groups:
@@ -42,3 +49,48 @@ updates:
4249
commit-message:
4350
prefix: "chore"
4451
include: "scope"
52+
53+
# The isolated test environments (`test/jet`, `test/formatter`, and with
54+
# `ad = true` also `test/ad` and `test/ADFixtures`). These exist precisely so
55+
# a heavy QA dependency's own pins cannot clash with the shared test deps, so
56+
# they are deliberately NOT `[workspace]` members of the root Project.toml —
57+
# which means the `directory: "/"` entry above has never seen them. Left
58+
# unwatched, their pins drift away from the compat entries in
59+
# `test/Project.toml`: a bump there goes green while the environment that
60+
# actually runs the check stays on the old version, so the green tells you
61+
# nothing about the new one.
62+
#
63+
# A glob rather than an explicit list because which of these directories
64+
# exist is per-package: a `noad` package has no `test/ad` or
65+
# `test/ADFixtures`, and an explicit path that does not exist fails the
66+
# Dependabot run.
67+
#
68+
# Kept as its own entry, and its own group, so these land in a separate PR
69+
# from the workspace bumps. That is the point: a JET or Runic minor
70+
# is a breaking bump under 0.x semver and wants reviewing on its own, not
71+
# bundled into a grouped PR alongside routine workspace updates.
72+
- package-ecosystem: "julia"
73+
directories:
74+
- "/test/*"
75+
# The docs project, and one environment per tutorial that needs its own.
76+
# A tutorial environment resolves standalone rather than joining the
77+
# root `[workspace]`, which is what lets two tutorials hold
78+
# incompatible versions, and also what leaves nothing else watching
79+
# them. Both depths are listed so an environment tree may mirror the
80+
# tutorial tree: `*` is documented, `**` is not, so the recursive
81+
# pattern is additive rather than relied on.
82+
- "/docs"
83+
- "/docs/environments/*"
84+
- "/docs/environments/**"
85+
schedule:
86+
interval: "daily"
87+
groups:
88+
julia-isolated:
89+
patterns:
90+
- "*"
91+
open-pull-requests-limit: 10
92+
reviewers:
93+
- "seabbs"
94+
commit-message:
95+
prefix: "chore"
96+
include: "scope"

‎.github/workflows/Register.yml‎

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
# MANAGED by EpiAwarePackageTools.scaffold — do not edit by hand.
22
#
33
# Triggers Julia General Registry registration by posting the
4-
# `@JuliaRegistrator register` comment on the `main` branch's HEAD commit —
5-
# the same comment a maintainer would type by hand on the commit page, so no
6-
# extra registration service or token beyond the default `GITHUB_TOKEN` is
7-
# needed. Two ways to fire it, both gated on the actor having write access:
4+
# `@JuliaRegistrator register` comment on `main`'s HEAD commit — the same
5+
# comment a maintainer would type by hand, so no extra service or token
6+
# beyond `GITHUB_TOKEN` is needed. Two ways to fire it, both gated on the
7+
# actor having write access:
88
#
99
# - Comment `/register` on any issue or pull request.
1010
# - Run this workflow manually (Actions -> Register -> Run workflow).
1111
#
12-
# JuliaRegistrator (the separate GitHub App installed on the org) then reacts
13-
# to the posted commit comment, opens the registry PR, and TagBot creates the
14-
# GitHub release once it merges — see docs/src/developer/release-process.md.
12+
# JuliaRegistrator (the org's GitHub App) then reacts to the commit comment,
13+
# opens the registry PR, and TagBot creates the release once it merges.
1514

1615
name: Register
1716

@@ -26,13 +25,11 @@ jobs:
2625
github.event_name == 'workflow_dispatch' ||
2726
startsWith(github.event.comment.body, '/register')
2827
runs-on: ubuntu-latest
29-
# `contents: write` — posting the `@JuliaRegistrator register` commit
30-
# comment (`POST .../commits/{sha}/comments`) needs Contents write.
31-
# `issues: write` — posting the permission-denied reaction
32-
# (`POST .../issues/comments/{id}/reactions`) needs Issues write (a PR
33-
# conversation comment is an issue comment for this endpoint). The
34-
# collaborator-permission check below needs no extra scope: `Metadata`
35-
# read is always available to `GITHUB_TOKEN`, permissions block or not.
28+
# `contents: write` — posting the commit comment needs Contents write.
29+
# `issues: write` — posting the permission-denied reaction needs Issues
30+
# write (a PR conversation comment is an issue comment for this
31+
# endpoint). The permission check itself needs no extra scope: Metadata
32+
# read is always available to `GITHUB_TOKEN`.
3633
permissions:
3734
contents: write
3835
issues: write

‎.github/workflows/ad.yaml‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@
22
name: AD
33

44
# Drives the per-backend AD gradient matrix (the shipped `test/ad/` harness).
5-
# The per-flag coverage upload and job mechanics live in the reusable; this is
6-
# the thin caller. Without it the AD harness the kit ships never runs in CI.
5+
# Per-flag coverage upload and job mechanics live in the reusable; this is
6+
# the thin caller.
77
#
8-
# `backends` is passed explicitly (built from `_AD_BACKENDS`, the kit's single
9-
# source of truth for the AD infra) rather than left to the reusable's own
10-
# default, so the actual CI matrix can never drift from the badges/codecov
11-
# flags this same package generates.
8+
# `backends` is passed explicitly (built from `_AD_BACKENDS`, the kit's
9+
# single source of truth) rather than left to the reusable's own default,
10+
# so the CI matrix can never drift from the badges/codecov flags this
11+
# package generates.
1212

1313
on:
1414
push:
1515
branches: [main]
16-
# Don't fire the 6-backend AD sweep (the heaviest, slowest matrix) for
17-
# changes that cannot alter a gradient result. Only clearly AD-irrelevant
18-
# paths are ignored: prose docs and markdown. Anything touching src/,
19-
# ext/, test/, Project.toml, benchmark/ or the workflow itself still
20-
# triggers the full matrix. paths-ignore only skips when EVERY changed
21-
# file matches, so a mixed docs+src PR still runs.
16+
# Skip the heavy 7-backend sweep only for changes that cannot alter a
17+
# gradient result (prose docs, markdown); everything else — src/, ext/,
18+
# test/, Project.toml, benchmark/, the workflow itself — still triggers
19+
# it. Only skips when EVERY changed file matches.
2220
paths-ignore:
2321
- 'docs/**'
2422
- '**/*.md'
@@ -38,5 +36,5 @@ jobs:
3836
ad:
3937
uses: EpiAware/.github/.github/workflows/ad.yml@d024dc6927cc3523292a159dc0d4a45193c9c65d
4038
with:
41-
backends: '[{"name":"ForwardDiff","tag":"forwarddiff","flag":"ad-forwarddiff"},{"name":"ReverseDiff (tape)","tag":"reversediff","flag":"ad-reversediff"},{"name":"Enzyme forward","tag":"enzyme_forward","flag":"ad-enzyme-forward"},{"name":"Enzyme reverse","tag":"enzyme_reverse","flag":"ad-enzyme-reverse"},{"name":"Mooncake reverse","tag":"mooncake_reverse","flag":"ad-mooncake-reverse"},{"name":"Mooncake forward","tag":"mooncake_forward","flag":"ad-mooncake-forward"}]'
39+
backends: '[{"name":"ForwardDiff","tag":"forwarddiff","flag":"ad-forwarddiff"},{"name":"ReverseDiff (tape)","tag":"reversediff","flag":"ad-reversediff"},{"name":"ReverseDiff (compiled)","tag":"reversediff_compiled","flag":"ad-reversediff-compiled"},{"name":"Enzyme forward","tag":"enzyme_forward","flag":"ad-enzyme-forward"},{"name":"Enzyme reverse","tag":"enzyme_reverse","flag":"ad-enzyme-reverse"},{"name":"Mooncake reverse","tag":"mooncake_reverse","flag":"ad-mooncake-reverse"},{"name":"Mooncake forward","tag":"mooncake_forward","flag":"ad-mooncake-forward"}]'
4240
secrets: inherit # pragma: allowlist secret

‎.github/workflows/auto-version-increment.yaml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@ jobs:
2222
- name: Check if version changed
2323
id: version-check
2424
run: |
25-
# Get the version from current commit
2625
CURRENT_VERSION=$(grep '^version = ' Project.toml | sed 's/version = "\(.*\)"/\1/')
2726
echo "Current version: $CURRENT_VERSION"
2827
29-
# Get the version from previous commit
3028
git show HEAD~1:Project.toml > Project.toml.prev
3129
PREV_VERSION=$(grep '^version = ' Project.toml.prev | sed 's/version = "\(.*\)"/\1/')
3230
echo "Previous version: $PREV_VERSION"
3331
34-
# Check if version changed
3532
if [ "$CURRENT_VERSION" = "$PREV_VERSION" ]; then
3633
echo "Version unchanged, need to increment"
3734
echo "needs_increment=true" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)