Skip to content

v3.4.0 — October 2026

Latest

Choose a tag to compare

@kjkrol kjkrol released this 13 Oct 17:50
· 3 commits to main since this release

Added

  • Optional columns (3.2.0): QueryBuilder.Optional with OptComp[T] tracks a component
    whose absence never excludes an archetype, read when the archetype carries it — one pass in
    place of the old Include+Exclude pair, ~14% faster, no allocation, across All, Pick,
    Seek and SeekH. Zero-size tags are optional too (3.2.1): presence comes from the
    archetype mask.
  • Tags in factories (3.2.2): NewFactory takes zero-size tag components among the data
    ones (&Comp[T]{}), marking the spawned archetype without a data column.
  • 512 component types (3.3.0): the mask grows from 2 words to 8, a component ID from 8 to
    16 bits (MaskSize = 8, MaxComponents = 512). Iteration, Seek, Pick, migrations and
    factories measure as before; announcing a new archetype to the queries costs about four
    times as much, once per combination of components.
  • As many queries as a world needs (3.3.0): the matcher catalog keeps matchers in blocks
    of 64 instead of one array of 64 that panicked past it; no matcher ever moves.
    WithMatcherCap(n) is a hint for a world building many queries, never a limit.
  • Components known only at run time (3.4.0): RegCompOf(t) on the ECS and on SysInit,
    LoadCompOf(t) and the columns NewColumn(t) / NewOptColumn(t) are RegComp[T],
    LoadComp[T], Comp[T] and OptComp[T] for a reflect.Type: a column goes wherever a
    &Comp[T] goes and reads the same memory (Base, At, Present); Comp.Index and
    OptComp.Index tell a typed column's position, so a Column can share it.
  • CmdBuf.Reserve(e, compID) (3.4.0) queues an add and hands back the staged slot to
    write the value into before Sync — AddOne without the type parameter, and AddOne is
    written over it. ECS.CmdBuf(r) is the buffer a registered system's Update is
    handed, for a system queuing changes from outside its own Update.

Fixed

  • Chunk memory carries the GC's exact pointer bitmap (3.2.3): 3.1.0 allocated scanned
    archetypes as []unsafe.Pointer viewed as bytes, marking every word a pointer, padding
    included; a stale address in padding aborted the process with found bad pointer in Go heap. Scanned archetypes allocate through a generated Go type, pointer-free ones keep plain
    bytes, and the CmdBuf arena holds pointer-free payloads only.
  • Seek/SeekH refuse an archetype missing a tracked column (3.2.3): it baked as
    offset 0, the entity-ID column, so Comp[T].At pointed into unrelated storage; both return
    false and leave the cursor untouched.
  • A save keeps every value in its own column, whatever the registration order (3.2.4):
    Save wrote an archetype's values in its own order while the directory listed them by type
    number, so a type registered early but added to entities later loaded into another
    component's column. Saves the bug did not touch load as before; those it did cannot be
    repaired.
  • A matcher is 384 bytes, not 320 KB (3.3.0): its Seek cache was an array over every
    possible archetype, about 21 MB for a world's first 6the
    archetypes Seek meets.

Changed

  • CmdBuf.AddOne verifies that compID names T (3.2.3), as AddCompValue did.
  • Blank (_) filler fields are accepted in components (3.2.3); persistence skips them.

Additive since v3.1.0: no API removed.