Repository navigation
OUQBase: evaluate Inequality probability events as Bool comparisons - #60
Merged
ChrisRackauckas merged 11 commits intoOct 3, 2026
Merged
ChrisRackauckas merged 11 commits into
ChrisRackauckas merged 11 commits into
Conversation
Add Type-specialized promote_symtype methods so SymbolicUtils Operator
dispatch is unambiguous, and build terms via SymbolicUtils.term so the
SymVariant Term API is used instead of Term{Real}.
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
Symbolics treats Operator applications as variable leaves, so get_variables(𝔼(Q^n)) returned 𝔼(Q^n) and group lookup failed. Unwrap OUQ operators and collect variables from their arguments. 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
Replace the broken @rule chain with TermInterface extraction, and unwrap Const-wrapped numeric RHS values before filling Float64 moment sequences. 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
Cover promote_symtype for 𝔼_/ℙ_, underlying RV extraction through 𝔼(Q^n), and raw moment order parsing. 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
Unwrap Inequality/Equation args in underlying_random_variables so ℙ(Q ≳ c)/ℙ(Q ≲ c) discover the RV (Flood fixtures); drop unused Chain; import Operator from SymbolicUtils (owner). 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
Check isinteger before Int(...) so 𝔼(Q^2.5) raises the descriptive raw-moment error instead of InexactError. 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
get_variables returns the leaf itself for z(t), a[1], and Differential(t)(z); treat that as a base case so group lookup does not StackOverflow. 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
Qualified ModelingToolkit.getdefault failed check_all_qualified_accesses_via_owners; route through the owner package (direct dep) and drop the QA ownership ignore. 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/OUQ-b/jobs/54-cursor/log.txt on amdci2.julia.csail.mit.edu
≲/≳ build Symbolics.Inequality constraint objects, not Bools. Convert leq/geq to lhs <= rhs / lhs >= rhs before evaluate so Flood canonical-moments objectives return numeric probabilities. 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
Avoid non-public Symbolics.leq/geq; compare against (x ≲ y).relational_op / (x ≳ y).relational_op from the public constructors, and drop those names from the QA ignore. 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/OUQ-b/jobs/54-cursor/log.txt on amdci2.julia.csail.mit.edu
ChrisRackauckas-Claude
force-pushed
the
agent/54-ouqbase-inequality-bool
branch
from
September 26, 2026 23:19
2b3fb2d to
133a780
Compare
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Cursor Agent <noreply@cursor.com> Agent-Harness: Cursor Agent CLI Agent-Model: auto Agent-Session: ~/sandbox/goals/ci-green/work/cig-ouq-60-merge/log.txt (local transcript, amdci2)
ChrisRackauckas
marked this pull request as ready for review
October 3, 2026 14:28
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
Stacked on #59 (merge after it).
≲/≳buildSymbolics.Inequalityconstraint objects, not Boolean comparisons; Symbolics 7 leaving them as unfoldedisless(...)insideevaluateis a design difference, not an upstream bug. This PR mapsInequality(lhs, rhs, leq|geq)tolhs <= rhs/lhs >= rhsviaboolean_probability_eventbefore probability-oracle evaluation (canonical moments and Winkler paths), so Flood-style events becomeBool.Verification
Fail-before / pass-after
Before (#59 tip sources, new tests):
UndefVarError: boolean_probability_event not definedtest_canonical_moments.jl:29:MethodError: isapprox(::BasicSymbolic, ::Float64)After:
(includes unit conversion + Flood canonical-moments objective)
OUQBase Core / QA
julia +lts (1.10.12):
julia +1 (1.13.0):
What I did NOT verify
Reviewer pushback
evaluateclosure is clearer.Inequality.Part of #54. Stacked on #59 — merge after #59.
Please ignore this draft until reviewed by @ChrisRackauckas.
Risk assessment
≲/≳events only (canonical moments + Winkler Symbolic).isapprox(BasicSymbolic,…)/ pass-after numeric; Core+QA green on +lts and +1.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
Update (Codex gpt-6-astra round-1 CHANGES)
Stopped using non-public
Symbolics.leq/Symbolics.geq. Inequality dispatch now comparesrelational_opagainst the values from the public constructors(lhs ≲ rhs).relational_op/(lhs ≳ rhs).relational_op(also applied in the Winkler Jump helper). Removed:leq/:geqfrom the QA qualified-accesses ignore list. Rebased onto fixed #59 (ModelingToolkitBase.getdefault, no ownership ignore).Re-verification (
OPTIMALUNCERTAINTYQUANTIFICATION_TEST_GROUP)julia +lts (1.10.12):
julia +1 (1.13.0):
What I did NOT verify
getbounds(::OrderedSet)failure on Fix OUQBase 𝔼/ℙ SymbolicUtils Operator ambiguity (separate from #54 floor) #59 tip and this head; not attributed to this conversion).Harness: Cursor Agent CLI 2026.09.26-dd393fe; model: auto; transcript: /home/crackauc/sandbox/agent-jobs/OUQ-b/jobs/54-cursor/log.txt on amdci2.julia.csail.mit.edu
Risk assessment
get_ordered_group_namesnow looks inside 𝔼/ℙ and inside≲/≳inequalities), raw-moment order parsing, and probability-objective evaluation in the canonical-moments oracle path and the WinklerSymbolicpath. Winkler's JuMP path is unaffected because it still reads the raw condition (only(arguments(objective._obj))). The PR's base ismain, not Fix OUQBase 𝔼/ℙ SymbolicUtils Operator ambiguity (separate from #54 floor) #59, so merging it also brings in all 8 of Fix OUQBase 𝔼/ℙ SymbolicUtils Operator ambiguity (separate from #54 floor) #59's commits. That includes a new direct dependency onModelingToolkitBase(compat1.50).133a780, 2 checks fail. Both are pre-existing, because the same jobs fail with the same errors on the latestmainpush runs (013f14a, 2026-09-16):Downgrade Sublibraries / test (lib/DiscreteMeasures): 5 errors,ArgumentError: intersect is purposely not supported for intervalsatdiscrete_measures_tests.jl:94-98. Main shows the same 5 errors on the same lines. Pre-existing, and the PR does not touchlib/DiscreteMeasures.tests / QA (julia 1) / Tests - QA (Julia 1): the root package'sno_implicit_importserrors, andpublic API has docstringsandNo unapproved public reexportsfail. The totals are 18 passed / 2 failed / 1 errored, which matches main exactly. Pre-existing.Downgrade Sublibraries / test (lib/OUQBase)fails on main and passes here, so that one is an improvement.630a206) is red onsublibraries / lib/OUQBase / Julia {1,lts} / Tests - CorewithMethodError: isapprox(::BasicSymbolic, ::Float64)attest_canonical_moments.jl:29. Following the description's advice to merge Fix OUQBase 𝔼/ℙ SymbolicUtils Operator ambiguity (separate from #54 floor) #59 first would leave main red on OUQBase Core until this PR lands.Symbolicchange has no end-to-end test (the author says a pre-existinggetbounds(::OrderedSet)failure blocks one).ModelingToolkitBase(compat1.50, SciML/MIT) is not mentioned or license-noted in this PR's description. OUQBase's version is not bumped either..relational_opis still read directly fromSymbolics.Inequality. Comparing it against the value from the public≲/≳constructors avoids namingSymbolics.leq/geq, but it still depends on an undocumented struct field. The QA ignores forpromote_symtype,isbinop,evaluate,BasicSymbolic,Operator,Term,symtypeandvalueare still in place (pre-existing).SymbolicUtils.terminstead ofTerm{symtype(x)}.get_raw_moment_ordernow errors on any left-hand side that isn't a 𝔼 term, andbuild_raw_moment_sequenceconverts the right-hand side toFloat64. These look like bug fixes and all touched helpers are unexported, but a human should confirm none of it counts as a public behavior change.:geq,:leq,:getdefaultremoved) and there are no skips or loosened tolerances. Two small issues in the new test file:d = Dict(...)is unused, and one assertion checks that Symbolics leavesislessunfolded, which will break if Symbolics changes that behavior.🤖 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)