Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add portable replacement tests for excluded XS::APItest bigmem stack tests

Open
#1,492 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
java, perl
Domain
compilers, testing

Research direction

The issue requires adding new tests to src/test/resources/unit. First, examine the excluded upstream tests perl5_t/t/bigmem/stack.t and perl5_t/t/bigmem/stack_over.t to understand the portable behaviors they represent. Then, design new Perl-level tests that validate list-context propagation, argument counts, list operations, and bounded stack behavior without XS::APItest. Ensure tests pass under system Perl, the JVM backend, and the interpreter backend. The acceptance criteria include running within CI limits and documenting the exclusions.

Written by the indexing model from the issue text.

Description

area:backend area:runtime enhancement

Summary

Add PerlOnJava-owned replacement coverage for the portable behavior represented
by the Perl core tests:

  • perl5_t/t/bigmem/stack.t
  • perl5_t/t/bigmem/stack_over.t

Those upstream tests are now excluded from dev/tools/perl_test_runner.pl
because they require the native XS::APItest extension and directly test
Perl 5 C-level value-stack/MARK implementation details. They also require
multi-gigabyte allocations that are unsuitable for the PerlOnJava test suite.

The exclusion is intentional, but it must not remove all coverage of the
observable list, argument-stack, and bounded overflow behavior that is
portable across Perl implementations.

Current upstream-test classification

bigmem/stack.t depends on XS::APItest functions including wide_marks,
xs_items, eval_sv, and call_sv, and creates arrays with indices beyond
0x8000_0000. It exercises native mark-stack offsets, XS argument counts,
large list operations, split, repeat, tie, and related C implementation paths.

bigmem/stack_over.t also depends on XS::APItest and specifically checks
32-bit MARK behavior on a 64-bit native Perl build while allocating an array
with a 2-billion-element index.

These implementation-specific assertions cannot be ported verbatim to the
JVM or interpreter backend.

Proposed replacement coverage

Add focused tests under src/test/resources/unit for Perl-level behavior that
does not depend on XS, native pointers, or enormous allocations. At minimum,
cover:

  1. List-context propagation through nested calls and expressions.
  2. Correct item counts for bounded list construction, list assignment, and
    list-returning functions.
  3. List slicing and negative indexes after a list-producing call.
  4. split, join, grep, and repetition with bounded inputs.
  5. Argument counts observed by ordinary Perl subs through @_, including
    nested calls and calls returning multiple values.
  6. eval and require paths that occur while a list/argument stack is active.
  7. Bounded recursive or deeply nested calls that verify the runtime reports a
    controlled stack/resource failure rather than hanging or corrupting values.

Use sizes large enough to expose indexing and context bugs but small enough for
ordinary CI machines. Do not reproduce the 2-billion-element allocation or the
60/17 GB memory requirements.

Test requirements

  • Validate every new Perl-level test with system Perl first.
  • Require success on both JVM and interpreter backends.
  • Keep the tests deterministic and independent of XS::APItest.
  • Do not weaken or modify the upstream Perl core tests.
  • Preserve the runner exclusions for the two native-only upstream files.
  • Add comments documenting which native XS::APItest assertions are
    intentionally not represented by the portable replacements.

Acceptance criteria

  • A project-owned test suite covers the portable semantics listed above.
  • The suite passes under system Perl, PerlOnJava JVM, and PerlOnJava
    interpreter execution.
  • The tests run within normal CI memory and time limits.
  • The compatibility documentation or test-runner notes explain why the two
    upstream XS tests remain excluded.
Dominant language
Perl
Stars
64
Forks
6
Avg merge
5h 11m
Merged PRs (30d)
168

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fglock/PerlOnJava

All issues in fglock/PerlOnJava

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.