Table of Contents

Struct SpatialGridOccupancy

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

A snapshot of the sparse spatial grid's occupancy and memory (#872 step 8). Obtained from GetSpatialGridOccupancy(); all-zero when no grid is configured.

public readonly struct SpatialGridOccupancy
Inherited Members

Remarks

A readonly struct with init-only members, matching SpatialMigrationTelemetry — its sibling snapshot in this namespace. A snapshot that its reader can mutate invites a caller to "fix up" a field and pass it on as if the engine had reported it.

Properties

BlockCellCapacity

Cells one block can hold: BlockDimX x BlockDimY x BlockDimZ.

public int BlockCellCapacity { get; init; }

Property Value

int

BlockCount

Allocated blocks — one per occupied block-sized region of the world.

public int BlockCount { get; init; }

Property Value

int

BlockDimX

Block extent on X, derived from the world as clamp(nextPow2(extentInCells), 1, 16).

public int BlockDimX { get; init; }

Property Value

int

BlockDimY

Block extent on Y.

public int BlockDimY { get; init; }

Property Value

int

BlockDimZ

Block extent on Z. 1 for a flat world.

public int BlockDimZ { get; init; }

Property Value

int

DenseEquivalentBytes

Bytes a dense grid over the same world would have held: 64 per cell the bounds imply, occupied or not.

public long DenseEquivalentBytes { get; init; }

Property Value

long

IntraBlockFill

Mean fraction of a block's index slots that name a live cell — OccupiedCellCount / (BlockCount * BlockCellCapacity). The measurement that decides whether the dense per-block index array is the right payload.

public double IntraBlockFill { get; init; }

Property Value

double

OccupiedCellCount

Cells that actually exist. A cell is created when something first occupies it and is never removed while the grid lives.

public int OccupiedCellCount { get; init; }

Property Value

int

ResidentBytes

Bytes the grid's block index arrays and cell chunks hold. Excludes the root map and the per-archetype cluster pools.

public long ResidentBytes { get; init; }

Property Value

long