compile_all: a template for compiling everything a package provides - #312
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>
|
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. |
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>
Benchmark Results |
|
Two commits since the last review state:
Gate on the tip: 242/242, including signature assertions for all four instantiation surfaces. Consumer counterparts are on both masters (CNLPModels.jl 🤖 Generated with Claude Code |
|
This merge landed on 🤖 Generated with Claude Code |
Stacked on #311 (base is that branch) so it can land after it, or fold in if you'd rather.
ExaModelsCompilerdeclares the verb and owns the keyword contract; a package that ships models implements it for itself in an extension, so providing models never costs a dependency on a compiler toolchain — a benchmark set is a modelling package, and juliac is not something you should acquire by loading one.Callers name the package; providers implement
compile_all(::Val{TheirModule}; …).Valis the uniform handle — every provider spells it the same way, and it works for a package that has no marker type of its own (ExaModelsPower has none today). The module method is a one-line wrapper over it.One library rather than one per model, because sizes are deferred: the models share a runtime, one compile amortises across all of them, and a consumer selects with
CNLPModel(lib, :bearing, n).Verification
Against LuksanVlcekBenchmark on its recipes branch, with a draft extension over its eighteen models: compiled
:rosenrockand:broyden_bandedinto one library, instantiated both at a size never compiled (37), exact against the in-Julia models on objective and gradient. ExaModelsCompiler suite 246/246.The docstring carries a complete worked extension (weakdeps stanza, ext module, the argument-function spelling for data-defined models) so a provider implements it by copying. @ohm and @nabla are testing it against ExaModelsPower and COPS/LVB respectively — emp is the interesting case, since its models take an argument function rather than sizes.
🤖 Generated with Claude Code