-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cwise-compiler >1.1.0] cwise: Arrays do not all have the same shape (ao 34**3 but array 36**3) #11
Comments
Reproduced with isolated voxel-example: https://github.com/deathcap/voxel-example/tree/5e8ed535f8418e816001c8f14d4f3dcb858360aa previously was using cwise 1.0.4 circa 2014, https://github.com/scijs/cwise/commits/master - https://github.com/scijs/cwise#notes documents "All input arrays must have the same shape. If not, then the library will throw an error". Exception is thrown in generated code: https://github.com/scijs/cwise-compiler/blob/master/lib/thunk.js#L61 code.push("if (!(" + shapeConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same shape!')") this is a recent message, changed in scijs/cwise-compiler@8f881ce from "Generic arrays not supported in combination with blocks" which was added Jun 20th 2015 in scijs/cwise-compiler@77fc925 "Implemented array shape equality test.". Using cwise-compiler 1.0.0, also 1.1.0 does not have this check, but 1.1.2 does. |
Pinning cwise-compiler to 1.0.0 (package.json: "cwise-compiler": "1.0.0" — instead of "^1.0.0") gets past this error, but then the same problem occurs in ops.assign() in voxel-mesher splitVoxelArray(). ndarray-ops 1.2.2, but then ndarray-fill 1.0.1 depends on cwise-compiler, rolling back to ^0.1.0 hits the esprima-six unpublishing issue (voxel/voxelmetaverse#60)
|
Versions after 1.1.0 added array shape equality test: scijs/cwise-compiler@77fc925 which fails in voxel-mesher because of chunk padding (34**3 vs 36**3). Stay on the older version for now, until #11
cwise-compiler 1.1.0 is compatible, sticking on it for now (voxel-mesher 0.14.3 bugfix release), but may want to revisit to upgrade to a newer version. The problem is voxel-mesher relies on unequal array sizes in order to add padding between the chunks, maybe could instead use .subarray() to get an equally-sized ndarray before passing to cwise. @jaspervdg any possibility the check added in scijs/cwise-compiler@77fc925 could be made optional? |
voxel/voxel-mesher#11 cwise: Arrays do not all have the same shape voxel/voxel-shader#10 Broken dependency: glslify (esprima-six unpublished) voxel/voxel-shader#11 gl-shader: Error compling vertex shader: ERROR: 0:18: '=' : global variable initializers must be constant expressions Note that semver would have pulled in the voxel-mesher fix (^0.14.0 matches 0.14.3), but since these fixes are all very important (either cannot run on modern browsers or build in development environment, due to unpublished dependency), making the requirements explicit.
on vmv with dev versions of voxel-decals, voxel-engine-stackgl, voxel-webview.
ao0, ao1, ao2 are all
Int32Array[39304]
(34^3 = 39304, chunk size 32x32x32 + 2 for padding) butarray
isUint16Array[46656]
(36^3 = 46656), passed in from:The text was updated successfully, but these errors were encountered: