Fix: unrecoverable WASM crash when loading large SPZ Gaussian splat datasets#13287
Fix: unrecoverable WASM crash when loading large SPZ Gaussian splat datasets#13287danielzhong wants to merge 4 commits intoDanielZ/Splat_FIX4from
Conversation
|
Thank you for the pull request, @danielzhong! ✅ We can confirm we have a CLA on file for you. |
|
It's good to see the reason for the issue being identified. I don't fully understand the 2.2 GB. With position, scale, opacity, rotation, and the 15*3 SH coefficients, that would be However, when you say
I wonder: Is it possible to ~"compile this with 64 bit address space"? Maybe something to raise as an issue in https://github.com/drumath2237/spz-loader ? The point is: Apparently, tools (including ion!) have already created data sets that cause this error. And I wonder whether it's possible to handle this on the client side. Otherwise, people would 1. have to wait until this is fixed, so that ion does no longer create data sets that cause this error, and 2. then have to re-tile their data... |
Math: On Memory64: |
This comment was marked as resolved.
This comment was marked as resolved.
|
I see the enhanced error message as described. (disregard my previous resolved comment as I was testing the wrong branch) My only questions:
|
The preflight is best effort. If the glTF JSON does not contain the metadata needed for the estimate, we skip the estimate rather than failing on the JSON itself. So this change should not introduce a new failure mode for incomplete/malformed glTF JSON. That said, if the required metadata is missing, we also cannot preflight the SPZ size, so in that case the loader falls back to the existing decode path. I added a lightweight unit test around the preflight estimate / early-failure path. I think that is the right level of coverage here, since the goal of this change is to verify our guard logic before invoking the WASM decoder, rather than exercising the full GLB loading path or the downstream SPZ library itself. |
Description
Loading SPZ Gaussian splat files with a high spherical harmonics degree (e.g. degree 3) and a large number of splats could cause the spz-loader WASM module to call
Aborted(), producing an unrecoverable crash and an unhelpful "Aborted(). Build with -sASSERTIONS for more info." error message. This occurred because the WASM module is compiled with a signed 32-bit address space, imposing a hard 2 GB memory ceiling.For example, a dataset of ~4.9 million splats at SH degree 3 requires approximately 2.2 GB to decode, exceeding that limit.
Changes:
glTF POSITIONaccessor's count field; SH degree is inferred from the highest numberedSH_DEGREE_nattribute in the primitive. The SPZ binary itself cannot be inspected directly because it is gzip compressed.Before:
After:
Issue number and link
#13283
Testing plan
Test data:
#13283
Author checklist
CONTRIBUTORS.mdCHANGES.mdwith a short summary of my change