Skip to content

test: add known-issue predicates for #4278 and #4280 to property tests - #4281

Open
TaiSakuma wants to merge 1 commit into
scikit-hep:mainfrom
TaiSakuma:nightly-4278-unit-span-predicate
Open

test: add known-issue predicates for #4278 and #4280 to property tests#4281
TaiSakuma wants to merge 1 commit into
scikit-hep:mainfrom
TaiSakuma:nightly-4278-unit-span-predicate

Conversation

@TaiSakuma

Copy link
Copy Markdown
Member

The Property Tests nightly run of 2026-07-31 (log) failed on tests/properties/operations/test_flatten.py::test_properties: ak.flatten(axis=None) on 1 * union[timedelta64[as], timedelta64[m]] raises OverflowError: Integer overflow getting a common metadata divisor for NumPy datetime metadata [as] and [m].

Two issues came out of the finding, and each gets its own predicate. #4278 is decided by the units at the form level: NumPy rejects a conversion factor between two temporal units once the factor reaches 2**56, so leaves of one family whose units span such a factor cannot promote. #4280 is decided by the stored values and cannot be told from the form: with the factor in bounds, a value outside the finest unit's int64 range overflows at the cast (found while verifying the #4278 predicate). Both are distinct from the cross-family merge failures of #4261, whose has_issue_4261 trigger deliberately models families, not units.

Changes, in tests/properties/operations/:

  • known_issues.py: new predicate has_issue_4278 — a record or union whose temporal leaves of one family span an overflowing conversion factor. The helper _overflowing_unit_span computes the exact factor between the extreme base units present from an attosecond table against NumPy's bound of 2**56; datetime calendar units count at their average lengths (2629746 s per month, 31556952 s per year), timedelta calendar units do not convert and stay with has_issue_4261's family grouping, and a unit multiplier (as in datetime64[10s]) is ignored, as NumPy's factor check ignores it.
  • known_issues.py: new predicate has_issue_4280 — a record or union with a temporal value of magnitude above (2**63 - 1) // f, f being the factor to the family's finest unit present. NaT is exempt, datetime calendar units are excluded (their value conversion wraps silently instead of raising), and the check reads every value in each temporal leaf's buffer, an over-match.
  • known_issues.py: one correction in has_issue_4261's docstring — its np.result_type parenthetical claimed extreme unit pairs merge, which ak.ravel raises OverflowError when temporal leaves need an overflowing unit conversion #4278's probing disproved; the corrected text names the actual divergence (np.result_type promotes datetimes with timedeltas, which the merge rejects with TypeError) and points unit-span failures to has_issue_4278.
  • test_flatten.py: both predicates join the axis=None clause of _would_raise_from_known_issue. test_all.py needs no wiring: its _reducible refuses every union, so the affected draws never reach ak.all.

Verification:

  • 893 truth checks pass: 532 compare has_issue_4278 against the exact-factor prediction (55 linear timedelta pairs and 78 datetime pairs including the calendar units, on union and record layouts in both orders), 312 compare the three predicates' disjunction against the observed outcome (skip exactly when ak.flatten(axis=None) raises, for all 78 pairs of the 13 units per kind on unions in both orders), 26 cover has_issue_4280's value boundaries ((2**63 - 1) // f and one past it for two unit pairs, negative symmetry, NaT, same-unit, record and nested layouts, calendar wraparound), and 23 cover the falsifying layouts and structural variants.
  • Replaying the nightly failure blob (@reproduce_failure, hypothesis 6.164.0 as in the CI run) reproduces the OverflowError on the unmodified tests and raises DidNotReproduce with has_issue_4278 wired in; the locally found value-overflow example replays as filtered by has_issue_4280 the same way.
  • tests/properties/operations passes at the default profile. A nightly-profile run (10,000 examples) then surfaced a further, unrelated defect — a regular list of plain leaves under a union breaks the interleaving broadcast (the machinery of ak.broadcast_arrays fails for a flat array and a regular list of variable-length lists #4262, whose trigger matches only variable-length-list content) — deferred to a follow-up; its stored example keeps a local replay failing until then.

Issues #4278 and #4280 stay open; each predicate is deleted in the pull request that fixes its issue.

🤖 Generated with Claude Code

 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>
@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 83.98%. Comparing base (1b161d3) to head (e9af82c).

Additional details and impacted files

@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/PR4281

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