Skip to content

Settle the public surface: remove Device, make the taught names public, keep internals internal - #986

Merged
seabbs-bot merged 19 commits into
mainfrom
claude/public-surface
Dec 2, 2026
Merged

seabbs-bot merged 19 commits into
mainfrom
claude/public-surface

Conversation

@seabbs-bot

@seabbs-bot seabbs-bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Finding 3 of #930: the public list against what the docs and docstrings teach, with the owner's decisions applied.

Each decision is its own commit, so any one can be dropped.

Commit Change
Remove Device, the older name of Parallel an alias that existed only as an older spelling
Make State, Secondary, Auto and TRACED_MIN_STRATA public State and Secondary stay public; the two later commits below take Auto and TRACED_MIN_STRATA back out
Make test_adjoint, uses_adjoint and Run public test_adjoint stays public; the commit below takes the other two back out
Name ismodifier on the extension page and drop an internal link ismodifier was public and on no page
State TRACED_MIN_STRATA's rule as a formula superseded: the name is internal again
Keep uses_adjoint and Run internal test_adjoint(backend, op, args...) takes no role, so its public signature names no internal type; the pages point to gradient_routes for the route a recurrence takes
Remove the uncalled _kernel_couplings and its marker in the scenario registry; ispointwise stays, as the tests and the AD fixtures call it
Make Local internal and teach closed-form derivatives with the pure step the parameters page, the extension API table, the branching-process tutorial and the LogExpFunctions page write a closed-form derivative as a step_pullback
Keep TRACED_MIN_STRATA internal a tuning constant; the Reactant pages say that small traced loops are written out and larger ones run as one kernel
Keep Auto out of the public list the FFT becomes a method chosen on request in its own pull request, which removes Auto
Give the closed-form derivative section its maths first and shorter sentences for the standards checks
Name the widths field in the State docstring State is public here, and #928 added the field

Public surface

5 exported names and 63 public ones, against 5 and 62 on main.

Name What it is Decision
Recurrence, Convolution the two operators exported
TimeVarying, PerStratum, Pairwise coefficient wrappers exported
Primary kernel column read at the input's time public
Secondary the default reading, at the output's time made public
Depletion, Hazard, Floor, Truncate pools and the forms that draw from them public
Flow, Share, Split flows between pools public
Redistribute, Allocate, Transform the other built-in modifiers public
Derived, Gather parameters computed from, or read at other rows of, a parameter public
Recent a parameter read from recent outputs public
Survival, Increments, Normalised, kernel_weights, delay_masses computed kernels and delay masses public
exponential_history, window_sums, contributions, pressure helpers around a run public
growth, growth_gain growth rate and profile of a recurrence public
Trace, Resume, Pressure record markers; Pressure is also a role public
State what record = Resume() returns and state = takes made public
step, init, step_pullback, trace the pure step public
blocks, isstateless, islinear, nstate, ntrace, trace_rows, ismodifier declarations of a new type public
forward!, pullback!, Step, Init roles of a coupling or whole-step modifier public
param, add_param!, param_rows, cotangent, add_cotangent! reading parameters and adding cotangents in a pullback! public
PieceInterface conformance test of a new type public
test_adjoint rule tester, test_adjoint(backend, op, args...) made public
gradient_routes the routes a recurrence can take, timed public
NoAdjoint plain AD of an operator public
Serial, Threaded, Parallel, EXECUTOR executors and their setting public
Direct, FFTMethod convolution methods; Direct is the default once the FFT runs only on request public
convert_floats an operator in another float type public
select, Batched strata of a state, and batched runs public, added by #928
Device older spelling of Parallel removed
Local role of a map's own partials internal; the pages teach a closed-form derivative as a step_pullback
uses_adjoint, Run route query and the operator's role internal; test_adjoint takes no role, and gradient_routes answers the route question
TRACED_MIN_STRATA strata from which a traced loop is one kernel internal: a tuning constant; the Reactant pages describe the behaviour
Auto the automatic convolution method internal; the pull request that runs the FFT only on request removes it
param_eltype, depth, forward, ispointwise, each! internals with docstrings internal

What I ran

On Julia 1.13.4, after merging main with #928:

Before #928, on main at 3255360:

  • The docs build: doctests and cross-references pass, and the API pages list 66 public and 14 internal bindings; the only errors are the link checks of github.com links, which this container's proxy answers with 403.

  • The test/ad items that call test_adjoint, now without the role: the Mooncake and Enzyme slices, the user-defined types and the FFT convolution gradients on Mooncake and Enzyme reverse, 10,507 pass.

What I did not run

  • The rest of test/ad and the Reactant suite.

Generated by Claude Code

Device was an alias of Parallel kept from before the rename. Tests and
benchmarks that built an executor through it now call Parallel.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7izUDKjuoR5m5Ky44oy
Each is named on a user page: State is what a call with Resume() returns,
Secondary the default reading of a TimeVarying kernel, Auto the default
convolution method and TRACED_MIN_STRATA a setting of traced calls.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7izUDKjuoR5m5Ky44oy
The developer pages teach all three as the way to test a new type's rule,
and labelled them internal. A documented check is part of the surface.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7izUDKjuoR5m5Ky44oy
ismodifier is public and was on no page. The output number type section
linked the internal param_eltype; it now says what the type is.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7izUDKjuoR5m5Ky44oy
A public name's docstring gives its formula; this one gave it in words.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7izUDKjuoR5m5Ky44oy
@seabbs-bot
seabbs-bot requested a review from seabbs as a code owner December 2, 2026 11:29

@seabbs-review-bot seabbs-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removes the Device alias and updates every use to Parallel. It also marks State, Secondary, Auto, TRACED_MIN_STRATA, test_adjoint, uses_adjoint and Run as public. The change is sound. I found two small leftovers.

Detail

I checked src, test, docs/src and benchmark for remaining uses of Device as the alias. The only ones left are the test item names listed in the first comment, plus test/item_times.tsv, which is generated and renames itself when the items are renamed. The Device mention at test/unit/gpu_arrays.jl:593 means device arrays, so it is correct. The test_tags.jl regex change is consistent with the removal. I did not run the tests or CI.

About this review

Automated first pass by seabbs-review-bot (Claude sonnet), triggered by: first pass. Not a human review. Comment @seabbs-review-bot to ask for another pass: @seabbs any time, the author's agent once it has pushed changes. Add the no-review label to opt this PR out. Ping @seabbs with any questions.

Comment thread test/unit/executor.jl Outdated
@test CR.each!(window_dot!, CR.Parallel(nothing), 0, 0) === nothing
end

@testitem "Device: arrays on a device select it" tags = [:threads] begin

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion Rename the test items that still say Device after the alias was removed.

Why and how to fix

Two items keep the old name:

  • Line 77: "Device: arrays on a device select it".
  • Line 54: "each!: Device runs a body as a kernel on JLArrays".

Both now test Parallel, and no Device symbol exists. Rename them to "Parallel: arrays on a device select it" and "each!: Parallel runs a body as a kernel on JLArrays". test/item_times.tsv then regenerates with the new names.

Comment thread src/adjoints/executor.jl Outdated
A traced call runs each step's loop over ``S`` strata as

```math
\begin{cases}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion Drop the piecewise ```math block from the TRACED_MIN_STRATA docstring, or allow-list the name.

Why and how to fix

The block restates the sentence above it (one kernel when S is at least the setting, otherwise written out), and the prose after it says the same thing a third time. It adds length without adding information. It looks added to satisfy the maths check in the standards tests. If so, add :TRACED_MIN_STRATA to MATHS_ALLOW in test/package/standards_config.jl, with a comment that it is a setting and not a computation. Then remove the block, the where ``S_{\min}``` line and the duplicate A shorter loop is written out` sentence. Keep one statement of the rule.

@seabbs-review-bot seabbs-review-bot Bot added the llm-reviewed Reviewed by seabbs-review-bot label Dec 2, 2026
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7izUDKjuoR5m5Ky44oy
The formula added to the setting's docstring restated its sentence, so
the docstring is as it was and the name joins the roles in MATHS_ALLOW.
Two test items still named Device.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7izUDKjuoR5m5Ky44oy

Copy link
Copy Markdown
Collaborator Author

Pushed 5d41949 for the review's two points.

  • TRACED_MIN_STRATA: the formula restated the sentence, so the docstring is as it was on main and the name is in MATHS_ALLOW as a setting.
  • The two test items that still said Device are renamed, with their rows in test/item_times.tsv.

Rerun on this head: test/package/standards.jl, time_budget.jl and test/unit/executor.jl, 727 pass, 18 broken.
The commit to merge is 5d41949.


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iv2KDpxHFtSvpTQrsG
Drop them from the public list. test_adjoint takes the operator and its
positional arguments without a role, so its public signature names no
internal type. The developer and explanation pages point to
gradient_routes for the route a recurrence takes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iv2KDpxHFtSvpTQrsG
Nothing in src, ext or the tests calls it, so its marker in the scenario
registry goes too. ispointwise stays: the tests and the AD fixtures call
it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iv2KDpxHFtSvpTQrsG
Drop Local from the public list. The parameters page, the extension API
table, the branching-process tutorial and the LogExpFunctions page write
a closed-form derivative as a step_pullback of a pure step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iv2KDpxHFtSvpTQrsG
A tuning constant is not public API. Drop it from the public list and
from the maths allow-list, and say on the Reactant pages that small
traced loops are written out and larger ones run as one kernel, without
naming the setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iv2KDpxHFtSvpTQrsG
The FFT becomes a method chosen on request and Auto is removed in its
own pull request, so it is not made public here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iv2KDpxHFtSvpTQrsG
…entences

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iv2KDpxHFtSvpTQrsG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iv2KDpxHFtSvpTQrsG
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Try this Pull Request!

Option 1: Julia Package Manager

Open Julia and type:

import Pkg
Pkg.activate(temp=true)
Pkg.add(url="https://github.com/EpiAware/ComposableRecurrences.jl", rev="claude/public-surface")
using ComposableRecurrences

Option 2: Local Checkout

If you have the repo locally:

git checkout claude/public-surface
julia --project=. -e "using Pkg; Pkg.instantiate()"

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iv2KDpxHFtSvpTQrsG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iv2KDpxHFtSvpTQrsG
State is public here, and #928 added the field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iv2KDpxHFtSvpTQrsG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iv2KDpxHFtSvpTQrsG
@seabbs-bot seabbs-bot changed the title Freeze the public surface: remove Device and make the taught names public Settle the public surface: remove Device, make the taught names public, keep internals internal Dec 2, 2026
@seabbs-bot
seabbs-bot merged commit 9e4c1d6 into main Dec 2, 2026
18 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llm-reviewed Reviewed by seabbs-review-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants