Skip to content

feat(science): bounded sampled integration and interval derivatives - #153

Merged
sanskarIN merged 27 commits into
mainfrom
feature/scientific-sampled-calculus
Nov 7, 2026
Merged

sanskarIN merged 27 commits into
mainfrom
feature/scientific-sampled-calculus

Conversation

@sanskarIN

@sanskarIN sanskarIN commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Introduce a focused scientific-computing vertical slice implemented entirely in safe Rust and directly usable from .srp files:

  • sample_area(x: vector, y: vector) -> float: composite trapezoidal integration, Neumaier-accumulated, protected against spurious ordinate-sum overflow.
  • sample_slopes(x: vector, y: vector) -> vector: interval secant slopes; divide-before-subtract fallback when extreme ordinate differences overflow.
  • Validate identical lengths, minimum 2 samples, strictly increasing finite coordinate widths; reject nonfinite results with existing diagnostics.
  • Charge exact work (4 × intervals) and new vector payload (8 × intervals for slopes); respect visible immutable windows.
  • Add host/compiler tests, analytic and subnormal/overflow checks, checked .srp stdout fixture, cross-platform shell/PowerShell validation, guide and development matrix.

Scope and compatibility

This does not add a new parser syntax, module namespace, native executable compiler, tensor ABI, GPU execution, external dependencies, or a release. It extends the existing typed built-in registry and uses the established finite-vector runtime. These operations are intentionally not claimed to exist in published v0.0.6-alpha.3 binaries.

Review / required gates

  • Rustfmt and Clippy on all supported targets
  • Full debug/release Rust tests on Linux, Windows and macOS
  • Minimum supported Rust 1.74 tests and benchmarks
  • Example stdout fixtures and scripts
  • Verify numerical invariants, resource charging and potential unusual overflow cases
  • Independent review and CI all green before merge

Manual issue comments: none posted by this automation.

Rust embedding compatibility

This adds two variants to the public numeric::Builtin enum. Although no .srp grammar or existing builtin behavior changes, Rust hosts that exhaustively match every Builtin variant may need to update their matches when upgrading. This is an experimental alpha API, and the compatibility impact should be documented in the next prerelease notes.

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