Skip to content

Widen Symbolics compat to include v7 (blocked by SymbolicTracingUtils)#94

Open
hmzh-khn wants to merge 1 commit intomainfrom
upgrade/symbolics-v7
Open

Widen Symbolics compat to include v7 (blocked by SymbolicTracingUtils)#94
hmzh-khn wants to merge 1 commit intomainfrom
upgrade/symbolics-v7

Conversation

@hmzh-khn
Copy link
Copy Markdown
Collaborator

Summary

Widens the Symbolics compat bound from "6.51.0" to "6.51.0, 7" in Project.toml to prepare for Symbolics.jl v7. This addresses CompatHelper PR #51.

Status: Blocked — Symbolics v7 cannot actually be installed yet. See investigation below.

Changes

  • Project.toml: Updated Symbolics compat from "6.51.0" to "6.51.0, 7"

Investigation Findings

Blocker: SymbolicTracingUtils v0.1.3

The Pkg resolver cannot install Symbolics v7 because SymbolicTracingUtils v0.1.3 declares:

Symbolics = "4,5,6"

This is the only released version of SymbolicTracingUtils, and it has no v7 compat. The dependency chain is:

MixedHierarchyGames → SymbolicTracingUtils v0.1.3 → Symbolics "4,5,6" (BLOCKER)
MixedHierarchyGames → ParametricMCPs v0.1.17 → SymbolicTracingUtils v0.1.3 → Symbolics "4,5,6"

Upstream PR exists: JuliaGameTheoreticPlanning/SymbolicTracingUtils.jl#5 — a CompatHelper PR to bump compat to "4,5,6,7". It is open but untested (no CI checks, auto-generated).

Transitive version pins

With Symbolics held at v6, these are also held back:

  • SymbolicUtils v3.32.0 (v7 requires SymbolicUtils v4)
  • SymbolicLimits v0.2.3 (held by SymbolicUtils constraint)
  • SciMLOperators v0.3.13 (held by SciMLBase and SymbolicTracingUtils)

Symbolics v7 Breaking Changes Analysis

When SymbolicTracingUtils is eventually updated, these are the key v7 changes relevant to our codebase:

  1. New Const variant: Num now always wraps BasicSymbolic — constants become Const{T}(val). Code using Symbolics.Num.(...) for broadcasting conversion (our nonlinear_kkt.jl:318,328) may need adjustment.

  2. symtype moved from type parameter to field: BasicSymbolic{T} where T is now vartype (not symtype). Our code uses Num type annotations (Dict{Int, Vector{Symbolics.Num}}) which should still work since Num remains.

  3. SymbolicUtils v3 → v4: Internal representation uses Moshi.jl instead of Unityper. arguments() now returns read-only arrays.

  4. Add/Mul merged into AddMul: Pattern matching internals changed, but we don't access these directly.

  5. Expression simplification changes: (a/b)^c auto-rewrites to a^c/b^c in SymReal mode, which could affect numerical results in KKT condition simplification.

  6. APIs we use that are UNCHANGED: @variables, Symbolics.gradient, Symbolics.jacobian, Symbolics.get_variables, build_function (via SymbolicTracingUtils).

Our Symbolics API Usage (for future reference)

API Files Impact
@variables test/test_kkt_verification.jl Unchanged surface API
Symbolics.gradient src/qp_kkt.jl, src/nonlinear_kkt.jl Unchanged
Symbolics.jacobian src/qp_kkt.jl, src/nonlinear_kkt.jl Unchanged
Symbolics.get_variables src/problem_setup.jl Unchanged
Symbolics.Num type annotations src/problem_setup.jl, src/nonlinear_kkt.jl Num still exists, likely safe
Symbolics.Num.(x) broadcasting src/nonlinear_kkt.jl:318,328 May need adjustment — constants now wrap in Const
eltype() with symbolic vectors Multiple src/ files Should work, but Num internals differ
SymbolicTracingUtils.build_function src/utils.jl, src/nonlinear_kkt.jl Depends on upstream compat

Testing

  • All 450 tests pass with the widened compat bound (Symbolics remains at v6.58.0 since the resolver cannot upgrade)
  • No functional changes to the package

Recommendation

Do NOT merge this PR yet. The compat bound widening is harmless but premature — Symbolics v7 cannot be installed. The recommended path forward:

  1. Wait for SymbolicTracingUtils.jl#5 to be tested and merged upstream
  2. Wait for a new SymbolicTracingUtils release (≥0.1.4) with Symbolics = "4,5,6,7"
  3. Then: update our SymbolicTracingUtils compat, run Pkg.update(), and test with actual Symbolics v7
  4. Expected work: Minor adjustments to Symbolics.Num.(...) broadcasting in nonlinear_kkt.jl, possible test tolerance adjustments due to expression simplification changes

Alternatively, if urgency is high, consider forking SymbolicTracingUtils temporarily or using Pkg.develop() with the compat PR branch.

Changelog

  • 2026-02-09: Initial PR with investigation results. Compat bound widened. Documented blocker and v7 breaking changes analysis.

Add Symbolics v7 to the [compat] bound in preparation for the upgrade.
Currently, SymbolicTracingUtils v0.1.3 constrains Symbolics to v4/5/6,
so the resolver will continue installing Symbolics v6 until that
upstream dependency is updated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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