Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4ae3f72
Move all Enzyme tests into test/integration/enzyme
yebai May 13, 2026
0693756
Share AD test bodies across backends via test/shared/
yebai May 13, 2026
e392845
Merge shared/ into test/testresources.jl with Mooncake-style TestCases
yebai May 13, 2026
0547906
Skip known Enzyme product failures inline in the integration test
yebai May 13, 2026
eadc163
Replace index-based Enzyme product skip with structural predicate
yebai May 13, 2026
c0cc557
Tighten test resources: short names, centralised adtypes, hoisted cases
yebai May 13, 2026
63859d2
Rename NONENZYME_ADTYPES to BASE_ADTYPES
yebai May 13, 2026
fafb46a
Rename BASE_ADTYPES to adtypes
yebai May 13, 2026
b81f223
Fix Enzyme CI: drop stale Pkg.resolve, apply JuliaFormatter
yebai May 13, 2026
dc6cbb6
Apply JuliaFormatter v1.0 (CI version)
yebai May 13, 2026
ebe3384
Reload ForwardDiff in Enzyme integration; allow Enzyme job to fail
yebai May 13, 2026
edcdccb
Make broken cases self-correcting; reproducible random inputs
yebai May 13, 2026
c3ce01b
Audit follow-ups: prune imports, mark broken cases, unify style
yebai May 13, 2026
c5475ac
Rewrite Enzyme adtype comment with direct technical reasons
yebai May 13, 2026
d56ee2b
Shorten Enzyme adtype comment; drop unverified claims
yebai May 13, 2026
1b33965
Move ReverseDiff/Mooncake to integration tests, drop DI from Bijector…
yebai May 14, 2026
9aaeb37
Make test/vector/main.jl the non-AD main-suite runner
yebai May 14, 2026
1ff76b5
Restore ReverseDiff source relpath; add ForwardDiff bijector-AD loop
yebai May 14, 2026
ebe788b
Test housekeeping: drop DistributionsAD, rename dirs/files, split int…
yebai May 14, 2026
b2d2124
/simplify follow-ups on ebe788b
yebai May 14, 2026
d217f31
CI: pin matrix to min + 1 across workflows
yebai May 14, 2026
1613f87
CI: shorten check-tile names
yebai May 14, 2026
00ce398
CI: shorten Format check-tile name
yebai May 14, 2026
8a423b2
Fold doctests into docs build
yebai May 14, 2026
9327bcf
Format: drop trailing blank line in runtests.jl
yebai May 14, 2026
3a7a57c
CI: drop duplicate ubuntu/Julia 1 matrix entry, grant cache cleanup p…
yebai May 14, 2026
754fc22
Add MacroTools to test environment
yebai May 14, 2026
d8bbc37
CI: Pkg.develop Bijectors in AD integration suites for Julia 1.10
yebai May 14, 2026
bc58fcd
Drop unused MacroTools test dep
yebai May 14, 2026
24ed323
Drop BijectorsDistributionsADExt
yebai May 14, 2026
43e2d18
Re-merge AD-dependent vector checks into VectorBijectors.test_all
yebai May 14, 2026
2b764eb
Scrutinise cleanup
yebai May 14, 2026
9e145be
Docs: clarify which AD backends test_all uses by default
yebai May 15, 2026
d3555e8
test_all: add broken/skip kwargs; skip AD for discrete distributions
yebai May 15, 2026
daa2d1d
test_roundtrip_inverse: skip y ≈ ynew for JointOrderStatistics
yebai May 15, 2026
f397b5e
test_all: replace broken::Bool with broken_adtypes for per-adtype gra…
yebai May 15, 2026
c3046d0
Update Project.toml
yebai May 18, 2026
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
8 changes: 6 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
- main
pull_request:

# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
actions: write
contents: read

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
Expand All @@ -14,6 +19,7 @@ concurrency:

jobs:
test:
name: ${{ matrix.group }} / Julia ${{ matrix.runner.version }} / ${{ matrix.runner.os }}
runs-on: ${{ matrix.runner.os }}
strategy:
fail-fast: false
Expand All @@ -25,8 +31,6 @@ jobs:
os: 'macos-latest'
- version: '1'
os: 'windows-latest'
- version: '1.11'
os: 'ubuntu-latest'
- version: 'min'
os: 'ubuntu-latest'
group:
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/DocTests.yml

This file was deleted.

24 changes: 19 additions & 5 deletions .github/workflows/Enzyme.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Enzyme AD tests
name: Enzyme

on:
push:
Expand All @@ -17,19 +17,33 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
enzyme:
test:
name: Julia ${{ matrix.version }}
runs-on: ubuntu-latest
# Enzyme is an integration test isolated from the main suite. It reports failures for
# visibility but does not block PRs: Enzyme regressions surface as red here without
# making the rest of the workflow fail.
continue-on-error: true
strategy:
fail-fast: false
matrix:
version:
- "min"
- "1"
steps:
- uses: actions/checkout@v6

- uses: julia-actions/setup-julia@v3
with:
version: "1.11"
version: ${{ matrix.version }}

- uses: julia-actions/cache@v3

- name: Run Enzyme tests
working-directory: test/integration/enzyme
working-directory: test/integration_tests/enzyme
# `Pkg.develop` makes Julia 1.10 use the working tree's Bijectors. The
# `[sources]` section in `Project.toml` only takes effect on Julia 1.11+,
# so on 1.10 the registry version would be resolved instead.
run: |
julia --project=. --color=yes -e 'using Pkg; Pkg.instantiate()'
julia --project=. --color=yes -e 'using Pkg; Pkg.develop(PackageSpec(path="../../..")); Pkg.instantiate()'
julia --project=. --color=yes main.jl
3 changes: 2 additions & 1 deletion .github/workflows/Format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
format:
check:
name: runic
runs-on: ubuntu-latest

steps:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/Mooncake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Mooncake

on:
push:
branches:
- main
pull_request:

# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
actions: write
contents: read

# Cancel existing tests on the same PR if a new commit is added to a pull request
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
name: Julia ${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "min"
- "1"
steps:
- uses: actions/checkout@v6

- uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.version }}

- uses: julia-actions/cache@v3

- name: Run Mooncake tests
working-directory: test/integration_tests/mooncake
# `Pkg.develop` makes Julia 1.10 use the working tree's Bijectors. The
# `[sources]` section in `Project.toml` only takes effect on Julia 1.11+,
# so on 1.10 the registry version would be resolved instead.
run: |
julia --project=. --color=yes -e 'using Pkg; Pkg.develop(PackageSpec(path="../../..")); Pkg.instantiate()'
julia --project=. --color=yes main.jl
45 changes: 45 additions & 0 deletions .github/workflows/ReverseDiff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: ReverseDiff

on:
push:
branches:
- main
pull_request:

# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
actions: write
contents: read

# Cancel existing tests on the same PR if a new commit is added to a pull request
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
name: Julia ${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "min"
- "1"
steps:
- uses: actions/checkout@v6

- uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.version }}

- uses: julia-actions/cache@v3

- name: Run ReverseDiff tests
working-directory: test/integration_tests/reversediff
# `Pkg.develop` makes Julia 1.10 use the working tree's Bijectors. The
# `[sources]` section in `Project.toml` only takes effect on Julia 1.11+,
# so on 1.10 the registry version would be resolved instead.
run: |
julia --project=. --color=yes -e 'using Pkg; Pkg.develop(PackageSpec(path="../../..")); Pkg.instantiate()'
julia --project=. --color=yes main.jl
4 changes: 0 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[weakdeps]
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
DistributionsAD = "ced4e74d-a319-5a8a-b0ac-84af2272839c"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"

[extensions]
BijectorsDistributionsADExt = "DistributionsAD"
BijectorsForwardDiffExt = "ForwardDiff"
BijectorsLazyArraysExt = "LazyArrays"
BijectorsMooncakeExt = "Mooncake"
Expand All @@ -49,7 +47,6 @@ ChainRulesCore = "0.10.11, 1"
ChangesOfVariables = "0.1"
DifferentiationInterface = "0.7.14"
Distributions = "0.25.33"
DistributionsAD = "0.6"
DocStringExtensions = "0.9"
EnzymeCore = "0.8.15"
FillArrays = "1"
Expand All @@ -69,7 +66,6 @@ Test = "1"
julia = "1.10.8"

[extras]
DistributionsAD = "ced4e74d-a319-5a8a-b0ac-84af2272839c"
EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
Expand Down
7 changes: 6 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ makedocs(;
"vector.md",
],
checkdocs=:exports,
doctest=false,
doctest=true,
doctestfilters=[
# Ignore the source of a warning in the doctest output, since this is dependent
# on host. This is a line that starts with "└ @ " and ends with the line number.
r"└ @ .+:[0-9]+",
],
)
5 changes: 3 additions & 2 deletions docs/src/vector.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ For more information about generally testing bijectors (and in particular how to

One of the most tricky parts of testing Bijectors is ensuring that the transforms are compatible with automatic differentiation.
This is important for DynamicPPL: we need to be able to compute the gradient of the log-density with respect to (possibly transformed) parameters, which may include the log-abs-det-Jacobian of the transformation.
The default AD backends tested are ForwardDiff, ReverseDiff, Mooncake, and Enzyme.
`test_all` accepts an `adtypes` keyword argument and defaults to `[AutoForwardDiff()]`, so the main test suite exercises ForwardDiff as the reference backend.
ReverseDiff, Mooncake, and Enzyme are covered by standalone integration suites under `test/integration_tests/<backend>/`, each of which passes its own `adtypes` list through to `test_all`.
It is acceptable to skip tests for a particular backend if there are genuine upstream bugs, especially with ReverseDiff, which is not actively maintained.
However where possible it is best to ensure that all backends are supported, and to use `@test_broken` to mark any known issues with specific backends.
Where possible it is best to ensure that all backends are supported, and to use `@test_broken` to mark any known issues with specific backends.
92 changes: 0 additions & 92 deletions ext/BijectorsDistributionsADExt.jl

This file was deleted.

Loading
Loading