Skip to content

Reject non-one-based out/tt in sorted-batch itp(out, ts) kernels - #622

Open
ChrisRackauckas-Claude wants to merge 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:pr-s1-offsetarray-batch-safety
Open

ChrisRackauckas-Claude wants to merge 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:pr-s1-offsetarray-batch-safety

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

What changed and why

The sorted-batch kernels behind itp(out, ts) (LinearInterpolation,
QuadraticInterpolation, AkimaInterpolation, ConstantInterpolation,
QuadraticSpline, CubicSpline, CubicHermiteSpline, QuinticHermiteSpline)
only check length(out) == length(tt) before indexing both arrays as if
they were 1-based. An OffsetArray out or tt is therefore read/written
out of bounds, returning silently wrong values, and a prior probe
segfaulted the GC when all 10 interpolation types were exercised this way
in one process.

Update: the first version of this PR added
Base.require_one_based_indexing(out, tt) unconditionally right after the
length check. Independent review (Cursor, round 1) correctly flagged that
as a regression: the unsorted path already falls through to
map!(A, out, tt), which handles arbitrary axes correctly on master
(confirmed empirically below), so unconditionally throwing broke calls
that previously worked.

Fixed by guarding only the unsafe @inbounds sorted-batch kernel:

if !Base.has_offset_axes(out, tt) && _sorted_batch_extrapolation_ok(A) && issorted(tt)
    _linear_eval_sorted!(out, A, tt)
else
    map!(A, out, tt)
end

Non-one-based out/tt (sorted or not) now always routes to map!,
which is correct for any axes. One-based, sorted input still takes the
fast @inbounds path. No input that worked on master now errors; the
only behavior change is that the two inputs that were previously
silently wrong (sorted tt/out with offset axes) are now correct.

Failing before / passing after

Before (unmodified master, commit b98db80), reproduced in a clean
temp environment with Pkg.develop pointed at the unmodified checkout:

=== candidate 1: itp(out, ts) with OffsetArray ts, 1-based out ===
correct = [0.8753842058167891, 0.5252087174427744]
master out = [0.5252087174427744, 2.4456522643573106]  (wrong if != correct)

LinearInterpolation(sin.(1:10), 1:10)(zeros(2), OffsetArray([1.5, 2.5], 0:1))
silently returns [0.5252, 2.4457] on master where [0.8754, 0.5252] is
correct — i.e. it's reading/writing through the wrong 0-based offsets.
That input is sorted, so it hits the broken fast path.

Confirmed separately that master's unsorted path already gives the
correct answer via map!, which is exactly what this PR's fix now also
guarantees for the sorted case:

master-equivalent unsorted OffsetArray tt, 1-based out:
  result = [-0.30784124362403054, 0.8753842058167891, 0.5252087174427744]  match=true
unsorted 1-based tt, OffsetArray out:
  result = [-0.30784124362403054, 0.8753842058167891, 0.5252087174427744]  match=true

After this fix, the sorted case is also correct:

julia> A(zeros(2), OffsetArray([1.5, 2.5], 0:1))
[0.8753842058167891, 0.5252087174427744]   # correct, via map! fallback

Updated test in test/interpolation_tests.jl ("OffsetArray batch safety")
exercises all 8 covered types with offset out, offset tt, and both
offset together, for both sorted and unsorted query order, and asserts
the result matches the scalar call in every case — including the cases
that already worked on master (unsorted, offset) and the case that was
silently wrong on master (sorted, offset). This test fails against
unmodified master (wrong values on the sorted/offset case) and passes
with the fix; it also fails against the first version of this PR (throws
on the unsorted/offset case) and passes with the current fix.

What was not verified

  • Did not re-run the GC segfault repro from the original probe (all 10
    types evaluated with offset arrays in one process); the out-of-bounds
    write this PR closes is the same code path that produced it.
  • GPU/CUDA paths, downstream packages, and the pre Julia channel were not
    exercised locally.
  • Core and QA groups were run on Julia 1.12 and 1.10 (lts) after this
    fix; pre is listed in test_groups.toml but was not run.

Anything a reviewer should push back on

Base.has_offset_axes is the right public-ish Base check for "does this
need the map! fallback", matching the semantics map!/copyto! already
use internally, but worth double-checking there isn't a cheaper
AbstractUnitRange-based check the package would prefer for consistency
with _cumulative_integral's use of Base.require_one_based_indexing
elsewhere (that call site has no working fallback, so throwing there is
still correct and unrelated to this change).

Please ignore until reviewed by @ChrisRackauckas.

Risk assessment

  • Risk: low
  • Blast radius: only the 8 sorted-batch itp(out, ts) methods in
    interpolation_methods.jl. One-based out/tt (the overwhelming common
    case) is unaffected; non-one-based input now always gives a correct
    result via the existing map! fallback instead of either corrupting
    memory (master) or erroring (this PR's first version). No public API
    signature changes.
  • Evidence: failing-before/passing-after shown above, including the
    regression the first version introduced and this version fixes.
  • Independent review: Cursor reviewed round 1 and returned CHANGES
    (regression on the unsorted offset path); addressed in this revision.
    A fresh independent pass is pending on the current head.
  • Merge: needs human review — safety fix touching 8 hot-path methods;
    wants an independent pass before merge despite being low-risk.

🤖 Generated with Claude Code

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: #622 (comment)

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Risk assessment (independent review, Codex gpt-6.1-sol, head 0aa37ba)

  • Verdict: MERGE
  • Rating: Codex gpt-6.1-sol rated it medium-low (ML1) at head 0aa37ba
  • Risk: medium-low (ML1: public batch evaluation returns corrected numerical values where sorted offset-array calls previously silently read or wrote the wrong elements; higher than the also-applicable L2/L6 criteria).
  • Blast radius: Eight vector-output batch methods, specifically the peripheral case where either query or output indices start somewhere other than one. Ordinary one-based batches retain their existing fast path; unsorted offset batches retain their existing fallback. This does not change the widely used scalar evaluation path, public signatures, exported names, or documented accepted inputs, and requires no breaking-version bump.
  • Evidence: Read the complete git diff origin/HEAD...HEAD, package/test configuration, evaluation dispatch, and supporting kernels. No linked issue exists (closingIssuesReferences is empty); the test's repository-root “candidate 1” link identifies no issue. Default-branch source was archived from origin/HEAD=898d88e, which differs from merge base b98db80 only by an unrelated CI commit. Both versions were developed into isolated scratch environments.

All local Julia runs used Julia 1.12.4, the requested JULIA_DEPOT_PATH, four threads, scratch TMPDIR, and timeout 3600. With S=<local path>, the targeted commands were:

timeout 3600 julia --startup-file=no --check-bounds=yes --project="$S/base-env" "$S/newtest.jl"
timeout 3600 julia --startup-file=no --check-bounds=yes --project="$S/head-env" "$S/newtest.jl"
timeout 3600 julia --startup-file=no --check-bounds=yes --project="$S/head-env" "$S/head-driver.jl"
timeout 3600 julia --startup-file=no --check-bounds=yes --project="$S/base-env" "$S/base-driver.jl"

The extracted PR test errored on base with eight BoundsErrors, one per interpolation type (exit 1); the identical test passed on head, 56/56 (exit 0). The reviewer probe passed 600/600 assertions against analytic affine and piecewise-constant reference values, covering all eight types, sorted/unsorted queries, positive/negative and differing offsets, extrapolation, singleton and empty batches. Existing one-based sorted/unsorted controls produced 3,248 bitwise-identical values across base and head.

Warmed timings (probe.jl, median of nine trials) gave head/base ratios 0.977–1.013 for 10,000-point one-based batches across all eight types. Short initial timing samples were noisy; the longer timeout 3600 julia --startup-file=no --project="$S/<base|head>-env" "$S/smallbench.jl" runs used nine million-call trials with default bounds settings: linear median 46.43 → 46.20 ns, quintic 200.82 → 198.48 ns. ir.jl LLVM inspection found no runtime offset-axis check for these ordinary-vector specializations.

gh pr checks reported 21 successful checks, no failures; gh run view 37943873502 --json headSha,conclusion,jobs confirmed the successful test matrix belongs to the exact reviewed head. Consequently there was no failing CI check needing default-branch comparison. git diff --check origin/HEAD...HEAD was clean.

G1: PASS — independent analytic accuracy evidence above, alongside the discriminating before/after regression test. G2: NOT APPLICABLE — no GPU kernel, AD rule, Reactant tracing implementation, or MPI path changes; existing AD extension CI jobs also succeeded. G3: NOT APPLICABLE — no shared state, cache implementation, threading, or global-default changes.

Base.has_offset_axes has a Julia docstring and is declared public on the locally tested Julia version; it is also described in the installed older Julia offset-array documentation. The only dependency addition is test-only OffsetArrays; I checked the installed 1.17.0 MIT license against this package's MIT license. No skips, weakened assertions, copyleft dependencies, or new public names were introduced.

  • Merge: merge (no blocking findings; medium-low review requirements still apply).

🤖 Posted by an AI agent — harness: Codex CLI 0.162.1 · model: gpt-6.1-sol
Conversation: local headless review run (no public session URL); transcript kept by the fleet master.

@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Devin CLI 3000.11.3, model fusion-claude-opus-5-5-high-sidekick-swe-2-medium): MERGE, risk low.

Full review

VERDICT: MERGE
RISK: low

Review of #622 (head 0aa37ba, base origin/master = b98db80). The fix is correct. Every change to the source is the same one-term guard, !Base.has_offset_axes(out, tt) && …, added in 8 places. When out and tt are one-based this guard is a no-op, so the fast path behaves exactly as it did before. When either has offset axes, the call falls back to map!, which handles any axes. I found no wrong results, no loosened tests and no swallowed errors. Everything below is cosmetic or a follow-up.

Blocking findings

None.

Non-blocking findings

  1. The PR title says the opposite of what the code does. (Confirmed by reading the diff and the PR.) The title is "Reject non-one-based out/tt in sorted-batch itp(out, ts) kernels", which describes the first commit f78f25e (require_one_based_indexing, i.e. throw). The head commit 0aa37ba routes these inputs to map! and throws nothing. A squash merge would put the wrong description into history. Retitle it, e.g. "Route offset-axis out/tt to map! in sorted-batch itp(out, ts)".

  2. The test comment includes history and a reference that leads nowhere. (Confirmed by reading.) See test/interpolation_tests.jl:2163-2168:

    • "(which already handles arbitrary axes correctly, as it does on master for unsorted tt)" is retrospective wording. CLAUDE.md says to describe what exists, not what came before.
    • "(https://github.com/SciML/DataInterpolations.jl, candidate 1)" is the repo root plus the name of an internal probe. It is not an issue link and means nothing to a reader.
    • There are about 9 comment lines out of about 60 added (~15%), above the ~10% guideline.

    Suggested fix: cut it to one line saying non-one-based out/tt must give the same result as the scalar call.

  3. The comment on the last test block is not checked. (Confirmed by reading.) test/interpolation_tests.jl:2200-2201 says the one-based sorted input "takes the sorted fast path", but nothing asserts that. The assertion is only out ≈ A.(q_sorted). Either drop the parenthetical or add a check. I checked the fast path myself with timings (see "What I ran"), so this is about the comment's wording, not a bug.

  4. Offset inputs hit a performance cliff. (Confirmed by running.) Sorted 1e4-point CubicSpline batch:

    • one-based input, PR: 52.5 µs (master: 52.4 µs, so no change)
    • offset-tt input, PR: 410 µs, the same as the unsorted map! path
    • offset-tt input, master: 52.6 µs, but the output there is garbage

    This trade is acceptable: correctness first, and offset inputs are rare. Writing the _*_eval_sorted! kernels in terms of firstindex/eachindex would keep the fast path for them. That belongs in a separate follow-up, not this PR.

  5. PR body attribution does not follow CLAUDE.md. (Confirmed by reading.) The body lacks the required first-line 🚧 UNREVIEWED banner and ends with "Generated with Claude Code" rather than the footer format (harness version and model). The commit trailers say Agent-Harness: Claude Code with no version. This has no effect on the code.

  6. Out of scope, and already present on master: an interpolation built from offset-axis u/t fails with BoundsError instead of a clean error. (Confirmed by running.) LinearInterpolation and ConstantInterpolation reject offset u/t with a clean ArgumentError. CubicSpline(OffsetArray(u,-1), OffsetArray(t,-1)) throws a BoundsError during construction instead. The behaviour is the same on master and this PR does not touch it. Noted only because it is the next neighbour of the same bug class.

What I ran

All runs used TMPDIR/scratch under the review directory. Master was a pristine copy from git archive origin/master, developed into its own env.

  • The PR's own example (LinearInterpolation(sin.(1:10), 1:10)(zeros(2), OffsetArray([1.5,2.5],0:1)), Julia 1.12, default bounds checking) reproduced exactly:

    • master: [0.5252…, 2.4457…] (wrong)
    • PR: [0.8754…, 0.5252…], which matches the scalar result
  • My adversarial probe scratch/probe.jl covered:

    • 11 types: the 8 the PR names, plus PCHIPInterpolation, LagrangeInterpolation and BSplineInterpolation
    • extrapolation set to Extension
    • 5 query sets: sorted small, sorted with extrapolation on both sides, sorted dense (400 points, which reaches the large-n interior kernel), unsorted, and a single point
    • offsets −1, 1, 7 and −1000
    • offset tt, offset out, both offset, and both offset with different offsets, plus one-based controls

    1100 cases in total. Every result was compared against the scalar A.(q).

    • PR, Julia 1.12, --check-bounds=yes: 0 wrong, 0 errors
    • PR, Julia 1.12, default bounds: 0 wrong, 0 errors
    • PR, Julia 1.10.12 (lts), --check-bounds=yes: 0 wrong, 0 errors. So map!'s positional iteration with mismatched axes also holds on LTS.
    • master, Julia 1.12, --check-bounds=yes: 576 BoundsErrors, all in the sorted cases with offset axes. That is 9 types (PCHIP is a CubicHermiteSpline) × 4 sorted query sets × 4 offsets × 4 offset variants. Lagrange and BSpline are unaffected, as expected, because they use the generic map! method.
  • The new testset alone (extracted to scratch/newtest.jl):

    • PR, Julia 1.12 with --check-bounds=yes, and PR, Julia 1.10: 56/56 pass
    • master, --check-bounds=yes: 8 errors (BoundsError)
    • master, default bounds: 8 errors (out-of-bounds reads of tt returned garbage below t[1], which raised LeftExtrapolationError)

    So the test fails before the fix and passes after it. Its reference values come from the scalar call, not from the batch output being tested.

  • Full suite: GROUP=Core julia +1.12 --project -e 'using Pkg; Pkg.test()' passed. interpolation_tests.jl had 17627 pass and 5 broken; the broken count is unchanged because the diff adds no @test_broken. extrapolation_tests, interface, abstract_interface and parameter_tests all passed.

  • Formatting and spelling:

    • julia +1.12 --project=@runic -m Runic --check src/interpolation_methods.jl test/interpolation_tests.jl: exit 0
    • git diff origin/master...HEAD | typos -: clean
  • Public API check: Base.ispublic(Base, :has_offset_axes) is true on 1.12.7 and 1.13. It is false on 1.11, and ispublic does not exist on 1.10. QA runs on lts and 1 (= 1.12), so ExplicitImports' public-access check should pass. Base.require_one_based_indexing, which the package already uses, has the same status.

  • Matrix-valued u: a sanity check of the generic (out::AbstractArray, t) method gave correct results. That method is unchanged.

  • Benchmarks: scratch/probe2.jl, using BenchmarkTools; numbers are in finding 4.

What I did not verify

  • GROUP=QA (Aqua/ExplicitImports/JET) was not run, because it loads Makie, Mooncake and Symbolics and the host was memory-limited. I judge it low risk because has_offset_axes is public on 1.12, but I did not run it.
  • The PR's GC-segfault claim was not reproduced. On master with default bounds I saw only silently wrong reads.
  • Not exercised: Julia pre, the 32-bit Core job, GPU arrays, and downstream packages.
  • Linked or tracking issue: the PR references none (closingIssuesReferences is empty), so there was no sibling work to check against.
  • New test dependency: I did not check the OffsetArrays license myself. It is widely known to be MIT, and it is only a test dependency with [compat] OffsetArrays = "1".

🤖 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
Conversation: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master)

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review December 1, 2026 01:45
ChrisRackauckas and others added 2 commits December 1, 2026 10:46
The sorted-batch kernels behind `itp(out, ts)` (LinearInterpolation,
QuadraticInterpolation, AkimaInterpolation, ConstantInterpolation,
QuadraticSpline, CubicSpline, CubicHermiteSpline, QuinticHermiteSpline)
index `out` and `tt` assuming 1-based indexing, checking only `length`.
An OffsetArray `out` or `ts` reads and writes out of bounds, returning
silently wrong values and segfaulting in one probe.

Add `Base.require_one_based_indexing(out, tt)` at each entry point so a
non-one-based `out`/`ts` errors clearly instead of corrupting memory.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code
Agent-Model: claude-sonnet-5
Agent-Session: https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
The previous fix called Base.require_one_based_indexing(out, tt)
unconditionally, which rejected an OffsetArray out/tt even on the
unsorted map!(A, out, tt) path -- a path that already handles
arbitrary axes correctly on master (map! iterates positionally
regardless of indexing). That made previously-working calls regress
to an error.

Guard only the unsafe @inbounds sorted-batch kernel: when out or tt
has non-standard axes, skip the sorted fast path and fall through to
map!, which is correct for any axes. One-based, sorted input still
takes the fast path; non-one-based input of any order now gives the
same correct result it gave on master instead of corrupting memory
(previously) or throwing (previous fix).

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code
Agent-Model: claude-sonnet-5
Agent-Session: https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
@ChrisRackauckas
ChrisRackauckas force-pushed the pr-s1-offsetarray-batch-safety branch from 0aa37ba to ea8c909 Compare December 1, 2026 11:47
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

PR: #622

Reviewed head: ea8c909
Raw SHA-256: 755b4812a3976c27e3c3bac350f6548461436633839d3fdd49d6ad31ca4874f9
Source SHA-256: ef425c8388c54d82a15d195d71c55dc055ec85798368fe82d02662e9cb3cee32
Source: standard-review-v1 (harness-log)
Reviewer session: 8301da4c-5ae6-4fa3-b10d-93086e4d4b3f
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium-low (ML1)
  • Verdict: MERGE
  • Reviewed head: ea8c909

Review report

VERDICT: MERGE
Round: 1
Head: ea8c909
Base: b7ce0ca
Slot: 1
CI: CI is not green
Session: 8301da4c-5ae6-4fa3-b10d-93086e4d4b3f
Reviewer: Antigravity CLI 1.5.21; model: gemini-4-carbon-high
Review triage: {"families":[],"contract":false}

Risk

medium-low (ML1: fixes silent wrong results and out-of-bounds memory accesses on peripheral sorted non-1-based itp(out, ts) batch calls across 8 interpolation types while keeping 1-based main-lane callers bit-for-bit unchanged; failing-before test included)

Blocking findings

None.

Non-blocking findings

  1. [pre-existing] src/interpolation_utils.jl:294-374, 435-450 and src/interpolation_methods.jl:374, 499, 690, 821, 971, 1131, 1388, 1548 — Non-1-based u or t passed at construction time still reaches @inbounds 1-based sorted-batch kernels when out and tt are 1-based.

    • Observed evidence (confirmed by running on both b7ce0cae7c9a9fb1e47f3b2288340b7d618906a7 and ea8c909a896477455af0e868fe168398862680e5):
      • A_t = LinearInterpolation(sin.(collect(1.0:10.0)), OffsetArray(collect(1.0:10.0), -1)); A_t(zeros(3), [1.5, 2.5, 3.5]): construction succeeds because _cumulative_integral only checks Base.require_one_based_indexing(A.u) and not A.t. Calling A_t with 1-based out and sorted tt enters _linear_eval_sorted!, where t1 = @inbounds t[1] reads the second knot (2.0) and tn = @inbounds t[10] reads past indices 0:9 (throws LeftExtrapolationError under --check-bounds=auto and BoundsError at index [10] under --check-bounds=yes on both base and head).
      • A_sym = ConstantInterpolation(OffsetArray([:a, :b, :c, :d], -1), [1.0, 2.0, 3.0, 4.0]); out = Vector{Symbol}(undef, 2); A_sym(out, [1.5, 2.5]): bypasses _cumulative_integral (since eltype(u) is not <:Number), enters _constant_eval_sorted!, and silently returns [:b, :c] instead of [:a, :b] under --check-bounds=auto (BoundsError at index [4] under --check-bounds=yes on both base and head).
    • Implementation fix: This is a follow-up design choice outside PR Reject non-one-based out/tt in sorted-batch itp(out, ts) kernels #622's itp(out, ts) scope with two valid options: (a) reject non-1-based u, t (and du, ddu in Hermite constructors) at construction time via Base.require_one_based_indexing, or (b) support arbitrary-axis u and t throughout construction, scalar evaluation, derivatives, integrals, and batch evaluation. Option (a) is recommended unless full offset knot/data storage is explicitly intended, because _cumulative_integral (src/interpolation_utils.jl:436), get_I (src/integral_inverses.jl:115), check_no_duplicate_t (src/interpolation_utils.jl:226), and parameter caches (src/parameter_caches.jl) already assume 1-based indexing. Concretely, add Base.require_one_based_indexing(u, t) at the top of the three munge_data methods in src/interpolation_utils.jl:294-374 and Base.require_one_based_indexing(du) / Base.require_one_based_indexing(ddu, du) in CubicHermiteSpline and QuinticHermiteSpline constructors in src/interpolation_caches.jl, then add a @testset in test/interpolation_tests.jl asserting @test_throws ArgumentError when constructing each interpolation type with an OffsetArray u, t, du, or ddu.
  2. [regression] test/interpolation_tests.jl:2391-2396, 2416-2428 — Test comment includes retrospective master phrasing and an internal triage note, and test inputs only exercise offset +1.

    • Observed evidence (confirmed by reading and running):
      • test/interpolation_tests.jl:2391-2396 contains (which already handles arbitrary axes correctly, as it does on master for unsorted tt) and (https://github.com/SciML/DataInterpolations.jl, candidate 1), referencing branch history and a bare repository URL / triage candidate label rather than stating the invariant in the present tense.
      • test/interpolation_tests.jl:2418-2427 only tests offset +1 (axes 2:4). On b7ce0cae7c9a9fb1e47f3b2288340b7d618906a7 under --check-bounds=auto, OffsetArray(copy(q_sorted), 1) throws a spurious LeftExtrapolationError because @inbounds tt[1] reads 0.0 < 1.0, whereas negative offsets (e.g., -1) or sentinel-wrapped views (sentinel = fill(999.0, 7); out = OffsetArray(view(sentinel, 3:5), 1); A(out, [1.5, 2.5, 3.5])) silently overwrite sentinel[2] outside the view and return [0.5252087174427744, -0.30784124362403054, 999.0] without throwing. The production guard !Base.has_offset_axes(out, tt) already handles all of these correctly on ea8c909a896477455af0e868fe168398862680e5.
    • Implementation fix: In test/interpolation_tests.jl:2390-2436, shorten the comment to present-tense prose without master or candidate 1 (e.g., # Non-one-based out or ts must route to map! rather than the 1-based @inbounds sorted-batch kernels.), and include a negative/mismatched offset pair plus a sentinel-backed view check asserting both collect(out) ≈ ref and unchanged sentinel guard elements before and after the slice. No other files or docs are affected.

What I ran

All checks were executed on the build host with Julia 1.12.4 (OffsetArrays v1.18.0 in [extras]/[targets] test, MIT-licensed; [deps] unchanged):

  • Locked Python interpreter check: uv run --locked python --version -> warning: --locked has no effect when used outside of a project / Python 3.13.13 (no uv.lock or Python code exists in this repository).
  • Public API verification: julia -e '@show Base.ispublic(Base, :has_offset_axes) Docs.hasdoc(Base, :has_offset_axes)' -> both true on Julia 1.12.4.
  • Spell check and formatting:
    • typos -> exit 0 (no typos).
    • Runic.main(["--check", "src/interpolation_methods.jl", "test/interpolation_tests.jl"]) -> exit 0 (properly formatted).
  • QA and allocation suites on head (ea8c909a896477455af0e868fe168398862680e5):
    • GROUP=QA julia --project -e 'using Pkg; Pkg.test()' -> QA/qa.jl 20/20 passed (Aqua + ExplicitImports across src/ and all weakdep extensions).
    • test/qa/alloc_tests.jl -> 20/20 passed (Allocation-free interpolation tests 16/16, Cached plain-Vector construction allocations 2/2, Default-cache Vector invert_integral allocations 2/2).
  • Affected Core test group on head (ea8c909a896477455af0e868fe168398862680e5):
    • GROUP=Core julia --project -e 'using Pkg; Pkg.test()' -> passed (Core/abstract_interface.jl 11/11, Core/extrapolation_tests.jl 316/316, Core/interface.jl 31/31, Core/interpolation_tests.jl 17687 passed / 2 pre-existing broken / 17689 total, Core/parameter_tests.jl 177/177).
  • Differential & adversarial probes on base (b7ce0cae7c9a9fb1e47f3b2288340b7d618906a7) vs head (ea8c909a896477455af0e868fe168398862680e5):
    • PR regression cases on base: all 8 interpolation types failed on base (BoundsError under --check-bounds=yes; spurious LeftExtrapolationError, silent out-of-bounds memory corruption on OffsetArray(view(sentinel, 3:5), 1), and SIGSEGV on ConstantInterpolation{Vector{Symbol}} under --check-bounds=auto) and passed on head.
    • Sentinel & offset sweep (2,184 combinations): 13 builders (LinearInterpolation cached/uncached, QuadraticInterpolation :Forward/:Backward, AkimaInterpolation standard/modified, ConstantInterpolation :left/:right, QuadraticSpline, CubicSpline, CubicHermiteSpline, PCHIPInterpolation, QuinticHermiteSpline) × dense (n = 10) and sparse (n = 200, exercising 32 * n_interior < n) × all 6 ExtrapolationType modes × m in {0, 1, 3, 4} sorted/unsorted queries × 7 offset pairs (0,0), (1,0), (0,1), (-2,3), (5,-5), (0,-1), (-1,0) around padded sentinel views -> 0 failures on head (both --check-bounds=auto and --check-bounds=yes), 1,716 BoundsError failures on base under --check-bounds=yes.
    • Edge cases & performance on head: verified DimensionMismatch, LeftExtrapolationError, and RightExtrapolationError preservation on OffsetArray inputs; in-place aliasing A(buf, buf) with OffsetArray; repeated knots in LinearInterpolation; ForwardDiff.Dual elements; @inferred type stability and 0 bytes allocated (@allocated) on both 1-based Vector and OffsetArray inputs across all 13 builders.
    • Bit-for-bit invariance on 1-based paths: compared 192 1-based batch outputs (8 interpolation types × dense/sparse × 6 extrapolation modes × sorted/unsorted) between base and head -> isequal and UInt64 bit patterns 100% identical.

What I did not verify

  • Test groups Methods, Extensions, Misc, and 32-bit Core ("Core 32-bit"), as none of their source files or dispatch targets were modified by this diff.
  • Julia LTS (1.10) and nightly (pre) test runs and the Downgrade workflow.
  • Full docs/make.jl build (no docstrings, exports, or files under docs/ were touched).
  • Exact cause of the non-green remote CI status reported at dispatch time (blind code-only review with no GitHub check-run access; local Core, QA, Runic, typos, and allocation checks all passed).

AUTHOR_GRADE: {"task": "bugfix", "score": 5, "difficulty": 2, "rounds": 1, "author_harness": "Claude Code", "author_model": "claude-sonnet-5", "note": "Focused, zero-overhead fix across all 8 sorted-batch entry points using public Base.has_offset_axes, routing non-1-based out/tt to map! without regressing unsorted OffsetArray calls or altering 1-based paths, backed by discriminating tests."}

Head link: ea8c909


🤖 Posted by an AI agent — harness: Antigravity CLI 1.5.21 · model: gemini-4-carbon-high
Conversation: local session 8301da4c-5ae6-4fa3-b10d-93086e4d4b3f (no session URL)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants