feat: split the AD benchmark report out of the ad-backends template (#299)#305
feat: split the AD benchmark report out of the ad-backends template (#299)#305seabbs-bot wants to merge 4 commits into
Conversation
…299) Follow-up from EpiAwareADTools#28: the AD backend-comparison benchmark (the "Packages used"/DIT/CairoMakie setup and the whole "Benchmark" section) lived on the ad-backends.jl tutorial page, reading as a how-to guide even though it is a cost report. Splitting it per-repo would be clobbered on the next sync since it is a kit-managed template, so the split happens here. - New template docs/src/getting-started/tutorials/ad-comparison.jl: the benchmark computation, summary table, and plots, moved verbatim out of ad-backends.jl. Cross-links back to ad-backends for the how-to-choose narrative and configuration. - ad-backends.jl keeps the backend-support table, Enzyme configuration, choosing-a-backend, and debugging sections, now linking to ad-comparison for the numbers instead of duplicating them. - Both pages are heavy tutorials (`_ad_heavy_tutorials`/ `_ad_tutorial_stubs`), sharing the existing ad-only docs-env deps (`_ad_docs_deps` etc., unchanged -- ad-comparison.jl is the one that actually needs the DIT/plotting stack). - New `_benchmarks_nav(benchmarks, ad)`: nests "Performance history" (benchmarks.md) and "AD comparison" under one "Benchmarks" section when both are enabled -- the shape EpiAwareADTools#28 asked for -- falls back to whichever single page applies when only one is, and omits the section entirely when neither is. ad-comparison.md is registered under Benchmarks, not Tutorials: that is the entire point of the split. Verified beyond the kit's own (extended) test suite: a real `Documenter.makedocs` build resolves the `@ref ad-backends`/ `@ref ad-comparison` cross-links between the split pages, and Literate.jl processes both substituted templates cleanly (`execute = false`, no heavy AD/DIT/CairoMakie compute needed for that check). Existing ad=true adopters need a one-line docs/pages.jl edit to pick up the AD-comparison nav entry -- pages.jl is package-owned/write-once, so this mirrors how enabling `benchmarks = true` later already requires the same manual edit. Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
Review: fix/299-benchmark-report-splitIndependent review (read-only checkout, PR head Probe 1: template split fidelityDiffed the old Probe 2: nav matrixRan
All four parse and evaluate correctly when spliced into a real Probe 3: reproduced the end-to-end verification myselfThe PR's own diff only adds Probe 4: the two fixed gating tests
Probe 5: the rollout noteConfirmed structurally: However: this exact disclosure isn't in NEWS.md, despite an established convention for it — the current top entry in Probe 6: suite + formatter + hygiene
This was opened by a bot. Please ping @seabbs for any questions. |
Try this Pull Request!Option 1: Julia Package ManagerOpen Julia and type: import Pkg
Pkg.activate(temp=true)
Pkg.add(url="https://github.com/EpiAware/EpiAwarePackageTools.jl", rev="fix/299-benchmark-report-split")
using EpiAwarePackageToolsOption 2: Local CheckoutIf you have the repo locally: git checkout fix/299-benchmark-report-split
julia --project=. -e "using Pkg; Pkg.instantiate()" |
|
📖 Documentation preview is ready! View the docs for this PR at: https://EpiAware.github.io/EpiAwarePackageTools.jl/previews/PR305/ This preview will be updated automatically when you push new commits. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Review on this PR asked for the rollout note (existing ad=true adopters need a one-line docs/pages.jl edit to surface the new nav entry) to be disclosed in NEWS.md rather than only in the PR description, mirroring the #294 entry's format and precedent for this kind of adopter-facing manual-edit note. Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
AlgebraOfGraphics caps DimensionalData (transitively, via Makie) below the range FlexiChains requires, so any package that hard-deps both (e.g. DistributionsInference.jl) cannot resolve a workspace that includes the scaffolded docs environment (kit#283). The #299 split moved both grammar-of-graphics plots onto the new ad-comparison.jl page, so this is the one place left carrying the AlgebraOfGraphics/ DimensionalData pull-in -- swap them to plain CairoMakie/Makie (per-facet Axis grids, boxplot!/scatter! recipes, a manual Legend) with identical output, and drop AlgebraOfGraphics from the docs-env deps and compat it no longer needs. The scenario-scatter facets build their Axis grid via a comprehension rather than a mutating for-loop: `@example` blocks execute each top-level statement in global scope, where reassigning a pre-declared variable inside a for loop is Julia's ambiguous soft-scope case (warns locally, hard `UndefVarError`s under Literate/Documenter). Verified with a standalone repro against synthetic data: both figures render correctly (box plot; scatter faceted by metric, coloured by backend family, marker by forward/reverse mode, with a working legend), and the kit's own suite passes unchanged bar the one dropped assertion for the removed dependency. Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
|
Pushed two follow-ups after review:
Also rebased (via merge, not rebase, to avoid rewriting the original This was opened by a bot. Please ping @seabbs for any questions. |
|
Sorry what we should have both of these in a benchmarks tab with one being AD comparison and the other Over time or similar we had an issue steer for this on i.e convolveddistributions which was very clear. This PR description currently reads as a reversion to past practice but also current state seems not in line with where we want to go |
Summary
Fixes #299. Follow-up from EpiAwareADTools#28: the AD backend-comparison benchmark (the "Packages used" DIT/CairoMakie setup and the whole "Benchmark" section -- summary table, box plots, per-scenario plot) lived on the
ad-backends.jltutorial page, reading as a how-to guide even though it is a cost report. That page is a kit-managed template shared verbatim across every AD-enabled adopter, so a per-repo split would be clobbered on the next sync -- the split has to happen here.What moved
templates/docs/src/getting-started/tutorials/ad-comparison.jl: the benchmark computation, summary table, and both plots, moved out ofad-backends.jllargely verbatim. Cross-links back toad-backendsfor the how-to-choose narrative and configuration rather than duplicating it.ad-backends.jlkeeps the backend-support table, Enzyme configuration, "Choosing a backend", and "Debugging" sections, now linking toad-comparisonfor the actual numbers instead of carrying them._ad_heavy_tutorials/_ad_tutorial_stubs; the shared ad-only docs-env deps (_ad_docs_depsetc.) are unchanged sincead-comparison.jlis the one that actually needs the DIT/plotting stack.Nav
New
_benchmarks_nav(benchmarks, ad)replaces the old flatbench_navcomputation:benchmarks && ad: nests "Performance history" (benchmarks.md) and "AD comparison" under one "Benchmarks" section -- the shape EpiAwareADTools#28 asked for, rather than five one-off per-repo nav edits.benchmarksonly: the existing flat"Benchmarks" => "benchmarks.md", unchanged.adonly (the common default, no performance-history suite): a flat"Benchmarks" => "...ad-comparison.md"entry, so a tooling-only-benchmarks package still gets a Benchmarks nav entry rather than none.ad-comparison.mdis registered under Benchmarks, not Tutorials -- that's the entire point of the split.Rollout note
docs/pages.jlis package-owned and write-once (substituted only on firstscaffold, never re-applied byupdate), so an already-scaffoldedad = trueadopter needs a one-line manual edit to pick up the new Benchmarks nav entry pointing atad-comparison.md-- this mirrors the existing pattern for a package that later flipsbenchmarks = trueand needs the same manualpages.jledit today. Thead-comparison.jlfile itself is a fully managed template, so it lands automatically on the nextupdate(); only its own nav link needs the one-line follow-up.Verification
ad-backends.jl, present inad-comparison.jl; cross-refs present in both; valid-Julia parse check on both), the three_benchmarks_navshapes, and fixed two pre-existingbenchmarks_gating.jltests whose fixtures used the scaffold defaultad = trueand so now correctly get a Benchmarks nav entry even withbenchmarks = false(previously "no Benchmarks entry at all" was the only case tested).Documenter.makedocsbuild resolves the@ref ad-backends/@ref ad-comparisoncross-links between the split pages (anchors only, not the full AD/DIT/CairoMakie compute), andLiterate.jl(execute = false) processes both substituted templates cleanly.This was opened by a bot. Please ping @seabbs for any questions.