Repository navigation
Fix DiscreteMeasures IntervalArithmetic 1.x clamp_domain (downgrade floor) - #58
Merged
ChrisRackauckas merged 2 commits intoOct 3, 2026
Merged
Conversation
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
marked this pull request as ready for review
September 27, 2026 03:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Downgrade Sublibraries fails on
lib/DiscreteMeasuresbecause the IntervalArithmetic extension still calledBase.intersectand compared with==. Those APIs throw on every IntervalArithmetic 1.x release (including the floor1.0.11and latest1.0.12), so this is an incomplete 0.x→1.x migration rather than a missing floor bump. This PR switches tointersect_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-compatv2 viadg_local.jl, modealldeps, effective skip = Julia stdlibs ∪ in-repo sublibs,Pkg.test(; allow_reresolve=false)):Before (HEAD without fix), IntervalArithmetic v1.0.11 — matches CI:
After (interval API fix), same floor Manifest:
Explicit-imports follow-up (
julia +1,JULIA_REVISE_POLL=1):QA-only (
OPTIMALUNCERTAINTYQUANTIFICATION_TEST_GROUP=QA):All / extension loaded (
OPTIMALUNCERTAINTYQUANTIFICATION_TEST_GROUP=All; Core loads IntervalArithmeticExt then QA runs ExplicitImports):Commands:
What I did NOT verify
Reviewer pushback
isequal_intervalis the preferred public comparison for decorated intervals (vsisequal/isthinchecks).println("Load Ext")— left untouched as out of scope.IntervalArithmeticcompat 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
clamp_domain/clamp_weight. No public API rename. Downstream OUQBase only sees correct interval clamping. Explicit-import change is extension-module only.intersectArgumentError 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 importsHarness: 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
lib/DiscreteMeasuresIntervalArithmetic 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 theIntervalArithmetic = "1.0.11"compat allows,clamp_domainused to throwArgumentErroron every call. It now returnsintersect_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.7bcb7d1has 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_variablesfrom 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.intersect_interval,isequal_interval,interval,Interval), so no non-public dependency internals are used. The test edit swaps==, which throwsInconclusiveBooleanOperationon non-thin intervals, forisequal_intervalwhile 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:versionbump inlib/DiscreteMeasures/Project.toml, so a separate release step is needed to ship the fix.println("Load Ext")side effect is still there; the description does say this.🤖 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)