[ABA-23] test(vortex-array): repro for integer arith panics#17
Open
abnobdoss wants to merge 1 commit into
Open
[ABA-23] test(vortex-array): repro for integer arith panics#17abnobdoss wants to merge 1 commit into
abnobdoss wants to merge 1 commit into
Conversation
…verflow / div-by-zero
Add 5 inline repro tests in `scalar_fn::fns::binary::numeric::tests`:
- 4 `#[ignore]` + `#[should_panic]` tests locking the current wrong behaviour
(i32 add overflow, i64 div-by-zero, u32 sub underflow, i32 mul overflow —
all panic via `to_primitive()` -> `vortex_expect("to_canonical failed")`).
- 1 always-green test confirming `to_canonical()` (the VortexResult path)
returns `Err` gracefully rather than panicking.
Root cause: `ToCanonical::to_primitive()` (canonical.rs:489-492) calls
`to_canonical().vortex_expect(...)`, converting any Arrow arithmetic `Err`
into a process-aborting panic that callers cannot catch as `VortexResult`.
Fixes: https://linear.app/abanoubdoss/issue/ABA-23
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Abanoub Doss <abanoub.doss@gmail.com>
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
vortex-array/src/scalar_fn/fns/binary/numeric.rs(scalar_fn::fns::binary::numeric::tests) documenting the ABA-23 integer arithmetic panic bug.#[ignore]+#[should_panic(expected = "to_canonical failed")]— they lock the current wrong behaviour (panics on i32 add overflow, i64 div-by-zero, u32 sub underflow, i32 mul overflow).issue_aba23_to_canonical_returns_err_not_panic_on_overflow) is always green: confirmsto_canonical()(theVortexResultpath) returnsErrgracefully; onlyto_primitive()converts thatErrto a panic viavortex_expect.Linear: https://linear.app/abanoubdoss/issue/ABA-23
REPRO-ONLY PR — no fix included. The fix requires a cross-operator overflow-semantics decision.
Root cause (confirmed on develop)
ToCanonical::to_primitive()atcanonical.rs:489-492callsto_canonical().vortex_expect("to_canonical failed"). Arrow arithmetic kernels returnErron integer overflow/div-by-zero but evaluation is lazy — the error surfaces insideto_canonicalwherevortex_expectconverts it to an unrecoverable panic. Callers cannot catch withVortexResult.Open question — semantics decision needed
to_primitive()propagatesVortexResult; breaking API change. MatchesOperator::Adddoc.T::MAX/T::MIN. Silent but predictable.numeric.rs:68comment says "wrapping" but Arrow errors, not wraps.Should this follow Arrow's
checked_*convention universally, or be per-operator configurable?Test plan
cargo test -p vortex-array --lib scalar_fn::fns::binary::numeric::tests— 4 ignored, 1 green-- --include-ignored— all 5 pass (4should_panicconfirmed, 1 green)cargo +stable fmt -p vortex-arraymod testsubtests🤖 Generated with Claude Code