Repository navigation
Fix OUQBase 𝔼/ℙ SymbolicUtils Operator ambiguity (separate from #54 floor) - #59
Merged
ChrisRackauckas merged 9 commits intoOct 3, 2026
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
This was referenced Sep 26, 2026
ChrisRackauckas-Claude
pushed a commit
to ChrisRackauckas-Claude/OptimalUncertaintyQuantification.jl
that referenced
this pull request
Sep 26, 2026
No QA opt-outs: leave the promote_symtype ambiguity check running; it is pre-existing and fixed at the root in PR SciML#59. 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/55-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
ChrisRackauckas
added a commit
that referenced
this pull request
Oct 3, 2026
* Import @random_variables explicitly in the umbrella package. The precompile workload uses the macro by name; ExplicitImports flags that as an implicit import even though @reexport already exports it. 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/55-cursor/log.txt on amdci2.julia.csail.mit.edu * Document OUQBase public API and add a docs API page. SciMLTesting requires every public name to have a docstring at its owning module and an entry under docs/src; the umbrella reexports inherit those docs. 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/55-cursor/log.txt on amdci2.julia.csail.mit.edu * Approve intentional public reexports in QA allow-lists. The umbrella and sublibraries deliberately reexport owned APIs; list those names in reexports_allow so SciMLTesting does not treat them as leakage. 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/55-cursor/log.txt on amdci2.julia.csail.mit.edu * Bump sublibrary and umbrella QA envs to SciMLTesting 2. reexports_allow requires SciMLTesting ≥2; the previous =1.7 floor resolved 1.8.0 and aborted both sublibrary QA lanes with MethodError. 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/55-cursor/log.txt on amdci2.julia.csail.mit.edu * Document CanonicalMoments quadratic solvers and approve Base reexports. SciMLTesting 2 requires docstrings for the exported quadratic root helpers and flags Base.denominator/numerator as public reexports of the Stieltjes API. 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/55-cursor/log.txt on amdci2.julia.csail.mit.edu * Import Operator from SymbolicUtils; mark #54 Aqua ambiguity broken. ExplicitImports requires importing Operator from its owning module. The pre-existing promote_symtype ambiguity stays tracked under issue #54. 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/55-cursor/log.txt on amdci2.julia.csail.mit.edu * Revert Aqua ambiguities broken marker from OUQBase QA. No QA opt-outs: leave the promote_symtype ambiguity check running; it is pre-existing and fixed at the root in PR #59. 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/55-cursor/log.txt on amdci2.julia.csail.mit.edu * Correct quadratic closed-form docstring stability claims. Each form loses precision on one root when b^2 >> |4ac|; none is uniformly more stable. Document that fagnano_mod is NaN for b == 0, and drop the unverified Golub-Welsch wording on StengerCanonicalMoments. 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/55-cursor/log.txt on amdci2.julia.csail.mit.edu * Document scalar @random_variables bounds as numeric literals. The scalar Independent form splices bound AST without evaluating caller bindings, so named (lo, hi) stored (:lo, :hi). Fix the docstring example, state the restriction, and assert getbounds on the documented literals. 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/55-cursor/log.txt on amdci2.julia.csail.mit.edu * Import Symbolics in umbrella QA for @random_variables bounds test. 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/55-cursor/log.txt on amdci2.julia.csail.mit.edu --------- Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com> Co-authored-by: Cursor Agent <noreply@cursor.com>
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-59-merge/log.txt (local transcript, amdci2)
ChrisRackauckas
marked this pull request as ready for review
October 3, 2026 13:51
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
OUQBase Core fails on current SymbolicUtils (≥4.38, including latest 4.48) with
MethodError: promote_symtype(::𝔼_, ::Type{Real}) is ambiguousagainstpromote_symtype(::Operator, ::Type{T}). This is the same failure seen in Downgrade Sublibraries (CI run 35162761668) and Sublibrary CI Core. This PR resolves the ambiguity, switches Term construction toSymbolicUtils.term, and fixes follow-on group-lookup / raw-moment parsing that only become reachable once Operators construct successfully.Independent review: Codex gpt-6-astra rounds 1-4 CHANGES (each fixed); Claude Code claude-opus-5-5 (a different harness from the Cursor author) round 5 on head 630a206: VERDICT MERGE, no blocking findings. Codex is out of quota until 2026-10-03, so round 5 used Opus.
Round-2 follow-up on this branch:
get_raw_moment_ordernow checksisintegerbeforeInt(...)so non-integer exponents raise the descriptive raw-moment error instead ofInexactError.Verification
Non-integer raw-moment exponent (round-2 finding)
Before:
After:
Probability
≳/≲regression (round-1 finding)Before (pre-Inequality unwrap): 10 pass, 2 fail, 2 error (
Any[]/ AssertionError).After: 14/14 (then 16/16 with the isinteger assertion).
OUQBase Core (
TEST_GROUP=Core, julia +lts)OUQBase QA (
TEST_GROUP=QA)Quality Assurance 16/16 on julia +lts (prior head); reviewer also saw 18/18 on +release.
Out of scope: canonical-moments
objective_f/ symbolicislessNot fixed in this PR (and no upstream issue filed here). Standalone Symbolics-only reproducer + version bisect live in the job
REPORT.md:evaluate(H, d)is numeric;evaluate(substitute(H ≳ h, …), d)leavesisless(2.0, (1000.0 / (9000.0sqrt(0.0009)))^0.6)unfolded.≳comparison totrue::Bool; breakage begins at Symbolics 7.0.0.What I did NOT verify
evaluate/islessfor≳).getdefaultvia-owners ignore (reviewer finding 3) is safe on every CI Julia lane.Reviewer pushback
underlying_random_variablesplacement.≳evaluate /islessfold (documented in REPORT; not filed upstream from this job).qa.jlignore cleanup.Part of #54
Please ignore this draft until reviewed by @ChrisRackauckas.
Risk assessment
𝔼/ℙ), RV group resolution, raw-moment parsing (including non-integer exponent errors).≳discovery, and non-integer moment order; QA green locally; Core still blocked only on disclosed Symbolicsisless.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-4 CHANGES)
Removed the QA
all_qualified_accesses_via_ownersignore for:getdefaultand the comment that preserved the non-owner access.getdefault(and qualifiedgetbounds) now go through their ownerModelingToolkitBase, declared as a direct dependency (compat = "1.50", matching ModelingToolkit 11.31).Ownership fail-before / pass-after
Before (
e09a134, no ignore):After (
630a206, no ignore):Re-verification (
OPTIMALUNCERTAINTYQUANTIFICATION_TEST_GROUP)julia +lts (1.10.12):
julia +1 (1.13.0):
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
𝔼/ℙ/𝟙operator term construction (now built withSymbolicUtils.term, plus a newpromote_symtype(::𝔼_/ℙ_, ::Type{T})method), random-variable group lookup (get_ordered_group_namesnow goes through the new internalunderlying_random_variables), raw-moment parsing (get_raw_moment_orderrewritten; the RHS is now coerced withFloat64(...)), and a new direct dependency onModelingToolkitBase(compat1.50, SciML, MIT). CanonicalMoments, DiscreteMeasures and the umbrella source are untouched. Draft PR OUQBase: evaluate Inequality probability events as Bool comparisons #60 edits the same 9 files, and PR Fix QA: explicit imports, OUQBase docs, approved reexports #57 editsqa.jl,interface.jlandoperators.jl, so conflicts are certain.630a206. None is a regression:tests / QA (julia 1): the same result on main013f14a(run 35162761805): 18 pass, 2 fail, 1 error (no_implicit_imports, public-API docstrings, unapproved reexports). Pre-existing.Downgrade Sublibraries / test (lib/DiscreteMeasures): the same 5intersectArgumentErrors on main (run 35162761668). Pre-existing, and this PR doesn't touch it.Downgrade Sublibraries / test (lib/OUQBase): main fails earlier, atFlood Problem (Q only)with thepromote_symtype(::𝔼_, ::Type{Real}) is ambiguouserror. The PR gets past that and fails later atFlood Problem (canonical moments objective)withisapprox(::BasicSymbolic, ::Float64). Pre-existing red that the PR partly fixes.sublibraries / lib/OUQBase / Julia 1and/ Julia lts / Tests - Core: these jobs are skipped on main pushes (path detection), so there is no main baseline. I compared against PR Fix QA: explicit imports, OUQBase docs, approved reexports #57 instead (run 36274860212, no fix), where both fail atQ onlywith the same ambiguity. With this PR they fail only at theisapproxerror, which the description discloses as out of scope and handled in OUQBase: evaluate Inequality probability events as Bool comparisons #60. Pre-existing, improved.lib/OUQBase [QA] / Julia 1(PR Fix QA: explicit imports, OUQBase docs, approved reexports #57's run had 1 failure).:getdefaultremoved; access now goes through its ownerModelingToolkitBase, and the sublib QA check passes).:Termand:symtypestay inall_explicit_imports_are_publiceven thoughoperators.jlno longer imports them. The comment still says the compat caps are "SymbolicUtils 3.x / ModelingToolkit 9.x", which doesn't match the current compat.Operatoris now imported fromSymbolicUtilsinstead ofSymbolics.get_raw_moment_ordernow throwsErrorExceptionfor non-integer or non-power forms, where it used to hit a different path. The OUQBase version stays at0.1.0and the changed functions aren't exported, so this is a minor SemVer concern.ModelingToolkitBaseas a new direct dependency.:Term/:symtypeQA ignores and their comment are stale.🤖 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)