feat(compiler): the built-in ECS's stores grow - 100 000 entities, where 1024 was the wall
Every per-entity store (@S_ components, @H_ flags, alive, kind, freelist, owners) is a heap block
L_grow doubles from 1024 as L_alloc hands out a slot past it, the new slots zeroed; each site loads
the store's base where it indexes it (ecs_base, its registers %ecsb* so a raw function's t0 labels
cannot collide). Prop.has bounds against @L_cap, Pool.capacity answers it, a mod's registered
stores grow with the rest, every main grows the stores once before anything reads them. A snapshot
records its slot count first and a load grows to it before reading back. The overflow stop of
1c7ce84 is gone with the wall. ludic-dev test 305 passed, selfhost-test 33 passed; 1000 / 5000 /
100000 entities spawn and count.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0c6235e55b
commit
8384ad3215
13 changed files with 27441 additions and 26036 deletions
|
|
@ -1,7 +0,0 @@
|
|||
bump: patch
|
||||
type: fix
|
||||
**The 1,025th entity stops the program instead of corrupting it.** The built-in ECS keeps every
|
||||
component in a fixed array of 1024 slots, and `L_alloc` never checked: one entity more was written
|
||||
past the end of every component array at once. A spawn past the store now stops with `more than
|
||||
1024 entities: the built-in ECS holds 1024; keep many things in a ludic.base Table`. A game that
|
||||
keeps thousands of something keeps them as rows of `ludic.base`'s `Table<T>`, which grows.
|
||||
9
changes/ecs-growable-stores.md
Normal file
9
changes/ecs-growable-stores.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
bump: minor
|
||||
type: feature
|
||||
**The built-in ECS grows.** Every component was a fixed array of 1024 slots, so a game past 1024
|
||||
entities could not have them (and until the last release silently corrupted memory trying). The
|
||||
per-entity stores are heap blocks now, doubled by `L_grow` as entities outgrow them, the new slots
|
||||
zero: 100 000 entities spawn and query. `Prop.has` bounds against the live capacity and
|
||||
`Pool.capacity` answers it. A snapshot (`save`/`load`, `world_save`/`world_load`) records its slot
|
||||
count first and a load grows to it before reading the stores back, so a snapshot's size follows the
|
||||
world's instead of a fixed 1024. A mod's registered components grow with the rest.
|
||||
Loading…
Add table
Add a link
Reference in a new issue