Skip to content

ecs 0.2.4, ecs-persistence 0.1.0: despawnWhere, System.describe, sync points between tiers, run changes, persisting by an app's trait - #240

Merged
krisnye merged 4 commits into
mainfrom
knye/ecs-0.2.4
Nov 1, 2026
Merged

krisnye merged 4 commits into
mainfrom
knye/ecs-0.2.4

Conversation

@krisnye

@krisnye krisnye commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Syncs ecs/ from the ecs repository at 244f952 (Adobe-Firefly/ecs#7 and Adobe-Firefly/ecs#8).

Closes #232, closes #233, closes #234, closes #236, closes #237, closes #238, closes #241. #235 and #239 are in ecs/packages/ecs/followups.md.

  • @adobe/ecs 0.2.4:
    • commands.despawnWhere({ with, not?, where? }) despawns every entity a query matches at the sync point; where takes shared values, so a chunk unloads by its value.
    • System.describe(system) gives a schedule's tiers, sync points, readonly systems and each system's inferred access, as data and text.
    • Sync points between tiers: a run applies the fewest that cover every system following one whose commands may change what it reads, matches, looks up or indexes.
    • A row the build can't follow is a build error at its use; components: { whole: true } takes it whole on purpose.
    • Finalizer.changes watches resources too, and world.run(system, ...input, { changes: true }) resolves to that run's own change set.
    • commands.spawnTables(tables, { resources?, existing? }), where on a readonly system's tables, and Index.declarationOf(index).
    • Faster: bulk spawns with owner references (161 → 53 ms at 1M), row loops (small archetypes 1K 7.74 → 6.90 ns a row), up load (186 → 123 ms) and retag (35.5 → 30.0 ms). Across all 174 node benchmarks the mean change of the new features is +0.2%, each apparent slowdown within noise on rerun.
    • Fixes, each with a test: a holder spawned with its owner in one sync point no longer survives the owner's despawn, and spawned holders are journaled once.
  • @adobe/ecs-persistence 0.1.0:
    • The app names what is saved: snapshot({ world, by, ...selection }) takes a trait the app declares, a symbol whose value is each component's or resource's saved name, and saves only what it covers. persist is removed.
    • decode(bytes, { by }) refuses bytes saved by another trait; encode and spawn are unchanged.
    • spawn({ world, snapshot, entities?, match? }): match merges a snapshot's entities into the world's by unique indexes, 906 → 409 ms at 1M matching all; spawn takes 163 ms at 1M, from 300 ms.
    • match fails, as data, for an index whose key, with or not names a component the snapshot's trait doesn't cover.
    • snapshot's where on shared components selects whole archetypes: one chunk of 10K among 1M snapshots in 0.13 ms and spawns back in 2.1 ms.
  • @adobe/ecs-gpu 0.0.2: its build keeps its keys top-level const, and it has guide chapters.
  • The guide has a section per library: two chapters for ecs-gpu and four for ecs-persistence, the fourth "Documents and settings".

pnpm-workspace.yaml lists ecs-guide-checks, and the lockfile takes its entry (format v6). Nothing outside ecs/ uses what changed.

From a clean state, check:workspace, build, typecheck and every package's full suite pass locally, with a GPU and CI unset:

Package Tests
ecs 1742
ecs-persistence 73
ecs-gpu 38
ecs-guide 131
ecs-todo-vanillajs 65
ecs-sample-browser 13
ecs-particles-webgpu 2
ecs-transfers-canvas 1
ecs-gpu-views 1

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

🤖 Generated with Claude Code

krisnye and others added 3 commits October 31, 2026 21:35
…wns, row loops and match, spawn's match and snapshot's where

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pped on CI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e, sync points between tiers, a run's changes, @adobe/ecs-persistence 0.1.0 persisting by an app's trait

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@krisnye krisnye changed the title ecs 0.2.4: faster spawns, row loops and match; spawn's match and snapshot's where ecs 0.2.4, ecs-persistence 0.1.0: despawnWhere, System.describe, sync points between tiers, run changes, persisting by an app's trait Nov 1, 2026
…se with or not the snapshot's trait doesn't cover, and the guide's build reads past dot folders

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@krisnye
krisnye merged commit b4cd62f into main Nov 1, 2026
3 checks passed
@krisnye
krisnye deleted the knye/ecs-0.2.4 branch November 1, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment