Skip to content

Conversation

@ChrisRackauckas-Claude
Copy link

Summary

This PR adds compatibility with SymbolicUtils v4.

SymbolicUtils v4 renamed the Symbolic type to BasicSymbolic. This change:

  1. Updates compat bounds to include SymbolicUtils v4
  2. Updates the extension to use a version-agnostic SymbolicType constant that resolves to Symbolic (v0.19-v3) or BasicSymbolic (v4+)

Motivation

This is needed for DataDrivenSR (from DataDrivenDiffEq.jl) to work with SymbolicRegression.jl when using Symbolics v7 / SymbolicUtils v4.

Related: SciML/DataDrivenDiffEq.jl#571

Changes

  • Project.toml: Added 4 to SymbolicUtils compat
  • ext/SymbolicRegressionSymbolicUtilsExt.jl: Use conditional SymbolicType constant instead of directly importing Symbolic

Test plan

  • Verify existing tests pass with SymbolicUtils v3
  • Verify extension works with SymbolicUtils v4

🤖 Generated with Claude Code

SymbolicUtils v4 renamed the `Symbolic` type to `BasicSymbolic`. This commit:

1. Updates compat bounds to include SymbolicUtils v4
2. Updates the extension to use a version-agnostic `SymbolicType` constant
   that resolves to `Symbolic` (v0.19-v3) or `BasicSymbolic` (v4+)

This allows DataDrivenSR (from DataDrivenDiffEq.jl) to work with
SymbolicRegression.jl when using Symbolics v7 / SymbolicUtils v4.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisRackauckas
Copy link
Contributor

This looks reasonable at face value.

@github-actions
Copy link
Contributor

Benchmark Results (Julia v1)

Time benchmarks
master 241f615... master / 241f615...
search/multithreading 14.8 ± 0.23 s 14.6 ± 0.15 s 1.01 ± 0.019
search/serial 32.9 ± 1.3 s 32.6 ± 0.81 s 1.01 ± 0.046
utils/best_of_sample 2.01 ± 0.6 μs 1.94 ± 0.52 μs 1.04 ± 0.42
utils/check_constraints_x10 16.6 ± 4.2 μs 16.9 ± 4.2 μs 0.982 ± 0.35
utils/compute_complexity_x10/Float64 2.16 ± 0.098 μs 2.15 ± 0.09 μs 1 ± 0.062
utils/compute_complexity_x10/Int64 2.1 ± 0.089 μs 2.06 ± 0.081 μs 1.02 ± 0.059
utils/compute_complexity_x10/nothing 1.55 ± 0.09 μs 1.55 ± 0.09 μs 1 ± 0.082
utils/insert_random_op_x10 5.39 ± 1.7 μs 5.33 ± 1.7 μs 1.01 ± 0.44
utils/next_generation_x100 0.437 ± 0.022 ms 0.44 ± 0.022 ms 0.993 ± 0.071
utils/optimize_constants_x10 0.0339 ± 0.0078 s 0.0332 ± 0.0075 s 1.02 ± 0.33
utils/randomly_rotate_tree_x10 8.17 ± 0.96 μs 7.89 ± 0.88 μs 1.03 ± 0.17
time_to_load 2.71 ± 0.14 s 2.62 ± 0.041 s 1.03 ± 0.055
Memory benchmarks
master 241f615... master / 241f615...
search/multithreading 0.207 G allocs: 54 GB 0.204 G allocs: 53.2 GB 1.02
search/serial 0.207 G allocs: 53.8 GB 0.207 G allocs: 53.8 GB 1
utils/best_of_sample 0.038 k allocs: 3.25 kB 0.038 k allocs: 3.25 kB 1
utils/check_constraints_x10 0.034 k allocs: 0.875 kB 0.034 k allocs: 0.875 kB 1
utils/compute_complexity_x10/Float64 0 allocs: 0 B 0 allocs: 0 B
utils/compute_complexity_x10/Int64 0 allocs: 0 B 0 allocs: 0 B
utils/compute_complexity_x10/nothing 0 allocs: 0 B 0 allocs: 0 B
utils/insert_random_op_x10 0.046 k allocs: 1.94 kB 0.045 k allocs: 1.88 kB 1.03
utils/next_generation_x100 4.63 k allocs: 0.276 MB 4.63 k allocs: 0.276 MB 1
utils/optimize_constants_x10 24.5 k allocs: 25.4 MB 21.5 k allocs: 21.3 MB 1.19
utils/randomly_rotate_tree_x10 0.042 k allocs: 1.34 kB 0.042 k allocs: 1.34 kB 1
time_to_load 0.145 k allocs: 11 kB 0.145 k allocs: 11 kB 1

@MilesCranmer
Copy link
Owner

Requires SymbolicML/DynamicExpressions.jl#148 first. (Not sure why those CI aren't running)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants