Repository navigation
Description
Act on the findings of the independent review of the release branch, so each is fixed or decided before the freeze.
Open now
- Finding 2, a step reading a parameter from the modifier gives a zero reverse gradient (done in Fail at the call when a step reads a float parameter from the modifier #981).
- Finding 3, the public list against what the docs teach (done in Settle the public surface: remove Device, make the taught names public, keep internals internal #986).
- Finding 5, Enzyme without runtime activity (done in Test Enzyme's default mode on each rule and state when runtime activity is needed #984, which tests the default mode on each rule and states when runtime activity is needed); the owner wants the default mode to work, with the package's rules where needed.
- Finding 6, the Julia floor (done in Raise the Julia floor to 1.12 #1033 and Run the compat-floor CI legs on Julia 1.12 #1036).
- Finding 9, opaque errors (done in Name the error for a device kernel with host inputs, and take one modifier without a tuple #991 and Say at the call when a step does not return a pair #993).
- Finding 10, the silent plain-AD route (done in No silent plain AD: the rule takes ranges and lazy wrappers, and names what it does not #955).
- Finding 12, the convolution method depends on whether FFTW is loaded (done in Run the FFT only on request and remove Auto #1027:
Autois gone fromsrcand the FFT is chosen on request). - Findings 7, 8, 11, 14, 15 and 16: not fixed; each has a reason in the comment of 2 December, 11:41, and needs the owner to accept or reopen it (left unticked for the owner's decision).
Decided
- No wrong output or wrong gradient was found in the built-in parts.
- Finding 4 (
NEWS.md) is resolved: the file is gone. - Julia floor: 1.12.
- The FFT is chosen on request only, and
Autois removed. - Public:
State,Secondary,test_adjoint. Internal:uses_adjoint,Run,Local,TRACED_MIN_STRATA.Deviceis removed;Recentstays. - One modifier is accepted without a tuple.
- A part that needs the package's rule need not work under
NoAdjoint(owner, 2 December).
Earlier text
Earlier title: Independent review before release
Review of claude/amazing-shannon-6nrow8 at 1f19e43, on Julia 1.13.4, Linux, 4 cores.
Summary
The numerical core is sound and fast, but the branch is not yet a release candidate.
I found no wrong output and no wrong gradient in the built-in parts: 34 modifier and coupling set-ups and 15 model cases agreed with ForwardDiff on every backend I ran.
The primal matches or beats a plain hand loop, and the reverse rule matches a hand-written adjoint.
The weak point is the extension surface, not the arithmetic.
There are five ways to write a modifier step, two cotangent contracts, and routing that depends on method-table reflection.
One natural mistake in a user step gives a silently zero reverse gradient while forward mode stays correct.
The public surface is 5 exported and 55 public names, and the docs teach at least ten more that are not public.
Six open pull requests change 12,400 lines against this branch, three add public API and one removes an extension mechanism.
Enzyme works only with runtime activity, and the docs themselves list a forward-mode crash on Julia 1.12 and later.
GPU support is real on JLArrays for the forward pass, narrow for reverse, and untested on a real GPU per pull request.
NEWS.md describes names that do not exist in the source.
The Julia 1.11 floor is claimed but barely tested, with a known silent gradient loss under Enzyme there.
The owner's worry about a local minimum is fair for the extension interface and the number of specialised run paths, not for the operator design.
My advice: merge or close the in-flight API changes, cut the public list to a core, fix the items under "Must fix", then freeze.
Must fix
1. The branch is still moving under the release
- Evidence: six open pull requests against this branch total +8,621 and -3,831 lines.
- Make the pure step the single way to extend the package #920 (66 files) removes
forward!steps as a way to write a modifier; its description says "work in progress". - Table by input time, reversed recurrence and growth of a recurrence #923 adds
contributions,reverse(r),growthandgrowth_gainto the public surface. - Stepwise methods: select strata of a state, shared parameters, batches and the chunked-run contract #928 adds
select, changes what aStateholds, and adds a chunked-run contract. - Benchmark comparison with a noise band, a hand-run suite and gradient_routes #926 adds
gradient_routes. Project.toml:3still says0.2.0, and everything inNEWS.mdis under "Unreleased".- Suggestion: decide each of these before tagging, and review the result again, as most findings below on the extension API depend on whether Make the pure step the single way to extend the package #920 lands.
2. A step that reads a parameter from the modifier gives a silently zero reverse gradient
- Verified with this reproducer:
struct Bad{A}; a::A; end
CR.isstateless(::Bad) = true
CR.step(m::Bad, θ, v, s) = (m.a * v, nothing) # m.a, not θ.a
f = x -> sum(Recurrence(g; modifiers = (Bad(x[1]),))(R; history = h))
# ForwardDiff: [124.788] Mooncake reverse: [0.0]m.ais the idiomatic way to read a field in Julia, so users will write it.- The docs warn about it (
docs/src/developer/extending.md:39), and onlyPieceInterface{(:step,)}catches it, by printing[false], not by throwing. - A gradient that differs between backends with no error is the worst failure a package like this can have.
- Suggestion: make the mistake impossible rather than documented.
- Pass the step a modifier whose parameter fields are stripped (or pass only its type), or drop
mand dispatch on a tag, som.afails loudly.
3. The public list is not the surface the docs teach
- Verified with
Base.ispublic:State,contributions,Secondary,param_eltype,uses_adjoint,Run,test_adjoint,depth,forward,ispointwise,AutoandExecutorare not public. - Each of them is used on a user-facing page or in a public docstring; a call with
record = Resume()returns aState, for example. Deviceis public, and its own docstring calls it the older name forParallel(src/adjoints/executor.jl:460).- Suggestion: for each name, make it public or remove it from user pages; drop
Devicebefore it is frozen.
4. NEWS.md contradicts the code
- Read, not run: it names
Pool,Routes(...),SoftTruncate,movement,prepend = true,flows_first,AddandClamp, none of which exist insrc. - It says
forward,depth,uses_adjoint,test_adjoint,Executorandeach!are public; none is insrc/ComposableRecurrences.jl:102-110. - It says the ForwardDiff extension is gone and also lists one.
- Suggestion: replace it with a short changelog against
v0.1.0, checked against thepubliclist.
5. Enzyme support is narrower than the README says
- Verified: with
AutoEnzyme(; mode = Enzyme.Reverse)three of my 15 cases throwEnzymeRuntimeActivityError, including every plain-AD route (NoAdjoint, a coupling without apullback!). - Verified: with
Enzyme.Forwardsix of 15 throw the same error, including a plain dense-coupled recurrence differentiated in its coupling. - With
set_runtime_activityall 15 pass in both modes. - Every Enzyme test in
test/adsets runtime activity, so the default mode is untested. docs/src/extensions/enzyme.mdlists a forward-mode garbage-collector crash on Julia 1.12 and later after repeated gradients (Enzyme forward gradient of "Recurrence array-field and scalar-field modifiers" segfaults in the GC #321); I did not reproduce it in a short run.- The README says the same code runs "under forward- and reverse-mode automatic differentiation" without qualification.
- Suggestion: state in the README that Enzyme needs runtime activity, call Enzyme forward experimental until Enzyme forward gradient of "Recurrence array-field and scalar-field modifiers" segfaults in the GC #321 is closed, and add one default-mode test per rule so a regression is seen.
6. The Julia 1.11 floor is claimed, not tested
- Read, not run:
test.yaml:39runs Julia1only, and 1.11 gets the unit suite inthreads.yamland a smallcompat_floorset per pull request. - ForwardDiff, Mooncake forward and Enzyme forward never run on 1.11 or 1.12 by name.
- Two 1.11 Enzyme defects are marked broken (
test/ad/adjoints.jl:979-981,1430-1435), and the Enzyme page lists a silent zero gradient on 1.11. _stored_coupling(src/operators/recurrence.jl:217-221) and_ADLeaves(src/adjoints/adjoints.jl:210-216) exist only to work around 1.11.- Suggestion: raise the floor to 1.12 and delete the workarounds, or test every backend on 1.11 per pull request.
Should fix
7. Too many ways to extend, with two contracts
- A modifier step can be written as: a pure scalar
step; a purestepon tuples withblocks; an in-place pointwiseforward!withblocks = (1, 1)(extending-parameters.md); an in-place whole-vectorforward!; an in-placeforward!on tuples of one-entry views with a group index (extending-steps.md). - A depletion form reuses
forward!(form, Step(), v, s, N), where the last argument is a population, not a time (src/interface/roles.jl:64-66). pullback!has two contracts: it mutatesgradsand returnsnothingforStep,Init,PressureandRun, and it returns partials forLocal(roles.jl:320-338).- A coupling author must learn roles,
grads.piece, mirrors,cotangent,add_cotangent!,add_param!andislinear; a modifier author needs none of these. - Suggestion: land Make the pure step the single way to extend the package #920 so
stepis the only modifier path, give depletion forms the same pure signature, and rename theLocalmethod (for examplelocal_partials) sopullback!has one meaning. - Consider a pure form for couplings too,
q = couple(C, θ, p)differentiated as the step is, withforward!andpullback!kept as the measured fast path.
8. Routing rests on reflection and inference
_canonical,_has_init,_has_step_pullbackand_has_pullbackcallCore._hasmethod(about ten uses), which is internal to Julia._has_localcallsCore.Compiler.return_type(roles.jl:377-386), so whether a rule or a forward-mode pass runs depends on what inference returns.- A method is found only when its trailing arguments are untyped.
- Verified:
CR.step(::Ty, θ, v::Float64, s::Float64)givesArgumentError: Ty has neither step(m, θ, v, s) nor forward!(...), which is false. - Verified: late definitions are picked up correctly, so there is no world-age bug today.
- Suggestion: replace the lookups with one declared trait or a supertype, or at least detect any
stepmethod for the type and say "its arguments must be untyped".
9. Errors from a wrong step are opaque
- Verified: returning
(v, nothing)withoutisstatelessgivesMethodError: Cannot convert an object of type Nothing to Float64. - Verified: returning only
vgivesBoundsError: attempt to access Float64 at index [2]. - Verified:
modifiers = Depletion(N)without a tuple givesMethodError: no method matching length(::Depletion{...}). - Verified: a device kernel with host inputs gives a scalar-indexing error, while the opposite mix gives a clear message.
- Suggestion: check the step's return once per call (it is already inferred), accept a single modifier, and make the device check symmetric.
10. The cost of leaving the rule is a cliff
- Verified on Mooncake reverse, 5 strata, 200 steps: my coupling with a
pullback!costs 4.5 times the primal, and without one 18.4 times. - Enzyme reverse: 3.0 and 17.2 times.
- The constructor logs an
@infoonce, which is good, but the log is the only signal. - Each construction of such an operator builds the message string and takes a lock: 0.9 µs and 1,200 bytes against 0.08 µs for a rule-routed one (
recurrence.jl:1122-1142). - Unexplained: after one Mooncake gradient through a plain-routed operator, the primal of the same closure went from 14.9 µs to 21.1 µs in the same session, in three separate runs.
- Suggestion: build the message only when it is new, and look into the slowdown before release.
11. Naming collisions that will be frozen
stepis a public function,Stepis a role, andstep =is a constructor keyword for lag width.- Verified:
ComposableRecurrences.stepis notBase.step, sostep(1:2:5)inside the module is aMethodError. Pressure()andTrace()are both roles andrecordmarkers;pressureis also a function.- Options come as structs (
Hazard()), as symbols (overflow = :queue) and asVal(trace_imports = Val(true)), while the module docstring says options are structs. Recurrencetakesgainpositionally andConvolutiontakes it as a keyword.- Suggestion: rename the keyword (
width, say), pick one option style, and decide the names before the freeze.
12. The convolution method depends on whether FFTW is loaded
Autotakes the FFT from 300 lags and 1000 steps, only when FFTW is loaded in the session.- Verified at 300 lags and 1000 steps: direct 28.1 µs, FFT 34.2 µs, so
Autopicked the slower method on this machine. - At 300 by 2000 they tie; at 1000 by 5000 the FFT is 4.4 times faster.
- Results differ at about 1e-14 relative, so loading FFTW anywhere changes a model's numbers.
- Suggestion: make the FFT opt-in for the stable release, or raise the threshold to where it wins by a clear margin.
13. Specialised run paths, some without a clear margin
- A recurrence can run as a scan, a strata-major run, a carried run, a chained run, a series run or a coupled run (
recurrence.jl:1583-1930,1962-2092). - Verified: the strata-major run is 2.4 times faster at one lag and about 1.35 times at two, but about 1.05 times at three, its upper bound (
_STRATA_MAJOR_LAGS = 3). - Verified: the same stratum gives different last bits with 1 and with 3 strata (relative 5e-16), as the paths round differently.
- Verified: a
Threadedexecutor belowmin_workis 10 to 20% slower thanSerialat 20 strata. - Suggestion: drop three lags from the strata-major run unless a benchmark in the repository shows 10%, and state in the docs that outputs agree across paths only to rounding.
14. The package is large for its stated job
- 24,421 lines in
srcandext, 629 distinct internal function names, 63 generated functions, 12 extensions, 27 workflows. Allocate(848 lines),Recent(631), computed kernels and the cohort walk (about 2,300), change points (383),growth_rate,window_sumsand the Reactant extension (659) are beyond "recurrences and convolutions over lag kernels".- The Reactant path never runs the package's rules, by the docs' own account.
- Suggestion: freeze a core (
Recurrence,Convolution, the three wrappers,Depletionwith its forms and flows,Transform,step,init,step_pullback, executors,NoAdjoint) and mark the rest experimental and outside semver.
15. No downstream test, and benchmarks that cannot be tied to this code
- Read, not run:
downstream.yaml:43has an empty list, so BVDOutbreakSize, ComposableTuringIDModels and Wren models are not tested against this branch. benchmark.yamlruns only for pull requests intomain, so nothing compares this branch.- All 279 rows of
benchmark/results/docs.csvcarry one older revision, and the performance pages are built from it. - 129 of 607 default test items have no recorded time, so the time-budget test can pass while the run is over budget.
- Suggestion: add the two consumers to the downstream job, regenerate the results at the release commit, and fail the budget test on unrecorded items.
16. Docs: accurate in the main, too long and repetitive
- Read, not run: 36 pages and 12 tutorials, about 31,500 words.
- The step equation appears in six places.
- Rule policy and timings are split over five pages, and role argument tables over four.
Shiftis defined twice with different meanings in the extending pages.- The README carries ReverseDiff badges while the backends page says ReverseDiff is not a target.
- Private vocabulary is heavy: piece, mirror, twin, arm, cohort, draw and part are used before they are defined.
- The GPU section of
adjoints-and-backends.mdis implementation notes; a table of what runs where would serve better. extending.mdis the best page and was enough to write a modifier.- For a coupling I had to assemble the layout of
gradsfrom three pages, and found noPieceInterfaceexample for one. - Restructure the docs to the EpiAware standards #922 fixes the structure and most repetition; it leaves
NEWS.md, the extending pages and the badges.
Can wait
- A call without
historyreturns zeros, and a short history is zero-padded, both silently and both documented; a warning for a recurrence with no seed and noaddwould save new users. - A
Statefrom another operator is accepted when the sizes fit; I resumed a four-lag recurrence from a three-lag state without an error. Depletion(-5.0)and a negative gain run without complaint.showof aDepletionin a container prints the full type; thetext/plainsummaries are good.- The first Mooncake gradient took 16 to 25 s to prepare, and each new model type 1 to 16 s; a precompile workload in the extension would help.
- A reverse gradient allocates 11 to 16 kB at 200 steps against 1.9 kB for the primal.
- Reverse rules are tested three times (
test/unit/adjoints.jl,test/ad/adjoints.jl, the registry); keep the registry as the one oracle. test/ADFixturesholds shims for pre-release designs (ADFixtures.jl:38-69); drop them at the release.- About 25 allocation assertions are skipped under coverage, and the main test job uploads coverage; confirm one cell runs them.
test/cuda/has no workflow; say in the docs that a real GPU is tested by hand.
What is good
- Output and gradients: correct everywhere I looked.
- Resume: a split run equals the whole run bit for bit in all 34 set-ups, and a state can be reused.
- Threads:
ThreadedequalsSerialbit for bit in all 34, and 64 concurrent calls on one operator agreed. - Inference:
@inferredpasses for a call with everyrecordmarker. - Load time 0.44 s, first call a few microseconds, so precompilation works.
- A user's pure step ran unchanged on JLArrays, under threads and on every backend, with the rule.
- Broken markers are few, central and honest, and tolerances are tight (read, not run).
What I ran
- Edge cases: about 60 calls on empty inputs, one stratum, one lag, no lags,
NaN,Inf, integers,Float32,BigFloat, views, ranges and bad shapes. - Primal timing against hand loops at three sizes, with and without depletion, coupled and not: the package was 1.2 to 3.7 times faster than my plain loops.
- At 3 lags and 5 steps the package took 0.20 µs against 0.10 µs for the hand loop, so a call carries about 100 ns of overhead.
- 15 gradient cases against ForwardDiff on Mooncake reverse and forward and Enzyme reverse and forward, one backend per process.
- Rule against a hand-written adjoint for a 14-lag, 200-step renewal: hand 6.0 µs, Enzyme rule 4.8 µs, Mooncake rule 5.4 µs.
- A sweep of 17 built-in modifier set-ups with
Iand a dense coupling: resume,Threaded, trace and Mooncake gradients in parameters and gain. - 19 calls on JLArrays with scalar indexing disallowed, including ForwardDiff through device arrays.
- My own modifier and coupling written from the docs alone.
test/unit/pure_step.jlandtest/unit/primary_recurrence.jl: 195 passed in 3 min 12 s.- The specialised paths and the FFT threshold, as timed above.
What I did not run
- The full test suite, the AD registry, the Reactant suite, the docs build and the benchmark suite.
- Anything on Julia 1.11 or 1.12, on macOS or Windows, or on a real GPU.
- A reverse gradient on device arrays.
- ReverseDiff.
- The downstream packages.
- The shared workflows in
EpiAware/.github, so claims about CI are from the workflow files in this repository only. - Timings are minimum-of-repeats on a shared 4-core machine without BenchmarkTools, so read ratios under 1.2 as ties.
Generated by Claude Code
Activity
seabbs-bot commentedon Dec 2, 2026
Triage of every finding against
mainat cc74265Run today on Julia 1.13.4, Linux, 4 cores, with Enzyme 0.13, Mooncake 0.5 and ForwardDiff 1.
Each reproducer of the review was run again unless a line says it was read.
Timings are BenchmarkTools minima of repeated blocks in one process, not the interleaved harness, so ratios under 1.2 are ties.
Nothing was changed before this comment.
Status is one of: resolved, still true, partly, not reproduced.
Must fix
Project.tomlstill says0.2.0.m.agives a zero reverse gradient[215.45], Mooncake forward[215.45], Mooncake reverse[0.0], with no error or warning.publiclist is not the surface taughtBase.ispublicis false forState,Secondary,param_eltype,uses_adjoint,Run,test_adjoint,Auto,TRACED_MIN_STRATA(each on a docs page) and fordepth,forward,ispointwise,each!(docstrings only).contributionsis now public.Deviceis still public and still documented as the older name ofParallel.ismodifieris public and on no docs page.NEWS.mdcontradicts the codegrep -rn NEWS docs README.md .github testfinds nothing.test/ad/static_activity.jltests seven default-mode calls. The README still does not say it.compat_floorAD items, nearly all Enzyme reverse. Every AD item runs on 1.11 and 1.12 for Enzyme reverse and Mooncake reverse only, weekly. ForwardDiff, Mooncake forward and Enzyme forward have no 1.11 or 1.12 cell. Two 1.11 Enzyme defects are marked broken (test/ad/adjoints.jl:939,:1419), and_stored_couplingand_ADLeavesare still there.Enzyme, finding 5 (reverse and forward, each against ForwardDiff):
EnzymeRuntimeActivityErrorDepletion(PerStratum(N)),Na constant globalDepletion(PerStratum(N)),NactiveDepletion(N), scalar activeNoAdjoint, kernel a constant globalNoAdjoint, everything built in the losspullback!, global inputsCause, from the error text: in every failing reverse case a constant array that lives outside the loss is returned or stored where Enzyme expects a differentiable value.
For the rule-routed cases the failure is inside the constructor, not the rule:
_as_coupling(::Matrix)(recurrence.jl:223) andfloat(::Vector)under_populationeach return their constant argument through a call that is not inlined.With the same matrix copied inside the loss, the default mode is correct.
On the plain-AD route the constant kernel is stored beside the active arguments at
adjoint_call(adjoints.jl:160).So the rule itself runs in the default mode; the constructors and the plain route are what need runtime activity.
Should fix
stepthe one modifier path, and a depletion form is now a pure step withθ.N.pullback!still has two contracts: it returns partials forLocal(roles.jl:397-463) and mutates for the other roles. A coupling still needsforward!,pullback!,cotangentandadd_cotangent!.Core._hasmethodand 4 ofCore.Compiler.return_typeremain insrc. The typed-step reproducer now givesArgumentError: step(::Ty, θ, v, s) types its arguments after the modifier; write θ, v and s untyped. A late definition is still picked up.(v, nothing)withoutisstatelessnow gives a clearArgumentErrornaminginitandisstateless. Still opaque: a step returning onlyv(BoundsError: attempt to access Float64 at index [2]),modifiers = Depletion(N)(MethodError: no method matching length(::Depletion{…})), and a device kernel with host inputs (scalar-indexing error forRecurrenceandConvolution; the opposite mix is a clearArgumentError).pullback!(3 times the primal) and 246 µs without (27 times). Construction costs 0.25 µs and 896 bytes without apullback!against 2 ns and 0 bytes with one. The primal after a gradient was 0.87 and 1.08 times its time before, inside the spread of repeats, so the slowdown is not reproduced. #955 is open on the silent route.widthon both operators, sostep =is gone. Still true:ComposableRecurrences.stepis notBase.step;Pressure()andTrace()are roles andrecordmarkers;overflow = :queueandtrace_imports = Val(true)sit beside struct options;Recurrencetakes its gain as a call argument.Convolution(k)(x)at 300 lags and 1000 steps by 2.8e-13 relative. At that size direct took 19.9 µs and the FFT 17.5 µs here (the review saw the opposite order); at 300 × 2000, 41.6 and 28.7; at 500 × 2000, 64.6 and 32.3; at 1000 × 5000, 416 and 82. So the threshold is a tie that falls either way by machine.Threaded()belowmin_worktook 1.05 timesSerialat 20 strata, a tie.srcandext(24,421 in the review), 64 generated functions, 13 extensions, 27 workflows.downstream.yamlstill passesdownstreams: '[]';test/downstream/runtests.jlclones BVDOutbreakSize but no workflow calls it. All 267 rows ofbenchmark/results/docs.csvcarry one revision,d41af96e. #953 recorded item times: 2 of 639 default items have none, against 129 of 607. The budget test still weighs an unrecorded item as the median and does not fail on it.Shiftis still two different types inextending.md:132andextending-parameters.md:44. The README's ReverseDiff badges are now explained inadjoints-and-backends.md:103. #922 is open and removes that page. Read, not built.Can wait
Recurrence([0.5, 0.5])(fill(1.2, 4))returns zeros with no warning.Statefrom another operator is acceptedDepletion(-5.0)and a negative gain runshowin a container prints the full typerepr([Depletion(100.0)])prints the type parameters;text/plainisDepletion(pools (:S,), draw Hazard(), population 100.0).test/unit/adjoints.jl(1,805 lines),test/ad/adjoints.jl(2,816) and the registry all exist. Read.test/ADFixtures/src/ADFixtures.jl:30-68; its comment says the benchmark history loads the fixtures with earlier releases. Read.threads.yamlruns theallocationsitems without coverage. Read.test/cudahas no workflowadjoints-and-backends.md:239says the CUDA checks are run by hand. Read.What I did not run
EpiAware/.github: claims about CI are from this repository's workflow files.Next
Fixes follow as pull requests, must-fix first: finding 2, then the public surface (3), Enzyme's default mode (5), the facts for the 1.11 choice (6), and the should-fix items that are small (9, 11, 12, 13's docs line).
Each finding left unfixed gets its reason here.
Generated by Claude Code
seabbs-bot commentedon Dec 2, 2026
Finding 6: the Julia 1.11 floor, for the owner to decide
No code is changed for this finding; the choice is between two pieces of work.
Facts are read from this repository's workflow and test files at cc74265; the shared workflows in
EpiAware/.githubwere not read.What runs on 1.11 today
threads.yaml,unitskip_quality, 4 threads, Runic removed from the environmentthreads.yaml,adcompat_floorAD items (the Enzyme reverse registry in 4 slices,test_adjointon one operator of each kind, 13 single cases) and the executor allocation itemsad-versions.yamlWhat does not run on 1.11
test.yamlpassesjulia_versions: '["1"]', so the quality set (Aqua, doctests, the standards) and the downgrade job run on the current release only.ad.yamlnames no version, so the per-pull-request jobs of ForwardDiff, ReverseDiff, Mooncake forward and Enzyme forward do not run on 1.11 or 1.12 by name.What 1.11 costs in the code and docs
test/ad/adjoints.jl:939and:1419): Enzyme reverse loses a scalar's gradient in code Julia cannot infer, and finds no shadow for a vector index underNoAdjoint.:2519): plain reverse mode of aNoAdjointoperator with threads can crash in the garbage collector, so only the runtime-activity mode is tested._stored_coupling(recurrence.jl:233) and_ADLeaves(adjoints.jl:204, used at three places in the Enzyme extension) exist for 1.11, with twoVERSION < v"1.12"guards in the Enzyme extension and one in the EnzymeTestUtils extension, which checks an operator asConstonly on 1.11.The two options
Add 1.11 to
test.yaml's versions and run the five forward-mode and ReverseDiff AD jobs on it per pull request.Going by the weekly job (two backends on two versions in about 7 runner-hours), all seven backends on one more version is of the order of 12 runner-hours per pull request.
The two broken tests and the silent zero gradient stay, as they are defects of Enzyme on 1.11 that the package can warn about and not fix.
julia = "1.12, 1.13", delete_stored_coupling, the threeVERSIONguards, the two broken markers and the two known-issue rows, and drop 1.11 fromthreads.yamlandad-versions.yaml._ADLeavesneeds a check on 1.12 before it goes, as the Mooncake rule also routes through it.I could not read the two consumers' compat entries; they would need to allow it.
Recommendation
Raise the floor to 1.12.
The claim then matches what is tested, and the one failure mode a release cannot carry, a gradient that is silently zero on a supported version, leaves the support matrix.
1.11 is not the long-term-support line, so the floor protects few users.
I have not made the change: it is a compat change for the owner, and I can open it as its own pull request on request.
Generated by Claude Code
seabbs-bot commentedon Dec 2, 2026
Every finding accounted for
Pull requests against
mainat cc74265, none merged.The triage and its evidence are in the comment above; the 1.11 choice has its own comment.
Must fix
mainand says where #928 would add to it.ArgumentErrorin the plain call and under every backend.constglobal arrays read inside the loss do, for reasons given there.Should fix
pullback!returning partials forLocaland the coupling interface. Renaming theLocalmethod changes a public signature that three pages teach, and #916 has an open question on whetherLocalstays public at all; that decision comes first. A pure form for couplings is a design of its own, not a release fix.Core._hasmethodlookups with a declared trait changes how every extension declares itself, one day after #920 settled that. The risk that stays is the use of a Julia internal, which the tests on each Julia version cover.step =is alreadywidth =.ComposableRecurrences.stepis public and not exported, so it shadowsBase.steponly inside the module.Pressure()andTrace()as both role and marker is #916's decision 1, and each names one quantity. The gain is the recurrence's input and a convolution's option, which the argument positions follow. The one inconsistency left is option style:overflow = :queueandtrace_imports = Val(true)beside struct options. I recommend deciding those two before the freeze and have not changed them, as #916 did not rule on them.Auto's threshold the two methods tie and the order depends on the machine; loading FFTW changes results at 1e-13. I recommend the FFT only on request,method = FFTMethod(), and removingAuto. That touches 33 references, three registry scenarios and their recorded results, so I have not opened it without a yes. The smaller option is to raise the threshold to 500 lags and 2000 steps, where the FFT was twice as fast here; it leaves the dependence on what is loaded.Threadedbelowmin_workwas 1.05 timesSerial, a tie. The docs now say outputs agree across loops to rounding.Allocate,Recent, computed kernels, change points and the Reactant extension experimental is a statement about semver for the owner. #916 keptAllocate,Survival,IncrementsandNormalisedbecause consumers use them. The surface table marksRecentandLocalas the two names still open.benchmark/results/docs.csvbelongs at the release commit. Making the budget test fail on an unrecorded item is a small change I have left, as #953 just reworked that file.Shifttypes in the extending pages are still to rename, best done on top of #922.Can wait
Statefrom another operatorStateholds.Depletion(-5.0), negative gainshowin a containerthreads.yamlruns them without coverage.What was and was not run
Each pull request lists its own runs.
Across all of them: no full test suite, no full AD registry, no Reactant suite, no docs build, nothing on Julia 1.11 or 1.12 and nothing on a real GPU.
CI on each pull request is the check for those.
Generated by Claude Code
seabbs-bot commentedon Dec 2, 2026
Finding 2: three routes compared, for the owner
The cause is that a parameter is reachable by two names inside a step,
m.aandθ.a, and only the second carries the derivative.Nothing here is implemented beyond #981, which is held.
Figures for B and C are estimates from reading the code; only A has been run.
A. The modifier with its float parameters replaced by a marker (#981)
src: a marker type that is aRealwhose arithmetic throws, a generated function that rebuilds the modifier withExpr(:new)past its constructors, and atry/catcharound the rebuilt type.step(::M, θ, v, s)as today.a::Float64cannot hold the marker and reads asNaN, which is a wrong value and not an error.isbits; a misread inside a kernel fails to compile, with a compiler message and not the package's.B. One object: the modifier with its parameters read at the stratum and time
The step becomes
step(m, v, s), wheremis the modifier rebuilt with each parameter field read at(k, t).m.ais then the right and only spelling, andθleavesstep,init,step_pullbackandtrace._thetatoday builds a named tuple of the read fields; B builds the modifier from the same values, so the read is unchanged and the rebuild replaces the named tuple.The rule's dual pass seeds the fields of the rebuilt modifier where it seeds
θtoday.I estimate the change in
srcat the size of A, plus the mechanical edit below.ConstructionBase.constructorof(typeof(m))(fields...)is already howPieceInterfacerebuilds a type (21 uses ofconstructorofinsrc). For a struct with the default constructor it infers and is free once inlined. A type with a checking inner constructor would run its check at every step, on scalars where it may expect arrays, so such a type definesconstructorof, asDepletiondoes. Rebuilding past the constructor withExpr(:new)avoids that and brings back the machinery objected to in A, so I would not.Float64fields under dual numbers. A field declareda::Float64cannot hold the dual the local derivative seeds. That is decidable from the type, so_rule_fieldscan send such a modifier to plain AD, which is correct and shows ingradient_routes, or the constructor can refuse it. Either way nothing is silent. Requiring a parametric field type for a differentiated parameter settles it, and is already what ForwardDiff through the operator requires.constructorofdoes.PerStratumof a device array becomes a scalar field, so the rebuilt modifier isisbitswhere the original is not. This is no worse thanθtoday.step(m::Smooth, v, s) = (s′ = m.a * s + (1 - m.a) * v; (s′, s′)). One argument fewer and no rule to remember.CR.step(definitions and calls in 38 files ofsrc,docs,testandbenchmark, and both consumers, one day after Make the pure step the single way to extend the package #920 settledstep(m, θ, v, s).θ.N, which is not a field of the form (8 uses). B needs a place for it: a fourth argument for forms, which is the two-signature problem of finding 7 again, or a form rebuilt withNbeside its fields.C. No change to what
stepreceives; a check when the operator is builtCall the step once with
θperturbed and the modifier's floats held, or compare a dual pass inθwith one in the fields, and throw the same message; refuse a type that cannot be checked._reads_thetaand_perturbedlogic thatPieceInterface's:stepcheck already has, moved to the constructor.m.a * 0), passes.initon a history the constructor does not have, so the check either guesses or moves to the first call.Summary
srcstep(m, v, s)NaNfor concrete float fieldsconstructorofRecommendation
B, if the step's signature can still change before the freeze.
It is the only route that removes the cause, it makes the interface smaller, and its rules (a parametric field for a differentiated parameter,
constructoroffor a checking constructor) are ones Julia authors already meet.Its price is a second signature change in two days and a decision on where a depletion form gets its population.
If the signature is frozen as #920 left it, A with the
NaNarm removed: a modifier with a concretely typed float field is refused when the operator is built, which deletes the_nanhelper and the silent case, and leaves mutable types toPieceInterface.I would not take C: it costs something on every construction and still passes the mistakes it does not happen to probe.
I can prototype B on one built-in and one user step, with the LLVM comparison and an
ab.jlrun, before anything is decided.Generated by Claude Code
seabbs commentedon Dec 2, 2026
Note we really want enzyme running in no activitiy mode its okay if this needs our rule support to get it working well.
seabbs-bot commentedon Dec 2, 2026
Finding 6, addendum: the two failures of the weekly 1.11 job, re-run today
Re-run on
mainat 6159cbf with Julia 1.11.9, Mooncake 0.5.74 and the Enzyme release the AD environment resolves today.Both failures of the scheduled
ad-versionsrun on 4b4bc8c reproduce, and neither is a wrong gradient.1. Enzyme reverse: a
brokenmarker that now passestest/ad/adjoints.jl:940-942.Unexpected Passonbroken = w === NoAdjoint && m(0.8) isa Pick{<:Vector} && backend isa AutoEnzyme && VERSION < v"1.12".@test. One line, and one fewer 1.11 branch in the tests.2. Mooncake reverse: no rule for
jl_genericmemory_slice_layout_sums(src/operators/convolution.jl:524).reshape(x, :, 1)of aVectorwhose memory is longer than the vector, or that starts at an offset, callsjl_genericmemory_slice, and Mooncake has no rule for that call on 1.11.sum(abs2, reshape(x, :, 1)),xwith exact memoryx = sizehint!(copy(x), 64)No rrule!! available for foreigncall … jl_genericmemory_slicexafterpopfirst!Convolution(k)(x)by its rule,xwith spare capacityNoAdjoint(Convolution(k))(x),xwith exact memoryNoAdjoint(Convolution(k))(x),xwith spare capacityVERSION < v"1.12", which adds to the 1.11-only code;_layout_sumscalling a vector method in place ofreshape(xr, :, 1). That removes the call from this path, and would have to be justified on its own, since any otherreshapeof such a vector under plain AD fails the same way.Effect on the choice
The cost of 1.11 in the first comment grows by one stale marker to delete and one missing upstream rule to carry or work around.
The weekly job has been red on 1.11 since at least 23 November for these reasons, and no pull request sees it, as it runs on a schedule.
With the floor at 1.12 both items vanish: the marker's condition is
VERSION < v"1.12", and the scheduled run's four 1.12 jobs passed.The recommendation stands: raise the floor to 1.12.
If 1.11 stays, the marker should go now and the Mooncake rule be raised upstream; I have changed neither.
Generated by Claude Code
seabbs commentedon Dec 2, 2026
its fine to have things that need rules can't work with noadjoint I think?
[-]Independent review before release[/-][+]Independent review before release: findings still open[/+]seabbs-bot commentedon Dec 2, 2026
Julia floor 1.12: paused. Pushed to
claude/julia-1.12-floorat bdf0fd1, with main merged up to 80945f6. No PR is open yet.Passed on Julia 1.12: the full suite (649 items, 42,377 pass, 8 broken), the ForwardDiff AD group (3,339 pass) and Mooncake registry slices 3–4 (2,944 pass).
The docs build passes except for the github.com link checks, which this container's proxy answers with 403.
Not run: Mooncake reverse slices 1–2 and the Mooncake items outside
scenarios.jl; the permission check refused the restart after the pause.Kept, as they are not 1.11-only: the integer scale of the stored identity coupling (it sets the integer output type) and the plain-AD hook (#955 uses it).
No managed workflow names 1.11, so nothing goes to EpiAwarePackageTools.jl#567.
Next: (1) run those Mooncake items on 1.12; (2) open the PR from the branch (opening it from here was refused); (3) merge main before review.
Generated by Claude Code
seabbs-bot commentedon Dec 4, 2026
Status against
mainat d1f52c3Done:
Autoremoved (Run the FFT only on request and remove Auto #1027, 80945f6).Remaining:
overflow = :queue,trace_imports = Val(true)) is the one open public API point. It is also listed on Stabilise the call API before the release #916.FFTMethod()convolution on device arrays still takes plain AD, as_DeviceReadyConvolutionpinsDirect(An FFTMethod() convolution on device arrays takes plain AD, not the rule #1031).Generated by Claude Code
seabbs commentedon Dec 4, 2026
I have no idea what you want