Skip to content

Deprecate IntervalContractors in favour of IntervalArithmetic#60

Open
dpsanders wants to merge 1 commit into
masterfrom
deprecate-into-IA
Open

Deprecate IntervalContractors in favour of IntervalArithmetic#60
dpsanders wants to merge 1 commit into
masterfrom
deprecate-into-IA

Conversation

@dpsanders
Copy link
Copy Markdown
Member

Summary

This is the deprecation release for IntervalContractors.jl. Every reverse-mode function previously provided here now lives in IntervalArithmetic.jl (1.1+); this PR replaces the implementations with shims that forward to IA and emit Base.depwarn. The package will be archived after the 0.7.x cycle.

  • New src/deprecations.jl provides the shims
  • The per-domain source files (arithmetic.jl, exponential.jl, extrema.jl, etc.) are deleted, since their only public API was the reverse functions
  • src/IntervalContractors.jl reduced to module declaration + exports + include of deprecations.jl
  • Project.toml: 0.6.0 → 0.7.0; IntervalArithmetic = "1.1"; drop unused IntervalBoxes dep
  • README gets a deprecation banner with a migration table
  • Tests qualify imports explicitly to disambiguate IC's deprecated names from IA's same-named exports

Migration

Old New
IntervalContractors.plus_rev(a, b, c) IntervalArithmetic.plus_rev(a, b, c)
IntervalContractors.mul_rev(a, b, c) IntervalArithmetic.times_rev(a, b, c) (rename)
IntervalContractors.f_rev(c, x) returning (c, x_new) IntervalArithmetic.f_rev(c, x) returning x_new
IntervalContractors.mul_rev_IEEE1788 IntervalArithmetic.mul_rev
(other reverse names) same name in IntervalArithmetic

using IntervalContractors and using IntervalArithmetic together now makes the reverse names ambiguous; users qualify or drop using IntervalContractors.

Behaviour drift

Four Non1788 tests are now @test_broken because IA's implementation is tighter or more correct than IC's old one. Each is annotated inline with the reason:

  • cos_rev returns a slightly different bound (ulp drift).
  • acosh_rev clips c to [0, ∞) before applying cosh, giving a tight [1, cosh(1)] instead of IC's loose [1, ∞].
  • max_rev and min_rev on empty a correctly return empty preimages instead of IC's old entire.

Helpers dropped

The non-exported helpers that lived in the deleted source files (integer_contractor, reflect_x, sin_main, exp!, log!, constant_contractor, ...) are gone. These were never exported; consumers can pin to 0.6.0 or copy from git history.

Dependency

Depends on JuliaIntervals/IntervalArithmetic.jl#756 being merged and released as 1.1.0. Local test runs use Pkg.develop against that branch.

Test plan

  • Local test suite passes against Pkg.develop'd IA reverse-refactor branch (with the 4 documented @test_broken)
  • CI run on this PR (will fail until IA 1.1 is released; should be re-run after that)
  • After IA 1.1 release: register IC 0.7.0
  • Eventually: archive the repo

🤖 Generated with Claude Code

Every reverse-mode function previously defined here now lives in
`IntervalArithmetic.jl` (>= 1.1). This release replaces the per-domain
implementations with deprecation shims that forward to their IA
equivalents and emit `Base.depwarn`. The package will be archived after
the 0.7.x deprecation cycle.

Changes:

- New `src/deprecations.jl` provides the shims:
    - `@deprecate` for tuple-rewriting reverses and singleton extras
      whose names and shapes match IA (`plus_rev`, `minus_rev`,
      `div_rev`, `power_rev`, `max_rev`, `min_rev`, `mul_rev_to_pair`,
      `pow_rev1`, `pow_rev2`).
    - `@deprecate mul_rev → IntervalArithmetic.times_rev` (rename — the
      IC tuple-rewrite collided with IA's IEEE 1788 `mul_rev(b, c, x)`).
    - `@deprecate mul_rev_IEEE1788 → IntervalArithmetic.mul_rev`.
    - Manual shims for the 2-arg reverses (`sqr_rev`, `abs_rev`,
      `sign_rev`, `sqrt_rev`, `inv_rev`, the exp/log/trig/hyperbolic
      families) that wrap IA's single-output result back into IC's
      `(c, x_new)` tuple shape and emit `Base.depwarn`.
- `src/IntervalContractors.jl` reduced to module declaration, exports,
  the `IntervalType{T}` alias for backwards compat, and the include of
  `deprecations.jl`.
- Per-domain source files (`arithmetic.jl`, `exponential.jl`,
  `extrema.jl`, `hyperbolic.jl`, `inverse_hyperbolic.jl`,
  `inverse_trig.jl`, `trig.jl`, `transformations.jl`, `powers.jl`,
  plus the long-orphaned `decorated.jl` and `pave.jl`) are deleted.
  Helpers that lived alongside the reverses (`integer_contractor`,
  `reflect_x`, `sin_main`, `exp!`, `log!`, etc.) were never exported
  and are dropped with this release; consumers can pin to 0.6.0 or
  copy from git history.
- `Project.toml`: bumped to 0.7.0, dropped the unused `IntervalBoxes`
  dependency, and tightened the `IntervalArithmetic` compat to `1.1`.
- `README.md`: deprecation banner with a migration table at the top.
- `test/runtests.jl`: explicit `using IntervalContractors:` imports for
  every reverse name to disambiguate from `IntervalArithmetic`'s
  same-named exports.
- Four tests are now `@test_broken` because IA's implementation is
  tighter or more correct than IC's old one (`cos_rev` ulp drift,
  `acosh_rev` clipping, `max_rev` / `min_rev` on empty `a`); each is
  annotated inline with the reason.

Depends on the IntervalArithmetic PR adding the new reverse exports
(JuliaIntervals/IntervalArithmetic.jl#756) being merged and released
as 1.1.0. Local test runs use `Pkg.develop` against that branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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