Skip to content

Fix DiscreteMeasures IntervalArithmetic 1.x clamp_domain (downgrade floor) - #58

Merged
ChrisRackauckas merged 2 commits into
SciML:mainfrom
ChrisRackauckas-Claude:agent/54-dg-sublibs
Oct 3, 2026
Merged

ChrisRackauckas merged 2 commits into
SciML:mainfrom
ChrisRackauckas-Claude:agent/54-dg-sublibs

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Downgrade Sublibraries fails on lib/DiscreteMeasures because the IntervalArithmetic extension still called Base.intersect and compared with ==. Those APIs throw on every IntervalArithmetic 1.x release (including the floor 1.0.11 and latest 1.0.12), so this is an incomplete 0.x→1.x migration rather than a missing floor bump. This PR switches to intersect_interval / isequal_interval, which are the supported IA 1.x APIs and already work at the declared floor. A follow-up commit also makes the extension's imports explicit so ExplicitImports QA passes when the extension is loaded.

Verification

CI-faithful local floor run (julia +lts, julia-downgrade-compat v2 via dg_local.jl, mode alldeps, effective skip = Julia stdlibs ∪ in-repo sublibs, Pkg.test(; allow_reresolve=false)):

Before (HEAD without fix), IntervalArithmetic v1.0.11 — matches CI:

  Measure Restrictions   |   14      5     19   3.6s
    Interval Ext         |           5      5   3.5s
ERROR: LoadError: Some tests did not pass: 40 passed, 0 failed, 5 errored, 0 broken.

After (interval API fix), same floor Manifest:

Test Summary:     | Pass  Total  Time
Discrete Measures |   45     45  9.8s
     Testing DiscreteMeasures tests passed

Explicit-imports follow-up (julia +1, JULIA_REVISE_POLL=1):

QA-only (OPTIMALUNCERTAINTYQUANTIFICATION_TEST_GROUP=QA):

Test Summary:     | Pass  Total     Time
Quality Assurance |   18     18  1m03.7s
     Testing DiscreteMeasures tests passed

All / extension loaded (OPTIMALUNCERTAINTYQUANTIFICATION_TEST_GROUP=All; Core loads IntervalArithmeticExt then QA runs ExplicitImports):

Test Summary:     | Pass  Total   Time
Discrete Measures |   45     45  10.5s
Test Summary:     | Pass  Total     Time
Quality Assurance |   18     18  1m01.5s
     Testing DiscreteMeasures tests passed

Commands:

export RESOLVER_PATH=<scratch>/resolver
julia +lts dg_local.jl "<stdlib+sublib skip>" lib/DiscreteMeasures alldeps 1.10
julia +lts --project=lib/DiscreteMeasures -e 'using Pkg; Pkg.test(; allow_reresolve=false)'
JULIA_REVISE_POLL=1 OPTIMALUNCERTAINTYQUANTIFICATION_TEST_GROUP=QA julia +1 --project=lib/DiscreteMeasures -e 'using Pkg; Pkg.test()'
JULIA_REVISE_POLL=1 OPTIMALUNCERTAINTYQUANTIFICATION_TEST_GROUP=All julia +1 --project=lib/DiscreteMeasures -e 'using Pkg; Pkg.test()'

What I did NOT verify

Reviewer pushback

  • Confirm isequal_interval is the preferred public comparison for decorated intervals (vs isequal / isthin checks).
  • The extension still println("Load Ext") — left untouched as out of scope.
  • No IntervalArithmetic compat bump: the floor already resolves to a version that works once the API calls are fixed.

Closes #54

Please ignore this draft until reviewed by @ChrisRackauckas.

Risk assessment

  • Risk: low
  • Blast radius: DiscreteMeasures IntervalArithmetic extension + its Interval Ext tests only; weakdep path for interval-valued clamp_domain/clamp_weight. No public API rename. Downstream OUQBase only sees correct interval clamping. Explicit-import change is extension-module only.
  • Evidence: local floor fail-before (40 pass / 5 error, same intersect ArgumentError as CI run 35162761668) and pass-after (45/45) at IntervalArithmetic 1.0.11; QA 18/18 and All (Core+QA with extension loaded) 45+18 after explicit imports
  • Independent review: Codex gpt-6-astra rated round 1 (head 9251200) MERGE, risk low, high confidence. Claude Code (claude-opus-5-5, a different harness from the Cursor author) rated round 2 (head 7bcb7d1, after the explicit-import cleanup) MERGE with no blocking findings. The two red checks, OUQBase downgrade and umbrella QA, are pre-existing and fixed by Fix OUQBase 𝔼/ℙ SymbolicUtils Operator ambiguity (separate from #54 floor) #59 and Fix QA: explicit imports, OUQBase docs, approved reexports #57.
  • Merge: auto-merge candidate after CI green on explicit-imports follow-up head — independent review MERGE/low/high on the interval fix; follow-up is mechanical ExplicitImports hygiene verified locally

Harness: Cursor Agent CLI 2026.09.26-dd393fe; model: auto; transcript: /home/crackauc/sandbox/agent-jobs/OptimalUncertaintyQuantification.jl/jobs/54-cursor/log.txt on amdci2.julia.csail.mit.edu

Risk assessment

  • Risk: low
  • Blast radius: Only the lib/DiscreteMeasures IntervalArithmetic weak-dependency extension, i.e. clamp_domain(::Interval, lb, ub). The other method, clamp_weight, is not changed. On IA 1.x, which is the only range the IntervalArithmetic = "1.0.11" compat allows, clamp_domain used to throw ArgumentError on every call. It now returns intersect_interval(x, interval(lb, ub)). That turns a method that always errored into a working one, so it is a patch-level fix and no working caller can break. Nothing outside the extension is touched: no public names, core modules, compat bounds or the root package.
  • Evidence: Head 7bcb7d1 has 2 failing checks, and both fail the same way on the latest default-branch commit, 013f14a (runs 35162761668 and 35162761805):
    • Downgrade Sublibraries / test (lib/OUQBase): MethodError: promote_symtype(::OUQBase.𝔼_, ::Type{Real}) is ambiguous, "0 passed, 0 failed, 1 errored" on both head and main. Pre-existing.
    • tests / QA (julia 1) / Tests - QA: the implicit import of @random_variables from OUQBase, plus the undocumented-public-API and reexport failures, "18 passed, 2 failed, 1 errored" on both head and main. Pre-existing.
    • Downgrade Sublibraries / test (lib/DiscreteMeasures) was red on main (5× ArgumentError: `intersect` is purposely not supported, 40 passed / 5 errored) and is green on head, so the PR fixes it.
    • Every other check passes, including DiscreteMeasures Core on lts/1/pre, DiscreteMeasures QA, root Core on lts/1/pre/x86, Downgrade Core, docs, Runic and typos.
    • No regressions.
  • Independent review: Devin CLI (Mac) / fusion-claude-opus-5-5-high-sidekick-swe-2-medium rated it low risk with high confidence. The 10-line diff moves from APIs that IA 1.x deliberately makes throw to its exported replacements (intersect_interval, isequal_interval, interval, Interval), so no non-public dependency internals are used. The test edit swaps ==, which throws InconclusiveBooleanOperation on non-thin intervals, for isequal_interval while keeping the same five cases and expected values. That is not a weakened test. It flips a CI job from red to green without making any job red. Minor points the description does not raise:
    • There is no version bump in lib/DiscreteMeasures/Project.toml, so a separate release step is needed to ship the fix.
    • The two earlier agent reviews that the description cites are not on GitHub (0 reviews, 0 comments), so I couldn't verify them.
    • The println("Load Ext") side effect is still there; the description does say this.
  • Merge: auto-merge candidate

🤖 Risk assessment posted by an AI agent (fleet master) — harness: Devin CLI (Mac) / fusion-claude-opus-5-5-high-sidekick-swe-2-medium; dispatched by Claude Code head, model claude-opus-5-5[1m]
Conversation: local Claude Code session 3cd6500a-1f81-46b5-ac0b-c466e15b6a53 on Chris's Mac (session ID, no URL)

The Interval Ext used Base.intersect and ==, which throw on all IA 1.x
releases; switch to intersect_interval and isequal_interval so floor
downgrade tests pass at IntervalArithmetic 1.0.11.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OptimalUncertaintyQuantification.jl/jobs/54-cursor/log.txt on amdci2.julia.csail.mit.edu
Broad `using IntervalArithmetic` failed no_implicit_imports when the
extension was loaded in the combined All suite; list Interval,
interval, and intersect_interval (and DiscreteMeasures.clamp_domain)
explicitly.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OptimalUncertaintyQuantification.jl/jobs/54-cursor/log.txt on amdci2.julia.csail.mit.edu
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 27, 2026 03:42
@ChrisRackauckas
ChrisRackauckas merged commit 21d0bdf into SciML:main Oct 3, 2026
22 of 24 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.

Downgrade Sublibraries red: DiscreteMeasures Interval extension fails at the floor

2 participants