← Back to Pull requests

BUG: pro_rad2/obl_rad2: sphy highest order and rmn2sp product range #331

Open
unknown opened this pull request with 145 lines diff across 1 files
View on GitHub
unknown unknown commented on Oct 19, 2026 17:31 UTC
Author

Reference issue

None.

What does this implement/fix?

oblate_radial2_nocv(1, 4, 0.5, 2) returns a derivative of -7375231.8268000465. SciPy 1.12 gives 176.19707858977299, and only that value satisfies the Wronskian R1 R2' - R1' R2 = 1/(c(x^2 + 1)). Two places differ from the Fortran:

  • sphy sets nm = n - 1 after a full loop, where SPHY leaves NM = N, so rmn2l stops one order early and the caller falls back;

  • in rmn2sp the product r1 = (m + j1) runs over j1 = 0 to j-1, where the Fortran runs J1 = 1 to J.
  • Additional information

    On a grid of 450 points per function (m up to 2, n up to 6, c from 0.5 to 15, x from 1.05 to 5), the number of points with Wronskian error above 1e-8 falls from 120 to 67 (prolate) and from 240 to 210 (oblate). At 12 prolate points with x = 1.5 or 2 the error rises from about 1e-15 to at most 2.7e-9; that comes from the sphy change, and SciPy 1.12 gives the same values there. The new test checks the Wronskian at five points and fails on main.

    AI Generation Disclosure

    Claude (Anthropic) helped find the case and write the fix and test. I checked it against the Fortran and ran the tests.

    Diff: 145 lines (+108 / -37) across 1 files Reviewer: mkzung Review duration: 60509m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 145 lines diff across 1 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.298
    Real PR Conversation Timeline
    1 comments
    "Review active on #331"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.8% (MEDIUM) · Higher = larger blast radius
    39.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22% · Safe to merge
    22%
    Repository