Skip to content

Document public code generation API - #1928

Merged
ChrisRackauckas merged 3 commits into
JuliaSymbolics:masterfrom
ChrisRackauckas-Claude:agent/public-codegen-function-options
Jul 13, 2026
Merged

Document public code generation API#1928
ChrisRackauckas merged 3 commits into
JuliaSymbolics:masterfrom
ChrisRackauckas-Claude:agent/public-codegen-function-options

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Jul 13, 2026

Copy link
Copy Markdown
Member

This PR should be ignored until reviewed by @ChrisRackauckas.

Summary

  • declare CodegenFunctionOptions and codegen_function as public Symbolics API
  • document codegen_function and render both low-level code-generation entries in the manual
  • direct consumers to the owning public SymbolicUtils.IRStructure type rather than its Symbolics reexport
  • test that both new public bindings retain docstrings
  • bump Symbolics from 7.31.2 to 7.32.0 because this adds public API

Motivation

ModelingToolkit now uses these low-level code-generation entries, but Symbolics 7.31 introduced them without declaring them public. Publishing and documenting them at their owning package lets downstream code avoid relying on internals. The documentation also names SymbolicUtils.IRStructure through its owner module, where that type is declared public.

Local verification

  • julia +1.12 --startup-file=no --project=. -e 'using Pkg; Pkg.instantiate(); using Test; include("test/codegen_function.jl")' — passed, including 9/9 CodegenFunctionOptions interface/public/documentation checks
  • GROUP=Core julia +1.12 --startup-file=no --project=. -e 'using Pkg; Pkg.test(; allow_reresolve=true)' — passed (17,061 passed; 351 pre-existing broken checks), followed by 12/12, 12/12, and 14/14 passing SymbolicIndexingInterface testsets
  • julia +1.12 --startup-file=no --project=docs -e 'using Pkg; Pkg.develop(path = pwd()); Pkg.instantiate(); include("docs/make.jl")' — passed; both low-level API entries and the SymbolicUtils.IRStructure owner qualification rendered without docstring or cross-reference warnings
  • Runic 1.7 was checked across all 128 tracked Julia files; the existing repository is not Runic-clean across many unchanged files, while formatting each modified Julia range produced no changes
  • git diff --check — passed

Declare the low-level code generation entry points public, render their documentation, and bump Symbolics to 7.32 for the added API surface.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@codecov-commenter

codecov-commenter commented Jul 13, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.21%. Comparing base (45c0167) to head (ba50b0b).
⚠️ Report is 15 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1928   +/-   ##
=======================================
  Coverage   81.21%   81.21%           
=======================================
  Files          59       59           
  Lines        5807     5807           
=======================================
  Hits         4716     4716           
  Misses       1091     1091           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Assert that both newly public low-level code generation entry points retain docstrings.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Assertion follow-up and independent verification:

  • Fresh pre-push audit: upstream master was 294457d1aaf130ca49bf38f2e161ba0886d422eb; the feature remote was 1d886fd717835e580eaf9add9036fa08f48c9359, containing the single documented commit by ChrisRackauckas-Claude. HEAD..upstream/master was empty. Commit 10ee6d52c411ee083ccb520a2a48e91797ceed4c was pushed as a normal fast-forward; no force push was used.
  • Added two focused assertions that the public CodegenFunctionOptions and codegen_function bindings retain docstrings.
  • Exact local Core command (Julia 1.12.6, isolated workspace depot): GROUP=Core timeout 3600 julia --startup-file=no --project=. -e 'using Pkg; Pkg.test(; allow_reresolve=true)'. Result: exit 0; 17,061 passed, 351 pre-existing broken, followed by 12/12, 12/12, and 14/14 passing SymbolicIndexingInterface testsets.
  • Exact local docs command: timeout 3600 julia --startup-file=no --project=docs -e 'using Pkg; Pkg.develop(path = pwd()); Pkg.instantiate(); include("docs/make.jl")'. Result: exit 0; both new low-level API entries expanded without warnings. Existing warn-only diagnostics remain on unrelated pages.
  • Runic 1.7 was run across all 128 tracked Julia files and reproduced existing repository-wide formatting differences. Runic output for the modified testset range was byte-identical to the source. git diff --check passed.
  • All generated .audit and docs build artifacts were removed before committing; the commit contains only the two test assertions.

Benchmark check classification: its benchmark comparisons completed successfully with ratios effectively 1. The job failed only when peter-evans/create-or-update-comment received HTTP 403 Resource not accessible by integration while trying to post from the fork PR. This is a GitHub token-permission/infrastructure result, not a benchmark regression; no code or workflow change is warranted here.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Downstream follow-up: SciML/ModelingToolkit.jl#4744 raises the Symbolics floor to 7.32 and adds the ODEProblem code-generation regression. Local ModelingToolkitBase InterfaceI passed with 1,466 checks and 5 marked broken. Benchmark computations for this PR completed with ratios near 1 and identical allocations; the reported benchmark failure is only the AirspeedVelocity result-comment POST receiving 403 from fork-token permissions.

Direct downstream users to SymbolicUtils.IRStructure, where the low-level IR type is declared public, instead of implying ownership through Symbolics' reexport.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Owner-module follow-up (ba50b0b50d1e645caa7e1c6e27732fbacfa77759):

  • Qualified every new public-doc reference to the IR type as SymbolicUtils.IRStructure, because SymbolicUtils declares/exports the type and Symbolics only reexports it.
  • Targeted test/codegen_function.jl passed, including 9/9 interface/public/doc checks.
  • The complete docs build passed; the owner-qualified prose and both new API entries produced no warning. Existing unrelated warn-only and external-link diagnostics remain elsewhere.
  • Runic 1.7 was rerun over all 128 tracked Julia files (reproducing pre-existing repository formatting differences); Runic output for the modified Julia range was byte-identical.
  • Before committing, generated .audit/docs artifacts were removed and git status contained only the two intended documentation files. Before pushing, upstream remained 294457d1aaf130ca49bf38f2e161ba0886d422eb and the feature remote remained exactly 10ee6d52c411ee083ccb520a2a48e91797ceed4c. The commit was pushed as a normal fast-forward; no force push was used.

The PR body now reflects the latest full Core totals (17,061 passed, 351 pre-existing broken), the 9/9 targeted result, and the owner qualification.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

The refreshed benchmark check failed before running any Symbolics benchmark. AirspeedVelocity tried to download the ephemeral PR merge commit 775cdb7 as a repository revision, but that merge commit is not present in the clone, so Pkg reported Did not find rev ... in repository. The job never reached package benchmark execution. This is a benchmark-workflow checkout/revision failure, distinct from the earlier comment-permission failure and unrelated to the public-API/docs diff.

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review July 13, 2026 19:40
@ChrisRackauckas
ChrisRackauckas merged commit e3c0806 into JuliaSymbolics:master Jul 13, 2026
22 of 24 checks passed
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