From ce1b7a94e9c956811ea5f6ba15095a8cd3f75bc7 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Thu, 20 Aug 2026 08:27:19 -0400 Subject: [PATCH] Add representative PrecompileTools workload Co-Authored-By: Chris Rackauckas --- Project.toml | 2 ++ src/FunctionProperties.jl | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/Project.toml b/Project.toml index 3ae1018..a031864 100644 --- a/Project.toml +++ b/Project.toml @@ -4,8 +4,10 @@ version = "1.1.1" authors = ["SciML"] [deps] +PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" [compat] +PrecompileTools = "1.2" ComponentArrays = "0.15" Random = "1.10" SafeTestsets = "0.1" diff --git a/src/FunctionProperties.jl b/src/FunctionProperties.jl index af1544e..ce5d9d1 100644 --- a/src/FunctionProperties.jl +++ b/src/FunctionProperties.jl @@ -25,4 +25,27 @@ include("writeprobe.jl") # Capability-gated certificates over the compiler's effects and inference results. include("effects.jl") +using PrecompileTools: @compile_workload, @setup_workload + +@setup_workload begin + @compile_workload begin + linear = (x, p, t) -> p * x + t + branchy = (x, p, t) -> x < 0 ? -x + p : x + p + mutating = (dx, x) -> (dx[1] = x[1]) + x = [1.0] + p = 2.0 + t = 0.0 + hasbranching(linear, x[1], p, t) + hasbranching(branchy, x[1], p, t) + islinear(linear, x[1], p, t) + isquadratic(linear, x[1], p, t) + isautonomous(linear, x[1], p, t) + issmooth(linear, x[1], p, t) + hasrandomness(linear, x[1], p, t) + hasmutation(mutating, copy(x), x) + ispure(linear, x[1], p, t) + isinferable(linear, x[1], p, t) + end +end + end