Skip to content

Remove 'Base' as a dependency - #1663

Open
WardBrian wants to merge 5 commits into
std/middlefrom
std/remove-core
Open

Remove 'Base' as a dependency#1663
WardBrian wants to merge 5 commits into
std/middlefrom
std/remove-core

Conversation

@WardBrian

Copy link
Copy Markdown
Member

See #1655

This is the ultimate conclusion of the patch sequence #1643 #1644 #1650 #1652.

After updating to 5.5, Base was providing us (up to renaming) essentially just:

  • Polymorphic sets
  • Hash sets
  • A few small quality of life functions

These are all easy to provide ourselves, which means we can remove the dependency entirely.

The binaries produced with dune build --profile release from this branch are 12mb, down from 15mb on master. Shockingly, they're also the same speed if not faster (especially when running optimizations):

Summary
  ./stanc-nobase ./test/integration/good/code-gen/mother.stan ran
    1.03 ± 0.07 times faster than ./stanc-master ./test/integration/good/code-gen/mother.stan
Summary
  ./stanc-nobase --O1 ./test/integration/good/compiler-optimizations/copy_fail.stan ran
    1.56 ± 0.10 times faster than ./stanc-master --O1 ./test/integration/good/compiler-optimizations/copy_fail.stan
Summary
  ./stanc-nobase --Oexperimental ./test/integration/good/compiler-optimizations/copy_fail.stan ran
    2.03 ± 0.16 times faster than ./stanc-master --Oexperimental ./test/integration/good/compiler-optimizations/copy_fail.stan

Javascript builds are down to 16mb from 19mb, with minified sizes roughly the
same.

Submission Checklist

  • Run unit tests
  • Documentation
    • If a user-facing facing change was made, the documentation PR is here:
    • OR, no user-facing changes were made

Release notes

Decreased our dependence on third-party libraries.

Copyright and Licensing

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)


Stack created with GitHub Stacks CLIGive Feedback 💬

Comment thread docs/core_ideas.mld Outdated
Comment thread scripts/docker/ci/Dockerfile
@WardBrian
WardBrian force-pushed the std/remove-core branch 2 times, most recently from 9d80ee9 to 096bed4 Compare August 12, 2026 16:03
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.26%. Comparing base (9d7b62a) to head (096bed4).

Additional details and impacted files
@@              Coverage Diff               @@
##           std/middle    #1663      +/-   ##
==============================================
+ Coverage       92.13%   92.26%   +0.13%     
==============================================
  Files              70       69       -1     
  Lines           10140    10124      -16     
==============================================
- Hits             9342     9341       -1     
+ Misses            798      783      -15     
Files with missing lines Coverage Δ
src/middle/UnsizedType.ml 84.57% <100.00%> (ø)
src/stan_math_backend/Cpp.ml 90.90% <100.00%> (ø)
src/stan_math_backend/Transform_Mir.ml 95.55% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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