Repository navigation
ci: align sublibrary CI to OrdinaryDiffEq canonical translating dispatcher - #953
Closed
ChrisRackauckas-Claude wants to merge 3 commits into
Closed
ChrisRackauckas-Claude wants to merge 3 commits into
ChrisRackauckas-Claude wants to merge 3 commits into
Conversation
…all groups Keeps the centralized sublibrary-tests.yml@v1 form (SublibraryCI.yml is untouched) and fixes the coverage gap by teaching it the real per-sublibrary test matrix instead of reverting to bespoke CI_*.yml. Without a lib/<sub>/test/test_groups.toml, the reusable workflow defaults to GROUP=Core (versions lts/1.11/1/pre) + GROUP=QA (version 1) on ubuntu only, and emits GROUP="<pkg>" / "<pkg>_QA", which the sublibrary runtests.jl filtered on bare tag names never match -> most groups ran zero tests, the macOS legs were dropped, and the per-suite version matrices were lost. This commit, per sublibrary: - Adds test/test_groups.toml encoding exactly what the old bespoke CI ran: versions 1.10/1.11/1 (lts/1.11/1 for SCCNonlinearSolve), an ubuntu Core section, and a parallel <Section>MacOS section with runner="macos-latest" to restore the macOS legs. SimpleNonlinearSolve additionally encodes its adjoint and alloc_check groups (each on ubuntu + macOS). - Adds a GROUP-decoding shim at the top of test/runtests.jl that maps the emitted GROUP="<pkg>" -> Core and GROUP="<pkg>_<grp>" -> <grp> (stripping the "MacOS" runner-only suffix), driving the existing tag/group dispatch. Bare "All"/"all" still works for local runs. Verified with the actual SciML/.github@v1 compute_affected_sublibraries.jl that each sublibrary emits the same group x version x OS matrix as its old bespoke CI, and that every emitted GROUP decodes to a non-empty test selection. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Replace the bespoke per-sublibrary group sections (Core/CoreMacOS, and for SimpleNonlinearSolve adjoint/alloc_check + MacOS variants) with the SciML standard sublibrary groups: Core — all functional/correctness tests (default-on group) QA — Aqua + ExplicitImports + allocation tests (quality/static/allocation) GPU — CUDA tests (driven by the dedicated GPU.yml workflow, GROUP="cuda") Each affected sublibrary's specialized test/test_groups.toml is deleted so the reusable SublibraryCI (SciML/.github sublibrary-tests.yml@v1) falls back to its standard defaults: Core on [lts, 1.11, 1, pre] and QA on [1], all on ubuntu-latest. None of these sublibraries has a GPU section in test_groups.toml because CUDA is already handled by the separate GPU.yml workflow. runtests.jl in each sublibrary keeps the prefix-strip shim (GROUP="<pkg>" -> Core, GROUP="<pkg>_<Section>" -> Section) and dispatches on the standard section, folding the old custom groups: - functional (core, adjoint, wrappers, basic, EXPANDED/NESTED-style) -> Core - Aqua/JET/ExplicitImports/allocation (alloc_check) -> QA - cuda/gpu -> GPU QA test items are re-tagged from :core to :qa; SimpleNonlinearSolve adjoint folds :adjoint -> :core and :alloc_check -> :qa; NonlinearSolveSciPy folds :wrappers and the untagged basic load test -> :core. Also fixes the pre-existing @itesitem typo in SimpleNonlinearSolve/test/core/allocation_tests.jl so the QA allocation test actually runs. macOS legs are dropped: the standard sublibrary CI is ubuntu (Core/QA) plus the gpu runner (GPU) and does not use macOS. This is a flagged tradeoff — the previous bespoke groups ran a macOS leg, the standard groups do not. The centralized SublibraryCI.yml (sublibrary-tests.yml@v1) is kept; no bespoke CI_*.yml is restored and no workflow files are changed. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
…tcher Match the OrdinaryDiffEq.jl test/runtests.jl reference exactly. The reusable SublibraryCI (sublibrary-tests.yml@v1) runs Pkg.test on the root NonlinearSolve package with GROUP="<sub>" (Core) or "<sub>_<Section>" (e.g. QA). Previously the root runtests.jl had no sublibrary dispatcher, so sublib tests never ran under SublibraryCI, and each sublib runtests carried a bespoke prefix-strip shim. Root test/runtests.jl: add the canonical dispatcher prelude that reads the RAW GROUP env (before the main-package lowercasing/parsing), detects a lib/<sub> directory via _detect_sublibrary_group, activates it, transitively Pkg.develop its [sources] path deps on Julia < 1.11, then runs Pkg.test(<sub>) under a clean NLS_TEST_GROUP env var. The _detect_sublibrary_group + transitive [sources] develop + withenv/Pkg.test tail are copied verbatim from OrdinaryDiffEq (env var adapted to NLS_TEST_GROUP). When GROUP is not a sublibrary (all/downstream/nopre/ bounds/cuda/wrappers/trim), control falls through to the existing main-package logic, preserved byte-for-byte in the else branch. Each lib/<sub>/test/runtests.jl: replace the _G/_SUB/startswith prefix-strip shim with const GROUP = get(ENV, "NLS_TEST_GROUP", "All"); the standard Core/QA(/GPU via cuda) dispatch is unchanged. Matches OrdinaryDiffEqRosenbrock's plain get(ENV, "ODEDIFFEQ_TEST_GROUP", ...). No test_groups.toml (defaults give Core[lts,1.11,1,pre] + QA[1]). SublibraryCI.yml kept; no bespoke per-sublibrary CI restored. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Member
Author
|
Closing in favor of the project-model approach (per discussion with @ChrisRackauckas). This PR added OrdinaryDiffEq's GROUP-dispatch Instead, the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR aligns the NonlinearSolve sublibrary CI to the exact OrdinaryDiffEq.jl canonical pattern: a translating root dispatcher plus clean-env sublibrary runtests, using the standard
Core/QA/GPUtest groups.It keeps the centralized sublibrary CI form merged in #951 —
.github/workflows/SublibraryCI.ymlcontinues to callSciML/.github/.github/workflows/sublibrary-tests.yml@v1, and no bespokeCI_<sublib>.ymlis restored. No workflow files are changed.The canonical pattern (matching OrdinaryDiffEq)
The reusable
sublibrary-tests.yml@v1runsPkg.teston the root package with envGROUPset to<sub>(Core) or<sub>_<Section>(e.g.<sub>_QA). The reference (SciML/OrdinaryDiffEq.jltest/runtests.jl) handles this by having the root runtests detect a sublibrary GROUP, activatelib/<sub>, translate the suffix to a clean section name, set it as a distinct env var, andPkg.testthe sublibrary. The sublibrary runtests reads only that clean env var (e.g. OrdinaryDiffEqRosenbrock reads justget(ENV, "ODEDIFFEQ_TEST_GROUP", "ALL")).Earlier revisions of this PR instead put a per-package prefix-strip shim (
_G/_SUB/startswith) in every sublibrary runtests and left the root runtests with no sublibrary dispatcher — so the sublibrary tests never actually ran under SublibraryCI. This revision adopts the OrdinaryDiffEq design exactly.What changed
Root
test/runtests.jl— canonical translating dispatcher preludeAdded at the top, reading the raw
GROUPenv before the main-package logic lowercases/parses it:_detect_sublibrary_group(copied verbatim from OrdinaryDiffEq):isdir(lib/<group>) → (group, "Core"), else scan underscores right-to-left for the longestlib/<prefix>match →(prefix, suffix), else(group, "Core").base_groupis alib/<sub>directory:Pkg.activate(lib/<sub>), on Julia < 1.11 transitivelyPkg.developthe activated project's[sources]path deps (verbatim OrdinaryDiffEq block, never developing the active project itself), thenwithenv("NLS_TEST_GROUP" => test_group)runPkg.test(base_group; julia_args=["--check-bounds=auto","--depwarn=yes"], force_latest_compatible_version=false, allow_reresolve=true).all/downstream/nopre/bounds/cuda/wrappers/trim/…): control falls through to the existing main-package logic, preserved byte-for-byte in theelsebranch (itsTEST_ARGSparsing,lowercase(GROUP), Enzyme/Mooncake/CUDAEXTRA_PKGS, worker config,ReTestItems.runtests, andtrimactivation are unchanged).Each
lib/<sub>/test/runtests.jl— clean-env reader, no shimThe
_G/_SUB/startswithprefix-strip shim is replaced by:The standard
Core/QA(/GPUviacuda) dispatch in each file is otherwise unchanged — functional items run underCore/All, Aqua/JET/ExplicitImports/alloc underQA/All, CUDA underGPU/cuda. (SimpleNonlinearSolve's now-unusedparse_test_args/get_from_test_args_or_envhelpers, which only fed the GROUP read, are dropped in favor of the plainget(ENV, …).) This matchesOrdinaryDiffEqRosenbrock/test/runtests.jl.The pre-existing
@itesitem→@testitemfix inSimpleNonlinearSolve/test/core/allocation_tests.jl(so the QA allocation test actually runs) is retained.Standard groups
GPU.ymlworkflow (which setsGROUP="cuda"on a self-hosted GPU runner).No
test_groups.tomlin any sublibrary: with none present, the reusablecompute_affected_sublibraries.jlfalls back to its standard defaults —Coreon[lts, 1.11, 1, pre]+QAon[1], allubuntu-latest— emittingGROUP="<sub>"(Core) andGROUP="<sub>_QA"(QA). CUDA is covered byGPU.yml, so no[GPU]section is needed.Verification (run locally, no heavy test runs)
_detect_sublibrary_group("<sub>") == ("<sub>", "Core")and_detect_sublibrary_group("<sub>_QA") == ("<sub>", "QA")for all 10 sublibraries — all OK.NLS_TEST_GROUP="Core"enters the Core block andNLS_TEST_GROUP="QA"enters the QA block (non-empty in each case; SciPy intentionally has no QA items, documented in-file) — all OK.GROUPvaluesnopre/cuda/all/downstream/bounds/wrappers/trimare not detected as sublibraries (isdir(lib/<group>)is false) and fall through to the unchanged main-package logic — all OK.elsebranch was diffed againstmaster'stest/runtests.jland is byte-identical (after accounting for the one extra level ofelseindentation).runtests.jlparse cleanly and are Runic-clean (Runic 1.5.1). No TOML files changed; notest_groups.tomlpresent.SublibraryCI.ymlis unchanged and kept. No bespokeCI_<sublib>.ymlis restored. OnlyCore/QA/GPUgroup names remain.Please ignore until reviewed by @ChrisRackauckas.
🤖 Generated with Claude Code