Skip to content

Fix EllipticE divergence and unrecognized Temporary/Stub attributes - #696

Merged
ad-si merged 3 commits into
mainfrom
claude/zealous-mccarthy-tqp4r4
Aug 28, 2026
Merged

Fix EllipticE divergence and unrecognized Temporary/Stub attributes#696
ad-si merged 3 commits into
mainfrom
claude/zealous-mccarthy-tqp4r4

Conversation

@ad-si

@ad-si ad-si commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

Found while checking Woxi Studio's compatibility against a random Wolfram Demonstration notebook ("Ellipse Rolling around Another Ellipse", downloaded from the Wolfram Demonstrations Project) via cargo run -p woxi-studio --example dump_manipulate. Notebook parsing, evaluation, and Manipulate widget/graphics rendering all already worked — but two real bugs surfaced along the way:

  • EllipticE[m]'s one-argument complete integral used a power series in powers of m, which only converges for |m| < 1. Any m <= -1 (a value that occurs naturally in the demonstration's formula) blew up to nonsense values — e.g. EllipticE[-1.2857142857142856] returned ~1.6*10^48 instead of the correct ~1.99. Negative m now delegates to the already-correct incomplete-integral numeric quadrature at phi = Pi/2, verified against mpmath.ellipe to ~13 significant digits.
  • Attributes[...] = {Temporary} (and Stub) wrongly warned Attributes::attnf: ... is not a known attribute. — these are real Wolfram attributes, and Temporary in particular is what Mathematica stores on the auto-generated unique symbols used internally by Manipulate.

Test plan

  • Added regression tests for EllipticE at m = -1, a value below -1, and a larger negative m, checked against independently computed mpmath reference values (tests/interpreter_tests/math/special_functions.rs)
  • Added a regression test confirming Temporary/Stub no longer trigger the attnf warning (tests/interpreter_tests/attributes.rs)
  • make test (27792 tests via cargo nextest) passes
  • make format

Generated by Claude Code

claude added 2 commits August 27, 2026 17:58
Found while checking Woxi Studio against a random Wolfram Demonstration
notebook ("Ellipse Rolling around Another Ellipse"):

- EllipticE[m]'s power series only converges for |m| < 1, so any m <= -1
  blew up to nonsense values (e.g. ~1.6*10^48 instead of ~1.9). Negative m
  now delegates to the already-correct incomplete-integral quadrature at
  phi = Pi/2.
- Attributes[] rejected the real Wolfram attributes Temporary and Stub as
  unknown, which is what Mathematica stores on the auto-generated unique
  symbols used internally by Manipulate.
The 2.3069156143590688 literal round-trips through f64 with fewer
digits than written; clippy -D warnings flagged it.
Comment thread src/evaluator/attributes.rs
Addresses review feedback on PR #696: the Stub row had no
description/effect_level at all, and Temporary's description read
like it described an Option rather than an Attribute.

implementation_status is left blank for both (rather than marked
done): Woxi now recognizes the two names so they no longer trigger
Attributes::attnf, but no functional behavior is implemented for
either (no autoload for Stub, no auto-removal for Temporary), so
marking them implemented would overclaim relative to how this column
is used for the other attributes.
@claude

claude Bot commented Aug 27, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@ad-si
ad-si merged commit 729f575 into main Aug 28, 2026
6 checks passed
@ad-si
ad-si deleted the claude/zealous-mccarthy-tqp4r4 branch August 28, 2026 09:48
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