test: fix OOM in ndarray/base/quinary-tiling-block-size dtype sweep - #15536
Draft
Planeshifter wants to merge 1 commit into
Draft
Planeshifter wants to merge 1 commit into
Planeshifter wants to merge 1 commit into
Conversation
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
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request:
linux_testandmacos_testscheduled workflows, which have failed on every run againstdevelopfor at least the past monthtest/test.jsof@stdlib/ndarray/base/quinary-tiling-block-size, which callscartesianPower( dtypes(), 5 )and asserts on all 16^5 = 1,048,576 resulting dtype quintuplets in a single process, now thatdtypes()returns 16 entriesRelated 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 taskstep); same signature inmacos_test(Node.js v16). Every scheduled run of both workflows againstdevelopfrom 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 oftapeassertions of the formreturns 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.jsbuilds the full cartesian power ofdtypes()at arity 5 and asserts on each of the 16^5 combinations in onenodeprocess. The basetiling-block-sizetest 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 indtypes()pushed it over the runner's heap limit. The siblingquaternary-tiling-block-sizetest (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 ownlib(installingtapeinto a scratchNODE_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 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 ifdtypes()grows further.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
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