Skip to content

test: fix OOM in ndarray/base/quinary-tiling-block-size dtype sweep - #15536

Draft
Planeshifter wants to merge 1 commit into
developfrom
philipp/ci-fix-quinary-tiling-block-size-oom-2026-09-25
Draft

Planeshifter wants to merge 1 commit into
developfrom
philipp/ci-fix-quinary-tiling-block-size-oom-2026-09-25

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • fixes a JavaScript heap OOM in the linux_test and macos_test scheduled workflows, which have failed on every run against develop for at least the past month
  • the crash originates in test/test.js of @stdlib/ndarray/base/quinary-tiling-block-size, which calls cartesianPower( dtypes(), 5 ) and asserts on all 16^5 = 1,048,576 resulting dtype quintuplets in a single process, now that dtypes() returns 16 entries
  • replaces the full cartesian sweep with a cyclic rotation of the dtype list (16 quintuplets), which still exercises every dtype in every argument position without exhausting the default V8 heap
  • the two monotonicity sanity checks at the end of the test file are unchanged

Related Issues

This pull request has the following related issues: none.

Questions

No.

Other

Failing run: https://github.com/stdlib-js/stdlib/actions/runs/36117442014 (linux_test, Node.js v12/v14/v16, Run build task step); same signature in macos_test (Node.js v16). Every scheduled run of both workflows against develop from 2026-08-27 through 2026-09-25 shows the identical failure.

Symptom: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory, surfacing after hundreds of thousands of tape assertions of the form returns a positive integer when provided (dtype1, ..., dtype5, promoted).

Root cause: dtypes() now returns 16 dtypes (float16 support was added recently). quinary-tiling-block-size/test/test.js builds the full cartesian power of dtypes() at arity 5 and asserts on each of the 16^5 combinations in one node process. The base tiling-block-size test file this package wraps deliberately caps its own exhaustive dtype sweep at arity 3; the quinary wrapper's test did not follow that precedent, and the growth in dtypes() pushed it over the runner's heap limit. The sibling quaternary-tiling-block-size test (arity 4, 65,536 combinations) is not currently failing and is left untouched.

Fix: generate quintuplets via cyclic rotation of the 16-entry dtype list instead of the full cartesian power — 16 assertions instead of 1,048,576. Every dtype is still exercised in every argument position at least once. No production code, workflow YAML, or sibling package is touched.

Validation: ran the test file directly against dtypes(), promote-dtypes, and the package's own lib (installing tape into a scratch NODE_PATH, since this worktree has no installed dependencies) — all 20 assertions pass in under a second, versus minutes-to-OOM before. Reviewed by three independent agents:

  • Reviewer A (correctness): approve — confirmed the rotation scheme covers every dtype in every position and cannot regrow combinatorially; noted (non-blocking) that cross-dtype interaction coverage is reduced.
  • Reviewer B (regression scope): approve — confirmed the diff touches only this one test file, nothing else in the repo references it, and no other CI matrix leg is affected.
  • Reviewer C (style/conventions): approve — confirmed ES5/tab/paren-spacing conventions, comment style, and license header are all preserved.

Reviewer notes: the same combinatorial-growth risk exists in quaternary-tiling-block-size/test/test.js (currently 65,536 combinations, not failing today). Worth a follow-up if dtypes() grows further.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

This PR was written primarily by Claude Code, run as a scheduled CI-triage routine. It identified the failing workflows from GitHub Actions run history, isolated the root cause to the combinatorial dtype sweep in this test file, implemented the fix, and validated it with three independent automated reviews before opening this PR as a draft for maintainer review.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01UKGSSD6r2kGi83tGeBWnUv


Generated by Claude Code

The `linux_test` and `macos_test` scheduled workflows on develop have
failed every day for at least the past month with `FATAL ERROR:
JavaScript heap out of memory` during `make test-javascript-local`.

Root cause: the test file calls `cartesianPower( dtypes(), 5 )`,
enumerating all 16^5 = 1,048,576 dtype quintuplets now that `dtypes()`
returns 16 entries, and asserts on each one in a single `tape` process.
This commit replaces the full cartesian sweep with a cyclic rotation
of the dtype list (16 quintuplets), which still exercises every dtype
in every argument position but no longer exhausts the default V8
heap. The two monotonicity sanity checks are unchanged.

Ref: https://github.com/stdlib-js/stdlib/actions/runs/36117442014

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UKGSSD6r2kGi83tGeBWnUv
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
ndarray/base/quinary-tiling-block-size $\\color{green}90/90$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}90/90$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

This branch has not been deployed

No deployments
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.

3 participants