test: add a no-raise property-test module for ak.ravel - #4284
Draft
TaiSakuma wants to merge 2 commits into
Draft
Conversation
to property tests The 2026-07-31 nightly failed ak.flatten(axis=None) on union[timedelta64[as], timedelta64[m]]: NumPy rejects a unit-conversion factor of 2**56 or more, so temporal leaves of one family whose units span such a factor cannot merge (scikit-hep#4278). Verifying that predicate surfaced a second, value-decided case: a value outside the finest unit's int64 range overflows at the cast even when the factor is in bounds (scikit-hep#4280). has_issue_4278 judges the unit span from the form; has_issue_4280 scans the stored values. One sentence in has_issue_4261's docstring is corrected: probing disproved its claim that np.result_type fails on extreme unit pairs that merge. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The module follows test_flatten.py's template; ak.ravel has no axis, so the options are highlevel, behavior, and attrs only, and _should_not_raise accepts every draw. Its gates surfaced two defects, each filed and covered by a new predicate in known_issues.py: has_issue_4282 (a regular list with no variable-length dimension under a union crashes or silently reorders the union fast path's marker broadcast; also wired into test_flatten's axis=None clause, where the stored falsifying example of 2026-07-31 now replays as filtered) and has_issue_4283 (a record directly under an option node survives drop_nones=False un-split and fails the merge; ak.ravel only, so test_flatten does not wire it). The package docstring's module enumeration gains the new module. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The documentation preview is ready to be viewed at http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/PR4284 |
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.
Draft while #4281 is in review: this branch stacks on
nightly-4278-unit-span-predicate(the new module wireshas_issue_4278andhas_issue_4280from that branch), so the diff shows #4281's commit until it merges; a rebase ontomainthen reduces the diff to this pull request's own commit.Extends the no-raise property-test family (#4265) to a third operation,
ak.ravel, and covers the two defects the new module's gates surfaced: a regular list with no variable-length dimension under a union crashes or silently reorders the interleaving broadcast (#4282, found by a local nightly-profile run oftest_flatten.pyon 2026-07-31 and deferred from #4281), and a record directly under an option node survivesak.ravel's flattening un-split and fails the merge (#4283, found by the new module's first nightly-profile run).Changes, in
tests/properties/operations/:test_ravel.py: new module from the template (test_flatten.pyis the closer twin).ak.ravelhas noaxis: the options arehighlevel,behavior, andattrsonly, sost_kwargskeeps just the related-options part._should_not_raisereturnsTrueunconditionally — probing on the released install found no documented rejection reachable from an array input and no option that affects raising — and_would_raise_from_known_issueapplies seven predicates with no option conditions: 4261, 4262, 4263, 4278, 4280, 4282, and 4283 (the negative-axis 4260 cannot apply,ak.ravelhaving noaxis).known_issues.py: new predicatehas_issue_4282— a regular list with no variable-length list below it, anywhere under a union. The union fast path's marker broadcast relies on replicate-per-row variable-length broadcasting; a branch with only regular dimensions takes NumPy's right-aligned rules instead, raisingIndexError(innermost size 1),ValueError(innermost size differing from the row count), or silently reordering (innermost size equal to the row count). A regular list of variable-length lists stayshas_issue_4262's trigger; the two triggers partition the regular-under-union space.known_issues.py: new predicatehas_issue_4283— a record directly under an option node.ak.ravel'sdrop_nones=Falsekeeps such an option whole, so the record reachesmergemanyun-split and a leaf part beside it fails the merge.ak.flatten(axis=None)projects options away and is unaffected — the first predicate that applies to one of the two operations only, sotest_flatten.pydoes not wire it.test_flatten.py:has_issue_4282joins theaxis=Noneclause; the falsifying example stored from the 2026-07-31 nightly-profile run now replays as filtered.Verification:
has_issue_4282's boundary on handmade layouts (the three size/row-count manifestations, regular-of-regular, the CI datetime shape, single-field record content, descent through record/option/list, the 4262 complement, no-union and plain-array negatives),has_issue_4283's boundary (all option flavors, a list above the option, the tuple-of-unknown finding shape, over-match cases that merge, list-of-records and no-option negatives), and a behavior oracle asserting every raise ofak.flatten(axis=None)orak.ravelon the probe set is matched by a predicate wired to that operation.ak.ravel, the drop-nones difference on the probe set, and nobehaviorlookups duringak.ravel.tests/properties/operationspasses at the default profile (26 tests) and at the nightly profile (10,000 examples per test), with both stored falsifying examples replaying as filtered; pre-commit is green.Issues #4282 and #4283 stay open; each predicate is deleted in the pull request that fixes its issue.
🤖 Generated with Claude Code