Skip to content

test: add a no-raise property-test module for ak.ravel - #4284

Draft
TaiSakuma wants to merge 2 commits into
scikit-hep:mainfrom
TaiSakuma:property-test-ravel
Draft

test: add a no-raise property-test module for ak.ravel#4284
TaiSakuma wants to merge 2 commits into
scikit-hep:mainfrom
TaiSakuma:property-test-ravel

Conversation

@TaiSakuma

Copy link
Copy Markdown
Member

Draft while #4281 is in review: this branch stacks on nightly-4278-unit-span-predicate (the new module wires has_issue_4278 and has_issue_4280 from that branch), so the diff shows #4281's commit until it merges; a rebase onto main then 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 of test_flatten.py on 2026-07-31 and deferred from #4281), and a record directly under an option node survives ak.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.py is the closer twin). ak.ravel has no axis: the options are highlevel, behavior, and attrs only, so st_kwargs keeps just the related-options part. _should_not_raise returns True unconditionally — 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_issue applies seven predicates with no option conditions: 4261, 4262, 4263, 4278, 4280, 4282, and 4283 (the negative-axis 4260 cannot apply, ak.ravel having no axis).
  • known_issues.py: new predicate has_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, raising IndexError (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 stays has_issue_4262's trigger; the two triggers partition the regular-under-union space.
  • known_issues.py: new predicate has_issue_4283 — a record directly under an option node. ak.ravel's drop_nones=False keeps such an option whole, so the record reaches mergemany un-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, so test_flatten.py does not wire it.
  • test_flatten.py: has_issue_4282 joins the axis=None clause; the falsifying example stored from the 2026-07-31 nightly-profile run now replays as filtered.

Verification:

  • 101 truth checks pass: 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 of ak.flatten(axis=None) or ak.ravel on the probe set is matched by a predicate wired to that operation.
  • 59 derivation probes for the module: each of the five prior issues' falsifying layouts raises through ak.ravel, the drop-nones difference on the probe set, and no behavior lookups during ak.ravel.
  • tests/properties/operations passes 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

TaiSakuma and others added 2 commits July 31, 2026 13:45
 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>
@github-actions github-actions Bot added the type/test PR title type: test (set automatically) label Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.01%. Comparing base (1b161d3) to head (5a7f877).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

see 9 files with indirect coverage changes

@github-actions

Copy link
Copy Markdown

The documentation preview is ready to be viewed at http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/PR4284

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

Labels

type/test PR title type: test (set automatically)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant