Skip to content

Allow Symbolics 6 by compiling out the Symbolics extension#149

Merged
mgyoo86 merged 6 commits into
ProjectTorreyPines:masterfrom
tomneiser:symbolics6-compat
Jun 10, 2026
Merged

Allow Symbolics 6 by compiling out the Symbolics extension#149
mgyoo86 merged 6 commits into
ProjectTorreyPines:masterfrom
tomneiser:symbolics6-compat

Conversation

@tomneiser

Copy link
Copy Markdown
Contributor

The FastInterpolationsSymbolicsExt weak compat pinned Symbolics = "7", which forces the entire environment to Symbolics 7 whenever Symbolics is present (weak compat is enforced even when the extension is unused). This made FastInterpolations 0.4.x unresolvable in ecosystems still on the Symbolics 6 / SymbolicUtils 3 / ModelingToolkit 9 generation (e.g. FUSE via ThermalSystemModels), breaking downstream builds.

Guard the extension body behind isdefined(SymbolicUtils, :TypeT) (the SymbolicUtils 4 API the extension relies on) so it compiles out as a no-op on the older generation, and widen the weak compat to Symbolics = "6, 7". Symbolics 7 keeps full symbolic-interpolation functionality; Symbolics 6 environments can install FastInterpolations with the extension simply inactive. Numeric interpolation is unaffected on either generation.

Verified: precompiles as a no-op under Symbolics 6.58 / SymbolicUtils 3.32 and precompiles + functions under Symbolics 7.26 / SymbolicUtils 4.

tomneiser and others added 2 commits June 9, 2026 21:45
The FastInterpolationsSymbolicsExt weak compat pinned Symbolics = "7",
which forces the entire environment to Symbolics 7 whenever Symbolics is
present (weak compat is enforced even when the extension is unused). This
made FastInterpolations 0.4.x unresolvable in ecosystems still on the
Symbolics 6 / SymbolicUtils 3 / ModelingToolkit 9 generation (e.g. FUSE
via ThermalSystemModels), breaking downstream builds.

Guard the extension body behind `isdefined(SymbolicUtils, :TypeT)` (the
SymbolicUtils 4 API the extension relies on) so it compiles out as a
no-op on the older generation, and widen the weak compat to
Symbolics = "6, 7". Symbolics 7 keeps full symbolic-interpolation
functionality; Symbolics 6 environments can install FastInterpolations
with the extension simply inactive. Numeric interpolation is unaffected
on either generation.

Verified: precompiles as a no-op under Symbolics 6.58 / SymbolicUtils
3.32 and precompiles + functions under Symbolics 7.26 / SymbolicUtils 4.

Co-authored-by: Cursor <cursoragent@cursor.com>
Indent the guarded extension body inside the `@static if` block to
satisfy the repo's Runic formatting check.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

FastInterpolations.jl Benchmarks

All benchmarks (50 total, click to expand)
Benchmark Current: 4a3d7d3 Previous Imm. Ratio Grad. Ratio
10_nd_construct/bicubic_2d 37230.0 ns 37551.0 ns 0.991 0.981
10_nd_construct/bilinear_2d 576.1 ns 608.9 ns 0.946 0.843
10_nd_construct/tricubic_3d 351942.0 ns 355206.0 ns 0.991 0.999
10_nd_construct/trilinear_3d 1636.1 ns 1677.1 ns 0.976 0.904
11_nd_eval/bicubic_2d_batch 1438.7 ns 1436.7 ns 1.001 0.943
11_nd_eval/bicubic_2d_scalar 16.3 ns 16.3 ns 1.0 1.001
11_nd_eval/bilinear_2d_scalar 7.5 ns 7.5 ns 1.0 1.036
11_nd_eval/tricubic_3d_batch 3239.1 ns 3251.0 ns 0.996 0.992
11_nd_eval/tricubic_3d_scalar 33.3 ns 33.7 ns 0.988 0.975
11_nd_eval/trilinear_3d_scalar 13.2 ns 13.5 ns 0.978 0.984
12_cubic_eval_gridquery/range_random 4238.6 ns 4270.4 ns 0.993 0.983
12_cubic_eval_gridquery/range_sorted 4221.9 ns 4219.3 ns 1.001 0.98
12_cubic_eval_gridquery/vec_random 9613.9 ns 9367.5 ns 1.026 0.993
12_cubic_eval_gridquery/vec_sorted 3198.4 ns 3204.8 ns 0.998 0.997
13_nd_oneshot_gridquery/bicubic_2d_rand_rand 65249.8 ns 65274.3 ns 1.0 0.984
13_nd_oneshot_gridquery/bicubic_2d_sort_rand 62577.8 ns 62137.5 ns 1.007 1.002
13_nd_oneshot_gridquery/bicubic_2d_sort_sort 53984.6 ns 58071.9 ns 0.93 0.917
13_nd_oneshot_gridquery/bilinear_2d_rand_rand 16104.9 ns 19221.4 ns 0.838 0.907
13_nd_oneshot_gridquery/bilinear_2d_sort_rand 9375.9 ns 9675.1 ns 0.969 0.959
13_nd_oneshot_gridquery/bilinear_2d_sort_sort 5283.8 ns 5715.3 ns 0.924 0.975
14_series_oneshot_batch/constant_inplace_vec_k8_q1000_rand 16585.2 ns 19236.0 ns 0.862 0.869
14_series_oneshot_batch/linear_inplace_vec_k8_q1000_rand 17505.0 ns 17920.6 ns 0.977 0.931
1_cubic_oneshot/q00001 545.8 ns 540.2 ns 1.01 1.075
1_cubic_oneshot/q10000 40172.7 ns 43528.5 ns 0.923 0.725
2_cubic_construct/g0100 1275.8 ns 1386.2 ns 0.92 0.917
2_cubic_construct/g1000 12716.0 ns 12722.9 ns 0.999 0.976
3_cubic_eval/q00001 20.9 ns 19.9 ns 1.05 1.005
3_cubic_eval/q00100 443.6 ns 442.0 ns 1.004 0.984
3_cubic_eval/q10000 39393.1 ns 42635.9 ns 0.924 0.905
4_linear_oneshot/q00001 24.6 ns 25.6 ns 0.961 0.967
4_linear_oneshot/q10000 18698.2 ns 18805.2 ns 0.994 0.991
5_linear_construct/g0100 34.8 ns 33.2 ns 1.048 0.821
5_linear_construct/g1000 241.0 ns 303.9 ns 0.793 0.849
6_linear_eval/q00001 10.1 ns 10.5 ns 0.962 0.99
6_linear_eval/q00100 196.6 ns 196.8 ns 0.999 0.986
6_linear_eval/q10000 18574.0 ns 18516.7 ns 1.003 0.991
7_cubic_range/scalar_query 8.3 ns 8.3 ns 1.0 0.981
7_cubic_vec/scalar_query 11.0 ns 11.3 ns 0.974 0.997
8_cubic_multi/construct_s001_q100 662.8 ns 647.8 ns 1.023 1.076
8_cubic_multi/construct_s010_q100 4453.2 ns 4460.8 ns 0.998 0.98
8_cubic_multi/construct_s100_q100 39645.7 ns 40208.4 ns 0.986 0.972
8_cubic_multi/eval_s001_q100 819.8 ns 827.4 ns 0.991 1.046
8_cubic_multi/eval_s010_q100 1837.3 ns 1813.8 ns 1.013 1.037
8_cubic_multi/eval_s010_q100_scalar_loop 2294.5 ns 2286.7 ns 1.003 0.983
8_cubic_multi/eval_s100_q100 11421.5 ns 11421.4 ns 1.0 0.996
8_cubic_multi/eval_s100_q100_scalar_loop 3363.4 ns 3352.3 ns 1.003 0.989
9_nd_oneshot/bicubic_2d 45646.0 ns 45192.7 ns 1.01 1.06
9_nd_oneshot/bilinear_2d 540.6 ns 539.8 ns 1.001 0.972
9_nd_oneshot/tricubic_3d 417419.3 ns 426524.4 ns 0.979 1.043
9_nd_oneshot/trilinear_3d 1031.9 ns 1040.0 ns 0.992 0.982

1 benchmark(s) were flagged but verified as CI noise after 10 re-run(s)

This comment was automatically generated by Benchmark workflow.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.74468% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.56%. Comparing base (05c2b34) to head (4a3d7d3).

Files with missing lines Patch % Lines
ext/FastInterpolationsSymbolicsExt.jl 95.74% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #149      +/-   ##
==========================================
+ Coverage   96.40%   96.56%   +0.16%     
==========================================
  Files         148      148              
  Lines       12269    12272       +3     
==========================================
+ Hits        11828    11851      +23     
+ Misses        441      421      -20     
Files with missing lines Coverage Δ
ext/FastInterpolationsSymbolicsExt.jl 95.83% <95.74%> (+44.72%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tomneiser and others added 4 commits June 9, 2026 23:23
…erivatives, nameof)

Add coverage for previously-untested extension paths: the ND varargs
symbolic call form `itp(u, v)` (vs the tuple form `itp((u, v))`),
mixed/second-order ND symbolic derivatives (exercising the
DifferentiatedInterpolantND order-accumulation path), and the `nameof`
registrations. Raises Symbolics-extension line coverage from ~51% to
~60%; the residual lines are constant-folded `nameof` one-liners and
defensive `promote_symtype`/`promote_shape` overloads not invoked by the
Symbolics 7 term machinery, which coverage tooling cannot register.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ontract tests

test_symbolics.jl now mirrors the extension's isdefined(SymbolicUtils, :TypeT)
guard: under Symbolics 7 / SymbolicUtils 4 the existing registration tests run
unchanged (whitespace-only diff on the 194-line body), while under Symbolics 6 /
SymbolicUtils 3 a new testset pins the no-op contract instead of erroring:
the extension loads as an empty module, the numeric core is unaffected with
Symbolics loaded, symbolic calls throw (TypeError) rather than returning
silent wrong results, and nameof stays unregistered.

Verified locally on both generations: Symbolics 7.24.0 / SymbolicUtils 4.29.3
(28 passes) and Symbolics 6.58.0 / SymbolicUtils 3.32.0 (25 passes). Runic clean.
@mgyoo86 mgyoo86 merged commit 19eab5e into ProjectTorreyPines:master Jun 10, 2026
13 checks passed
@tomneiser tomneiser deleted the symbolics6-compat branch June 11, 2026 00:13
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.

2 participants