compile_all, a library catalogue, and argument signatures - #313
Conversation
ExaModelsCompiler declares the verb and owns its keyword contract — path, only, exclude, and whatever compile_library takes; a package that ships models implements the Val form for itself in an extension, so providing models never costs a dependency on a compiler toolchain. Callers name the package: compile_all(LuksanVlcekBenchmark; path = "@lvb"), which forwards to the Val method. select(models; only, exclude) is the shared half, so every provider offers the same filtering and a typo is refused rather than quietly compiling a library with a model missing. Verified against LuksanVlcekBenchmark on its recipes branch: a draft extension over its eighteen models compiled two of them at a size never compiled, exact against the in-Julia models on objective and gradient, with an unknown name in only= refused before any compiling. Suite 246. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A two-line filter does not earn hub API. The docstring's worked example no longer advertises only/exclude as a shared contract; a provider that wants filtering writes it in its own extension, as the LVB draft does. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nt signatures
Two additions to the emitted ABI, both answering questions a caller
holding only a library path has no way to ask today.
cnlp_nmodels / cnlp_model_name — the models a library carries, by name.
Library-level and fixed-name, the only such symbols: every per-model
entry point needs a prefix, and these are where a prefix comes from.
P_argtype — what a model instantiates FROM, as a signature rather than
an enum: comma-separated types, each optionally type|description
("int|size", "string|...", or a structured model's full field list).
Every model answers, including those with no builder schema, and the
signature also identifies the entry point without symbol probing.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Your PR requires formatting changes to meet the project's style guidelines. Please run: julia --project=@runic -e 'using Pkg; Pkg.add("Runic")'
julia --project=@runic -e "using Runic; exit(Runic.main(ARGS))" -- --fix <files>(or Note: the full diff is omitted because it can exceed GitHub Actions input limits. |
The C interface ExaModelsCompiler emits is now independently specified — cnlp.h at madsuite-org/cnlp-abi, tag v0.1, with both consumers conforming and citing the same version — so the producer says so too: the module docstring and the README name the ABI and pin the tag, closing the loop where every package in the constellation references one versioned contract instead of describing its own copy of it. Four stale MadNLP-org links corrected to madsuite-org on the way through. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
One commit added: the emitted library's contract now has a name — the module docstring and README cite cnlp ABI v0.1 (madsuite-org/cnlp-abi, the header-is-the-spec repo, tagged) — plus four stale With this, merging #313 completes the constellation on ExaModels' side: producer, spec, and both consumers referencing one versioned contract. LVB #4, COPS #16 and ExaModelsPower #57 remain the benchmark-side pieces. 🤖 Generated with Claude Code |
ExaModels relates to NLPModels.jl; the subpackage that emits the ABI is the one that names it. The README bullet keeps its corrected links. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Benchmark Results |
The catalogue was emitted but never asserted on a real library — the consumers only exercised their reading against the hand-written fixture. The five-model library's testset now reads available_models through the consumer from the compiled artifact, closing the loop from compile_library to a caller discovering every model with only a path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Removed on the judgment that a two-line filter does not earn hub API; restored on evidence: all three provider extensions written since (LVB, COPS, ExaModelsPower) independently reimplemented the refusal half with near-identical messages, because a silent drop produces a library correct in every respect except the model you asked for — an absence that surfaces at the consumer, far from the typo. Restored byte-for- byte from the commit that introduced it, tests included. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A constraint or objective may iterate a collection of data points (for (i, tau) in nodes), and that collection then forms one axis of the block's size field. size/total had methods for Int and range axes and none for an array's, so everything downstream threw a MethodError: ExaModels' own multipliers on such a block, and — where it was found — a compiled library's layout query, which degraded the throw to status 2 and left six of COPS's seventeen models unconstructable through the consumer while compiling clean and cataloguing correctly. channel passes with 3-D deferred blocks (all range axes) while catmix fails (collocation-node vector axis), which is what closed the correlation its finder could not. One method: _length(n::AbstractArray) = length(n). Verified on the reproducer — catmix compiles, instantiates, c1 reads dims (20, 3, 2) matching its iterator's shape, objective exact against in-Julia — and regression-tested at both layers: a data-axis constraint in the feature suite, and a compiled data-axis block in the layout testset. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ve contact select's docstring now states the two shapes misread on first contact by the providers adopting it — it takes the assembled PAIRS (build all recipes, filter after: recipes are cheap, compiles are not), and exclude defaults to (), not nothing. Deliberately absent: the frozen-dimension validation convention drafted for compile_all's example. Its own author falsified it before it shipped — a named package function cannot carry the frozen value, and a closure that could is refused by the reachability guard — so the enforcement design (parameterized callable argfuns, or an instantiation-time check) is tracked on the PR instead of prescribed in a docstring. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Final state of the branch, after two rounds of field testing by the benchmark providers:
Open design item, deliberately NOT in the docs (its author falsified the drafted guidance before it shipped): a recipe that bakes a dimension (multi-period OPF's bus count) produces a library that silently accepts mismatched inputs — a named argfun cannot carry the frozen value, and a closure that could is refused by the reachability guard. Candidate fixes: admit parameterized callable types as argfuns ( Field verification on this branch: emp compiles clean on the tip (188s, 0 verifier errors, three prefixes); COPS's closing 17-model run is in flight. 🤖 Generated with Claude Code |
Supersedes #312, whose content never reached main: it was stacked on
anvil/rename-compilerand merged into that branch after #311 had already carried the branch into main — so the merge landed on a closed base. (Its third commit had additionally been pushed after GitHub took the merge snapshot.) This is the same three commits, cherry-picked onto current main and re-gated there.compile_all— ExaModelsCompiler declares the verb and its keyword contract; a package that ships models implementscompile_all(::Val{TheirModule}; …)in an extension, so providing models never costs a dependency on a compiler toolchain. Callers name the package —compile_all(LuksanVlcekBenchmark; path = "@lvb", sizes = 1000)— and the module method forwards to theValform, which is the uniform handle across providers (it works for a package with no marker type of its own). Noselecthelper: providers filter their own model lists.The library says what it carries —
cnlp_nmodels/cnlp_model_name, the ABI's only fixed-name symbols, because every per-model entry point needs a prefix and this is where a prefix comes from.Every model says what it instantiates from —
P_argtypepublishes a typed signature,"type|description,…":""for a fixed model,"int|size","string|…"for an argument-function model, or a structured model's full field list ("int|arg1,Vector{f64}|v0,Table{i::int w::f64 s::f64}|bus"). Every model answers — including those with no builder schema — and the signature identifies the entry point without symbol probing.Consumer counterparts are already on both masters (CNLPModels.jl
d4070e5, cnlpmodels-py45d3f08):available_models,argtype,schemaanswering rather than throwing.Gate on this exact tip: 242/242, including signature assertions for all four instantiation surfaces;
compile_allend-to-end verified against LuksanVlcekBenchmark's recipes branch (two models compiled into one library, exact at a size never compiled).🤖 Generated with Claude Code