Skip to main content

Module brick3d

Module brick3d 

Source
Expand description

3D Volumetric Bricks and Spatial Indexing for M64 Matter Containers.

Provides 3D Hilbert curve spatial addressing for macro-level chunk clustering and 3D Morton (Z-order) bit-interleaving for intra-brick 16×16×16 (4,096-voxel) cache locality in L1/L2 caches.

Constants§

M64_BRICK3D_BYTES
Total byte size of one 16×16×16 brick payload (256 KB = 262,144 bytes).
M64_BRICK3D_RECORDS
Total number of 64-byte records in one 16×16×16 brick (4,096 records).
M64_BRICK3D_SIDE
Side dimension of an M64 3D volumetric brick (16 voxels along each axis).

Functions§

brick_voxel_coords
Computes local 3D coordinates (lx, ly, lz) from an intra-brick linear index 0..4096.
brick_voxel_linear_index
Computes the linear 1D index 0..4096 of a voxel inside a 16×16×16 brick.
decode_hilbert3d_u64
Decode a 64-bit Hilbert index back to 3D brick coordinates (bx, by, bz).
encode_hilbert3d_u64
Encode 3D brick coordinates (bx, by, bz) to a 64-bit Hilbert index.