Skip to content

fix: overloaded / and % under use integer (Date::ISO8601)#729

Merged
fglock merged 2 commits into
masterfrom
fix/integer-overload-bigint-div-mod
May 13, 2026
Merged

fix: overloaded / and % under use integer (Date::ISO8601)#729
fglock merged 2 commits into
masterfrom
fix/integer-overload-bigint-div-mod

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented May 13, 2026

Summary

Under use integer, binary / and % still dispatch overloaded methods when either operand is a blessed overloaded object (for example Math::BigInt). The JVM backend skipped overload for the integer-specific helpers and coerced operands with native integer conversion, which stripped BigInt/BigRat results and broke modules such as Date::ISO8601.

Parallel perl_test_runner.pl previously globbed /tmp/perl_test_* to find each child’s JSON summary; under load that could associate the wrong TAP with the wrong .t, producing bogus regressions in saved logs (for example op/exec.t incomplete, spurious comp/ failures). That made compare_test_logs.pl deltas unreliable for merge gating.

Changes

  1. Runtime — MathOperators: integerDivide, integerDivideWarn, and integerModulus call OverloadContext.tryTwoArgumentOverload when either side is overloaded, matching non-integer divide/modulus before falling back to IV arithmetic.

  2. dev/tools/perl_test_runner.pl: Each child writes results to /tmp/perl_test_runner_result_<PID>; the parent reads that path for the reaped PID (no shared glob scan).

Verification

  • make
  • timeout 600 ./jcpan -t Date::ISO8601 (PASS)
  • perl dev/tools/perl_test_runner.pl --jobs 10 perl5_t/t/comp perl5_t/t/op/exec.tbproto.t, filter_exception.t, exec.t report full pass counts after the harness fix

Note: PR 731 duplicates the harness commit only; merge this PR (#729) first and close #731 when appropriate.

Perl keeps overload semantics for blessed operands even inside integer scopes.
integerDivide and integerModulus previously coerced via getLong(), stripping
Math::BigInt/Math::BigRat results and breaking Date::ISO8601 (and similar).

Generated with [Cursor](https://cursor.com/docs)

Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@fglock fglock force-pushed the fix/integer-overload-bigint-div-mod branch from 2a37f60 to 3083d8a Compare May 13, 2026 19:58
…d PID

Parallel runs globbed /tmp/perl_test_* and matched on test_file, which could
associate the wrong child output under load — logs showed phantom failures
(exec.t incomplete TAP, unrelated comp regressions).

Write each child's summary to /tmp/perl_test_runner_RESULT_<PID>; parent reads
exactly that path when waitpid reap fires.

Generated with [Cursor](https://cursor.com/docs)

Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@fglock fglock merged commit 64401e9 into master May 13, 2026
2 checks passed
@fglock fglock deleted the fix/integer-overload-bigint-div-mod branch May 13, 2026 21:12
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.

1 participant