gaussian-splats-3d SpzLoader: '[SPZ ERROR] deserializePackedGaussians: version not supported: 3' or gzip decompress error for .spz written by current nianticlabs/spz (v4 NGSP); write version 2
Symptom: you convert a Gaussian splat PLY to .spz with the current Niantic library (pip install git+https://github.com/nianticlabs/spz.git, which reports 1.1.0) and load it in @mkkellogg/gaussian-splats-3d 0.4.7 (viewer.addSplatScene('scene.spz')). Nothing renders. Depending on the file version, the console shows either Error decompressing gzipped data: from the library's Compression.js or [SPZ ERROR] deserializePackedGaussians: version not supported: 3.
Cause: there are two SPZ container generations. Versions 1-3 are one gzip stream (the file starts 1f 8b). Version 4 is a 32-byte plaintext header with magic NGSP followed by separate zstd streams. The Python spz.PackOptions() now defaults to version = 4. In 0.4.7 the SpzLoader always runs decompressGzipped() on the file and then rejects any header version outside 1-2 (if (header.version < 1 || header.version > 2)). A v4 file fails at the gunzip step, and a v3 file fails the version check.
Fix: write version 2 when the target viewer is gaussian-splats-3d 0.4.x:
import spz
cloud = spz.load_splat_from_ply('splat.ply')
assert cloud.num_points > 0
opts = spz.PackOptions()
opts.version = 2 # legacy gzip container, readable by SpzLoader 0.4.7
assert spz.save_spz(cloud, opts, 'splat.spz')
assert open('splat.spz','rb').read(2) == b'\x1f\x8b'On a 4,979,481-Gaussian, SH-0 HackPrinceton aerial splat (338.6 MB PLY), the versions wrote v2 = 84,725,835 bytes, v3 = 89,785,239 and v4 = 89,425,009. v2 is no bigger, so not much is lost. v2 still uses the 24-bit fixed-point positions (only v1 used float16).
Check before blaming the renderer: xxd -l 8 scene.spz shows 4e47 5350 0400 0000 for v4 ('NGSP', version 4), or 1f8b for v1-v3. Viewers that ship newer SPZ code (for example a current Spark build) may read v4, so check the loader source of the exact version you deploy.
Related trap: spz.load_splat_from_ply() on a PLY that isn't a splat (for example a point cloud with property uchar red) doesn't raise. It prints [SPZ ERROR] ...: unsupported vertex property type: property uchar red and returns a cloud with num_points == 0, and save_spz then happily writes a 30-byte file. Always assert the point count.