Skip to content

v0.5.0: N-dimensional spatial canvas

Latest

Choose a tag to compare

@JacobFV JacobFV released this 05 Apr 15:02
· 32 commits to develop since this release

Arbitrary spatial dimensions — the canvas is no longer locked to 2D.

What's new

  • spatial_shape parameter: CanvasLayout, compile_schema, and compile_program all accept spatial_shape=(...) for 1D, 2D, 3D, or higher.
  • 1D time-series: Field(spatial_shape=(128,)) + compile_schema(..., spatial_shape=(200,))
  • 3D volumetric: Field(spatial_shape=(4, 4, 4)) + compile_schema(..., spatial_shape=(8, 8, 8))
  • N-D positional encoding: SinusoidalPositionalEncodingND splits d_model evenly across all dimensions.
  • N-D packing: 1D linear, 2D strip (unchanged), 3D+ stacked greedy.
  • N-D masks: Rect generalized to hyperrectangles, rect_cover works on any-dimensional boolean masks.
  • Schema format: Serializes spatial_shape list; reads old H/W format transparently.

Backward compatible

The old H=/W= API continues to work unchanged. All 478 existing tests pass without modification.

# All of these still work exactly as before:
CanvasLayout(T=5, H=8, W=8, d_model=256)
Field(12, 12)
compile_schema(Robot(), T=8, H=16, W=16, d_model=256)

529 tests passing (478 existing + 51 new)