Skip to content

Expand slider-bounded Σ/Π in the worker's graph analysis - #80

Merged
aantthony merged 1 commit into
mainfrom
claude/worker-sum-bounds
Aug 8, 2026
Merged

Expand slider-bounded Σ/Π in the worker's graph analysis#80
aantthony merged 1 commit into
mainfrom
claude/worker-sum-bounds

Conversation

@aantthony

@aantthony aantthony commented Aug 2, 2026

Copy link
Copy Markdown
Owner

What

Rebased onto main (the random-variable worker support it was stacked on landed via #79). Fixes the parity gap: worker analyze() called resolveExpr with no ResolveOpts, so any Σ/Π whose bound is a constant from another row failed with "Σ bounds must be constant" through MCP create_graph and /g/ previews — including the Fourier example llms.txt itself ships (N = 8; y = 2 sum[n=1..N] (-1)^(n+1) sin(n x)/n). The app expands these fine.

analyze() now builds the same options web/main.ts does — constants evaluated at t = 0, minus animated constants and states (expansion is static), plus the sumBoundConsts set buildDefs already returned but the worker discarded — and passes them to every resolveExpr call (plot rows, distribution mean/sd, P(…) bodies) and to classifySeqRec.

Behavior

  • N = 8; y = 2 sum[n=1..N] … → validates, classifies implicit2d, draws in the preview (Σ expands before compile, so the vm needs nothing new).
  • Sums now also work inside distribution parameters (X ~ Normal(sum[n=1..N] 1/n, 1); the P readout verifies against the normal CDF) and in sequence rows.
  • Unchanged rejections, with the app's own messages: bounds on an animated constant ("Σ bounds must be constant — add "a = 5"…") and bounds on t ("Σ bounds cannot depend on t").

Tests

Two new end-to-end create_graph cases: the Fourier example validates with nothing omitted from the preview, and the animated-constant bound still errors. 629 passing after the rebase (ropts is also wired into the post-#79 call sites: buildRVSystem and E(…) rows); typecheck clean.

🤖 Generated with Claude Code


Migrated from equation-src#58 as part of the open-source move.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
equation 116e2b2 Commit Preview URL

Branch Preview URL
Aug 02 2026, 12:35 PM

analyze() called resolveExpr without ResolveOpts, so any sum whose bound is
a constant defined in another row — including the llms.txt Fourier example
`N = 8; y = 2 sum[n=1..N] …` — failed create_graph and /g/ previews with
"Σ bounds must be constant", while the app expands it fine.

Build the same options web/main.ts does (constants at t = 0, minus animated
constants and states, plus buildDefs' sumBoundConsts) and pass them to every
resolveExpr call and to classifySeqRec. Animated and t-dependent bounds
still fail with the app's own messages.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@aantthony
aantthony force-pushed the claude/worker-sum-bounds branch from 116e2b2 to 25d580e Compare August 8, 2026 03:53
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
equation 25d580e Commit Preview URL

Branch Preview URL
Aug 08 2026, 03:53 AM

@aantthony
aantthony merged commit 6cde152 into main Aug 8, 2026
2 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.

1 participant