splat-transform
splat-transform usage, task parameters, and output formats.
Background
splat-transform processes 3DGS assets for Aholo Viewer, including format conversion, data selection and modification, LOD generation, and voxel colliders. The npm CLI translates commands into JSON pipelines executed by a standalone C++ process.
Environment Requirements
- Node.js >= 22.22.1 for the npm CLI and JavaScript API. The standalone executable does not require Node.js.
- Windows: Windows 22H2+, x86_64 or ARM64.
- Linux: x86_64 or ARM64, Ubuntu 22.04 / glibc >= 2.35; the C++ runtime is linked statically.
- macOS: macOS 13+, Apple silicon ARM64.
- GPU acceleration requires a Vulkan 1.2+ loader, a Vulkan 1.2+ compute device, and the
timelineSemaphorefeature. macOS also requires MoltenVK supporting these requirements. Initialization checks and enables the feature. Packages do not include a Vulkan runtime or drivers.
SOG output with SH coefficients uses GPU clustering and reports an error if device initialization fails. SH0 SOG encoding runs on CPU. Other format conversion and LOD processing do not require Vulkan. See Voxel for backend selection and fallback behavior.
Run splat-transform list:gpu to list Vulkan devices. Enumeration does not check compute queues or timelineSemaphore support, so a listed device may not meet GPU task requirements. The former Dawn backend could include D3D12 devices, so check saved GPU indices when migrating.
Format Notes
Input Formats
| Format | Description |
|---|---|
ply, compressed.ply |
Standard PLY and SuperSplat compressed PLY. |
splat, ksplat |
SPLAT and KSPLAT, including multi-section KSPLAT files. |
spz, uspz |
SPZ and SPZ without gzip compression. |
sog, meta.json |
A SOG archive or unpacked SOG metadata. |
esz |
ESZ v2 with low- or high-precision layouts. |
lcc, lcc2 |
Pass the metadata file; LCC2 reads LOD0 and environment splats. |
zip |
A ZIP containing LCC, LCC2, or SOG resources; not a generic batch input for arbitrary splat files. |
Unpacked SOG/LCC/LCC2 companion resources resolve relative to their metadata file. ZIP resources resolve relative to the metadata path inside the archive, including nested directories. Pipeline tasks resolve filesystem paths using the top-level base field.
Output Formats
| Format | Description |
|---|---|
ply, splat |
Standard PLY and SPLAT. |
spz, uspz |
SPZ v3/v4 and SPZ v3 without gzip compression; configure the version in Write. |
sog |
SOG; SH coefficients require GPU clustering. |
esz |
ESZ v2; highPrecision selects the layout. Recommended for chunk LOD. |
| LOD / split directories | Created by AutoChunkLod or Split, then saved with Write. |
| Voxel directories | Written directly by Voxel, with metadata, binary data, and an optional collision GLB. |
Installation and CLI
npm install @manycore/aholo-splat-transform -g
splat-transform create input.ply output.esz
splat-transform lod:loading --ratio 0.1 input.ply loading.ply
splat-transform lod:flex --score scores.bin --ratio 0.3 input.ply selected.esz
splat-transform lod:auto --ratio 0.3 input.ply simplified.esz
splat-transform lod:auto-chunk --type esz --max-chunk-counts 400000 input.ply lod-output
splat-transform split --type esz --max-chunk-counts 400000 input.ply split-output
splat-transform list:gpu
splat-transform pipeline.json
| Command | Tasks and options |
|---|---|
create |
Read → Modify → Write for format conversion. |
lod:loading |
SkeletonLod; optional --ratio. |
lod:flex |
FlexLod; required --score, optional --ratio. |
lod:auto |
AutoLod; optional --ratio and --split-normal. |
lod:auto-chunk |
AutoChunkLod; required --type, optional --max-chunk-counts and --split-normal. |
split |
Split; required --type, optional --max-chunk-counts and --split-normal. |
list:gpu |
Lists Vulkan device indices and names. |
--type / -t accepts ply, spz, splat, sog, or esz. --split-normal accepts case-insensitive None, X, Y, or Z, or the corresponding numbers 0, 1, 2, or 3. A reference axis keeps blocks unsplit along that axis; for example, Y preserves the vertical extent. Use a pipeline for additional parameters. Inspect individual command help with commands such as splat-transform lod:flex --help.
Both the npm CLI and the standalone executable accept a pipeline file or - for stdin. The standalone executable exposes pipeline execution, --list-gpu, --help, and --version; the command aliases above belong to the npm CLI.
Get-Content -Raw pipeline.json | splat-transform -
Pipeline Structure and Resource Lifetime
{
"version": 2,
"base": "pipelineDir",
"gpu": 0,
"tasks": [
{ "id": "read", "type": "Read", "config": { "inputs": ["input.ply"], "output": "source" } },
{
"id": "lod",
"type": "AutoChunkLod",
"config": { "input": "source", "output": "lod", "type": "esz" },
"release": ["source"]
},
{ "id": "write", "type": "Write", "config": { "input": "lod", "output": "lod-output" }, "release": ["lod"] }
]
}
| Field | Type / default | Description |
|---|---|---|
version |
1 or 2 |
Required. Use 2 for new configurations. |
base |
"pipelineDir" or "workDir" |
Base for relative paths. Defaults to pipelineDir for V2 files and workDir for stdin. Other strings produce one warning and fall back to pipelineDir. |
gpu |
number / 0 |
Device index from list:gpu or enumerateAdapters(), used when GPU work starts. |
cpuWorkers |
positive integer / automatic | Global CPU pool worker count; capped at hardware concurrency minus one, with a minimum of one. |
tasks |
PipelineTask[] |
Executed in array order. A failed task stops subsequent execution. |
tasks[].id |
string |
Task log identifier, required by the TypeScript interface. |
tasks[].type |
string |
A case-sensitive task name listed below. |
tasks[].config |
object |
Parameters for that task. |
tasks[].release |
string[] / [] |
Resource keys removed after the current task succeeds. |
cpuWorkers is optional and configured before tasks run. The pool is still created on first use and shared by LOD, clustering updates, file output, CPU voxel jobs, and gzip. Explicit values are capped at max(1, std::thread::hardware_concurrency() - 1), using logical hardware threads; a reported concurrency of 28 allows at most 27 workers. Omitting the field preserves the existing default: half the next power of two of hardware concurrency, clamped to 1–16. The startup log reports the effective count. Zero, negative, fractional, and non-integer values report an error. zstd uses a separate pool initialized with the same worker count.
GPU tasks in one pipeline reuse the selected device context. It is initialized when GPU computation is first needed and released when the pipeline ends. SOG clustering and Voxel reuse working buffers during their respective computations and release them afterward. Each run() starts a separate native process; device contexts and working caches are not shared across calls.
Read.inputs, Write.output, Voxel.output, Modify.modifyPaths, Select.indicesPath, and the FlexLod fields scorePath and originalIndices all use base to resolve relative paths. Absolute paths are used directly. Read.output, processing-task inputs and outputs, and release refer to in-memory resource keys and match literally.
The ${pipelineDir} and ${workDir} path placeholders are supported only in V2. They refer to the directory containing the pipeline file and the process working directory, respectively. For example, "inputs": ["${pipelineDir}/data/input.ply"] reads from beside the config and "output": "${workDir}/out/result.ply" writes under the working directory. When the config arrives on stdin through - or JavaScript run(), both variables refer to the child process working directory. Pass run(config, { cwd }) to set it.
Reusing an output key replaces that resource. Modify mutates its input; a different output key remains an alias. Use Select or ExtractLodLevel to create an independent copy before modifying shared data. Write reads the in-memory resource but writes or replaces files on disk. Release a resource only after its final consumer, and do not release an output key needed by subsequent tasks.
Information, progress, and timing logs go to stdout; warnings and errors go to stderr. The standalone executable exits with 0 on success, 1 for pipeline/I/O failures, and 2 for command-line argument errors. Failures do not roll back earlier filesystem output.
Task Reference
Except for path fields in Read, Write, and Voxel, task input and output fields are required in-memory resource keys.
Read
Reads and combines multiple inputs while retaining input-block order for Modify.modifyPaths.
| Parameter | Type / default | Description |
|---|---|---|
inputs |
string[], required |
Input file paths. |
output |
string, required |
Output resource key. |
maxShDegree |
0 | 1 | 2 | 3 / 3 |
Maximum retained SH degree; does not create missing bands. |
Write
Writes a single splat to a file or a LOD / split bundle to a directory. The output extension or bundle filenames determine the format.
| Parameter | Type / default | Description |
|---|---|---|
input |
string, required |
Input resource key. |
output |
string, required |
Single-file path or bundle output directory. |
enableMortonSort |
boolean / true |
Applies Morton ordering for output; disabled for bundle files that must preserve interval order. |
version |
number / format default |
SOG supports 2 and 3, defaulting to 2; SPZ supports 3 and 4, defaulting to 3. Unsupported versions fall back to the format default. .uspz always writes uncompressed v3. |
compressLevel |
number / 6 |
SPZ only: v3 uses gzip (typically 0–9); v4 uses zstd and follows its level range. |
paletteSize |
number / 0 |
Omit or set to 0 to size the SOG SH palette by colorError. A positive integer selects fixed-size Lloyd clustering, clamped to the point count and the version limit (65536 for v2, 262144 for v3). |
colorError |
number / 5 |
Weighted e-means target for SH RMS colour error in 8-bit levels. Lower values are stricter. Nonfinite and nonpositive numbers use 5. |
highPrecision |
boolean / false |
ESZ only: false selects low precision, true selects high precision. |
shBits |
Array / [5, 4, 4] |
Integer bit counts for SH degrees 1, 2 and 3. SPZ, USPZ and low-precision ESZ clamp each entry to 1–8. High-precision ESZ uses fixed 11/10/11-bit RGB for every degree. |
Starting with 2.1.2, the default compression level is 6 for both SPZ v3 and v4. Version 2.1.1 uses 6 for v3 and 7 for v4. Set compressLevel: 7 explicitly to retain the SPZ v4 level used by 2.1.1.
SOG input supports v1/v2/v3. Output defaults to v2; set version: 3 to enable v3. V3 stores exp-map rotations in the RGB channels of a separate quats.webp texture, uses square-root opacity encoding up to 1.5625, and supports 24-bit SH labels. SH remains limited to degree 3. Optional blind data, extras, and comments are not retained. SOG v2 clamps opacity to 1.
Set "colorError": 4 in a Write task’s config to target four 8-bit colour levels. The error can exceed the target at the version limit. When SH data exceeds the 2 GiB search budget or the device’s label buffer limit, automatic mode uses the point count rounded down to a power of two, capped at 65536 entries.
Concurrent CPU bundle file writes are limited by top-level pipeline cpuWorkers; the former parallelCounts option is no longer used. Files requiring GPU processing are written sequentially. CPU texture encoding within a SOG file still uses the shared pool.
Directory replacement: writing a bundle recursively removes an existing output directory before recreating it. Use a dedicated output directory. The writer rejects filesystem roots, the working directory, and the directory containing the pipeline file. Single-file output overwrites an existing file.
Write the same LOD bundle to two directories with highPrecision: false and true. Writes do not consume or modify the in-memory resource and preserve LOD file/offset/count intervals.
Modify
| Parameter | Type / default | Description |
|---|---|---|
input, output |
string, required |
Input and output keys; the output aliases the modified input. |
modifyPaths |
string[] / [] |
Patch JSON files in input-block order; an empty string skips that block. |
rgba |
[number, number, number, number] / { r?, g?, b?, a? } / unchanged |
Internal float RGBA values; only finite non-negative channels are written, without clamping or color-space conversion. |
maxShDegree |
0 | 1 | 2 | 3 / unchanged |
Truncates to the smaller of the current and requested degree. |
Reads rgba and validates maxShDegree, applies patch transforms and deletions, then sets RGBA and truncates SH on the remaining points. rgba accepts [r, g, b, a] or an object with optional r, g, b, and a channels: omitted channels keep their current values; negative and non-finite values are not written, and unknown object fields are ignored; arrays must contain exactly four entries, and other forms or channel values that cannot be read as numbers (for example strings or null) fail the task. Patch files use this structure:
interface ModifyPatch {
isRowMatrix?: boolean; // Defaults to true; matrices contain 16 numbers.
transform?: number[]; // Input-block transform, defaults to identity.
deletedIndices?: number[]; // Byte bitmap: point i uses bit (i & 7) in byte[i >> 3].
indicesTransform?: Array<{ indices: number[]; transform: number[] }>;
}
Patch indices are local to the corresponding input block. deletedIndices is a bitmap, not a list of point indices.
Filter
Select Gaussians from a plain splat resource by center position or voxel occupancy. Both input and output are resource keys. Selected Gaussians retain their original order, attributes, and SH coefficients for subsequent Write or LOD tasks.
mode |
Configuration | Selection |
|---|---|---|
0 / box |
box: { min: [x,y,z], max: [x,y,z] } |
Keep centers inside the axis-aligned box, including its boundary. |
1 / sphere |
sphere: { center: [x,y,z], radius } |
Keep centers strictly within the radius. |
2 / cluster |
cluster?: { voxelResolution, opacityCutoff, minContribution }, defaults 1, 0.999, 0.1 |
Find the occupied component nearest the origin. Keep Gaussians centered in it or contributing sufficiently to it. |
3 / floaters |
floaters?: { voxelResolution, opacityCutoff, minContribution }, defaults 0.05, 0.1, 0.004 |
Keep centers in occupied voxels. Other Gaussians must contribute at least minContribution at one occupied voxel center. |
Use Filter as the task name. TypeScript accepts FilterMode enum values, numbers, lowercase names, or enum member names such as Cluster. Native JSON accepts case-insensitive mode names. Box and Sphere pass their input through when required fields are missing. Cluster and Floaters accept an omitted options object or omitted individual fields.
voxelResolution sets voxel edge length in input units. opacityCutoff sets the occupancy threshold and minContribution controls per-Gaussian selection. The task searches the input and its ancestors for a grid with the same occupancy threshold. It prefers the requested edge length, then the closest finer grid. Both modes can use it. A finer grid is queried at its actual resolution, so occupancy boundaries or connected components can differ from a fresh grid at the requested resolution. Rereading the same files with changed geometry or opacity starts a new grid lineage. Filtering the full input requires a grid built from all its Gaussians and covering its extents. On a cache miss, Filter automatically builds occupancy from the current input. Automatic grid generation prefers an available GPU and falls back to CPU when a GPU is unavailable or device initialization fails. A cache hit runs Gaussian selection on the CPU. An explicit Voxel task can supply its occupancy grid before collision cleanup and navigation. Only an explicit Voxel task writes collision files.
With default options, consecutive Cluster and Floaters tasks build separate grids. If a preceding Voxel task cached both its coarse prefilter grid and its main grid over the complete input, each Filter can reuse its corresponding grid. Reusable sparse grids stay in CPU memory for the lifetime of the native pipeline process. Their memory usage is additive.
[
{
"id": "scene",
"type": "Filter",
"config": {
"input": "source",
"output": "scene",
"mode": "cluster",
"cluster": { "voxelResolution": 0.1, "opacityCutoff": 0.5 }
}
},
{
"id": "clean",
"type": "Filter",
"config": {
"input": "scene",
"output": "clean",
"mode": "floaters",
"floaters": { "voxelResolution": 0.1, "opacityCutoff": 0.5 }
}
}
]
Select
| Parameter | Type | Description |
|---|---|---|
input, output |
string, required |
Copies into an independent single-block splat resource. |
indices |
number[] |
Specify exactly one of this field or indicesPath. |
indicesPath |
string |
.json accepts an array or { "indices": [...] }; other files contain little-endian uint32 values, with zstd decompression for .zst. |
Preserves first-occurrence order and removes duplicates, for example [8,2,8,5] → [8,2,5]. Copies complete attributes and SH without Morton sorting. Indices must be valid integers, and binary lengths must be multiples of four. Empty selection is valid; output-format support determines whether an empty result can be written.
ReplaceAppend
| Parameter | Type | Description |
|---|---|---|
input, patch, output |
string, required |
Source, patch, and independent output resource keys. |
sourceIndices |
number[], required |
Unique source indices; may be empty. |
For N source points, M patch points, and K indices, the patch prefix replaces the selected source points and the remainder is appended. The result contains N+M−K points and requires K≤M. Source and patch SH degrees and attribute layouts must match. Inputs and their aliases remain unchanged.
ExtractLodLevel
| Parameter | Type | Description |
|---|---|---|
input, output |
string, required |
An in-memory LOD bundle from this pipeline and an independent output resource. |
level |
number, required |
Zero-based level below the bundle’s level count; there is no default level. |
Copies file/offset/count intervals in tree order, retaining repeated references, complete attributes, and independent SH storage. Does not restore a bundle from an on-disk lod-meta.json or regenerate LOD.
SkeletonLod
Generates coarse SH0 data for loading previews.
| Parameter | Type / default | Description |
|---|---|---|
input, output |
string, required |
Input and output resource keys. |
ratio |
number / 0.1 |
Target retained ratio. |
counts |
number / 85000 |
Target point-count limit. |
The target count is min(ceil(input count × ratio), counts). Actual output may contain fewer points. The CLI command is lod:loading.
FlexLod
Selects points by external scores while retaining their original attributes.
| Parameter | Type / default | Description |
|---|---|---|
input, output |
string, required |
Input and output resource keys. |
scorePath |
string, required |
Little-endian float32 binary file with at least one score per input point, in input order. |
ratio |
number / 0.3 |
Target retained ratio. |
counts |
number / unlimited |
Limits the target count together with ratio. |
originalIndices |
string / not written |
Optional output path for retained source indices as little-endian uint32. |
Selects the highest-scoring min(ceil(input count × ratio), counts) points. Equal scores retain input order; the final selection is sorted by source index. The CLI command is lod:flex --score scores.bin.
AutoLod
Fuses Gaussians to generate simplified data.
| Parameter | Type / default | Description |
|---|---|---|
input, output |
string, required |
Input and output resource keys. |
ratio |
number / 0.3 |
Target retained ratio, normally 0–1. |
counts |
number / unlimited |
Limits the target count together with ratio. |
splitNormal |
None/X/Y/Z or 0/1/2/3 / None |
Block reference axis; strings are case-insensitive. |
The target count is min(ceil(input count × ratio), counts). Small-block stopping conditions and iteration limits can leave more points than requested. The CLI command is lod:auto.
AutoChunkLod
Generates a multi-level bundle containing lod-meta.json; save it with Write. See Chunk LOD for runtime integration.
| Parameter | Type / default | Description |
|---|---|---|
input, output |
string, required |
Input and output bundle resource keys. |
type |
string, required |
Chunk format; esz is recommended. |
maxChunkCounts |
number / 400000 |
Controls initial block size and must be positive; merged level files can be larger. |
splitNormal |
None/X/Y/Z or 0/1/2/3 / None |
Block reference axis. |
levels |
ChunkLevel[] / below |
A custom array replaces the complete default array. |
[
{ "precision": 1.0, "scaleBoost": 1 },
{ "precision": 0.5, "scaleBoost": 1 },
{ "precision": 0.25, "scaleBoost": 1 },
{ "precision": 0.05, "scaleBoost": 1.01, "merged": true, "permanent": true },
{ "precision": 0.01, "scaleBoost": 1.02, "merged": true, "permanent": true }
]
| Level field | Default | Description |
|---|---|---|
precision |
Required | Target retained ratio relative to the original data. Level 0 retains the source and should use 1; subsequent levels decrease. |
scaleBoost |
1 |
Gaussian scale multiplier after simplification, used to reduce gaps in coarse levels. |
merged |
false |
Combines blocks from this level not already assigned to output files, preserving interval order. |
permanent |
false |
Adds files referenced by this level to permanentFiles for runtime residency. |
Omitting merged / permanent in a custom array means false; it does not inherit true from the last two default levels. Voxel output associated with the same source automatically adds relative voxels paths to LOD metadata, whether Voxel runs before or after the LOD writes.
Split
Splits data without generating multiple LOD levels or lod-meta.json. The output bundle contains files such as block_0.<type> and is saved to a directory by Write.
The JavaScript and TypeScript interfaces use Split. The native C++ pipeline loader also accepts the legacy name SplitSplatTask.
| Parameter | Type / default | Description |
|---|---|---|
input, output |
string, required |
Input and output bundle resource keys. |
type |
string, required |
Block format; esz is recommended. |
maxChunkCounts |
number / 400000 |
Controls block size and must be positive. |
splitNormal |
None/X/Y/Z or 0/1/2/3 / None |
Block reference axis. |
Voxel
Writes a voxel directory directly from a splat resource; no subsequent Write is needed. See Physics Collision for the file format.
| Parameter | Type / default | Description |
|---|---|---|
input |
string, required |
Input splat resource key. |
output |
string, required |
Voxel output directory. |
voxelResolution |
number / 0.05 |
Finite positive voxel edge length, in input-coordinate units. |
opacityCutoff |
number / 0.1 |
Occupancy threshold in 0–1; higher values remove more low-density regions. |
backend |
gpu | cpu / gpu |
Compute backend; see fallback rules below. |
box |
{ minCorner: [x,y,z], maxCorner: [x,y,z] } |
Defaults to [-100,-100,-100] through [100,100,100]; limits the generated region. |
filterCluster |
boolean | object / true |
Prefilters a primary connected region; false disables it. Object fields are listed below. |
autoDenseBox |
boolean | object / true |
Attempts to tighten bounds inflated by scale outliers. |
compression |
none | gzip | zstd / none |
Binary compression; produces .bin, .bin.gz, or .bin.zst. |
nodeEncoding |
raw | compact / raw |
Octree node encoding; compact data must be decoded to the runtime node layout. |
collisionMesh |
boolean | smooth | faces / false |
true means smooth; faces emits voxel surfaces, while smooth uses marching cubes and merges coplanar triangles. |
floorFill |
boolean / false |
Fills upward from the bottom of the grid to the floor. |
floorFillDilation |
number / 0 |
Nonnegative horizontal dilation distance for floorFill. |
navExteriorRadius |
number / 0 |
Nonnegative exterior-fill dilation distance; requires navSeed. |
navSeed |
{ x, y, z } / unset |
Navigation seed in scene coordinates for exterior fill and capsule navigation. |
navCapsule |
{ height, radius } / unset |
Enables capsule navigation when height > 0 and navSeed is set; radius must be nonnegative. |
GPU is preferred by default. Each Voxel task initializes or reuses the pipeline’s Vulkan device when resolving its backend. If the device does not meet the environment requirements or initialization fails, it logs a warning and selects CPU for the complete task, including cluster filtering, main generation, and navigation. Explicit backend: "cpu" never attempts Vulkan initialization. Once selected, the backend stays fixed: GPU compute errors propagate, and empty results do not trigger CPU retries. Invalid parameters or files and CPU processing failures still report errors. The process-wide pool manages worker counts; the former cpuWorkerCount option is no longer used.
filterCluster object fields:
| Field | Default | Description |
|---|---|---|
voxelResolution |
1 |
Prefilter grid voxel edge length. |
opacityCutoff |
0.999 |
Prefilter occupancy threshold. |
minContribution |
0.1 |
Minimum Gaussian contribution to the selected connected region. |
seed |
{ x: 0, y: 0, z: 0 } |
Connected-region seed. If omitted and too few points remain, other large connected regions are considered. Explicit seeds disable that search. |
autoDenseBox object fields:
| Field | Default | Description |
|---|---|---|
targetCenterKeepRatio |
0.98 |
Target center retention when estimating dense bounds. |
minimumCenterKeepRatio |
0.95 |
Minimum center retention required to accept tighter bounds. |
minimumAxisInflation |
1.5 |
Axis inflation threshold for Gaussian bounds relative to center bounds. |
minimumVolumeInflation |
4 |
Volume inflation threshold; reaching either inflation threshold triggers an attempt. |
When grid or octree indices exceed capacity, generation may retry with a larger voxel edge length. Use voxel-meta.json.voxelResolution as the effective value. Voxel creates its directory and overwrites matching files without clearing the directory; use metadata files after changing compression. No collision.glb is written when the generated mesh has no triangles.
Pipeline Examples
Merge and Modify
{
"version": 2,
"tasks": [
{ "id": "read", "type": "Read", "config": { "inputs": ["a.ply", "b.ply"], "output": "source" } },
{
"id": "modify",
"type": "Modify",
"config": { "input": "source", "output": "source", "modifyPaths": ["a.json", "b.json"] }
},
{
"id": "write",
"type": "Write",
"config": { "input": "source", "output": "combined.esz" },
"release": ["source"]
}
]
}
Shared LOD, Interaction Data, and Voxels
Retain the source while creating a LOD bundle. Extract level 3 and modify only that copy. Low- and high-precision LOD outputs share the bundle. The final voxel task associates its output with metadata in both LOD directories.
{
"version": 2,
"tasks": [
{ "id": "read", "type": "Read", "config": { "inputs": ["input.ply"], "output": "source" } },
{ "id": "lod", "type": "AutoChunkLod", "config": { "input": "source", "output": "lod", "type": "esz" } },
{
"id": "extract",
"type": "ExtractLodLevel",
"config": { "input": "lod", "output": "interaction", "level": 3 }
},
{
"id": "modify",
"type": "Modify",
"config": { "input": "interaction", "output": "interaction", "rgba": [0, 0, 0, 1], "maxShDegree": 0 }
},
{
"id": "interaction",
"type": "Write",
"config": { "input": "interaction", "output": "interaction.esz" },
"release": ["interaction"]
},
{ "id": "low", "type": "Write", "config": { "input": "lod", "output": "lod-low", "highPrecision": false } },
{
"id": "high",
"type": "Write",
"config": { "input": "lod", "output": "lod-high", "highPrecision": true },
"release": ["lod"]
},
{
"id": "voxel",
"type": "Voxel",
"config": {
"input": "source",
"output": "voxel-output",
"backend": "cpu",
"voxelResolution": 0.05,
"compression": "gzip",
"nodeEncoding": "raw",
"collisionMesh": "smooth"
},
"release": ["source"]
}
]
}
Select and Replace
{
"version": 2,
"tasks": [
{ "id": "read", "type": "Read", "config": { "inputs": ["input.ply"], "output": "source" } },
{ "id": "select", "type": "Select", "config": { "input": "source", "output": "patch", "indices": [0] } },
{ "id": "modify", "type": "Modify", "config": { "input": "patch", "output": "patch", "rgba": [0, 0, 0, 1] } },
{
"id": "replace",
"type": "ReplaceAppend",
"config": { "input": "source", "patch": "patch", "output": "result", "sourceIndices": [0] },
"release": ["source", "patch"]
},
{
"id": "write",
"type": "Write",
"config": { "input": "result", "output": "result.esz" },
"release": ["result"]
}
]
}
This example requires at least one input point. The patch retains its SH degree because ReplaceAppend rejects mismatched source and patch degrees.
JavaScript API
import { run, PipelineError } from '@manycore/aholo-splat-transform';
const controller = new AbortController();
// Call controller.abort() when the caller requests cancellation.
try {
await run(
{
version: 2,
tasks: [
{ id: 'read', type: 'Read', config: { inputs: ['input.ply'], output: 'source' } },
{ id: 'write', type: 'Write', config: { input: 'source', output: 'output.esz' }, release: ['source'] },
],
},
{ cwd: process.cwd(), signal: controller.signal },
);
} catch (error) {
if (error instanceof PipelineError) {
console.error('Pipeline failed:', error.exitCode, error.signal);
} else if (error instanceof Error && error.name === 'AbortError') {
console.error('Pipeline cancelled');
}
throw error;
}
run() returns Promise<void>. enumerateAdapters({ cwd, signal }) returns DeviceInfo[] with index, name, numeric enum api, raw numeric apiVersion, vendorId, deviceId, and uuid. Indices start at zero and increase across APIs; the same hardware exposed through different APIs retains separate indices, which belong to the current enumeration order. Only Vulkan is implemented, with ApiType.Vulkan = 0 matching the native enum. apiVersion preserves the device-reported API version encoding for JavaScript to decode according to api; list:gpu displays the API name and decoded version. The former backend string is replaced by api, while apiVersion remains a raw number. Enumeration itself requires a Vulkan 1.2+ loader; compute capabilities are checked when a GPU task initializes the device.
PipelineError represents a nonzero child exit or termination signal. Process-start failures and AbortSignal cancellation can reject with a regular Error / AbortError. SIGINT and SIGTERM are forwarded to the child. Use resolveExecutable() to locate the native executable or set SPLAT_TRANSFORM_EXECUTABLE to an absolute local build path. If a platform executable is missing, check that npm optional dependencies are enabled.
The package exports the runtime ApiType and FilterMode enums and the types DeviceInfo, PipelineConfig, PipelineTask, TaskType, RunOptions, FilterConfig, ModifyConfig, SelectConfig, ReplaceAppendConfig, ExtractLodLevelConfig, and VoxelConfig. PipelineTask.config remains Record<string, unknown>; use the reference above for complete parameters.
Migration and Resource Guidance
Migrate a V1 pipeline to V2
- Set the top-level
versionto2. If an existing script relies on its working directory, also set"base": "workDir"to keep its relative paths pointing to the same files. - To run the file from any directory, omit
baseor set"base": "pipelineDir"and express relative paths from the config directory. For example, if you ranjobs/pipeline.jsonfrom the project root and readdata/a.ply, use../data/a.plyin the V2 file. To keep a single output under the launch directory, use${workDir}/out/a.ply. - For stdin or
run(), changing the version alone preserves the working directory as the default. To choose a directory, launch the process there or passrun(config, { cwd }).
An integer version other than 1 or 2 produces one warning on stderr, then processing continues as V2.
JavaScript API and resources
Version 2.0 of the npm package removed in-memory APIs such as SplatData, injectCustomTask, and deep module imports. The CLI and run() execute V2 pipelines in the native child process.
- Use
eszfor chunk LOD: settype: "esz"in a pipeline or pass--type eszto the CLI. - SOG clustering batches work according to the available Vulkan memory budget and device limits. It caches input that fits, reuses working buffers across iterations, and streams the remaining input. There is no universal 10 GB requirement; transfer staging and driver allocations consume additional resources, and insufficient working-buffer memory still causes an error. Random clustering can produce different results across repeated SOG exports.
- Voxel reuses working buffers for filtering, generation, and navigation within one task and releases them when the task ends. Large grids are split according to device storage and dispatch limits. A larger voxel edge length reduces grid size.
- Large LOD and voxel jobs require sufficient system memory. Release resources after their final consumer, control concurrent CPU writes with
cpuWorkers, and tune chunk sizes and voxel resolution for the scene.releaseremoves pipeline resource keys; data still shared by another key remains alive. - CPU and GPU voxel occupancy can differ near thresholds. Selecting CPU after device initialization fails allows generation without an available GPU, but does not guarantee bit-identical results across backends.