Changelog
All notable changes to this package are documented here. The format follows Keep a Changelog, versions follow Semantic Versioning.
[2.5.1] - 2026-12-03
Fixed
- World listeners and the entities still being created. A
NextTickoutside a runner, or aSystemsRunner.Run, called by a listener in the middle of aCreateEntityorCopyEntity(one begun without world listeners) made the world forget every entity still being created, not only the ones an exception had left: a world listener subscribed since was told the destroy of such an entity, though it never got itsOnEntityCreated. Followed by a rollback (Clear, thenWorldSerializer.Load), a creation nested in another then put back the record of the outer one after the load, and an entity the snapshot gave that handle, announced like any other, got noOnEntityDestroyed. A creation now keeps its record while it runs and removes it when it ends, also when an exception leaves it;NextTickand the end of the outermostRunforget only the entities of creations an exception cut. - An entity whose
CreateEntitythrew before it was announced (a listener of its component threw) while world listeners were subscribed was not recorded: its destroy was told to them, although it never had anOnEntityCreated. It now gets neither until the nextNextTickoutside a runner or the end of the outermostSystemsRunner.Run, as without world listeners. - A rollback (
Clear, thenWorldSerializer.Load) made by a listener no longer lets the operations still running go on with the restored entity that the snapshot gave the same handle. A creation or copy in progress sent that entity a secondOnEntityCreated(or one to a world listener that already counted it as restored); the world listeners not told yet of a change in progress were told of it for the restored entity (a component it was given without an event, a removal it never had); aCopyEntitywent on copying the source's components into the restored copy; a copy that failed afterwards destroyed the restored entity that had its handle. The same held for anAutoCopy, which runs between reading the source's value and storing it: one that destroyed the copy, cleared the world or rolled it back still had its value stored, on the freed slot (in release the next entity created there found the component without anAdd, and anAddof it threw "already has component"; underKENSEI_DEBUGCopyEntitythrew) or on the restored entity that had the copy's handle.ClearandLoadnow end every notification, creation and copy in progress for the entities they remove: nothing more is told, announced, copied or destroyed for them. A world listener that throws inOnEntityCreatedleaves the entity announced, as before: its destroy is told to every listener.
Documentation
- World events: the entities a snapshot restores and the ones a listener creates during
Warmupcount as existing for world listeners, like entities that existed before a listener subscribed: they get noOnEntityCreated, and their destroy is told. An entity a listener destroys duringWarmupgets noOnEntityDestroyed, asWarmupsuppresses every world event of the call (unchanged; now written in world-events.md).
[2.5.0] - 2026-12-02
Behaviour changes
What code written for 2.4.0 can notice; the entries below have the details.
- Listeners: a world, filter or typed listener hears the changes that happen after it subscribed. One subscribed during a notification is not told of the change in progress; an
IComponentListener<T>subscribed during anAddof its pool gets noOnAddedfor thatAdd. A change nested in the notification of another change of the same entity goes only to the listeners that heard of that change, and a notification ends once its change is undone: the listeners after the one that undid it hear of neither. - Snapshots:
WorldSerializer.Savewrites format version 2. Version 1 snapshots still load; 2.4.0 and earlier do not load a snapshot written by this version (InvalidDataException, "Unsupported snapshot version 2"). KENSEI_DEBUGthrows in two more cases: a command recorded on aPendingEntityof another buffer, of a recording the buffer has played back or cleared since (also right afterPlayback), or on adefaultone; and aFilter.Enumeratordriven by hand and never disposed, reported byWorld.NextTickoutside aRunand at the end of the outermostSystemsRunner.Run. Release checks neither.SystemsRunner.Destroydestroys every system, also after theDestroyof one of them threw, and then rethrows: one exception as is, several as one flatAggregateException.- Generator: code that compiled on 2.4.0 and was silently wrong there is now an error, and the warnings KECS013 to KECS016 fail a
TreatWarningsAsErrorsbuild (see Generator, Breaking). - Editor: the Profiler window takes its entity names from the world being recorded, not from the World Inspector's world, and a world left by a previous play session is never bound automatically.
Fixed
- Snapshots:
WorldSerializer.Savenow writes the generations of the slots that hold no entity (the free slots below the highest slot in use, and the slots above it whose generation aClearhad raised), andLoadrestores them. Before, a slot that was free atSavestarted again from the generation of a new world, so in the restored world a handle that was dead when the world was saved named the next entity created in its slot (IsAlivetrue for an entity that was destroyed before the save). The snapshot format version is 2; snapshots written by 2.4.0 and earlier (version 1) still load, without those generations, as before. Free slots are saved in the order the saved world would reuse them, so the entities created afterLoadget the same slots and handles as in the saved world. Loaded into a world with a past of its own (a rollback:Clear, thenLoad), a free slot keeps the later of the two generations, so a handle of an entity that lived and died there after the snapshot was taken stays dead. WorldSerializer.Loadand listeners. Pool and filter listeners run duringLoad, as documented. A listener that destroyed an entity being restored (a rule that destroys entities without health) let the components of that entity that were restored later land on the freed slot, where the next entity inherited them, or on an entity the listener had created in the slot; underKENSEI_DEBUGLoadthrew. Those components are now skipped. A listener that adds a component which the snapshot also holds (one component derived from another, in a world wired like the saved one) madeLoadthrow "already has component"; the stored value now overwrites the listener's, without a secondOnAdded.Loadnow refuses a world whose pools still hold components that an interruptedDestroyEntityleft without an entity; callworld.Clear()first. Up to 2.4.0 it did not check, and a stored component that met such an orphan in its pool threw "already has component" in the middle of the restore.WorldSerializer.Savewrites only the live entities with components and only their components. Called by a listener ofDestroyEntity, it wrote the entity being destroyed and its components not removed yet, a stream thatLoadrejected; it now saves the world without that entity. It also wrote the components an interruptedDestroyEntityhad left orphaned in their pools, whichLoadthen put on a free slot; they are left out now, and so is an entity inside the removal of its last component (Savecalled by a listener of that removal), which the auto-destroy that follows takes.- A listener that throws in the middle of a structural change no longer leaves the world inconsistent. When an
IFilterListenerthrew inOnEntityAddedorOnEntityRemoved, the filters of that component type that the update had not reached kept their old membership: an entity without the component stayed in anIncfilter (reading it through that filter failed), an entity with it stayed in anExcfilter. When a filter or world listener threw during the removal of an entity's last component, the entity stayed alive without components. Now the remaining filters are updated (without notifying their listeners) and the entity is destroyed before the exception leavesAdd,RemoveorDestroyEntity; the listeners not called yet are not called for that change. The first exception is the one reported: a world listener that throws again in theOnEntityDestroyedof that destroy does not replace it. A throw insideDestroyEntity(a listener orAutoReset) still leaves the components not removed yet orphaned in their pools, but the released slot now leaves every filter and owning group (an owning group kept counting the dead entity as a member) and is not reused untilClear, so a new entity never meets those components; a snapshot keeps it so (format version 2 stores those slots). - An
AutoResetthat throws duringRemoveon a pool that belongs to an owning group or tracks changes left the component in place but took the entity out of its group (the group no longer listed an entity that had every owned component) and gave the component the change version of the pool's last component.AutoResetnow runs before the group swap and the version move, as it already ran before the swap-remove: when it throws, nothing has been changed for the removal. AnAutoResetonly resets the value, so the order makes no other difference. - Listeners that change what they are being told about now hear every entity's changes in pairs and in order. When the first
IFilterListenerof a filter removed the component inOnEntityAdded, the second gotOnEntityRemovedand thenOnEntityAddedfor an entity that was no longer in the filter; the same for world listeners, for a listener that adds the component back, and for one that destroys the entity inOnEntityCreated. Now a change nested in the notification of another change of the same entity (made directly or from a callback further in) goes only to the listeners that heard of that change, and the notification ends once its change is undone: the listeners after the one that undid it hear of neither, and the last call every listener gets matches the world. For world listeners anAdd, aRemove,CreateEntityandCopyEntitycount from the start: a filter listener that removes the component again while it is being added (or adds it back while it is removed) tells world listeners nothing (up to 2.4.0 they heard of the removal alone, or of a removal and two additions), and an entity a listener destroys while it is being created gets noOnEntityDestroyedeither (it had noOnEntityCreated). A world listener subscribed while an entity is created (by a listener of its components) and destroyed before itsOnEntityCreatedis sent gets noOnEntityDestroyedfor it either, also when the entity being destroyed is not the one being created but one whose ownCreateEntityis still running further out (a listener of a component of an entity being made creates another, whose listener destroys the first). An entity whoseCreateEntityorCopyEntitythrows before it is announced gets neitherOnEntityCreatednorOnEntityDestroyed(until the nextNextTick); a snapshot loaded before then (a rollback:Clear, thenWorldSerializer.Load) drops that record, so an entity to which the restored generations give the same handle again is announced like any other. Listeners never change which slot or handle an entity gets. When a listener destroys an entity whose component's removal is still being told and creates another that takes its slot (destroy and spawn a replacement), the listeners not told yet hear that removal before the new entity's events; up to 2.4.0 they never heard it, and then heard the new entity's component come. CopyEntitychecks its source after telling the world listeners still to hear of a removal in the slot the copy takes: one of them may destroy the source, andCopyEntitythen behaves as for any dead source (Entity.Null, underKENSEI_DEBUGan exception) instead of leaving an entity without components.- A listener hears the changes that happen after it subscribed: one subscribed during a notification (also a world listener that a filter listener subscribes while the filters are updated) is not told of that change, but of the changes after it, nested ones included;
OnEntityCreatedgoes to the listeners subscribed when it is sent. Up to 2.4.0 a world listener subscribed by a filter listener got the change in progress, and could hear it twice. Behaviour change: the rule now holds for typed listeners as well. AnIComponentListener<T>that a filter or world listener subscribes during anAddof its pool gets noOnAddedfor thatAdd(the component was stored before it subscribed); its firstOnAddedis for the nextAdd. Up to 2.4.0 that depended on the pool: the new listener got theOnAddedwhen the pool already had a typed listener when theAddstarted, and did not when it had none. A typed listener unsubscribed during theAddstill gets noOnAdded, and a dispatch that has started still goes over the listeners it started with. - Change tracking no longer breaks when the world's change counter passes
int.MaxValue(two billionAdd,ModifyandMarkChangedcalls on tracking pools: hours of play for a game that marks a few thousand components per frame). The counter went negative, soChangedSincereported nothing as changed against a bookmark taken before the wrap and old components as changed against one taken after it. The counter now starts again at 1 andChangedSincecompares across that. Nothing changes before the first wrap. After it a bookmark is exact for the next 2^30 writes (seeWorld.ChangeVersion); compare versions withChangedSince, a plain>onChangedVersionvalues does not survive the wrap. - Change tracking past the first wrap of the counter lost changes made by
Modify/MarkChangedinParallelRunnerjobs: the counter is incremented without synchronization, so a worker can leave it below versions other workers handed out, and those versions looked a whole turn old toChangedSinceand to the aging. Such versions now count as the newest, the aging replaces only versions that are still old, and the first wrap is aged by one worker before any version of the new turn is stored; the worker that ages at the first wrap lets the others go on also if it fails. A job's writes may still share a version or show as changed against a bookmark taken after the job; no write is lost. CommandBuffer.Playback: commands that a listener records into the buffer while it is played back are applied by the samePlayback, but when they created entities past the buffer's capacity for pending entities (16 at first)PlaybackthrewIndexOutOfRangeExceptionand dropped the rest.SystemsRunner.Run: when a system threw and the OneFrame cleanup threw as well (a listener of a OneFrame component,AutoReset),Runreported the cleanup's exception, the system's was lost, and the OneFrame types after the failing one were not cleaned, so their events were processed again in the next frame. Every OneFrame type is now cleaned, and the first exception is the oneRunreports: the system's when a system threw, otherwise the one of the first cleanup that failed.SystemsRunner.Destroystopped at the first system whoseDestroythrew: the systems after it (in reverse order) were never destroyed, and a nested runner among them stayed initialized, so the nextInitskipped it. Every system is now destroyed, those of nested runners included; then the exception is rethrown as is, or, when more than oneDestroythrew, one flatAggregateExceptionholds them all in the order they were thrown, as for the rollback ofInit. A nested runner of a class derived fromSystemsRunnerthat implementsIDestroySystem.Destroyagain is destroyed through that method, called once, as before; its systems are now destroyed also when that method throws before it calls the base one, or never calls it.EcsBootstrap.OnDestroydestroys the world also when the Destroy of a system throws.- The OneFrame cleanup of one type stopped at the first component whose
OnRemovedlistener orAutoResetthrew, so the other components of that type stayed for the next frame. That component stays, as after anyRemove, the others are removed, and the first exception is the one reported. The cleanup of a disabled runner or group (cleanWhenDisabledtypes) now cleans every type when one of them throws, asRunalready did. World.Clearwith anAutoResetthat throws left the world half cleared: the pools after the failing one, the filters and the groups kept their contents while every entity was gone.Clearnow finishes, then rethrows the first exception.World.Destroy, which clears first, stopped there as well: the world stayed not destroyed (IsDestroyedfalse, still listed by the editor windows) until a secondDestroy. It now finishes too (the world is destroyed and drops out of the lists), then rethrows.CopyEntitywhoseAutoCopy(or a listener of a copied component) threw left the copy alive, with the components copied before the failure or with none when the first one failed: an entity the caller never got the handle of, which no filter saw when it had no component. The copy is now destroyed before the exception leaves; world listeners hear nothing of it.KENSEI_DEBUG: aPendingEntityof anotherCommandBuffer, of a recording the buffer has played back or cleared since, or adefaultone, was accepted and silently named another entity of the buffer. Recording a command on it now throwsInvalidOperationException; release does not check it, as for other handles. Behaviour change underKENSEI_DEBUG: this includes a command recorded on a pending entity after itsPlayback, before the buffer records anotherCreateEntity. Up to 2.4.0 that reached the entity thePlaybackhad created (its id was still resolved), in every build; it throws now underKENSEI_DEBUGand still lands there in release, until the new recording creates an entity first. Keep theEntityto address it afterPlayback.PendingEntityremains an unmanaged struct in both builds (it holds numbers, no reference to its buffer; 4 bytes in release, 12 underKENSEI_DEBUG), sostackalloc PendingEntity[n]andwhere T : unmanagedcompile in both.KENSEI_DEBUG: aFilter.Enumeratordriven by hand (GetEnumerator,MoveNext) and never disposed kept the filter's removal-during-iteration guard held for good, and later removals from the filter threw the double-visit error at random.World.NextTickoutside aRunand the end of the outermostSystemsRunner.Runnow release such a guard and throw, naming the filter.KENSEI_DEBUG: a secondDisposeof aFilter.Enumeratorended one more iteration than there was: it released the removal-during-iteration guard of another loop running over the filter, or left the filter's count of running loops below zero: the nextforeachover that filter then threwIndexOutOfRangeException, orWorld.NextTick(the end of the outermostSystemsRunner.Run) reported an iteration "never ended" with "(-1 enumerators)". A repeatedDisposenow does nothing, and the count never goes below zero.KENSEI_DEBUG: the removal-during-iteration check (an entity a runningforeachhas not reached leaves the iterated filter, so an entity already visited would be visited twice) threw in the middle of the removal: the component was gone from its pool, but its entity stayed in the iterated filter, where reading the component failed, and the filters after that one were not updated. The exception is now thrown once the removal is complete, as release completes it: the entity has left the filter, every other filter is updated and an entity left without components is destroyed. ADestroyEntityit interrupts ends like after any exception inside it (the slot is released and leaves every filter, the components not removed yet stay orphaned untilClear). The OneFrame cleanup that meets the check (a loop over a filter of the type left open by a system) removes every component and reports once; it stopped at the first one.- Unity, .NET trimming and NativeAOT: managed code stripping at Medium or High removed
IAutoReset<T>.AutoResetandIAutoCopy<T>.AutoCopy(the pool reached them only through reflection:GetInterfaceMapandDelegate.CreateDelegate), and creating the pool of any component that implements them threw in the player (ArgumentNullExceptionon IL2CPP,IndexOutOfRangeExceptionon Mono and NativeAOT). That includedEventBuffer<T>andListeners<T>, so the firstworld.AddEventorworld.Subscribefailed. The pool now calls them through the interface on one boxeddefault(T), with no reflection and no[Preserve]needed (checked in release IL2CPP and Mono players at Managed Stripping Level High, implicit and explicit implementations, and in a NativeAOT build); no allocation per call. - Unity:
EcsBootstraplifecycle methods (Awake,Start,Update,FixedUpdate,LateUpdate,OnDestroy) areprotected virtual. A subclass method with one of these names used to replace the bootstrap's one silently (no world, no initialization, no update or no cleanup); it now gets compiler warning CS0114, an error in the Console in the editor and underKENSEI_DEBUG, and, for a replacedAwake, one clear error in every build instead of aNullReferenceExceptionper frame. Override the method and call the base one. A replacing method that calls the one it hides (protected new virtual void Update() { base.Update(); }) is not reported, also from an iterator or asyncStart, a lambda or a local function, also in a generic base class. - Unity: an
EcsBootstrapsubclass method with the name of a Unity message and with parameters (Update(float dt)) is reported with an error in the editor and underKENSEI_DEBUG: Unity calls nothing for that message, so the bootstrap's own method never ran, with no message from the package. - Unity:
EcsBootstrap.OnDestroy: when theDestroyof a system throws, that first exception is the one that leaves; a later one fromWorld.Destroyis logged as an error instead of replacing it.
Performance
Against 2.4.0, measured on .NET 8 (Arm64 RyuJIT).
- Listener dispatch. A notification now keeps which listeners have heard of it (see Fixed), so that a change nested in it reaches only those. It is kept out of the world's and the filter's bookkeeping until a listener makes something look for it (it changes the entity it is told about, subscribes or unsubscribes, or another change is told from inside it), so listeners that only read cost little more than before. A change told to no listener, to one listener of a kind or to typed listeners (
IComponentListener<T>) costs what it did in 2.4.0; told to two to four listeners of a filter, 2 to 8% more; told to two to four world listeners, 9 to 20% more (about 1 ns).CreateEntityfollowed byDestroyEntitytakes about 5% longer with one world listener and 12 to 24% longer with two to four;CopyEntity29 to 36% longer with world listeners. CreateEntityis 4 to 13% faster (5.1 to 4.5 ns with one component) andDestroyEntity4 to 13% faster (7.8 to 6.8 ns): the slot allocation is inlined intoCreateEntity, and whatDestroyEntitydoes when a listener throws is written as handlers instead offinallyblocks, which the JIT called as functions on every destroy.CopyEntitywithout listeners takes 4 to 8% longer than in 2.4.0 (it destroys the copy when a component cannot be copied).WorldSerializer.Saveis four times faster (20 to 4.5 ns per entity with two or three components) andLoada third faster (20 to 13 ns): the entity table, the free-slot list and the components without a formatter go to and from the stream through a buffer, many at a time, instead of one call per number. The stream is the same, byte for byte.SystemsRunner.Runcosts 5 to 9% less per system, and the OneFrame cleanup 6% less (13% forOneFrame<EventBuffer<T>>).
Generator
Breaking
Code that compiled on 2.4.0 and was silently wrong there:
- 2.1 layout: a
base.Init(world, shared)that C# binds to anotherInitoverload isKECS006: an overload of a class in between, or one next to a baseInitthat is a hand-written override of a generatedInit(C# looks that override up at the generated base, above the overload). The baseInitwas skipped before; rename the overload. - A class that lists
IInitSystemover a hand-written override of anInithiding a generated base'sInitis the 2.1 layout:KECS006without thebase.Initcall. It was chained silently before; abase.Initthere wasKECS012and is now required. - An injection attribute written through a using alias is recognised (see Fixed), so such a class with a hand-written
InitgetsKECS002and with a member namedInitgetsKECS018. KECS019is an error also for a system no runner initialises.TreatWarningsAsErrorsprojects fail on KECS013 to KECS016 (KECS014 to KECS016 are new, KECS015 also on events, KECS013 also for abase.Initcall that an overload takes, see Fixed); list them inWarningsNotAsErrors.
Added
- New warnings KECS014 (static field with an injection attribute), KECS015 (
[field: ...]on an auto-property or a field-like event) and KECS016 (two kinds of injection attribute on one field): the cases where a marked field was left out with no diagnostic. KECS020(error): a failure of the generator on one class is reported on that class; the others still get theirInit.KECS018for a type parameter namedInit; a class with a type parameter namedOnInitgets itsInitwithout the hook.
Fixed
- Injection attributes written through a using alias (
using Inject = KenseiECS.PoolAttribute;, also aglobal using, and[K::Pool]) were not noticed and the field stayednull; they are injected now. - An
Initoverload with two parameters other than(World, SharedData)was reported as KECS002 and the class got no generatedInit. [field: Pool]on an auto-property next to an injected field produced generated code that did not compile.- A file-local system class (
file partial class, C# 11), a class nested in a file-local type, and a file-local component type in[Inc],[Exc]or[Any]produced generated code that did not compile; they are now the error KECS017 and the class gets no generated code. - A field, property, event or nested type named
Initin a system class, and a system class namedInit, produced generated code that did not compile (CS0102, CS0542); they are now the error KECS018 and the class gets no generatedInit. - A component type listed in
[Exc]and also in[Inc]or[Any]passed the generator, and the generatedInitthrewInvalidOperationExceptionwhen it built the filter; it is now the error KECS019. KECS019is also reported for types that differ only in tuple element names.[field: Pool](or another injection attribute) on a field-like event was ignored with no diagnostic; it is now the warning KECS015, as on an auto-property.- A system class named
OnInitgot a generatedpartial void OnInitthat did not compile (CS0542); it now gets itsInitwithout the hook. - An override of a base
OnInithook in a system derived from a generated base whose ownInitcalls no base (its base is not a system, or has anabstractInit) never ran. The derived class's generatedInitnow calls it; a generated base in another assembly is judged the same way when its injected fields areprotectedorpublic. - A hand-written
override Initof a generatedInitwhosebase.Init(world, shared)C# binds to anotherInitoverload compiled without a diagnostic, the generatedInitnever ran and the base fields stayednull(since 2.2.0). An overload such asInit(World, SharedData, int x = 0),Init(World, object)orInit(World, params SharedData[])takes the call when it is declared in a class between, or in the generated base itself when its generatedInitis an override. It is now the warning KECS013, reported on the call; an override whose onlybase.Initcalls are written for another overload gets it too. The calls are judged as the compiler binds them once the generated code exists, so an overload next to a generatedInitthat is the first declaration, which loses to it, is not reported. - Hand-written
override Initclasses between two generated systems: a second override in a row, or one over a generated base in the 2.1 layout, was a falseKECS006on the derived system (KECS006instead ofKECS012when itsOnInitcalledbase.Init). Below a generated base with its own error the derived system got a secondKECS006. [Inc(typeof(X))],[Exc]or[Any]with a type the compiler cannot resolve (a typo, or a type another generator adds) made the generator throw (CS8785), and no system of the assembly got itsInit. The filter is now written with the name as given and the type is left to the compiler. An attribute with broken arguments no longer gets a misleadingKECS007.- The packaged DLL carries the package version (it reported
1.0.0+<commit>);dotnet build KenseiECS.Generators -c Release -p:UpdatePackage=truerebuilds it intoKenseiECS/Plugins.
Editor
- The World Inspector, Systems and Profiler windows list every live world, not only the one a MonoBehaviour provider exposes, and switch between them with a dropdown in the toolbar. Worlds of
IEcsWorldProvider/IEcsSystemsProviderbehaviours (such asEcsBootstrap) come first, labelled with their GameObject; worlds created in code follow asWorld <id>, and rootSystemsRunners after theirInit. With several providers the windows bound whichever Unity returned first; now, when none is picked, the provider world with the lowest id. Worlds and root runners register in an internal, weakly referenced registry compiled only in the editor and underKENSEI_DEBUG: a world nobody references is still collected, a destroyed one drops out, and a release player has none of it. - With Debug Mode on, the
EcsEntityViewinspector hid the view's serialized fields (Destroy Entity With Game Object, Entity Name). It now draws them above the entity, supports multi-selection, and applies to subclasses ofEcsEntityViewtoo. - Editor windows held strong references to every world and runner they listed; they now hold them weakly.
- Enter Play Mode without domain reload: a world left by the previous session is listed last as
World <id> (previous session)and is never bound automatically. With only previous-session worlds alive, the windows bind nothing until one is picked. - Profiler window: entity names come from the world passed to
EcsProfiler.Enable; the toolbar wraps and is fully reachable at 430 pt. Behaviour change: the Profiler no longer shares its names world with the World Inspector. - World Inspector and Systems windows: dropdowns are sized by their longest label with a tooltip; "Reset peaks" and "Clear" stay in view.
Documentation
IRangeJob,ParallelRunner: the XML docs said the runner copies the job struct to each worker. It keeps one copy that every worker and the calling thread execute, so a field the job writes is shared between threads and never reaches the struct passed toRun.IFilterListener,IWorldEventListener: what a listener that undoes the change, or throws, means for the listeners after it.- The CommandBuffer, FAQ and migration examples recorded a hit with
CommandBuffer.Set, which keeps only the last of two hits on one target in a frame; they useworld.AddEventnow. - Warnings for
Subscribewithout the listener interface and forAddEventwithoutOneFrame<EventBuffer<T>>(); the world dropdown of the editor windows; managed stripping levels. - Debug mode, world lifecycle and FAQ:
CreateEntityandPool<T>on a destroyed world in a release IL2CPP player crash the process (Worldis compiled without null checks there); the pages promisedNullReferenceException, which is what Mono and .NET throw. Debug mode: the report of an iteration that was never ended also comes for aforeachover a filter wrapped around a rootRun()orWorld.NextTick()outside anyRun, and thatRun()then skips its systems for the frame. World events and entities: a world listener that throws inOnEntityCreatedleaves the entity alive and complete, forCopyEntityas forCreateEntity. - AGENTS.md: rule 1 says that pausing a whole phase is the runner's job (
SetActiveon itsSystemsRunner), not anifin each system. - Snapshots, architecture, threading, change tracking, listeners, runner and CommandBuffer pages describe the fixes above: snapshot format version 2 and the restore steps (free-slot order, rollback, the refusal of orphaned components),
Loadwith listeners, the order in which listeners hear a change that one of them undoes, the state of the world after a throwing listener, the counter wrap andModify/MarkChangedin jobs, and the single job copy ofParallelRunner. - Example:
Chasingstores anEntityhandle and checksIsAliveinstead of keeping a filter index across frames. The headless run uses a fixed seed, so its output is the same on every run. - Demo: the game pauses on the level-up screen and at game over by switching its
gameplaygroup off withSystemsRunner.SetActive, instead of the host checking the game status before running thesimphase; the level-up offer and the swarm loop are switched by a tag and a filter ([Exc(typeof(Dead))],[Inc(typeof(Swarm))]) instead of anifon the game state. The simulation output is unchanged, for a level-up screen held open for any number of frames: a paused frame advances neither the world's tick nor the spatial grid, andDemo/Headlessends every run by comparing a run that holds its level-up screens open with one that does not. - CI runs the tests also with
ENABLE_IL2CPPdefined (-p:KenseiIl2Cpp=true), so the IL2CPP code paths are compiled and tested on .NET.
[2.4.0] - 2026-10-27
Changed
- A world that uses a component type with an index of 64 or above (more than one mask word) keeps 8 more bytes per entity slot: the summary of the mask words each entity uses (see Performance).
world.ReserveEntitiesreserves it with the other per-entity arrays. Type indices are process-wide, so this depends on the types registered in the process, not only on the world's own.
Performance
No change in behaviour, also after an exception in a listener or an out-of-memory error while the mask grows.
AddandRemove: the world's per-change bookkeeping for a type no filter mentions is inlined into the pool,Removedecides the auto-destroy from the count it has just decremented while no filter or world listener can run, the filter updates read the mask arrays once per change instead of once per filter when no listener can run,AddandRemoveread each pool array once, andFilterreads its count and dense array once on entry and exit.- The OneFrame cleanup (
OneFrame<T>,DelHere<T>) removes each component in place while no callback can run (no listeners on the pool, its filters or the world). AnAutoResetthat changes the world anyway (it should only reset the value) makes the rest of the cleanup go throughRemove, as before.CommandBuffer.Clear(also at the end ofPlayback) walks only the payload stores it created. DestroyEntitystops reading mask words after the last one that holds a component of the entity (its component count says when every bit is met), and an auto-destroy (last component removed) reads none. After a destroy interrupted by a throwing listener, whose leftover components stay orphaned in their pools and can lower the count of the next entity in the slot, the world reads every word again untilClear.- A world with more than one mask word keeps per entity slot which words may hold a component of the entity (set by an
Addinto an empty word, reset when the slot is released):DestroyEntityandCopyEntityread word 0 and those words only, instead of every word. The words they read are scanned without re-reading the world's fields. - The world listener dispatch of
CreateEntity,CopyEntityandDestroyEntityis a test of one flag before the call, andCreateEntityno longer writes the new slot's count (a released slot's is zero already); growing the free-slot list is out of line. - IL2CPP:
TrailingZeroCountin the Unity build (netstandard2.1) is a shift-and-mask count instead of a De Bruijn table, soWorldhas no static constructor and each set bit ofDestroyEntity,CopyEntityandGetComponentTypescosts no class-initialization check or static load (clang compiles it torbit+clzon ARM64).Filter.Enumeratorwalks anint[]instead of aSpan<int>(whose indexer IL2CPP always bounds-checks); adefault(Filter.Enumerator)still throwsIndexOutOfRangeExceptionfromMoveNext.IsAlive,GetEntity,Filter.GetEnumeratorand theEntityconstructor are marked for inlining, so game code calls their inlined copies instead of a cross-module call.
Documentation
IAutoReset<T>.AutoReset: reset the value only; changing the world from it (adding or removing components, creating or destroying entities, subscribing listeners) is not supported.AGENTS.mdin the package, and the page Rules for AI Agents on the site: how to write game code on KenseiECS for an AI agent (a marker component instead of anifinRun, components as data, events as components, views called directly by a system,Entityhandles, changes inside a filter loop,reflifetime, allocation-free hot paths,KENSEI_DEBUG, the generator).
[2.3.1] - 2026-10-26
Fixed
- Under
KENSEI_DEBUGthe firstCreateEntityof a process allocated about 400 KB, also with the profiler off: the static constructor ofEcsProfilercreated its ring buffer ofMaxEvents(10,000) events. The buffer is now created byEcsProfiler.Enable;MaxEventsset before it applies as before. - When a system threw during
SystemsRunner.Runand applying the listener removals queued byUnsubscribeLaterthrew as well (a listener whoseEqualsthrows),Runreported the second exception and the system's was lost. The system's exception now propagates; the other one is dropped.
[2.3.0] - 2026-10-26
Added
World.ReserveEntities(n)andWorld.ReservedEntities: reserve the world's own per-entity storage (generations, alive flags, component counts, every mask word and the free-slot list) fornentity slots, sized exactly. Pools and filters are not touched, except the reserved ones, whose sparse side covers the reserved slots, also after a laterReserveEntities.ComponentPoolBase.Reserve(count)andReservedComponents.Reservemoved fromComponentPool<T>to the non-generic base, soGetPool(i).Reserve(n)and a loop overActivePoolswork without a type argument; code built against 2.2 keeps working.- Filters take their reserve from their component types: a filter whose Inc types are all reserved holds the smallest of their reserves (at most the sum of its Any types' reserves when those are all reserved; a filter without Inc types takes that sum), and at most
ReservedEntitiesonce the world reserved entity slots. This holds for a filter created after the reserve too, so the filters systems create inInitneed nothing. The reserve follows the reserves of the types as they are now, whatever the order of the calls (a laterReserveEntitiescan lower it; arrays never shrink), and the obsoleteWorld.Reservemoves its cap too.Filter.ReservedCountreports it. World.UnsubscribeLater<T>(entity, listener): queues the removal of a listener and applies it when the outermostSystemsRunner.Runof the world returns, after the OneFrame cleanup, also when a system threw; called outside aRun, at the nextWorld.NextTick(the root runner calls it before its systems; a world driven without a runner calls it itself). A listener leaves this way from inside its own callback while a system iterates the list it is in, also while its entity is being destroyed. A removal whose entity was destroyed by then is skipped (also when a new entity took the slot),World.Cleardrops the queue, and on a destroyed world the call does nothing; the queue is kept per listener type and allocates nothing once it reached its peak.- Under
KENSEI_DEBUG, whileEcsProfilerrecords, the growth of a pool or filter that nothing reserved is logged asStorageGrownmarked(not reserved): that is how a forgotten hot type shows. It is not counted inGrowthsAfterReserve.
Changed
- Behaviour change:
pool.Reservealso extends the pool's sparse array toReservedEntitiesand reserves the filters whose Inc types it completes;filter.Reservealso allocates the sparse pages of the reserved slots. A filter's dense array can therefore move in apool.Reserve: anEntitiesspan taken before it is invalid afterwards (a runningforeachis not affected). - Behaviour change:
GrowthsAfterReservecounts each reserved array that grows past its reserve: the world's slots and free-slot list pastReservedEntities, a reserved pool's or filter's dense side past its own reserve and its sparse side pastReservedEntities. Growth of a pool or filter that nothing reserved is no longer counted; the obsoleteWorld.Reservestill makes every pool and filter count in the dimensions it was given. Reserveof a pool or a filter of a destroyed world throwsObjectDisposedException, likeWorld.Reserve.- Under
KENSEI_DEBUG,World.Unsubscribeaccepts an entity whose ownDestroyEntityis running, as component access does; it threw "not alive" for a listener that unsubscribed while its entity was destroyed. SystemsRunner.Addwith anullsystem throwsArgumentNullExceptionin every build, likeAddGroupandAddPhase; it was aNullReferenceExceptionunderKENSEI_DEBUGand a runner that failed later otherwise.SystemsRunner.Run(World)counts its nesting on the world, so that the outermostRunapplies the queued listener removals. A phase driven on its own (thefixedandlaterunners ofEcsBootstrap) is the outermostRunof its frame step and applies the removals queued during it.
Deprecated
World.Reserve(entities, components)sizes every pool and filter, singletons and those created later included: about 4 bytes ×entitiesper pool, some 200 MB of sparse arrays at 1000 types and 50,000 entities. UseReserveEntities(entities), andPool<T>().Reserve(count)for the types whose count changes during play; the filters over reserved types follow. Its behaviour is unchanged; removed in 3.0.Listeners<T>.Invoke(both overloads),AddandRemove. A system iteratesValuesand calls the listeners itself (var values = listeners.Values; for (int i = 0; values != null && i < values.Count; i++) values[i].OnDamage(damage);;Valuesisnullon a component added without a list): no delegate, no snapshot, nothing allocated. A callback must not change the list it is called from, andWorld.UnsubscribeLateris how a listener leaves from inside one. Instead ofAddandRemove, useWorld.SubscribeandWorld.Unsubscribe. Their behaviour is unchanged; removed in 3.0.- Both produce warning CS0618, an error in projects that treat warnings as errors.
Performance
- Reserve footprint, measured on the prototype (.NET; the IL2CPP byte counts are the same), the obsolete
Reserve(n, n)/Reserve(n)with the hot pools and filters /ReserveEntitieswith the hot pools: 1000 types × 50,000 entities × 150 filters 916 / 256 / 44 MB; 60 types × 528 entities × 40 filters 0.76 / 0.42 / 0.37 MB. Peak resident memory of an IL2CPP process with 300 types × 50,000 entities: 395 / 197 / 108 MB. A frame of play allocates nothing with any of them. - Listener dispatch under IL2CPP (64 entities, Apple M5, the il2cpp CLI of Unity 6000.3.13f1 with the player's checks), nanoseconds per dispatch for 1 / 8 / 32 listeners: a
forloop overValues2.0–2.2 / 14.4–14.5 / 56.5,foreach5.7–6.0 / 22.4–24.4 / 76.0, the 2.2Invokewith a static lambda 32–33 / 53–54 / 121–125. Reservehas no generic body per component type any more (302 fewer in the benchmark's IL2CPP build, 162 KB smaller binary). The hot path compiles to the same IL and C++ as in 2.2.2.
Documentation
- Listener bridge rewritten: a view reference in a component found through a filter,
Listeners<T>iterated by the system, the rule for callbacks,UnsubscribeLaterand the migration fromInvoke. World config: reserving for the peak (ReserveEntitiesand the hot pools, filters following their types, what to reserve, small worlds, migrating fromWorld.Reserve, measurements); the anchor#reserving-capacity-lateris now#reserving-for-the-peak. Bootstrap: reserve inConfigure. Command buffer: anEventBuffer<T>written over one with a list returns that list to the pool, also when the new buffer has none. Architecture, components, one-frame, world lifecycle, debug mode, debug tools, the migration guide and the package README follow.
[2.2.2] - 2026-10-26
Fixed
World.Warmupwith a listener that destroys its temporary entity (a "Health ≤ 0 destroys the entity" rule subscribed inInitfires on the defaultHealth; anyIComponentListener<T>orIFilterListenerthat destroys the entity it is handed) kept adding the remaining types to the freed slot. In release the next entity created there inherited those components, their mask bits and filter memberships (a singleton created inInitgot a twin andGetSingletonthrew); underKENSEI_DEBUGWarmupthrew fromEcsBootstrap.Start. If the listener also created an entity, which took the freed slot, every remaining type was added to it in both builds.Warmupnow checks the temporary entity's handle before each type and continues on a new temporary entity when it is gone, and skips a type a listener already added to it (that threw "already has component"). Since 2.0.0.- Typed listeners that remove components of their own pool re-entrantly. 2.1.1 kept one continuation slot per pool, so two linked entities whose
OnRemovedremoves the partner (if (pool.Has(other)) pool.Remove(other)) recursed until the stack overflowed (a native crash on IL2CPP), longer cycles did too (also across two pools), and withDestroyEntityinstead of theHasguard the first listener got a secondOnRemoved. Removals in progress are now a stack of frames: a nestedRemoveof a component whose removal is running continues that notification, every listener gets oneOnRemovedper component, and a cycle ends. Since 2.0.0; 2.1.1 fixed only an entity removing itself. - A component re-created in the slot it is being removed from is no longer taken for the old one. When an
OnRemovedlistener removes the component and adds it again (to the same entity, or by destroying the entity and creating one that reuses the slot), the outerRemoveno longer removes the new component or destroys the new entity, and the new component's own removal notifies every listener (the first one was skipped). The same inAdd: when a listener removes and re-adds the component, or destroys the entity and a new one takes the slot, the remaining typed listeners no longer get a secondOnAddedfor the new component. A removal also keeps the listener array it started with, so a listener that unsubscribes during it no longer makes the next one miss itsOnRemoved. Since 2.0.0. - Adding
Twhile a filter listener takesTaway again left the entity out ofExc<T>filters it matches: anInc<T>listener that removesTinOnEntityAdded, anExc<T>listener that removesTinOnEntityRemoved(the laterExc<T>filters lost it), a listener that destroys the entity and creates a new one in its slot, and a nestedAdd<U>that anInc<U>listener rolled back (Exc<U>). The mirror of the 2.1.1 fix forRemove: after a filter whose listeners ran, the update stops when the entity no longer hasTor its slot holds another entity. Since 2.0.0. CopyEntitywith a listener that destroys the copy (anIComponentListener<T>.OnAddedorIFilterListenerof a copied component: a spawn limit, a "Health ≤ 0 destroys the entity" rule) kept copying the remaining components into the freed slot. In release the next entity created there inherited them, with their mask bits and filter memberships (its component count said 1 with three components in the pools), andOnEntityCreatedwent out for the dead copy; underKENSEI_DEBUGCopyEntitythrew with a message about int indices from a filter. When the listener created an entity, which took the slot, the remaining components and a secondOnEntityCreatedwent to that entity in both builds.CopyEntitynow stops when the copy is destroyed (it returns the dead handle and sends noOnEntityCreated) and when the source is destroyed (the copy keeps what it got and is created; an entity in the source's slot is not copied).CreateEntity<T>no longer sendsOnEntityCreatedfor an entity that a listener of its component destroyed.EcsEntityView.Spawnskips the remaining providers when a listener destroyed the entity (it applied them to the freed slot, underKENSEI_DEBUGthe next one threw) and binds the view to the dead handle. Since 2.0.0.CopyEntityof an entity inside the removal of its last component (from anIWorldEventListener.OnComponentRemovedor anIFilterListener.OnEntityRemovedof that removal, which run before the auto-destroy) created an alive entity without components: no filter saw it, nothing destroyed it, and world listeners gotOnEntityCreatedfor it. Such a source has nothing to copy:CopyEntitynow returnsEntity.Nulland creates nothing, in both builds. Since 2.0.0.World.Clearfrom a listener insideDestroyEntity(anOnEntityDestroyedorOnRemovedthat restarts the level when the player dies) left the world broken: the destroy went on afterClearand released the slot again, soEntityCountwas -1, the free list held a slot past the end, and the next entity created there was not alive (IsAlivefalse, its component on a dead slot, inherited by the entity after it); underKENSEI_DEBUGthe nextAddthrew. An entity that the listener created afterClear, in the slot being destroyed, lost its components to the destroy.DestroyEntitynow stops at aClear, asRemovealready did. Since 2.0.0.- During
DestroyEntity,world.Has<T>returnedfalsefor the components the destroy had not removed yet, although they were still in their pools, readable withGet, and got their ownOnRemovedlater:if (world.Has<Position>(e))in anOnRemovedofHealthskipped silently, andif (!world.Has<B>(e)) world.Add(e, …)threw "already has component". A plainRemovedid not do that. With component types in more than one mask word (over 64 types), removing a component of the dying entity could also put it into anExcfilter of that component, whose listeners saw it enter, until the components that made it match were removed.DestroyEntitynow clears each component's mask bit as it removes it, and removing a component of a dying entity no longer lets it into a filter. A component that a listener adds to the dying entity still lets it enter the filters it then matches, now with the components not removed yet (OnEntityAddedsees it dead), until the destroy removes that component too; seeIFilterListener. Since 2.0.0. - A pooled
EventBuffer<T>list could end up on two entities. A struct copy of the buffer stored again after its component was removed — throughAdd,CommandBuffer.Add/Set/CreateEntity, or the pattern 2.1.1 documented,var b = world.Get<EventBuffer<Hit>>(e); b.Add(h); cb.Set(e, b);, with a OneFrame cleanup (also of a nested runner) or a recordedRemovebeforePlayback— put a list that was back in the static pool on the entity; the next buffer, in any world, got the same list, and the pool handed it out twice from then on (in a measured loop of the documented pattern after 2,000 frames: 15,964 duplicate pool entries, 28 entity pairs sharing a list, 132,800 B allocated over frames 1,001–2,000 instead of 1,704 B). The same happened, in any world, to a copy of another entity's buffer, also one whose listworld.AddEventhad rented for a buffer the entity already had without a list (added asnew EventBuffer<T>(), or set todefault), and to a buffer forwarded fromOnRemovedto another entity. Pooled lists now record whether they are free and which entity holds them (a pool id and an entity index): a value whose list is free or held by another entity is stored with an empty list of its own (Count0, andValuesis notnull, so a reader that loops overValues.Countkeeps working), an overwrite with such a value keeps the entity's buffer, a list returned twice is pooled once, and a list a stale copy appended to is cleared before it is handed out again.world.AddEventrecords the entity as the holder of every list it rents. Every rent of a pooled list is numbered and the buffer that rents it keeps the number (in an internal field:EventBuffer<T>is 16 bytes instead of 8 on 64-bit), so a stale copy that holds a list rented again since, for a new buffer that is not stored yet (var b = new EventBuffer<T>(); b.Add(x); cb.Add(e, b);), is stored with the empty list and the new buffer keeps its events (in 2.2.1 both entities ended up with the list). Writes straight into the pool's storage (Get(e) = copy,RawData) andpool.Get(e).Add(v)on a buffer without a list (which rents a list without a holder) are not checked. Since 2.0.0. CommandBuffer.Setoverwriting anEventBuffer<T>with a buffer that brings its own list returns the replaced list to the pool; it used to be dropped.World.Destroykept the owning groups, and through them every owned pool's arrays, reachable from the destroyedWorldobject.- A
World.Reservethat ran out of memory left the world unusable: it recorded the reserved sizes first, so every pool and filter created afterwards tried the same allocation and threw, and an interrupted growth could leave parallel arrays (slot arrays, a pool's dense arrays and change versions) with different lengths. Every array is now allocated before it replaces the old one, and the reserved sizes are recorded only after everything succeeded. Filter.Reserve(n)and the filter side ofWorld.Reserve(entities, n)allocated up to twicen; they now size the dense array exactly, like pools. Forint.MaxValue, which needs one slot more than an array can have, both throwOutOfMemoryExceptionand change nothing; 2.2.1 did nothing for the filter, and in a world with filters but no poolWorld.Reserve(…, int.MaxValue)recorded the size anyway, so every pool created afterwards threw.- When the rollback of a failed
SystemsRunner.Initthrew both inside a nested runner (a group or a phase, such as thefixedandlatephases ofEcsBootstrap) and in a runner above it,Initthrew anAggregateExceptionnested in another:InnerExceptions[0]was the innerAggregateException, not the original exception, andFlatten()listed the outer rollback errors first. It now throws one flatAggregateExceptionat any depth: the original exception, then every rollback exception in the order they were thrown. Without rollback errors the original exception is still rethrown unwrapped; anAggregateExceptionthrown by a system itself is kept whole as the original one. - Under
KENSEI_DEBUGa nested runner with a differentWorldorSharedDatawas rejected only after its entry had been added to the parent; both checks now run before anything is registered. Registration errors name the method that was called (SystemsRunner.AddPhase("fixed", SystemsRunner): ...) instead of alwaysAdd. SystemsRunner.Sharedof a runner added to a group or phase before that group was added to its own parent (a tree built from the bottom up, such as the groupsEcsBootstrap.Configureadds tofixedUpdateorlateUpdate) returned the group's own emptySharedDatafrom then on, while the runner's systems got the root's inInit. A runner withoutSharedDataof its own now reads its parent's at every call. UnderKENSEI_DEBUGa runner constructed with the root'sSharedDataand added to such a group before the group joined the root was rejected ("different SharedData than its parent"); the check now runs once theSharedDatais known: when the runner, or a group holding it, is added under a runner constructed withSharedData, otherwise inInit. Since 2.0.0.EcsBootstrap: underKENSEI_DEBUGa system, group or phase thatConfigureregisters in the update runner under"fixed"or"late"madeAwakefail insideAddPhasewith a message that did not mentionEcsBootstrap.Awakenow throws right afterConfigure, naming the system and saying thatEcsBootstrapreserves these names for its phases. The phase names are unchanged, and the phases are still registered afterConfigure(initialized after the update systems, destroyed before them); release builds still check nothing.EcsBootstrap:FixedUpdateandLateUpdaterun their runner only while that runner is initialized (they checkedSystems.IsInitialized). WhenAwakefailed before the phases were registered (an exception inConfigure, or the reserved name above), everyFixedUpdateandLateUpdateran a runner thatInitnever reached: underKENSEI_DEBUGit threw each time, in release it ran systems that were never initialized, and in both it advanced the world tick on every call, like a root runner. Such phases now stay idle.EcsEntityView.Spawncalled again before it returns — from a listener that the new entity's components trigger, such as anIComponentListener<T>.OnAddedor anIWorldEventListener.OnEntityCreatedthat spawns another view — no longer breaks the outer entity. Since 2.0.0 every call shared one static provider list, so the nestedSpawnoverwrote and cleared it: the outer entity lost the components of its remaining providers, and when the nestedSpawnthrew and the listener caught it, the outer entity got the child's providers instead. Each nesting depth now has its own list, reused by later calls, soSpawnstill allocates nothing once warm; the list is also cleared when a listener throws.
Changed
- Behaviour change: the rollback of a failed
SystemsRunner.Initdestroys only the systems whoseInitcompleted and that implementIDestroySystem, at every nesting level. In 2.2.0 and 2.2.1 it destroyed everyIDestroySystemregistered before the failed system, so a system withoutIInitSystem(also one inside a nested runner that had completed itsInit) was destroyed by the rollback: the retriedInitand the frames after it ran with whatever itsDestroyhad released, and it was destroyed again at shutdown. Such a system now gets itsDestroyonly fromDestroy()after a completedInit; a runner whoseInitnever succeeds does not destroy it, as in 2.1. Nested runners that completedInitare still rolled back system by system, the failing one still rolls itself back first, and the nextInitstill starts from the first system. The XML docs ofIInitSystem,IDestroySystemandSystemsRunner.Init/Destroydescribe the contract. - Behaviour change: a
SystemsRunnercan be registered only once, in one slot of one parent, in every build.Add,AddGroup,AddPhaseand the obsoleteAdd(runner, name)throwInvalidOperationExceptionfor a runner that is already registered — in the same runner (two groups, two unnamed slots, a phase and a group) or in another one — naming its slot (the group "sim" (index 1) of this runner), and for a runner added to itself or to a runner nested in it. A rejected call registers nothing. Up to 2.2.1 a second registration was accepted, and its slots shared the runner'sIsEnabled: afterSetActiveon one slot the other slots,IsActiveandGetSystemInfo(i).IsEnableddisagreed with what actually ran, so the Systems window showed wrong checkboxes; a runner added to itself recursed without end inInit. To run the same systems at two points of a frame, use two runners. - Behaviour change: when a filter listener removes a component again while it is being added (or destroys the entity), world listeners get the
OnComponentRemovedof that removal and noOnComponentAddedafter it; up to 2.2.1 theOnComponentAddedfollowed and left them believing the entity had the component. The same for a removal: when a filter listener adds the component back while it is being removed (anInc<T>listener inOnEntityRemoved, anExc<T>listener inOnEntityAdded), world listeners get theOnComponentAddedof that addition and noOnComponentRemovedafter it, and when it destroys the entity and creates one that takes the slot, they get the new entity's events and noOnComponentRemovedfor the slot after them; up to 2.2.1 theOnComponentRemovedcame last and told them the entity had lost the component, or that the new entity had. A world without filter listeners on the type pays nothing for it. Unchanged: a filter listener that removes the component and adds it back at once makes world listeners get the removal and then twoOnComponentAdded, the re-added component's and the originalAdd's, and a world listener that a filter listener subscribes during anAddorRemovegets that change's event. - Behaviour change: a typed listener (
IComponentListener<T>) that a filter or world listener subscribes during anAddof its pool gets theOnAddedof thatAddonly when the pool already had typed listeners when theAddstarted; otherwise its firstOnAddedis for the nextAdd. Up to 2.2.1 it also got thatOnAddedwhen the pool tracked changes, belonged to an owning group or heldEventBuffer<T>(on a pool with none of these it did not either). With typed listeners present theOnAddeddispatch still starts after the filter and world listeners, over the listeners subscribed by then: one they unsubscribe gets noOnAdded, as up to 2.2.1. - Behaviour change: the
refreturned byAddpoints at the scratch value also when a listener destroyed the entity and a new entity took its slot; it used to point at the new entity's component. When a listener removed the component and added it to the same entity again, it points at the new component, as before. - Behaviour change: a list assigned to
EventBuffer<T>.Valuesby hand is still cleared when the component is removed, but no longer goes into the list pool. - Behaviour change: under
KENSEI_DEBUGa dead handle is accepted only for the entity whoseDestroyEntityis running. It used to pass validation (Add/Get/Has/Remove,AddEvent,pool.Addby index) whenever any entity was being destroyed, so a listener inside someDestroyEntitycould add a component or an event to another, dead slot, which the next entity there inherited.
Performance
Addno longer re-reads the dense index when no filter or world listener ran;World.OnComponentAddedtakes a lean path while no filter of the component's type has listeners and nothing is dispatched (each type counts its listened filters, so a filter listener elsewhere in the world does not slow this type down);World.OnComponentRemovedhandles world listeners out of line;EventBuffer<T>pools check list ownership onAddonly, record the holder as a pool id and an entity index and call the check through a class instead of an interface; the re-entrancy frames store their listener arrays only when there is one to store (on IL2CPP every store into a reference field,nullincluded, calls the GC write barrier). In-process A/B against 2.2.1 on an Apple M5, interleaved runs, medians: IL2CPP (Unity 6000.3.13f1, macOS arm64, Release, incremental GC with its write barriers; no device measured) / .NET 8 / .NET 10; runs of the same code differed by up to 2%, and by up to 4% for creating and destroying entities on .NET. Faster:Add+Removewithout hooks −17% / −10% / −6%, with fourIncfilters −4% / −5% / −6%, with fourExcfilters −6% / −3% / −1%, the same fourIncfilters next to a listened filter of another type −5% / −7% / −6%, with change tracking −13% / −4% / +3%;DestroyEntityof five components in filters −7% / −1% / −1%;CreateEntity+DestroyEntityandCopyEntity+DestroyEntitywithin ±3%. Slower, all with listeners orEventBuffer<T>: with a typed listener +26% / +20% / +24% (the re-entrancy frames, about 3 ns perAdd+Removeon IL2CPP); through a filter that has a listener +19% / +17% / +17% (the re-check of the entity after each filter whose listener ran, about 2.5 ns); with a world listener +13% / −1% / −4% forAdd+Remove(after the world listenersAddchecks that the entity still has the component, andRemovereports through a separate method) and +10% / +12% / +4% forDestroyEntity; anEventBuffer<T>'s first event in a frame plus its cleanup +16% / +6% / +11%, three events +8% / +4% / +6% (the ownership check).SystemsRunner.SetActive(bool)on an inline group sets its slot directly instead of scanning the parent's run slots.- What the last fixes of this release cost (the
OnAddeddispatch taking the typed listeners after the world update, a removal reaching world listeners its filter listeners subscribed, numbered list rents), measured in-process A/B against the state before them on an Apple M5 Pro, .NET 8 / .NET 10, interleaved runs, medians; IL2CPP not measured, so the IL2CPP figures above predate them:Add+Removewith a typed listener +1% / +1%, withInc,ExcorAnyfilters −1 to +2% / +1 to +3%, through a filter that has a listener and no world listener +3 to +6% / +2 to +3%; anEventBuffer<T>'s first event in a frame plus its cleanup +3% / +5%, a frame of OneFrame events +5% / +4%, the read-modify-write throughCommandBuffer.Set+5% / +5%; the other paths measured (no hooks, change tracking, groups, world listeners,CreateEntity/CopyEntity/DestroyEntity) within ±2%.
Generator
- Behaviour change: the generated
Initispublic virtualin every class that is notsealed, whether or not the compilation contains subclasses of it; asealedclass keeps the plainpublic void Init. In 2.2.0 and 2.2.1 it was virtual only when a subclass in the same compilation overrode it, so theInita subclass in another assembly saw depended on the subclasses (and defines) of the base's assembly: with a subclass underUNITY_EDITOR,DEVELOPMENT_BUILDorKENSEI_DEBUG, the Editor chained a derived system and reported (KECS012) thebase.Initthat the player build needed, while the player silently kept the 2.1 layout with the base fieldsnull, or failed with KECS006. A derived system in another assembly is now chained in every build, so abase.Initit still calls fromOnInitfor the 2.1 layout is KECS012: delete it. A hand-written subclass that declarespublic void Init(World, SharedData)withoutoverrideornewgets CS0114 instead of CS0108 (both warnings; it still hides the baseInit). - Behaviour change: a derived generated
Initfills the derived fields first, then callsbase.Init(world, shared), then the derivedOnInit. 2.2.0 calledbase.Initbefore filling the derived fields, so the baseOnInit, a hand-written baseInitand the virtual methods they call saw the derived fieldsnull; on 2.1, where the derivedOnInitcalledbase.Init, they were already filled. This corrects the 2.2.0 entries "base fields, baseOnInit, then derived fields andOnInit" and "the base still runs first": the baseInitstill runs before the derivedOnInit, but after the derived fields, as on 2.1. A[Shared]field of the derived class is now read before the baseInitruns, so an object the baseOnInitadds toSharedDatais not there yet. Code that stood inOnInitbefore the deletedbase.Initline runs after the baseInit. - Behaviour change: KECS006 again reports a class that keeps the 2.1 layout (lists
IInitSystemover a baseInitthat cannot be overridden: not virtual, sealed, not public, hidden by anew Initin between, or from an assembly built by 2.2.1 or older) without abase.Initcall, as 2.1.1 did, when the baseInitwould never run: it is theInitthe runner reaches throughIInitSystem.Init, or a base has injected fields (anew Initin between that does not implementIInitSystem.Init, with no injected fields above it, is taken for an unrelated method and not reported, as in 2.1.1); 2.2.0 dropped the check and the baseInitwith its injected fields was silently skipped. The check now also covers a hand-written non-virtual baseInitthat implementsIInitSystemwithout injected fields, which 2.1.1 did not report, and asealedorprotectedoverride of the baseInitin a class between (Mid : Root { public sealed override void Init(...) }), which neither 2.1.1 nor 2.2.1 reported: the interface maps to the first declaration of the method, so the override was taken for an unrelatedInitand both were skipped without a word. An explicit baseIInitSystem.Init, whichbase.Initcannot reach, stays accepted without the call. Of a base in another assembly only theprotectedandpublicinjected fields are seen, as for KECS013: over a base there with onlyprivateones a missingbase.Initis not reported. - New warning KECS013: a hand-written override of a generated
Init(directly or through hand-written overriding classes) that has nobase.Initin its own declarations. On 2.1 such an override did not compile (CS0506); since 2.2.0 it compiled and left the base fieldsnull. The check is syntactic like KECS012; a generated base in another assembly is recognised only by itsprotectedorpublicinjected fields. - A hand-written base that implements
IInitSystemthrough another interface (GameSystem : IGameSystemwithIGameSystem : IInitSystem) and has apublic virtual Initis chained; 2.2.0 reported KECS006 ("does not implement IInitSystem.Init") or, when the derived class listedIInitSystem, kept the 2.1 layout and skipped thatInitwithout a warning. A derived class that lists such an interface itself keeps the 2.1 layout like one that listsIInitSystem. Whether a baseInitis the oneIInitSystem.Initmaps to is decided by the compiler's interface mapping, now also for bases in other assemblies. - The base
Initis no longer picked by name and member order. An explicitIInitSystem.Initthat does part of the base's setup and then calls thepublic virtual void Initnext to it (Init(world, shared)orthis.Init(world, shared)) is chained in either member order: the runner calls the explicit one, which reaches the generated override; 2.2.0 and 2.2.1 chained it only when the publicInitcame first. An explicit implementation that does not call the publicInitis KECS006, since an override of the public one would never run (when the public one came first, 2.2.0 overrode it anyway and the generatedInitnever ran). The call is read from source, so a base from another assembly with both is KECS006. A genericInit<T>(World, SharedData)whoseTthe call cannot infer no longer gives a false KECS006 and does not take the generatedbase.Initcall; a non-voidInit(World, SharedData)between two chained classes is reported as an overload that takes the call instead of a misleading "is not virtual"; a privateInitof a base is ignored. - Behaviour change: such an explicit base
IInitSystem.Initthat does not call the publicInitis KECS006 also when hand-written overrides of the publicInitsit between the base and the derived class: the runner calls the explicitInit, so neither the overrides nor the generatedInitrun. 2.2.1 took an override for chainable, and the derived fields stayednullwithout a diagnostic. A base from another assembly is not read, so with an override in between it is KECS006 as well, also when its explicitInitcalls the public one (2.2.1 compiled that, and it worked). A derived class that listsIInitSystemitself is chained over such overrides, as before (the interface then maps to the generatedInit). - Behaviour change: KECS006 also reports an
Initoverload on the chained base itself and on the classes above it, up to the class that first declares the overriddenInit. C# looks an override up at that class, so an overload such asInit(World, params SharedData[]),Init(World, object)orInit(World, SharedData, int x = 0)above a hand-writtenoverrideor next to it (or above a generated override of anabstractInit) took the generatedbase.Init(world, shared), and the chainedInits never ran, without a word; 2.2.1 checked only the classes between. An overload in the class with the first declaration loses to it and stays allowed. - A hand-written base with an
OnInit(World, SharedData)of its own (for example a virtual hook itsInitcalls) no longer breaks the derived generated class: 2.2.0 declared the generatedpartial void OnInitover it (CS0114 or CS0108 in the generated file) and failed with CS0111 when the derived class overrode the hook. The generated part now declares no partialOnInitover such a member, and an override of the hook runs once, after the derived fields are filled: from the baseInitwhen the generatedInitcalls a baseInitthat can call the hook (the hook is declared in that base or in one of its bases), and from the generatedInitotherwise (a base that is not a system, anabstractbaseInit, a hook declared in a hand-written class between a generated base and the derived class). In the 2.1 layout an override of a hook that the replaced baseInitcan call is KECS006: the generatedInitwould call it, and thebase.InitthatOnInitmust call would run it again (without end, unless guarded). Apartial void OnInitthat the derived class implements anyway is still declared and called, with the hiding warning silenced in the generated file. The same removes CS0108 for a system nested in its generated base. AnOnInit(World, SharedData)written withoutpartial(CS0111 before) is called by the generatedInit, unless it overrides a hook that the chained baseInitcalls. - Systems whose full names differ only in case (
Game.AI.MoveSystemandGame.Ai.MoveSystem), or a generic system next to a class named like its hint (Gen<T>andGen_T_), no longer make the generator fail. Roslyn compares hint names without case; the generator threw, the compilation got only the warning CS8785, and no system of the assembly had a generatedInit, so all their injected fields stayednull. Such names now get a numeric segment (Game.Ai.MoveSystem.2.Injection.g.cs), chosen by the names, not by file order. - Keywords used as identifiers (
namespace Game.@event,class @class, a field@event, a type parameter@in) are escaped in the generated file; a keyword in a namespace or type name put@into the hint name and made the generator fail the same way (CS8785). A[Shared]key is written as an escaped string literal, so one with a line break or another control character compiles. - No more CS0108, CS0109 or CS0505 in generated code over unrelated base members: a generated
Initis declarednewexactly when it hides an accessible inherited member (also a staticInit(World, SharedData)or a non-method member namedInit, which got nonewbefore; not anInitwithinparameters or an inaccessible one such asprivate protectedin another assembly, which got a needlessnew), and a member namedInitthat is not a method on a class between two chained systems is KECS006 instead of CS0505 in the generated file. - KECS012 says that the generated
Initcallsbase.InitbeforeOnInit(it said "first"). Plugins/KenseiECS.Generators.dllis rebuilt; the packaged-DLL test covers the virtualInit, the new field order, KECS006 for the 2.1 layout withoutbase.Init(also over asealedoverride in between), for an override in between over an explicit baseInitand for an overload above the chained override, KECS013, a baseOnInithook (also one that no baseInitcalls), an explicitIInitSystem.Initthat calls the publicInit, and hint names that differ only in case.
Editor
- Profiler window: the selected event stays selected while recording goes on. Once the ring buffer was full, every new event moved the others down and the selection (a position in the list) slid to other events, so the call-stack panel changed with every snapshot. An event that leaves the buffer is now deselected.
- Profiler window: the Entity column no longer shows
v0for component events, which record no generation; it is taken from the slot's Created or Destroyed events in the buffer, and without one the cell shows the index alone (E(5)). The debug name is shown only for the event's own entity: once a slot was reused, older events of that index showed the name of the entity living there now. - Profiler window: Next > is disabled on the last page, a new search starts at the first page, and the page is pulled back when the events are cleared from code or
MaxEventsshrinks; the list could be paged past its end and stay empty. - World Inspector and Systems windows skip a provider that still returns a destroyed world (or a runner of one). The window dropped it on the next update and could find it first again on every later bind, so the live world or runner of a second provider was never shown.
- World Inspector (Entities, Filters and Pools tabs) and the
EcsEntityViewinspector name generic component types with their arguments (EventBuffer<Hit>,Listeners<IHealthView>) instead ofType.Name(EventBuffer`1for every buffer), and the entity search matches the arguments. Profiler events keepType.NameinComponentType.
Documentation
- README, site home page and introduction: what a throwing listener or system restores (entity slots, runner and buffer state) and that only a throw inside
DestroyEntityor a snapshotLoadcan leave components behind, whichClear()recovers; they said the world is never left inconsistent. - CommandBuffer page and
CommandBuffer.Set: the read-modify-write of anEventBuffer<T>is not a way to defer events; useworld.AddEvent, or keep the values and add them afterPlayback. - One-frame guide and
EventBuffer<T>: copies share the entity's list and are stale once the component is removed; what storing a stale copy does now;Valuesisnullin a buffer added without events;pool.Get(e).Add(v)on such a buffer is not checked, useworld.AddEvent;Prewarmtakes up to O(lists × free lists). - World config and
World.Reserve: whatReserve(entities)costs (about 4 bytes × entities per pool and 4 KB per 1024 entities per filter, also for pools and filters created later; about 200 MB for 1000 types at 50,000 entities, 236 MB with 150 filters) and what to do for such worlds until there is an API for it; exact sizes; a failedReserve; aReservethat grows a pool or filter invalidatesrefs,RawData/RawEntitiesandFilter.Entitiesspans like any growth. TheInitialEntityCapacityrow no longer claims to size filter sparse arrays. - Migration guide and components page: everything that invalidates a
ref(aReservethat grows the pool included), and why arefthat survives another entity'sDelin Lite does not here. - Component listeners: a listener may remove components of its own pool from
OnRemoved(its own entity's or a linked one's), every listener gets oneOnRemovedper component and cycles end; a component removed and added again is a new one;Warmupcontinues on a new temporary entity when a listener destroys it; whatOnRemovedsees duringDestroyEntity, aClearthere, and anOnAddedthat destroys an entityCreateEntity,CopyEntityorSpawnis still building. - World lifecycle, world events and architecture:
Warmupwhen a listener destroys its entity, the world event order when a filter listener takes a component away or adds it back,OnEntityCreatedfor an entity destroyed while it was made,HasduringDestroyEntity,Clearfrom a listener, hook frames, the add/remove hook flags, the per-type count of listened filters, list ownership, debug handle validation,Destroyreleasing groups. - Runner page: what the rollback of a failed
Initdestroys (completedInits only; systems withoutIInitSystemare left forDestroy()), the flatAggregateException, a runner registered only once, the namesEcsBootstrapreserves, and which registration a name reaches in release when two share it: the page said the second always replaced the first, but a system or group and a phase split the name (SetActive,IsActiveandIndexOfreach the system or group in either order,GetRunnerthe phase), which is what happens with"fixed"and"late"inEcsBootstrap's update runner; the bootstrap page says so too. Bootstrap page: the reserved names"fixed"and"late"in debug and release, the per-runner guards ofUpdate/FixedUpdate/LateUpdate, and not registeringfixedUpdate/lateUpdatein another runner. Systems page, migration guide, architecture and package README updated to match (whenInitandDestroyare called, the rollback, one parent per runner, the bootstrap guards). - Source generator guide: the order (derived fields, base
Init, derivedOnInit),Initvirtual unlesssealed, a base with its ownOnInit(who calls an override of the hook), an explicitIInitSystem.Initthat calls the publicInit, KECS006 for the 2.1 layout withoutbase.Init, the warning KECS013 and upgrading from 2.2.0 and 2.2.1; FAQ, migration guide and architecture (generator section) updated to match. - Release vs.
KENSEI_DEBUGchecked against the code:Getof a missing component throwsIndexOutOfRangeExceptionon Mono and .NET and reads (or through therefwrites) outside the pool's arrays on IL2CPP; new rows forAddEvent/Subscribe/Unsubscribewith a stale handle,GetComponentTypes/GetComponentCountof a dead entity, a listener that keeps re-adding components to a dying entity (in releaseDestroyEntitynever returns), a name registered twice in one runner, a runner registered twice, the namesEcsBootstrapreserves,IsActiveon a system withoutRunandWorld.ClearafterDestroy; the runner rows say what release does, and the handle rows that debug validation accepts only the entity being destroyed. Which debug APIs exist in release builds and which need#if KENSEI_DEBUG, the sources the release check names, and that-p:KenseiDebug=truereaches a referencedKenseiECS.NETproject. - Debug tools: the Systems window tags only phases as phase; the Pools tab's Size is
Marshal.SizeOf(aboolfield counts 4 bytes); the Profiler's Entity column, history per entity index, kept selection and paging;ProfileEvent.Generationis set for Created and Destroyed only; providers of a destroyed world are skipped. - Entity view:
Spawncan be called again from a listener of the components it adds, and stops when such a listener destroys the entity. Entities page and FAQ:CopyEntityandCreateEntityreturn a dead handle, and send noOnEntityCreated, when a listener destroys the new entity. - Filters page and
IFilterListener: a component that a listener adds to an entity being destroyed lets the dying entity (IsAlivefalse) enter filters until the destroy removes it; they said the entity is always alive on enter. World events and architecture: a world listener that a filter listener subscribes during a change gets its event, and a filter listener that removes the component and adds it back makes world listeners hear of two additions. Component listeners and architecture: which typed listeners theOnAddeddispatch takes. Entities page and FAQ:CopyEntityof a source without components left. One-frame guide andEventBuffer<T>: numbered rents. Runner page:Sharedof nested runners, and when the debugSharedDatacheck runs. World config,Filter.ReserveandWorld.Reserve:int.MaxValue. Source generator guide: KECS006 over overrides in between (and the chaining of a derived class that listsIInitSystemover them) and for overloads up to the first declaration, the 2.1 layout over anew Initthat is not reported, and which injected fields of a base in another assembly KECS006 sees. - Benchmarks: one game-loop time for 2.0. The game-loop table, the performance tables of the README and the introduction and the comparison page showed 34 us from the first benchmark session, taken before the last filter change of 2.0 (
479b6f0), while the 2.0-versus-1.0 table had 33 us measured after it; all say 33 us now, the benchmarks page says which numbers come from which session (the README and the introduction no longer say one session), and the game loop is 2.4x faster than Arch (was 2.3x, also on the home page).
[2.2.1] - 2026-10-23
Added
World.FirstGrowthAfterReserve(aStorageGrowth): underKENSEI_DEBUGthe first growth counted byGrowthsAfterReserve— owner (component type, filter description orWorld), array, old, new and reserved sizes and the tick — so the storage that outgrew the reserve can be found without recording the world inEcsProfiler. Later growths do not replace it;Clearresets neither it nor the count. Empty (IsEmpty) without the define.
Fixed
- Content builds with Debug Mode on work again. In 2.2.0 the release check was a
#errorin the runtime assembly, and Addressables, the Scriptable Build Pipeline and legacy AssetBundles compile the player scripts withoutDEVELOPMENT_BUILD, so every content build failed whileKENSEI_DEBUGwas set — with Addressables' default settings even a Development player build (its content step). The runtime assembly now compiles a marker type instead, and a new editor check after the player scripts compile (IPostBuildPlayerScriptDLLs, which Unity calls for player builds only) fails a non-development player whoseKenseiECS.dllhas it, naming where the define came from:BuildPlayerOptions.extraScriptingDefines, Player Settings -> Additional Compiler Arguments (-define:, which 2.2.0 did not mention) orAssets/csc.rsp. A development build is recognised by the build options, as in the preprocess guard, rather than by theDEVELOPMENT_BUILDdefine, which Unity 6.6 deprecates (its UAC0009 warning from this file is gone, and a release build with a hand-writtenDEVELOPMENT_BUILDno longer slips through). The check adds a short step to every player build. The preprocess guard for the Scripting Define Symbols of the Build Profile and Player Settings is unchanged. - In release, a
CreateEntityon a destroyed world claimed an entity slot before failing withNullReferenceException, after whichIsAliveandDestroyEntitythrew too instead of returningfalseand doing nothing. The slot is now claimed only once it exists. World.ClearafterWorld.DestroythrowsObjectDisposedExceptionin every build, likeReserveand filter creation; it failed withArgumentNullException.- Under
KENSEI_DEBUGa pool built its type name on its first growth even when nothing was reserved (one string per pool, about 30 extra allocations in a measured game battle, absent in 2.1.1). The name is now built only for a growth thatReservewatches. StorageGrownprofiler events for filters name the filter (Filter Inc<Position, Velocity> filter dense 128 -> 256 (reserved 128)) instead of the bare wordFilter.- The
[Obsolete]message ofSystemsRunner.Add(SystemsRunner, string)now says that only a named call creates a phase; withnullit adds an unnamed inline group, as documented.
Documentation
AddGroup(and an unnamedAdd(runner)) starts the group's slot as the group is: a group switched off withSetActive(false)before registration starts disabled.- World config: a filter does not create its pools, so a pool first used during play allocates there even after
Reserve(n, n); the cost ofcomponentsfor every pool, with a measured example, next to reserving only the hot pools. - Debug tools: the sources of
KENSEI_DEBUGeach check reads; the CI check beforeBuildPlayerdoes not read Additional Compiler Arguments orAssets/csc.rsp, and the check after the player scripts compile catches those. Content builds are not checked.
[2.2.0] - 2026-10-22
Added
EventBuffer<T>.Prewarm(lists, capacity)fills the static list pool up front: the nextlistslists the pool hands out getCapacityof at leastcapacity. Free lists already that large are used first, then the largest remaining ones are grown (at mostlistsof them, so a pool left large by an earlier peak is not inflated), and new lists are created only when fewer thanlistsare free; the prepared lists are moved to the top of the pool. A repeated call with the same arguments does nothing. The pool is static perTand shared by every world in the process;World.Warmupstill does not fill it, and neither doesPrewarmsize the world (useWorld.Reserve).World.Reserve(entities, components = 0)grows storage ahead of time in one call: entity storage (generations, masks, free-slot list) and the sparse side of every pool and filter forentities, and the dense arrays of every pool (entities, data, change versions) and filter forcomponents. Both apply to existing pools and filters and to those created later in the world. AfterReserve(n, n), creating and destroying n entities with components that enter filters allocates nothing; creating a pool or filter still allocates the object (and, in a new 64-type block, a mask word).componentscosts that many slots of every component type, singletons included;ComponentPool<T>.Reserve(count)(dense, data, change-version and sparse arrays) andFilter.Reserve(count)(dense array, safe during iteration) size one pool or filter. Nothing shrinks. On a destroyed worldReservethrowsObjectDisposedException.World.GrowthsAfterReserve: underKENSEI_DEBUGit counts every growth past whatReservereserved (entity slots, free-slot list, pool sparse arrays and filter pages pastentities; pool and filter dense arrays pastcomponents; a dimension left at 0 is not watched), and whileEcsProfilerrecords the world each such growth is aProfileEventType.StorageGrownevent naming the array and its sizes (Profiler window: Grow filter). ItsEntityIndexis -1. The window's search (ProfileEvent.MatchesSearch) treats a query of digits as an entity index and matches it only against events that have an entity, so typing1no longer lists every growth ("-1", "64 -> 128"); growth events are found by text (dense, a type name) or the Grow filter. Always 0 without the define; release builds check nothing.Listeners<T>.Invoke(call, onError)andInvoke<TArg>(arg, call, onError)call the listeners from a snapshot of the list in subscription order (first subscribed, first called; hand-written loops overValuesusually went from the end). A listener removed from the list during the dispatch before its turn is skipped (a view destroyed withObject.Destroystays subscribed until itsOnDestroyat the end of the frame, so it is still called); listeners added during the dispatch are not called; each snapshot entry is called at most once. "Still subscribed" usesEqualslikeRemove, so a struct listener removed and added again counts as subscribed; a listener added several times is matched by value, not per copy. On an unchanged list the check is one reference comparison per listener; after a change the search widens from the previous listener's position in both directions, so a listener unsubscribing itself or a callback inserting listeners before the current one does not make the rest of the dispatch quadratic. IfonErroritself throws, the dispatch stops and that exception propagates. The snapshot is rented fromArrayPool<T>.Sharedand cleared and returned infinally; nested calls work. WithoutonErroran exception propagates; with it the error is reported per listener and the call continues. In theTArgoverloadonErrorisAction<T, TArg, Exception>and receives the argument too, so static lambdas for bothcallandonErrorallocate nothing.SystemsRunner.AddPhase(name, runner)registers a separate phase (same as the now obsoleteAdd(runner, name));AddGroup(name, runner)registers a named inline group that runs inside the parent'sRun, is reachable throughSetActive(name),IsActive(name),IndexOf(name)andGetRunner(name), and gives its name to itsProfilerMarkerandSystemInfo.Name.SystemsRunner.IndexOf(ISystem)(by reference) andIndexOf(string)return the registration position used byGetSystemInfo/SetActive(int), or -1. They find any registered system, Init/Destroy-only ones included, whichSetActivecannot toggle (GetSystemInfo(i).IsRunnableis false). For a run system, group or phaseIndexOf(string)resolves an explicit registration name exactly likeSetActive(string)/IsActive(string)and falls back to the first unnamed system with that type name only when no system was registered under the name. Nested runners are not searched.SystemsRunner.SetActive(bool)toggles a runner through a reference to it: on an inline group (named or not) it switches the group's slot in the parent together with itsIsEnabled, like the parent'sSetActive(name); on a phase or a root runner it sets the runner's ownIsEnabled(a disabled root'sRunstill advances the tick but runs no systems).SystemsRunner.OneFrame<T>(cleanWhenDisabled): withtruethe type is also removed in frames where the runner is skipped, at the slot of a disabled inline group (recursively into its inline groups) or inRun()of a disabled phase. Systems andDelHereof the skipped runner still do not run.OneFrame<T>()keeps the old behaviour. A runner tree withoutcleanWhenDisabledtypes passes disabled slots at the 2.1 cost.
Changed
- Behaviour change: a
SystemsRunner.Initthat throws now rolls back.Destroyis called on everyIDestroySystemregistered before the failing system, in reverse order (a nested runner that fails rolls itself back first), the progress is reset and the original exception is rethrown; if rollbackDestroycalls throw too, the rollback still completes (also inside nested runners registered before the failing system: each of their systems is destroyed even when another one throws) and anAggregateExceptionholds the original exception followed by the rollback errors. The nextInitstarts from the first system. Up to 2.1.x the systems before the failing one were left initialized and the nextInitresumed with the failing system.Destroy()after a failedInitdoes nothing. - Behaviour change:
SetActive(index|name)on an inline group (named or unnamed) switches both the parent's slot and the group's ownIsEnabled; up to 2.1.x the unnamed child'sIsEnabledstayedtrue.GetSystemInfoandIsActiveagree with it. A directRun()of such a group while its slot is off now runs nothing (it only removesOneFrametypes registered withcleanWhenDisabled); in 2.1.x it ran the group's systems. - Under
KENSEI_DEBUGSetActive(int),SetActive(string)andIsActive(string)on a system withoutRun(Init/Destroy only) throwInvalidOperationExceptionsaying so;SetActive(int)used to do nothing, and by name the error claimed that nothing was registered under the name. Release builds still ignore it. Names stay case-sensitive and an unknown name stays silent in release; both are now spelled out in the XML docs and on the runner page. World.FilterafterWorld.DestroythrowsObjectDisposedException, and underKENSEI_DEBUGso doCreateEntityandPool<T>, instead of aNullReferenceException.- Under
KENSEI_DEBUGregistering a name that is already used in the same runner (system, group or phase) throwsInvalidOperationException; before, the later registration silently replaced the earlier one in the name lookup.AddPhase/AddGroupthrow for anullrunner or an empty name in every build. EcsBootstrapregisters itsfixedandlatephases withAddPhaseinstead of the now obsoleteAdd(runner, name); the phases and their names are unchanged.
Deprecated
SystemsRunner.Add(SystemsRunner runner, string name)is a new overload marked[Obsolete](a warning) with the 2.1 behaviour: a named runner passed toAddis a separate phase, which next toAddGroup(name, runner)reads like a group whose systems then never run. UseAddPhase(name, runner)for a phase orAddGroup(name, runner)for an inline group.Add(runner)without a name,Add(system, name)for other systems and a runner passed as anISystemdo not warn.
Generator
- Behaviour change: a derived system with injected fields whose base can be chained (a generated base in the same compilation, or a hand-written base with a
public virtualorabstractInit) always gets a generatedInitthat overrides the base one and callsbase.Init(world, shared)first (none for an abstract baseInit). Abase.Initwritten in the class itself is now the new error KECS012 ("generated Init already calls base.Init first; remove the call from OnInit"): the 2.1 layout, where the derived class re-implementsIInitSystemand callsbase.InitfromOnInit, is no longer kept for such classes. To upgrade, delete thebase.Init(...)line; the base still runs first. The check is syntactic: anybase.Initmember access in the class's own parts counts, whatever overload it binds to (rename a hand-written base helper namedInit); one inside a nested type does not. A class that listsIInitSystemitself over such a base without callingbase.Initis chained too, so that baseInitnow runs (on 2.1 it was skipped). Over a baseInitthat cannot be overridden (not virtual, sealed, not public, explicit), a class that listsIInitSystemitself keeps the 2.1 layout as before. - Systems with injected fields can derive from a
partialsystem with injected fields in the same compilation, or from a base with apublic virtual Init. The base's generatedInitbecomespublic virtual, the derived one apublic overridethat callsbase.Init: base fields, baseOnInit, then derived fields andOnInit. Works over several levels, through intermediate classes without fields and with generic bases. A hand-written subclass that overridesInit(directly or through hand-written intermediate classes that override it and callbase.Init) also makes the generated baseInitvirtual, so such a chain compiles instead of failing with CS0506. Systems without inheritance get the same.g.csas before. Where the generatedInithides an inherited one, it is declarednew(no more CS0108/CS0114 in generated code). - KECS006 is now reported only where inheritance cannot work: a base
Initthat is not virtual, sealed, not public or explicit (unless the class listsIInitSystemitself, see above), an intermediate class that hidesInit, an intermediate hand-written class with anotherInitoverload that the generatedbase.Init(world, shared)would bind to instead of the chained baseInit(for exampleInit(World, object),Init(World, SharedData, int x = 0), a generic orparamsoverload; rename it), or a base from another assembly whoseInitis not virtual. The message names the reason. A derived class of a base that failed with its own error (for example KECS001) gets no second error. Plugins/KenseiECS.Generators.dllis rebuilt; the packaged-DLL test covers the inheritance case and KECS012.
Editor
- Behaviour change: the Debug Mode toggle writes
KENSEI_DEBUGto the active Build Profile's scripting defines on Unity 6 when a profile is active, otherwise to the Player Settings of the current build target only (2.1.x wrote every target). The checkbox shows whether the define is in effect for the active profile or target; turning it off removes it from both the profile and the current target's Player Settings, so a define written to all targets by 2.1.x does not keep the mode on. Other targets are not changed; if their Player Settings still have the define, a warning lists them. Each write to a Build Profile asset (shared, usually under version control) is logged with its name and path. - Behaviour change: a new build guard (
IPreprocessBuildWithReport) fails a non-development player build whose defines (active profile plus Player Settings of the built target) containKENSEI_DEBUG. The error names where the define comes from (the profile's name and asset path and/or the Player Settings target). DefineKENSEI_ALLOW_DEBUG_RELEASEto allow it. Defines the guard cannot see (BuildPlayerOptions.extraScriptingDefines,csc.rsp) are caught by a#errorin the runtime assembly when a release player is compiled withKENSEI_DEBUG; an allow define passed only that way satisfies the#errorbut not the guard. The guard runs early (callbackOrder-1000) but does not stop other preprocessors: Unity still calls those ordered after it, so their asset changes can remain after the failed build; build scripts should check the defines beforeBuildPlayer.BuildPlayer(BuildPlayerWithProfileOptions)makes the profile active before the build, so its defines are checked (and it stays active afterwards). A profile with its own Player Settings ("Customize player settings") makes Unity read and write that copy while it is active: turning Debug Mode off then edits the profile asset and logs it, and the guard error and the other-targets warning say that the Player Settings are the copy in the profile (the warning also notes that the project'sProjectSettings.assetwas not checked). With the Dedicated Server subtarget active, the toggle and the guard use the Server define slot on every supported Unity version (2021.3+).
Documentation
- One-frame guide: prewarming the list pool, the static shared pool,
cleanWhenDisabledfor paused runners. - Runner page: phase / named group / unnamed group,
AddPhase/AddGroup,IndexOf,IsEnabledof inline groups, theInitrollback contract; architecture, migration guide and bootstrap page updated to match. - World config and lifecycle pages:
Reservewithcomponents,GrowthsAfterReserve, use afterDestroy. Listener bridge:Invokeorder, skipping of unsubscribed listeners (and why a view destroyed withObject.Destroyis still called in the same dispatch), matching byEquals, duplicates and a throwingonError. One-frame guide and migration guide:Prewarmdoes not size the world; a warmup that created entities needsWorld.Reserveas well. Runner page: case-sensitive names, silent unknown names in release,SetActive(bool), the obsoleteAdd(runner, name). Architecture: whyListeners<T>lists are not pooled (a copy written back after a remove would share a pooled list between entities). - Source generator guide: inheritance, the new KECS006 cases, KECS012 and upgrading from 2.1; FAQ, architecture and migration guide updated.
- Debug tools, debug mode, installation and FAQ: where the toggle writes the define and the release build guard; the profile is a shared asset (Unity may leave
m_HasScriptingDefineschanged after off/on), the warning about other targets, profiles with their own Player Settings, and a pre-BuildPlayercheck for CI (it activates the profile before readingPlayerSettings). World.Warmup/SystemsRunner.WarmupXML docs and the package README: typed and filter listeners see Warmup's temporary entity.
[2.1.1] - 2026-10-22
Fixed
- A typed listener that removes the same component again from
OnRemoved(for example by destroying its own entity) corrupted the pool: the outerRemoveswap-removed a slot that was already gone. The nestedRemovenow continues the notification from the next listener and does the removal, the outer one sees the component gone and stops; every listener gets oneOnRemoved. Works with change tracking and owning groups. World.Addandpool.Addreturned arefto a stale slot when a filter, world or typed listener added or removed the same type elsewhere, or removed the just-added component: writes through it landed on another entity. The dense index is re-read before each typedOnAddedand before returning; a component removed beforeAddreturns gets no furtherOnAdded, and therefpoints at a scratch value whose writes are discarded.CopyEntityshared oneListbetween the source and the copy forEventBuffer<T>andListeners<T>; after the next OneFrame cleanup the pool could hand that list to two entities. Both now implementIAutoCopy<T>and give the copy its own list.ParallelRunner: after a job threw, the chunk counter jump madechunk * chunkSizeoverflow, so chunks ran again or with a negative start (Execute(-1024, 0)). The start index is computed inlong.world.AddEventon a stale handle appended to the new occupant's buffer underKENSEI_DEBUG; it now throws like the other entity operations.- An
IFilterListener.OnEntityRemovedthat added the removed component back left the entity out of the remainingIncfilters of that type. World.Warmupleft its temporary entity alive, and world events suppressed, when a listener threw; both are now restored infinally.World.Destroycalled twice threw; the second call is a no-op.CommandBuffer.Seton an existing component and aCopyEntitythat overwrites a component (one a listener added during the copy) were invisible to change tracking; both now write throughModify.Setstill does not runAutoReseton the old value, so writing back a modified copy (var b = world.Get<EventBuffer<Hit>>(e); b.Add(h); cb.Set(e, b);) keeps its list.CopyEntityrunsAutoReseton the overwritten value for types withIAutoCopy, whose copied value owns its references.
Performance
- Under
KENSEI_DEBUG, poolAdd/RemovecallEcsProfileronly while it is enabled, and the component type name is cached per pool; before, every structural change evaluatedtypeof(T).Name, which allocates on Mono and IL2CPP. Removetests the pool's_autoResetdelegate instead of astatic readonly bool, which IL2CPP does not fold and checks through class initialization on every call.
Generator
- New errors for injection that compiled but left fields
nullat runtime or failed inside the generated file: KECS006 (a derived system where its own or the baseInitwould never run; deriving still works when the class listsIInitSystemamong its bases if the base implements it, and callsbase.InitfromOnInitif the base has injected fields), KECS007 (no types in[Inc]and[Any]), KECS008 (a non-component type in a filter attribute), KECS009 (readonlyinjected field), KECS010 (recordorstructsystem), KECS011 (system nested in arecordorinterface). - KECS002 also covers an explicit
void IInitSystem.Init(...); KECS003 also covers[Shared]on a value type, which failed with CS0452 in the generated file. - No false KECS003 on nullable-annotated fields (
Filter?,ComponentPool<T>?) in a#nullable enablecontext. Plugins/KenseiECS.Generators.dllis rebuilt from these sources. The test that loads it now uses a separate load context (it used to get the generator project's own assembly) and checks a 2.1.1 diagnostic, so a stale DLL fails the tests.
Editor
- Systems window repaints at most about 10 times per second instead of on every editor update.
- Profiler window caches the event snapshot (refreshed at most twice a second while recording, on enable/disable, after Clear and on entering Play Mode) instead of copying the buffer on every
OnGUI, and keeps showing recorded events after the world is destroyed or recording stops. - World Inspector counts components only for entities on the shown page (or for search matching), disables Next when no further match exists, and clamps the page when entities die.
Documentation
- Generator diagnostics table, FAQ and migration guide list KECS006-KECS011 and the new KECS002/KECS003 cases.
reflifetime fromGet/Add: anyAddorRemoveof the type on any entity invalidates it, and in an owning group any of the group's types does (components, groups, FAQ, architecture, XML docs).EventBuffer<T>allocates nothing only once its static, process-wide list pool has reached the peak;World.Warmupdoes not fill it.- A disabled runner (or an unnamed child disabled through the parent's
SetActive(int, bool)) does not clean its OneFrame/DelHere types; the unnamed child's ownIsEnabledstays true. World.Warmupis visible to pool and filter listeners subscribed inInit.EcsEntityView/SetNamewithoutKENSEI_DEBUG: the call is an empty method, not compiled out.- Benchmarks: measured on .NET 8 x64 only (no Mono, IL2CPP or ARM), the .NET build uses
BitOperationswhile Unity uses the De Bruijn fallback, noEventBuffer/OneFrame scenarios, and "0 B" holds after capacities reach their peak. CommandBuffer.Setand change tracking pages describe the overwrite;CopyEntityoverwrite andAutoResetare described underIAutoCopy.
[2.1.0] - 2026-10-08
Added
- Documentation site at https://kenseitheone.github.io/KenseiECS/: getting started, core concepts, feature guides, Unity integration, architecture, FAQ, migration from LeoEcsLite, benchmarks and changelog.
package.jsondocumentationUrlpoints to it. - API reference on the site, generated from the XML doc comments of the public .NET API.
- Comparison page: KenseiECS against Arch, Friflo.Engine.ECS, Unity Entities, LeoEcsLite and DefaultEcs, including where the others are the better choice.
- XML doc comments for every public type and member of the .NET API (117 had none: the
Inc/Exc/Anyfilter specs,Group<T1..T4>data arrays, enumerators, constructors, system and listener interfaces, attribute properties). A public member without one (CS1591) now fails the build. - Live demo "Horde": a survivors-like game on KenseiECS running in the browser on .NET WebAssembly, with an ECS inspector (per-system timings, system toggles, filter and pool sizes, stress mode) and touch controls; "Inside the Demo" walks through its systems.
Changed
- Every C# sample in the documentation that does not need
UnityEngine(plus the FAQ and migration samples, Unity-related ones against stubs) and the C# blocks of both READMEs is compiled from projects indocs/snippets/(the LeoEcsLite side of the migration guide against theLeopotam.EcsLite1.0.1 NuGet repack, which is unofficial but has the same API as the official repository) and checked in CI in release andKENSEI_DEBUG. - The root README is now a short landing page that links to the site; the installation guide covers building from source for .NET.
World.SetNameis no longer[Conditional("KENSEI_DEBUG")]. Without the define it is an empty method and its arguments are evaluated; before, the compiler dropped the call together with its arguments, soworld.SetName(world.CreateEntity(...), "Player")created no entity when the define was off - in practice, in release builds and in any test run without it. On .NET the name now depends on how KenseiECS itself is built rather than on the calling assembly, so assemblies compiled against 2.0.x need a rebuild to see names. A name built at the call site ($"Enemy {i}") is now built in release too; wrap such a call in#if KENSEI_DEBUGif that allocation matters.
Fixed
- README Quick Start: wrong call order and a missing
using; other README samples had duplicate locals, anEcsProfilercall not guarded by#if KENSEI_DEBUGand a doubleCommandBuffer.Add. - Migration guide and FAQ samples that did not compile or threw at runtime: a duplicate
Addin the deferred-changes loop (nowSeton the KenseiECS side and aHas-guardedAddon the LeoEcsLite side, each followed bybreak), a doubly declared variable, out-of-scope variables, statements mixed with declarations. - XML documentation of 21 public types and members (among them
SystemsRunner,SharedData,CommandBuffer,Group,EventBuffer<T>,WorldSerializerand the[Inc]/[Pool]/[Group]/[Shared]attributes) was dropped fromKenseiECS.xmlas badly formed XML, so IDEs showed no summaries for them. The comments are escaped now, and a badly formed doc comment (CS1570) fails the build. - Performance tables in the README, introduction and
BENCHMARKS.mdbolded KenseiECS's owning group (5.5 us) as the fastest two-component iteration; Arch (5.4 us) is.
[2.0.0] - 2026-09-02
Breaking
IComponentPoolreplaced by the abstract classComponentPoolBase.Clear,AddDefaultandCopyToare now internal; user code can no longer desynchronize masks and filters by calling them.World.GetEntity(int)on a dead slot returns the dead entity's own handle (IsAliveis false) instead of throwing underKENSEI_DEBUG. A slot's generation now changes when the slot is reused, not when it is freed.IWorldEventListener.OnEntityCreatedfires after the first component is added (CreateEntity) or after all components are copied (CopyEntity). Listeners never observe an entity without components.World.Unsubscribe<T>keeps the emptyListeners<T>component; unsubscribing the last listener no longer auto-destroys the entity.HasListeners<T>is false for an empty list.World.Remove<T>no longer creates the pool for a type that was never added.SystemsRunner.DestroyrunsIDestroySystem.Destroyin reverse registration order, is a no-op beforeInit, and resets the runner soInitcan run again.Listeners<T>andWorldListenerExtensionsmoved fromUnity/toCore/and no longer depend on Unity.- The .NET project file moved from
KenseiECS/KenseiECS.csprojtoKenseiECS.NET/KenseiECS.csproj; theKenseiECS/folder is now a UPM package.
Added
FilterBuilder.Any<T>(): match entities with at least one of the listed types.AnyandExcof the same type is rejected;Anyof anInctype is dropped as redundant.world.Filter<Inc<A, B>, Exc<C>, Any<D, E>>()static filter specs (Inc1-6 types,Exc1-4,Any2-4,None).Filter.IsEmpty,First(),TryGetFirst,Single(),Entitiesspan,AddListener(IFilterListener)for enter/leave notifications.ComponentPool<T>.AddListener(IComponentListener<T>):OnAddedafter filters update,OnRemovedbefore AutoReset.CommandBuffer: deferredCreateEntity/Add/Set/Remove/DestroyEntitywithPendingEntityhandles, typed payload storage, zero allocations after warmup; commands on dead entities are skipped.World.GetSingleton<T>(),GetSingletonEntity<T>(),HasSingleton<T>().EventBuffer<T>component andworld.AddEvent(entity, value)for several events per entity per frame; lists are pooled.KENSEI_DEBUG: removing an entity from a filter that is being iterated throws when the swap-remove would make the loop visit an entity twice (nested loops tracked per enumerator).KenseiECS.NETmulti-targetsnetstandard2.1andnet8.0; the .NET build usesBitOperations.SystemsRunner.GetSystemInfo(int),SystemCount,SetActive(int, bool),IsEnabled,World: introspection for tooling. Every run system gets aProfilerMarkeron Unity;LastRunMs/PeakRunMsandResetTimings()underKENSEI_DEBUG.World.FilterCount/GetFilter(int);Filter.IncludedTypes/ExcludedTypes/AnyTypes,ToString(),DenseCapacity,AllocatedBytes;ComponentPoolBase.SparseCapacity,DenseCapacity,ComponentSize,AllocatedBytes.World.SetName(Entity, string)/GetName(Entity)debug entity names (SetNamecompiles out withoutKENSEI_DEBUG).- Filter sparse arrays are paged (1024 slots per page, allocated on first touch); a filter no longer costs an
intper entity slot of the world. - Owning groups:
world.Group<T1, T2>()(up to four types) keeps the owned pools' dense arrays aligned so members can be iterated throughData1..DataNspans with no sparse lookups. A pool belongs to at most one group.World.GroupCount/GetGroup. - Change tracking:
pool.TrackChanges(),Modify(e),MarkChanged(e),ChangedVersion(e),ChangedSince(e, version)withWorld.ChangeVersionas the consumer's bookmark. WorldSerializer:Save(world, stream)/Load(world, stream)snapshots that keep entity indices and generations (soEntityfields inside components stay valid), identify types by name, write unmanaged components bit-for-bit and useIComponentFormatter<T>for components with references.- Source generator (
KenseiECS.Generators, shipped asPlugins/KenseiECS.Generators.dll):[Inc],[Exc],[Any],[Pool],[Group],[Shared]on fields of a partial system class generateInitand callpartial void OnInit(World, SharedData). Diagnostics KECS001-KECS005 for misuse. World.TryGetEntity(int, out Entity).ParallelRunnerandIRangeJob: struct jobs over an index range (filterEntitiesor groupDataspans) on fixed worker threads plus the caller, dynamic chunking, no allocations perRun, worker exceptions rethrown on the caller.- Unity:
EcsBootstrapbase MonoBehaviour (World, SharedData, update/fixed/late runners, warmup),IEcsSystemsProvider,EcsComponentProvider<T>inspector-authored components,EcsEntityView.Spawn(world)andEntityName,KenseiECS -> Systemswindow with enable toggles and timings, Filters and Pools tabs in the World Inspector, debug names in inspector and profiler,Samples~/BasicGame. - UPM package:
package.json,KenseiECSandKenseiECS.Editorassembly definitions, committed.metafiles. Install via git URL with?path=/KenseiECS. ComponentType.TypeOf(int)andComponentType.NameOf(int)resolve thetypeIndexpassed to world event listeners.World.GetComponentTypes(Entity, List<int>),World.GetComponentCount(Entity),World.GetPool(int).ComponentPoolBase.ComponentType.SystemsRunner.DelHere<T>()removes allTat that point of the pipeline;SystemsRunner.IsInitialized,SystemsRunner.Shared.SystemsRunner.SetActive/IsActivework on named child runners.Listeners<T>.Count.IAutoReset<T>andIAutoCopy<T>may be implemented explicitly.KENSEI_DEBUGvalidation: poolAddon a dead or never-allocated slot,RunbeforeInit,AddafterInit, unknown names inSetActive/IsActive/GetRunner,GetComponentTypeson a dead entity.- GitHub Actions workflow running the test suite in both configurations.
Fixed
- An exception thrown by a world event listener or
AutoResetduringDestroyEntityleft a permanent zombie (dead flag set, components and filter membership intact, slot never freed). The slot is now always released and components are drained infinally. - An exception in
SystemsRunner.Initmarked the runner initialized and skipped the remaining systems forever;Initnow resumes at the failed system. - An exception in a system skipped OneFrame cleanup, so events were processed twice; cleanup now runs in
finally. Warmupfired world events and profiler records for its temporary entity.- Removing a world event listener with a lower index from inside a dispatch invoked the current listener twice; the listener list is now copy-on-write.
- A child
SystemsRunnerconstructed withoutSharedDatagot an empty container instead of the parent's. - The World Inspector and EcsEntityView inspector lost edits made to nested structs and array elements.
KenseiECS -> Debug ModeappliedKENSEI_DEBUGonly to the current build target group.EcsProfilerkept a static reference to a destroyed world and survived Enter Play Mode without domain reload.Il2CppSetOptiondid not apply toFilter.Enumerator(nested types do not inherit it), so the hottest loop kept bounds checks under IL2CPP.ComponentPool.ClearandWorld.Clearwere O(entity capacity) per pool; sparse entries are now reset through the dense list.
Changed
- Per-type filter lists are split into include/exclude/any, so adding or removing a component tests the mask only for filters it can move the entity into.
[1.0.0] - 2026-03-28
Initial release.
