You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of reviving the project, we're closing stale support questions and version-specific reports from older releases. A lot changed today: 2.17.0–2.19.2 shipped and are on npm (npm install gpu.js), installs work on modern Node, new GPU() works in current browsers, Apple Silicon precision issues are fixed, and CI now guards every change. If this is still relevant on gpu.js@2.19.2, please open a fresh issue with a repro — happy to help. (See #807 for the full status update.)
Fixed upstream in gpu-mock.js v1.4.0 — mode: 'dev' delegates kernels entirely to gpu-mock.js, whose mock loops assigned each thread's return value into a Float32Array slot, so array returns coerced to NaN. Array-returning kernels now yield a Float32Array per thread, matching the real backends. Verified against your exact repro through gpu.js dev mode: [[1,2,3],[1,2,3],[1,2,3],[1,2,3]].
One step remains before this closes: publishing gpu-mock.js@1.4.0 to npm (maintainer access being sorted, same story as gpu.js's was) and bumping the dependency here. Will update when it ships.
Shipped in 2.19.4, now on npm — npm install gpu.js@2.19.4.
The fix went upstream into gpu-mock.js 1.4.0 (which mode: 'dev' delegates to) and gpu.js now depends on that release rather than the fork it had been pinned to. Verified from a clean npm install of 2.19.4:
const{GPU}=require('gpu.js');constgpu=newGPU({mode: 'dev'});constkernel=gpu.createKernel(function(){return[1,2,3];},{output: [4]});kernel();// [[1,2,3], [1,2,3], [1,2,3], [1,2,3]] — was NaN throughout
Array returns now match the real backends in one, two and three dimensions, and number returns still come back as a flat Float32Array. test/features/dev-mode.js covers all of that plus explicit parity against cpu mode, so running return-arrays.js under dev — your original suggestion — would pass too.
Thanks for re-verifying this after the batch-close; both issues you asked to reopen turned out to be real, and this one reached further than gpu.js itself.
Activity
fuzzie360 commentedon Jul 22, 2026
As part of reviving the project, we're closing stale support questions and version-specific reports from older releases. A lot changed today: 2.17.0–2.19.2 shipped and are on npm (
npm install gpu.js), installs work on modern Node,new GPU()works in current browsers, Apple Silicon precision issues are fixed, and CI now guards every change. If this is still relevant on gpu.js@2.19.2, please open a fresh issue with a repro — happy to help. (See #807 for the full status update.)rotu commentedon Jul 23, 2026
@fuzzie360 This still fails in exactly the same way. Could you please reopen?
fuzzie360 commentedon Jul 24, 2026
Reopened — thanks for re-verifying on 2.19.2. Apologies for sweeping this up in the stale batch-close; it's back in the triaged bug queue.
fuzzie360 commentedon Jul 24, 2026
Fixed upstream in gpu-mock.js v1.4.0 —
mode: 'dev'delegates kernels entirely to gpu-mock.js, whose mock loops assigned each thread's return value into aFloat32Arrayslot, so array returns coerced toNaN. Array-returning kernels now yield aFloat32Arrayper thread, matching the real backends. Verified against your exact repro through gpu.js dev mode:[[1,2,3],[1,2,3],[1,2,3],[1,2,3]].One step remains before this closes: publishing gpu-mock.js@1.4.0 to npm (maintainer access being sorted, same story as gpu.js's was) and bumping the dependency here. Will update when it ships.
fix: Array-returning kernels in dev mode
fuzzie360 commentedon Jul 26, 2026
Shipped in 2.19.4, now on npm —
npm install gpu.js@2.19.4.The fix went upstream into gpu-mock.js 1.4.0 (which
mode: 'dev'delegates to) and gpu.js now depends on that release rather than the fork it had been pinned to. Verified from a cleannpm installof 2.19.4:Array returns now match the real backends in one, two and three dimensions, and number returns still come back as a flat
Float32Array.test/features/dev-mode.jscovers all of that plus explicit parity againstcpumode, so runningreturn-arrays.jsunder dev — your original suggestion — would pass too.Thanks for re-verifying this after the batch-close; both issues you asked to reopen turned out to be real, and this one reached further than gpu.js itself.