gridwise-webgpu / gridwise-webgpu/gridwise

Memory limit exceeded in key-value sort validation for large arrays (>2^26 elements)

Open
#14 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11
Forks
9
Avg merge
9m
Merged PRs (30d)
6

Description

https://github.com/gridwise-webgpu/gridwise/blob/d0ecc7f0a1cafcc8ff6062e4f58d3c462dfd012f/onesweep.mjs#L1443

Issue: The validation function for key-value sorting fails with RangeError: Invalid array length when sorting arrays larger than ~67 million elements (2^26).

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length#:~:text=Setting%20length%20to,a%20RangeError%20exception.

Image

Works fine for 2^25 elements:

Image

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start at onesweep.mjs around line 1443, where key-value sort validation is linked, and reproduce the failure with arrays larger than 2^26 elements, comparing it with the working 2^25 case. Done means validation completes for the larger input without RangeError while still checking the sort result.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.