Repository navigation
Fix SimpsonsRule on uniform grids with n < 8 - #378
Conversation
The 17/59/43/49 end corrections overlap for n < 8, so fall back to the nonuniform composite weights on small AbstractRange grids. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Cursor Agent <noreply@cursor.com> Agent-Harness: Cursor Agent 2026.10.01-14929f9 Agent-Model: unknown (Cursor auto) Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/integrals/int-simpson/log.txt on amdci2
Independent review (Devin CLI 3000.11.3, model fusion-claude-opus-5-5-high-sidekick-swe-2-medium): CHANGES, risk medium. Full reviewVERDICT: CHANGES Review of #378 (head 390cb70). The PR links no issue. Repo root has no AGENTS.md or CLAUDE.md; I applied the global CLAUDE.md rules. The numerical fix is correct. On master, a uniform Blocking findings
Non-blocking findings
What I ranAll runs used Julia 1.11.9 with scratch envs in
What I did not verify
🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (review), Claude Code 2.1.285 (posting) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium |
Returning a different weight type for n < 8 broke SampledIntegralCache reuse when the grid crossed n = 8. Small-n composite 1/3 and 3/8 weights now live in SimpsonUniformWeights.getindex so the cache type is stable. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Cursor Agent <noreply@cursor.com> Agent-Harness: Cursor Agent 2026.10.01-14929f9 Agent-Model: unknown (Cursor auto) Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/integrals/int-simpson/log.txt on amdci2
Independent review (Devin CLI 3000.11.3, model fusion-claude-opus-5-5-high-sidekick-swe-2-medium): MERGE, risk low. Full reviewVERDICT: MERGE PR: #378 (head 42e98d4, merge-base 63b17e8). No linked issue, and there is no AGENTS.md or CLAUDE.md at the repo root. Blocking findingsNone. Non-blocking findings
What I ranAll of these are confirmed by running, on Julia 1.12.7 unless noted. The PR environment is
What I did not verify
🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (review), Claude Code 2.1.285 (posting) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium |
Bump version to 5.5.4 Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Harness: Claude Code 2.1.301 Agent-Model: claude-opus-5-5 Claude-Session: https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq
Summary
SimpsonsRuleon anAbstractRangeused the uniform 17/59/43/49 end corrections from both ends even whenlength(x) < 8, so those corrections overlapped and integrals of constants /x^2on[0,1]were wrong (e.g. ∫1 ≈ 0.96875 forn=3). This keepsfind_weightsreturningSimpsonUniformWeightsfor everyAbstractRangelength (cache-stable /@inferred), and implements correct composite Simpson weights for3 ≤ n < 8insidegetindex: classic 1/3 for oddn, and 3/8 on the first three panels plus 1/3 on the remainder for evenn(n == 4is pure 3/8). Forn ≥ 8the previous 17/59/43/49 weights are bitwise unchanged.n < 3on a range throwsArgumentError.A 2-point uniform
Rangepreviously returned a wrong value (∫1 over[0,1]≈ 0.708, absolute error ≈ −0.29) and now throwsArgumentError("The length of the grid must exceed 2 for simpsons rule.")fromfind_weights(Vector path still asserts ingetindex).Verification
n = 3..7; with fix → pass (before.txt/after.txtin the job dir).initatn = 5thencache.xlength 11 threwTypeErrorinsetfield!; with this commit, 5→11 and 11→5 reuse both return1.0and match a freshsolve.@inferred find_weightson a range; bitwise identity ofSimpsonUniformWeightsvs the old formula forn = 8..20; correctness forn = 3..10onFloat64/Float32/BigFloatfor1,x^2, andx^3(142/142 in the focused suite). Julia 1.10.12: same 142/142.Test-group tails (after F2)
GROUP=Core (Julia 1.12.4):
GROUP=QA (Julia 1.12.4):
Also ran Runic (
--inplace) andtyposon the changed files.Not verified
GROUP=AD/ADBatch/ Everything.ngetindexvs the old incorrect uniform path.Reviewer pushback
n < 8(same polynomial degree; different weight layout).n = 2should keep a numeric (wrong) result for back-compat instead ofArgumentError.SimpsonsRuleshould mention then ≥ 3requirement and the small-nvsn ≥ 8weight formulas.Please ignore until reviewed by @ChrisRackauckas.
Risk assessment
Independent review: F1 MERGE (Claude Code, Opus 5.5); F2 addressed Devin CHANGE finding (cache type split) — re-review pending.
🤖 Generated with Cursor Agent 2026.10.01-14929f9 (model: unknown (Cursor auto)), transcript /home/crackauc/sandbox/goals/performance/jobs/integrals/int-simpson/log.txt on amdci2; orchestrated by Claude Code (claude-opus-5-5[1m]) https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
Independent review: Devin Fusion (fusion-claude-opus-5-5-high-sidekick-swe-2-medium) rated it low, verdict MERGE: #378 (comment)
Risk assessment
Independent risk assessment by codex-cli (gpt-6.1-sol), reviewed head
42e98d447f; dispatched by the fleet master, Claude Code (claude-opus-5-5), https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq