Skip to content

Strip the inference layer to IDProblem and forecast, and pair a model with its data - #373

Merged
seabbs merged 13 commits into
mainfrom
feat/359-thin-inference
Nov 23, 2026
Merged

seabbs merged 13 commits into
mainfrom
feat/359-thin-inference

Conversation

@seabbs-bot

@seabbs-bot seabbs-bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #359.

Takes Option B from the issue plus the generated_observables sub-decision, then follows the maintainer's redirect in the comments.
IDProblem stays, but for holding a model and its data together rather than for tspan.

src/inference/ goes from 581 lines across nine files to 393 across two, and five direct dependencies go with it.

What was removed

Everything in the method layer was a wrapper over one Turing call and was used by nothing but its own tests.

types.jl, NUTSampler.jl, DirectSample.jl, apply_method.jl, IDObservables.jl, get_param_array.jl, post-inference.jl, and condition_model from src/utils/turing-methods.jl.

Two of them did not work on what sample returns.
sample returns a FlexiChains.VNChain, while get_param_array and spread_draws are both typed ::MCMCChains.Chains and raise MethodError on it.
Their own tests passed only because they wrapped the chain in MCMCChains.Chains(...) first.

Dropped dependencies, verified by resolving rather than by grep.
ADTypes, AbstractMCMC, AdvancedHMC, MCMCChains, DataFramesMeta, plus their [compat] entries.
MCMCChains and DataFrames also leave test/Project.toml.
Tables and Statistics stay, needed by ReportTriangle, HilbertSpaceGP and forecast.

What was added

as_turing_model(::IDModel, y) now covers a vector and a NamedTuple of streams as well as a matrix, so the shape comes from the data instead of being restated as length(y).
There is one shape path rather than two.
_obs_data_shape moved out of IDProblem.jl into compose.jl, the old _shape that duplicated its matrix case is gone, and forecast calls the same helper it always did.

A blank series reaches the same fallback a scalar missing reaches, so as_turing_model(model, Vector{Missing}(missing, n)) builds a Split's streams from its map or names the way missing does.
A scalar missing still needs an explicit n, and so does anything else with no time axis.
Both now raise an ArgumentError naming the type rather than a MethodError from whichever private helper reaches it first.

IDProblem

struct IDProblem{M <: IDModel, D}
    model::M
    data::D
end

as_turing_model(problem) delegates to as_turing_model(problem.model, problem.data).
It is no longer a @model wrapper, so the built model is the one the IDModel route builds rather than a name-preserving copy of it.
data_requirements(problem) takes no arguments and forecast(problem, chain, horizon) drops the y argument, because the object holds both halves.

There is no method taking data alongside the problem.
An IDProblem is a model and its data, so fitting the same model to a different series is a different problem rather than a different call on this one.
That is Accessors, the way everything else in a composition is respecified.

refit = @set problem.data = y_new

@set round-trips cleanly on the new struct, including nested into problem.model, and is shown in delays-dayofweek.md.

The check that could not fail

There is deliberately no data_fits(::IDProblem).
I wrote one, and the test written to prove it catches a misfit passed when it should have failed.
The observation count and the data being checked against it come from the same value, so for a single series the answer is true by construction.

A check that cannot fail is worse than no check, because a reader takes true as evidence that something was verified.
Asking whether a dataset fits a model stays data_fits(model, y_t, n), where the two arguments are independent.

What construction guards

A constructor that throws on the cases it can detect says nothing when it passes, so it cannot mislead the way a data_fits returning true would.
Construction is checked, in an inner constructor so @set is checked too.

obs = Split((cases = PoissonError(), deaths = PoissonError()), reshape([1.0, 1.0], 2, 1))
IDProblem(infection, obs, (cases = fill(5, 30), deaths = fill(1, 40)))
# ArgumentError: the data does not fit the model: ...

Two streams over one infection stratum, so the count is read off cases and deaths can contradict it.
The guard fires only when streams disagree with each other, never on a single series.
That scope is stated in the docstring as well as the code, because the obvious ragged case passes and a user who knows the type checks something would assume it checks the case they have.

It cannot reject data as_turing_model accepts, because data_fits is the weaker of the two conditions.
Checked over twelve shapes (plain, delayed, short, legacy-length, Aggregate, ReportTriangle, BinomialError, Split of BinomialError, ragged both ways, blank vector, blank matrix) with no case where the guard rejects something that builds.

There is no data-free IDProblem

The pairing is what the type is, so IDModel is the object for a model on its own.
A problem whose observations have not arrived is one over a blank series, which fixes the shape and says how many observations are expected.

problem = IDProblem(model, Vector{Missing}(missing, 20))   # shape fixed, none observed
fitted  = @set problem.data = y                            # observations attached

A scalar missing still errors, because it carries no length.
Attaching data this way gives what the constructor gives, field for field, with identical VarInfo keys.

IDProblem has no == method, so struct-level isequal falls back to === and compares field identity.
isequal(@set p.data = y1, IDProblem(model, y2)) is false for equal-but-distinct y1 and y2.
Compare field by field.

tspan is gone

Every call site in the repo wrote tspan = (1, length(y)), restating what the data already says, and if the two disagreed there was no good answer for which won.

data_requirements(::IDProblem) now passes the full ModelShape from _data_shape, so a stratified problem reports per-stratum supply where reading the length off tspan gave a bare Int and a stratum count of 1.
The simulation case tspan covered is served by a blank series, which carries its length the same way observations do.

One reason, three times

Three decisions in this PR look separate and are the same one.

tspan went because it restated a length the data already carries.
data_fits(::IDProblem) went because its answer was read off the same value it was checking, so it could not fail.
A per-stream n is deliberately not stored, for the first reason again.

The rule underneath is that the data is the single record, and every question about a length is answered by asking it.
Checking that rule turned up two bugs, filed as #374 and #383, and neither is an argument against it: both are the report failing to read a number the data states plainly.
A stored copy would have hidden them and then disagreed with the data, which is the tspan failure mode restated.

The display

This is the point of keeping IDProblem.
show(stdout, MIME"text/plain"(), as_turing_model(model, y, 30)) for a DirectInfections + LatentDelay(NegativeBinomialError()) model over 30 observations prints on one line as its full nested parametric type, with all 30 observations dumped inline.
The one number a reader might try to use, n = 34, is the lead-in-inflated internal series length rather than the 30 observations supplied.

The same model and data as an IDProblem:

IDProblem
├─ infection: DirectInfections
│  └─ Z: RandomWalk
│     └─ ϵ_t: HierarchicalNormal
├─ observation: LatentDelay
│  └─ model: NegativeBinomialError
└─ data: 30 observations (Int64)

Built on the package's own printer.
_component_children supplies the model's children, which hang directly off the problem so the pairing reads as one tree, and _print_component_tree gained one optional trailing argument for sibling lines that are not components.
That is the only change to shared printing code.

The data line reports what is there.

└─ data: none, 30 time points (simulating from the prior)
└─ data: 30 observations, 1 missing
└─ data: 30 observations in each of cases, deaths
└─ data: 2 strata x 30 observations

The NamedTuple line names the entries without saying whether they are streams or fields, which is deliberate.
They are streams for a Split, but a BinomialError takes (y = successes, N = trials), one stream with two named fields.
data_requirements is what distinguishes them, and the line points there.

The display does not flag a data/model mismatch, for the data_fits reason above.
It would mean something for ragged NamedTuple streams, but a check that is live in one shape and vacuous in another is not one to put in a show.

One bug found, not fixed here

_obs_data_shape makes the streams-versus-fields mistake the display avoids.
It reads a NamedTuple's entry count as the observation stream count, so a BinomialError's (y, N) resolves to two infection strata where data_requirements correctly reports one stream.

ComposableTuringIDModels._obs_data_shape(BinomialError(), (y = fill(5, 20), N = fill(20, 20)), 20)
# (2, 20)

data_requirements(IDModel(infection, BinomialError()), (y = fill(5, 20), N = fill(20, 20)), 20)
# DataRequirements(20 observations, 1 stream, series 20)

A ReportTriangle is the same fault and worse, because its matrix rows are reference days.

ComposableTuringIDModels._obs_data_shape(ReportTriangle(PoissonError(), fill(1/3, 3)), fill(5, 30, 3), 30)
# (30, 30), thirty infection strata from a 30 reference-day by 3 delay triangle

The general fault is that _obs_data_shape reads any leading array dimension or NamedTuple entry count as a stream count.

This is not a regression.
The helper is byte-for-byte what it was and only moved file, but it was reachable through IDProblem alone before and now also backs as_turing_model(model, y), so the exposure is wider.
Fixing it needs a discriminator between a stream axis and a field axis, and the nested case (a Split of BinomialError streams) has to be worked through, which is more than belongs in an already-large breaking change.
Filed as #374, which #363 already fixes by introducing observation_streams as the seam saying which of a data value's axes are streams.
#374 should be closed as superseded once #363 lands.

The three-argument form is unaffected, since the caller states the shape.

Migration

Was Becomes
apply_method(problem, NUTSampler(; ndraws = 1000, nchains = 4, adtype = ad), (; y_t = y)) sample(as_turing_model(IDProblem(model, y)), NUTS(0.8; adtype = ad), MCMCThreads(), 250, 4)
apply_method(m, DirectSample(; n_samples = n)) sample(m, Prior(), n)
apply_method(m, DirectSample()) rand(m)
res.samples the chain sample returns
generated_observables(m, d, chain).generated returned(m, chain)
spread_draws(chain) DataFrame(MCMCChains.Chains(chain)), then add a draw column
get_param_array(chain) reshape(rowtable(MCMCChains.Chains(chain)), size(chain, 1), size(chain, 3))
condition_model(m, f, c) condition(fix(m, f), c)
IDProblem(; infection, observation_model, tspan = (1, n)) IDProblem(infection, observation_model, y)
as_turing_model(problem, (; y_t = y)) as_turing_model(problem)
refitting the same model to a new series @set problem.data = y_new
data_requirements(problem, (; y_t = y)) data_requirements(IDProblem(model, y))
data_requirements(problem) reading n off tspan data_requirements(problem) reading it off the data
data_requirements(problem, n) now an error; use data_requirements(problem.model, y_t, n)
forecast(problem, y, chain, h) forecast(problem, chain, h)
as_turing_model(model, y, length(y)) as_turing_model(model, y)

Two need a caveat rather than a substitution.

NUTSampler.ndraws was the total across chains and _apply_nuts divided it by nchains before sampling, so ndraws = 1000, nchains = 4 drew 250 each.
The third positional argument of sample is per chain, so a ported script has to divide.

apply_method returned an IDObservables struct.
res.samples is the chain and res.generated is a returned call.
The struct's other two fields were never read anywhere in the repo.

Docs

Kept deliberately small.
design.md is being edited by three other open branches, so it gets the one sentence about tspan and nothing else.

delays-dayofweek.md is the page nothing else touches, so that is where IDProblem is shown properly.
The new constructor, the printed problem, data_requirements(problem) read straight off it, and the @set refit.
Accessors joins docs/Project.toml for that block.
The posterior-predictive model on the same page is built the same way, @set problem.data = Vector{Missing}(missing, n), since there is no longer a method taking data alongside the problem.
That model adds exactly the n y_t varnames predict needs and drops none of the parameters, checked against the fitted problem's VarInfo keys.

Six tutorials swap vec(generated_observables(m, d, chain).generated) for vec(returned(m, chain)), one line each.
renewal-negbin.md is also edited by docs/overview-cleanup, so expect a small conflict there.

A second tutorial was not converted to IDProblem.
With docs/overview-cleanup and docs/aog-plotting both in flight over the tutorials, more churn there costs more in rebases than it buys.
Worth a follow-up once those land.

Testing

Ran the affected files with the discovery scope copied from test/runtests.jl, filtered by basename: inference.jl, compose_strata.jl, compose.jl, requirements.jl, interfaces.jl, utils_extra.jl, prettyprinting.jl, traversal.jl.
Runic exits 0.

Four test items go (apply_method, spread_draws, both generated_observables items) plus the two in utils_extra.jl.
Three are added: IDProblem printing, IDProblem requirements, and two-argument as_turing_model across every data form.

The IDProblem items also assert that the problem route and the model route build models with identical VarInfo keys, so swapping one for the other still gives the same chain contents.

forecast is otherwise untouched, so the conflict with #348 stays confined to _extend_latent_draws and _assert_factorised, which this branch does not go near.

CI

Every red test and ad job is UndefVarError: SS_Int not defined in AMD, an AMD.jl 0.5.4 breakage that fails LinearSolve precompilation and takes ModelingToolkit and OrdinaryDiffEq down with it.
It hits every platform and every Julia version, and the same jobs are red on docs/overview-cleanup from the same hour.
codecov/project is red for the same reason, since the ad jobs never uploaded their coverage.
The Documenter job was cancelled by the shared deploy concurrency group (#353) rather than failing.

Review

@seabbs-review-bot raised five findings across two passes.
Four were real and are fixed; each is verified against the source in its thread.
The fifth, on data_requirements counting a blank series as supplied, is answered in the thread and left as it is, because n_supplied counts positions in the series exactly as it does for a series with gaps in it.

This was opened by a bot. Please ping @seabbs for any questions.

… a model with its data

The method layer predates the `as_turing_model` directive. Every part of
it wrapped one Turing call, none was used outside its own tests, and two
of them raised `MethodError` on the FlexiChains chain `sample` now
returns. `types.jl`, `NUTSampler.jl`, `DirectSample.jl`, `apply_method.jl`,
`IDObservables.jl`, `get_param_array.jl`, `post-inference.jl` and
`condition_model` all go, and with them `ADTypes`, `AbstractMCMC`,
`AdvancedHMC`, `MCMCChains` and `DataFramesMeta`.

`as_turing_model(::IDModel, y)` now covers a vector and a `NamedTuple` of
streams as well as a matrix, so the shape comes from the data rather than
from a restated `length(y)`. `_obs_data_shape` moves to `compose.jl` and
the `_shape` that duplicated its matrix case goes, leaving one shape path
shared with `forecast`.

`IDProblem` is rebuilt on top of that as a model paired with its data.
`tspan` goes: every call site restated the data's own length, and the
`data_requirements` path that read it now reads the full shape off the
data instead, so a stratified problem reports on the stratum axis. The
pairing earns its place by printing: the component tree from the
package's own printer, plus a line summarising the data, where a
conditioned `DynamicPPL.Model` renders as its full nested parametric type
with every observation dumped inline.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@seabbs-bot
seabbs-bot requested a review from seabbs as a code owner September 4, 2026 12:55
@seabbs-bot

This comment has been minimized.

…play claiming streams

The two-argument `as_turing_model` is public, so data it cannot read a
length from now raises an `ArgumentError` naming the type rather than a
`MethodError` from a private helper.

An `IDProblem`'s data line called a `NamedTuple`'s entries streams. They
are for a `Split`, but a `BinomialError` reads `(y, N)` as one stream's
named fields, so the line now names the entries without claiming which
and leaves the answer to `data_requirements`. The same confusion in
`_obs_data_shape` itself is older than this branch and is filed
separately.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@seabbs-bot

This comment has been minimized.

seabbs-review-bot[bot]

This comment was marked as resolved.

@seabbs-review-bot seabbs-review-bot Bot added the llm-reviewed Reviewed by seabbs-review-bot label Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 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/ComposableTuringIDModels.jl", rev="feat/359-thin-inference")
using ComposableTuringIDModels

Option 2: Local Checkout

If you have the repo locally:

git checkout feat/359-thin-inference
julia --project=. -e "using Pkg; Pkg.instantiate()"

…cessors

A problem is a model and its data, so fitting the same model to another
series is a new problem rather than a second argument. Drops
`as_turing_model(problem, data)` in favour of `@set problem.data = y_new`,
which is how the rest of a composition is respecified and which leaves
`forecast(problem, chain, horizon)` reading the data the problem holds.

The pairing is now checked when it is made, by an inner constructor so
`@set` is checked too. What it catches is narrow and the comment says so:
streams that disagree with each other, never a single series, whose count
comes from the data it would be checked against. It cannot reject data
`as_turing_model` accepts, `data_fits` being the weaker of the two.

Also refuses `data_requirements(problem, n)`, which fell through to the
generic method and reported as if no data had been supplied, and reports a
wholly blank matrix or set of streams as a simulation the way a blank
vector already was.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@seabbs-bot

This comment has been minimized.

…uard sees

There is no data-free problem, because the pairing is what the type is;
an `IDModel` is the object for a model on its own. A problem whose
observations have not arrived is one over a blank series, which fixes the
shape and says how many are expected, and the data is attached with
`@set`. Both were already true; neither was written down.

The construction check's scope moves out of a code comment and into the
docstring. It cannot see a length disagreement on a single series, nor
across streams that imply their own strata, and a user who knows the type
checks something would otherwise reasonably assume it checks those.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
seabbs-review-bot[bot]

This comment was marked as resolved.

@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark comparison vs base

Minimum time per call. Buckets are PR time as a % of base, so lower is faster (🟢 faster, ⚪ within 5%, 🔴 slower). Counts of benchmarks per bucket:

Group 🟢 <50% 🟢 50–75% 🟢 75–95% ⚪ 95–105% 🔴 105–125% 🔴 125–150% 🔴 >150%
Evaluation · · · 7 2 · ·
ForwardDiff · · · 1 · 1 ·
ReverseDiff (tape) · 1 · 1 · · ·
Mooncake reverse · · · 2 · · ·
Enzyme reverse · · · 1 · · ·
Evaluation — 9 benchmarks (by time change)
Benchmark base PR time memory
Model evaluation / RandomWalk latent / rand 450.0 ns 481.0 ns 🔴 1.07× ⚪ 1.0×
Sampling / NUTS (DirectInfections+Poisson, 50 draws) 93.08 ms 97.86 ms 🔴 1.05× ⚪ 1.0×
Model evaluation / AR latent / forward 531.0 ns 550.0 ns ⚪ 1.04× ⚪ 1.0×
Model evaluation / RandomWalk latent / forward 420.0 ns 430.0 ns ⚪ 1.02× ⚪ 1.0×
Model evaluation / DirectInfections+Poisson / forward 1.11 μs 1.13 μs ⚪ 1.02× ⚪ 1.0×
Model evaluation / DirectInfections+Poisson / rand 681.0 ns 691.0 ns ⚪ 1.01× ⚪ 1.0×
Model evaluation / Renewal+NegativeBinomial / forward 4.72 μs 4.69 μs ⚪ 0.99× ⚪ 1.0×
Model evaluation / AR latent / rand 642.0 ns 641.0 ns ⚪ 1.0× ⚪ 1.0×
Model evaluation / Renewal+NegativeBinomial / rand 2.2 μs 2.2 μs ⚪ 1.0× ⚪ 1.0×
AD gradients — 7 benchmarks (by time change)
Benchmark base PR time memory
AD gradients / AR latent logjoint / ForwardDiff 5.78 μs 8.06 μs 🔴 1.4× ⚪ 1.0×
AD gradients / AR latent logjoint / ReverseDiff (tape) 115.36 μs 77.61 μs 🟢 0.67× ⚪ 1.0×
AD gradients / DirectInfections+Poisson posterior / Enzyme reverse 3.63 μs 3.49 μs ⚪ 0.96× ⚪ 1.0×
AD gradients / DirectInfections+Poisson posterior / ForwardDiff 13.66 μs 14.13 μs ⚪ 1.03× ⚪ 1.0×
AD gradients / DirectInfections+Poisson posterior / ReverseDiff (tape) 104.16 μs 102.89 μs ⚪ 0.99× ⚪ 1.0×
AD gradients / DirectInfections+Poisson posterior / Mooncake reverse 8.83 μs 8.92 μs ⚪ 1.01× ⚪ 1.0×
AD gradients / AR latent logjoint / Mooncake reverse 5.33 μs 5.37 μs ⚪ 1.01× ⚪ 1.0×

@codecov

codecov Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.02985% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/inference/IDProblem.jl 89.18% 4 Missing ⚠️
Flag Coverage Δ
ad-enzyme-forward 63.76% <0.00%> (+0.43%) ⬆️
ad-enzyme-reverse 62.54% <0.00%> (+0.42%) ⬆️
ad-forwarddiff 62.98% <0.00%> (+0.43%) ⬆️
ad-mooncake-forward 62.98% <0.00%> (+0.43%) ⬆️
ad-mooncake-reverse 62.98% <0.00%> (+0.43%) ⬆️
ad-reversediff 63.17% <0.00%> (+0.43%) ⬆️
ad-reversediff-compiled 63.17% <0.00%> (+0.43%) ⬆️
unit 93.95% <96.92%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/base/prettyprinting.jl 100.00% <100.00%> (ø)
src/compose.jl 100.00% <100.00%> (+2.63%) ⬆️
src/inference/forecast.jl 98.03% <100.00%> (-0.15%) ⬇️
src/observation_models/requirements.jl 91.08% <ø> (+0.63%) ⬆️
src/inference/IDProblem.jl 89.18% <89.18%> (-7.11%) ⬇️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…s facts

`as_turing_model(problem, data)` was removed with the rest of the
data-alongside-problem route, but `delays-dayofweek.md` still called it to
build the posterior-predictive model. That raises an `ArgumentError` from
the `as_turing_model` fallback, so the page could not build. The refit
idiom the page already shows does the same job, and the resulting model
adds exactly the `y_t` varnames `predict` needs.

Trim the comments and docstrings this branch added to the facts a reader
cannot get from the code: the inner-constructor scope of the guard, why
there is no `data_fits(::IDProblem)`, and why a value with no time axis is
refused by name. Split the sentences that joined clauses with a colon or a
semicolon.

Record the blank-series requirements report in a test, since `n_supplied`
counts positions in the series there exactly as it does for a series with
gaps in it.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@seabbs-bot

This comment has been minimized.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
seabbs-review-bot[bot]

This comment was marked as resolved.

…tions

The field was documented twice and the two disagreed. "or `nothing` if
none was" reads as `nothing` when the series holds no observations, which
is not what it means and not what it does: a wholly blank series reports
its length, exactly as a series with gaps in it does. `nothing` means the
requirements were asked for with no data argument at all, which is the
distinction `_stream_fits` already turns on.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment thread docs/src/tutorials/delays-dayofweek.md Resolved
Comment thread docs/src/tutorials/delays-dayofweek.md Resolved
Comment thread src/inference/IDProblem.jl Resolved

@seabbs seabbs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IDProblem should take IDModle and data not i.e the components of an IDmdoel. you new docwstrings are too long adn LLM cut down

The rebuild-coverage test item added in #372 does
`using InteractiveUtils: subtypes`, but the stdlib was never added to
`test/Project.toml`. Julia 1.12 refuses to load a stdlib that is not in
the active environment, so every test matrix job on a branch carrying
that item errors in `reconstruction.jl`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lw3PbYZfA1dZhfaaE9tbdp
(cherry picked from commit 4d7322a)
…ings

An IDProblem pairs a composed model with its data, so it takes the
IDModel rather than the components an IDModel is built from. The
three-argument constructor is gone, and the tutorial and tests build
the model first.

The IDProblem, as_turing_model(problem) and two-argument
as_turing_model docstrings are cut to what the code does not already
say.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lw3PbYZfA1dZhfaaE9tbdp
seabbs-bot pushed a commit that referenced this pull request Sep 5, 2026
…ck after loading

The child called apply_method with a NUTSampler, which #373 removes.
It now builds Turing's NUTS from a budget carried on the scenario and
calls sample directly, so the smoke test does not depend on the
inference layer it is not testing. The adaptation count reaches the
sampler this way, where NUTSampler dropped it.

Mooncake reverse timed out at 900s on its first scenario, with package
loading and the backend's first rule compilation both charged to it.
The child now reports once its packages are loaded, which restarts the
parent's per-scenario clock, and the cap is 1800s.

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

This comment has been minimized.

seabbs-review-bot[bot]

This comment was marked as resolved.

…e items

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

Copy link
Copy Markdown
Collaborator Author

CI status on 1fb3ea8.

The test matrix and downgrade-compat passed, and the AD jobs are still running.
Two checks are red for reasons outside this diff's code:


Generated by Claude Code

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

📖 Documentation preview is ready!

View the docs for this PR at: https://EpiAware.github.io/ComposableTuringIDModels.jl/previews/PR373/

This preview will be updated automatically when you push new commits.

@seabbs
seabbs merged commit b0d9cee into main Nov 23, 2026
32 of 35 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.

Do we still need the apply_method inference layer, or can we rely on Turing after as_turing_model?

3 participants