Skip to content

ecs 0.2.3: World.Table and spawnTables, readonly: true; @adobe/ecs-gpu and @adobe/ecs-persistence publishable - #230

Merged
krisnye merged 5 commits into
mainfrom
knye/ecs-gpu-public
Oct 30, 2026
Merged

krisnye merged 5 commits into
mainfrom
knye/ecs-gpu-public

Conversation

@krisnye

@krisnye krisnye commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Syncs ecs/ from the ecs repository at b27a246 (Adobe-Firefly/ecs#6).

  • @adobe/ecs 0.2.3:

    • readonly: true replaces observer: true, with the same rules and the same behavior at runtime. The guide's systems chapter mentions it, and its sync points chapter spells it out.
    • World is a namespace holding create, join and Table. The table types are World.Table, World.Table.Column and World.Table.Spawned.
    • tables on a readonly system without components copies whole archetypes' columns; where keeps it to archetypes holding equal values of shared components.
    • commands.spawnTables(tables, { resources?, existing? }) spawns them as block copies, rewriting entity values by the reference traits, and sets resources; existing maps rows to entities already in the world.
    • Component.declarations(), Resource.declarations() and Index.declarationOf(index) give each key's and index's declaration.
    • Faster: bulk spawns with owner references (161 → 53 ms at 1M), row loops (small archetypes 1K 7.74 → 6.90 ns a row) and up load (186 → 123 ms), with no benchmark slower. Two fixes, each with a test: a holder spawned with its owner in one sync point survives the owner's despawn no more, and spawned holders are journaled once.
  • @adobe/ecs-persistence 0.0.1, a new package, publishable:

    • persist, a trait;
    • snapshot({ world, ...selection }), by with, not and where on shared components, or a root and what it owns;
    • encode and decode, a binary format whose columns are viewed in place on decode;
    • spawn({ world, snapshot, entities?, match? }), where match merges a snapshot's entities into the world's by unique indexes;
    • types Snapshot, which is opaque, Failure and Spawned.

    At 1M entities, a snapshot takes about 6 ms, encode about 5 ms, decode about 0 ms, spawn about 167 ms, and a merge matching every entity 439 ms. One chunk of 10K among 1M snapshots by where in 0.13 ms and spawns back in 1.8 ms.

  • @adobe/ecs-gpu is publishable as 0.0.1, and its typecheck leaves out its vitest config.

  • The guide has a section per library, with chapters for ecs-gpu and ecs-persistence.

pnpm-workspace.yaml lists the new packages, and the lockfile takes their entries (format v6). Nothing outside ecs/ uses what changed.

From a clean state, check:workspace, pnpm -r run typecheck and build pass locally, and so do every package's full suite, with a GPU and CI unset:

Package Tests
ecs 1711
ecs-persistence 56
ecs-gpu 38
ecs-guide 129
ecs-todo-vanillajs 65
ecs-sample-browser 13
ecs-particles-webgpu 2
ecs-transfers-canvas 1
ecs-gpu-views 1

ecs-sample-browser's page test failed to build once in the full run and passed in two reruns.

The next pnpm run publish <otp> here publishes @adobe/ecs 0.2.3, @adobe/ecs-gpu 0.0.1 and @adobe/ecs-persistence 0.0.1.

🤖 Generated with Claude Code

krisnye and others added 2 commits October 28, 2026 18:25
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…true in place of observer: true

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@krisnye krisnye changed the title ecs: @adobe/ecs-gpu is publishable ecs 0.2.2: readonly: true in place of observer: true; @adobe/ecs-gpu publishable Oct 29, 2026
krisnye and others added 2 commits October 29, 2026 11:42
…he guide's sync points chapter

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…clarations, and @adobe/ecs-persistence

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@krisnye krisnye changed the title ecs 0.2.2: readonly: true in place of observer: true; @adobe/ecs-gpu publishable ecs 0.2.3: World.Table and spawnTables, readonly: true, @adobe/ecs-persistence; @adobe/ecs-gpu publishable Oct 29, 2026
…blishable

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@krisnye krisnye changed the title ecs 0.2.3: World.Table and spawnTables, readonly: true, @adobe/ecs-persistence; @adobe/ecs-gpu publishable ecs 0.2.3: World.Table and spawnTables, readonly: true; @adobe/ecs-gpu and @adobe/ecs-persistence publishable Oct 29, 2026
@krisnye
krisnye merged commit de21eae into main Oct 30, 2026
3 checks passed
@krisnye
krisnye deleted the knye/ecs-gpu-public branch October 30, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant