@forgeax/engine-ecs 0.1.24 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"world-component-access.d.ts","sourceRoot":"","sources":["../src/world-component-access.ts"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAC1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,eAAe,EAGpB,KAAK,YAAY,EAMjB,KAAK,OAAO,EAEb,MAAM,aAAa,CAAC;AAKrB,OAAO,EAGL,KAAK,YAAY,EAIlB,MAAM,iBAAiB,CAAC;AAczB,OAAO,EAEL,iBAAiB,EAGlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAwB,KAAK,SAAS,EAAwB,MAAM,kBAAkB,CAAC;AAC9F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAE7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGrE,KAAK,YAAY,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpD;;;;;;;GAOG;AACH,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,Q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I;IAIzE,QAAQ,CAAC,CAAC,SAAS,eAAe,EAChC,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,EAC/B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAChB,IAAI;IAIP,uBAAuB,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;CAGlF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/engine-ecs",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -38,9 +38,9 @@
38
38
  "LICENSE"
39
39
  ],
40
40
  "dependencies": {
41
- "@forgeax/engine-math": "0.1.24",
42
- "@forgeax/engine-plugin": "0.1.24",
43
- "@forgeax/engine-types": "0.1.24"
41
+ "@forgeax/engine-math": "0.1.25",
42
+ "@forgeax/engine-plugin": "0.1.25",
43
+ "@forgeax/engine-types": "0.1.25"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^20.14.0"
@@ -395,17 +395,45 @@ function appendEntity(table: Table, entity: number): number {
395
395
  expect(refreshed.byteLength).toBe(4096);
396
396
  });
397
397
 
398
- it('alloc(beyond max bucket) returns err(managed-buffer-out-of-bounds)', () => {
398
+ it('allocates beyond the pooled classes without retaining a large free bucket', () => {
399
399
  const pool = new BufferPool();
400
- const top = SIZE_CLASSES[SIZE_CLASSES.length - 1];
401
- if (top === undefined) throw new Error('SIZE_CLASSES empty');
402
- const overshoot = top + 1;
403
- const r = pool.alloc(overshoot);
404
- expect(r.ok).toBe(false);
405
- if (r.ok) throw new Error('expected err alloc');
406
- expect(r.error.code).toBe('managed-buffer-out-of-bounds');
407
- if (r.error.code !== 'managed-buffer-out-of-bounds') throw new Error('narrow');
408
- expect(r.error.detail.index).toBe(overshoot);
400
+ const bytes = 20_000 * 64;
401
+ const large = pool.alloc(bytes).unwrap();
402
+ expect(large.view.byteLength).toBe(bytes);
403
+ expect(pool.byteCapacity(large.id)).toBe(bytes);
404
+ large.view[0] = 42;
405
+ pool.grow(large.id, bytes * 2).unwrap();
406
+ expect(pool.view(large.id)[0]).toBe(42);
407
+ pool.setLogicalLength(large.id, 0).unwrap();
408
+ expect(pool.byteCapacity(large.id)).toBe(bytes * 2);
409
+ pool.release(large.id).unwrap();
410
+ expect(pool.byteCapacity(large.id)).toBe(0);
411
+ expect(pool.view(large.id)).toHaveLength(0);
412
+ expect(pool.alloc(bytes).unwrap().id).not.toBe(large.id);
413
+ expect(SIZE_CLASSES.at(-1)).toBe(262_144);
414
+ });
415
+
416
+ it('grows from a small pooled field into a dedicated large field', () => {
417
+ const pool = new BufferPool();
418
+ const small = pool.alloc(128).unwrap();
419
+ small.view[127] = 71;
420
+ const grown = pool.grow(small.id, 20_000 * 64).unwrap();
421
+ expect(grown[127]).toBe(71);
422
+ expect(grown[128]).toBe(0);
423
+ expect(pool._liveCount()).toBe(1);
424
+ pool.release(small.id).unwrap();
425
+ expect(pool._liveCount()).toBe(0);
426
+ });
427
+
428
+ it.each([
429
+ -1,
430
+ 1.5,
431
+ Number.NaN,
432
+ Number.POSITIVE_INFINITY,
433
+ ])('rejects invalid allocation size %s', (bytes) => {
434
+ const result = new BufferPool().alloc(bytes);
435
+ expect(result.ok).toBe(false);
436
+ if (!result.ok) expect(result.error.code).toBe('managed-buffer-out-of-bounds');
409
437
  });
410
438
 
411
439
  it('M4 prelude: distinct ids on consecutive alloc with no release in between', () => {
@@ -1,45 +1,7 @@
1
- // @forgeax/engine-ecs - BufferPool (M2, plan-decisions D-5 / D-6 / D-7).
2
- //
3
- // Backing store for `buffer:<bytes>` schema-vocab fields. Each `buffer:<N>`
4
- // slot is a managed Uint8Array view; the pool keeps eight size-class
5
- // free-lists (radix 4) and uses ArrayBuffer.transfer for cross-bucket
6
- // growth. The integer `id` returned by `alloc` is the runtime stand-in for
7
- // the buffer slot; archetype columns store the `id` as u32 (M4 carry-over
8
- // reuses this id across archetype migrate without copying bytes).
9
- //
10
- // §contract — managed handles are operational, not persistent
11
- // Spec: docs/specs/2026-06-14-ecs-managed-lifecycle-ssot-design.md §3.3.
12
- // The slot id never escapes ECS internals — there is no public Handle<Buffer>
13
- // surface today. There is no generation tag on BufferPool; `release` is
14
- // typed `Result<void, never>` (no stale-slot error arm) and the dual
15
- // guards live at packages/ecs/src/__tests__/buffer-pool.test-d.ts (compile
16
- // time) + packages/ecs/README.md §"Managed handles are operational, not
17
- // persistent" (AI-user-facing). Should a future feat introduce a public
18
- // Handle<Buffer> surface, this design (no gen tag) MUST be re-debated —
19
- // the silent-resolve contract that UniqueRefStore tolerates relies on
20
- // the holder being a single ECS field, not a free-floating cache; a
21
- // public Handle<Buffer> changes that calculus.
22
- //
23
- // Design contract (frozen by plan-decisions):
24
- // D-5 size-class 8 buckets (radix 4):
25
- // 16 / 64 / 256 / 1K / 4K / 16K / 64K / 256K bytes.
26
- // Allocation rounds up to the smallest bucket >= byteLength; alloc(0)
27
- // is legal and returns a zero-length view (no bucket touched).
28
- // Requests > 256K surface 'managed-buffer-out-of-bounds'.
29
- // D-6 grow(id, newBytes) returns Result<Uint8Array, EcsError> - never
30
- // throws, never mutates the prior view in place. Cross-bucket growth
31
- // detaches the old ArrayBuffer (ES2024 transfer when available, copy
32
- // fallback otherwise) and installs a fresh view backed by the new
33
- // bucket's ArrayBuffer; same-bucket growth re-slices the existing
34
- // backing buffer to the new byteLength.
35
- // D-7 v1 forbids shrink (newBytes < current -> err); newBytes == current
36
- // is a legal no-op that returns the same view. Bucket free-lists are
37
- // NEVER trimmed - released slots stay parked on their bucket forever
38
- // in v1 (memory bloat is acceptable until M5/M6 telemetry).
39
- //
40
- // The pool is a `class` rather than a frozen module-level singleton because
41
- // World owns one BufferPool per instance; M2 wires it into the release loop
42
- // alongside UniqueRefStore (D-2 - per-World lifecycle).
1
+ // World-owned managed array storage. Small fields use eight radix-4 free
2
+ // lists; larger fields allocate dedicated buffers and drop them on release.
3
+ // Pooling policy never limits a field to the largest pooled class. Slot IDs
4
+ // remain private to ECS and survive archetype migration and growth.
43
5
 
44
6
  import { err, ok, type Result } from '@forgeax/engine-types';
45
7
  import { ManagedBufferOutOfBoundsError, ManagedBufferShrinkNotSupportedError } from './errors';
@@ -50,8 +12,7 @@ import { ManagedBufferOutOfBoundsError, ManagedBufferShrinkNotSupportedError } f
50
12
  *
51
13
  * `alloc(byteLength)` rounds up to `SIZE_CLASSES[i]` for the smallest `i`
52
14
  * with `byteLength <= SIZE_CLASSES[i]`. byteLength === 0 is the special path
53
- * (no bucket); byteLength > SIZE_CLASSES[7] (262_144) returns
54
- * `managed-buffer-out-of-bounds`.
15
+ * (no bucket); larger requests use dedicated, unpooled allocations.
55
16
  */
56
17
  export const SIZE_CLASSES: readonly number[] = Object.freeze([
57
18
  16, 64, 256, 1024, 4096, 16384, 65536, 262144,
@@ -77,7 +38,7 @@ const HAS_TRANSFER: boolean =
77
38
  typeof (ArrayBuffer.prototype as { transfer?: unknown }).transfer === 'function';
78
39
 
79
40
  interface SlotState {
80
- /** Bucket index in SIZE_CLASSES, or -1 for the alloc(0) zero-length slot. */
41
+ /** Bucket index, SIZE_CLASSES.length for dedicated storage, or -1 for zero length. */
81
42
  sizeClassIdx: number;
82
43
  /** Underlying ArrayBuffer for the slot's current bucket (zero-length for sizeClassIdx === -1). */
83
44
  buffer: ArrayBuffer;
@@ -92,8 +53,7 @@ interface SlotState {
92
53
  /**
93
54
  * Round `byteLength` up to a bucket index. Returns -1 for the legal zero
94
55
  * path; returns `SIZE_CLASSES.length` (out-of-range) for byteLength larger
95
- * than the top bucket so the caller can route a clean
96
- * `managed-buffer-out-of-bounds` error.
56
+ * than the top bucket so the caller can use a dedicated allocation.
97
57
  */
98
58
  function bucketIndex(byteLength: number): number {
99
59
  if (byteLength === 0) return -1;
@@ -130,10 +90,10 @@ export class BufferPool {
130
90
  * Allocate a managed buffer slot of at least `byteLength` bytes.
131
91
  *
132
92
  * Routes:
133
- * - byteLength < 0 -> not in current contract (caller responsibility).
93
+ * - invalid byteLength -> structured out-of-bounds error.
134
94
  * - byteLength == 0 -> ok({ id, view: zero-length Uint8Array }) (no bucket).
135
95
  * - byteLength <= 262144 -> ok({ id, view }), bucket = smallest >= byteLength.
136
- * - byteLength > 262144 -> err(managed-buffer-out-of-bounds).
96
+ * - byteLength > 262144 -> a dedicated allocation; allocation failure is structured.
137
97
  *
138
98
  * D-5: size classes are radix-4 (16 / 64 / 256 / 1K / 4K / 16K / 64K / 256K).
139
99
  * Free-list pop reuses the most recently released slot id at the same bucket;
@@ -147,11 +107,22 @@ export class BufferPool {
147
107
  this.slots.set(id, { sizeClassIdx: -1, buffer, view, byteLength: 0, live: true });
148
108
  return ok({ id, view });
149
109
  }
110
+ if (!Number.isSafeInteger(byteLength) || byteLength < 0) {
111
+ return err(new ManagedBufferOutOfBoundsError(byteLength, 0));
112
+ }
150
113
  const idx = bucketIndex(byteLength);
151
114
  if (idx === SIZE_CLASSES.length) {
152
- return err(
153
- new ManagedBufferOutOfBoundsError(byteLength, SIZE_CLASSES[SIZE_CLASSES.length - 1] ?? 0),
154
- );
115
+ // Large fields are dedicated allocations, not permanently retained
116
+ // pool buckets. Small fields keep exactly the existing allocation cost.
117
+ try {
118
+ const buffer = new ArrayBuffer(byteLength);
119
+ const view = new Uint8Array(buffer);
120
+ const id = this.nextId++;
121
+ this.slots.set(id, { sizeClassIdx: idx, buffer, view, byteLength, live: true });
122
+ return ok({ id, view });
123
+ } catch {
124
+ return err(new ManagedBufferOutOfBoundsError(byteLength, 0));
125
+ }
155
126
  }
156
127
  const bucketBytes = SIZE_CLASSES[idx];
157
128
  /* istanbul ignore next -- bucketIndex returns < SIZE_CLASSES.length here */
@@ -204,7 +175,7 @@ export class BufferPool {
204
175
  * the caller become detached / orphaned - callers must use `pool.view(id)`
205
176
  * after grow to read the refreshed view (the `release` loop refreshes
206
177
  * automatically).
207
- * - newBytes > 262144 -> err(managed-buffer-out-of-bounds).
178
+ * - newBytes beyond the last pooled class -> dedicated allocation.
208
179
  */
209
180
  grow(
210
181
  id: number,
@@ -222,13 +193,11 @@ export class BufferPool {
222
193
  if (newBytes === slot.byteLength) {
223
194
  return ok(slot.view);
224
195
  }
225
- const newIdx = bucketIndex(newBytes);
226
- if (newIdx === SIZE_CLASSES.length) {
227
- return err(
228
- new ManagedBufferOutOfBoundsError(newBytes, SIZE_CLASSES[SIZE_CLASSES.length - 1] ?? 0),
229
- );
196
+ if (!Number.isSafeInteger(newBytes) || newBytes < 0) {
197
+ return err(new ManagedBufferOutOfBoundsError(newBytes, slot.buffer.byteLength));
230
198
  }
231
- if (newIdx === slot.sizeClassIdx) {
199
+ const newIdx = bucketIndex(newBytes);
200
+ if (newBytes <= slot.buffer.byteLength) {
232
201
  // Same bucket: re-slice the existing backing ArrayBuffer to the new
233
202
  // logical length. No transfer; old view stays valid until next grow.
234
203
  slot.byteLength = newBytes;
@@ -236,19 +205,23 @@ export class BufferPool {
236
205
  return ok(slot.view);
237
206
  }
238
207
  // Cross-bucket: detach old buffer + carry old bytes into the new bucket.
239
- const newBucketBytes = SIZE_CLASSES[newIdx] as number;
208
+ const newBucketBytes = SIZE_CLASSES[newIdx] ?? Math.max(newBytes, slot.buffer.byteLength * 2);
240
209
  const oldByteLength = slot.byteLength;
241
210
  let nextBuffer: ArrayBuffer;
242
- if (HAS_TRANSFER) {
243
- // ES2024 transfer: copy contents into a fresh ArrayBuffer of the new
244
- // bucket size and detach the source. The transferred buffer keeps the
245
- // old prefix bytes intact.
246
- nextBuffer = (
247
- slot.buffer as unknown as { transfer(newByteLength: number): ArrayBuffer }
248
- ).transfer(newBucketBytes);
249
- } /* istanbul ignore next -- fallback only on runtimes without ES2024 transfer() */ else {
250
- nextBuffer = new ArrayBuffer(newBucketBytes);
251
- new Uint8Array(nextBuffer).set(new Uint8Array(slot.buffer, 0, oldByteLength));
211
+ try {
212
+ if (HAS_TRANSFER) {
213
+ // ES2024 transfer: copy contents into a fresh ArrayBuffer of the new
214
+ // bucket size and detach the source. The transferred buffer keeps the
215
+ // old prefix bytes intact.
216
+ nextBuffer = (
217
+ slot.buffer as unknown as { transfer(newByteLength: number): ArrayBuffer }
218
+ ).transfer(newBucketBytes);
219
+ } /* istanbul ignore next -- fallback only on runtimes without ES2024 transfer() */ else {
220
+ nextBuffer = new ArrayBuffer(newBucketBytes);
221
+ new Uint8Array(nextBuffer).set(new Uint8Array(slot.buffer, 0, oldByteLength));
222
+ }
223
+ } catch {
224
+ return err(new ManagedBufferOutOfBoundsError(newBytes, slot.buffer.byteLength));
252
225
  }
253
226
  slot.sizeClassIdx = newIdx;
254
227
  slot.buffer = nextBuffer;
@@ -268,11 +241,11 @@ export class BufferPool {
268
241
  if (slot === undefined) return ok(undefined);
269
242
  if (!slot.live) return ok(undefined);
270
243
  slot.live = false;
271
- if (slot.sizeClassIdx >= 0) {
244
+ if (slot.sizeClassIdx >= 0 && slot.sizeClassIdx < SIZE_CLASSES.length) {
272
245
  const bucket = this.freeBuckets[slot.sizeClassIdx];
273
246
  if (bucket !== undefined) bucket.push(id);
274
247
  } else {
275
- // Zero-length slot: nothing to park; drop the slot record entirely so
248
+ // Zero-length or dedicated slot: drop the slot record entirely so
276
249
  // the id is not retained.
277
250
  this.slots.delete(id);
278
251
  }
@@ -301,7 +274,7 @@ export class BufferPool {
301
274
  const slot = this.slots.get(id);
302
275
  if (slot === undefined || !slot.live) return 0;
303
276
  if (slot.sizeClassIdx < 0) return 0;
304
- return SIZE_CLASSES[slot.sizeClassIdx] ?? 0;
277
+ return slot.buffer.byteLength;
305
278
  }
306
279
 
307
280
  /**
@@ -334,7 +307,7 @@ export class BufferPool {
334
307
  }
335
308
  return err(new ManagedBufferOutOfBoundsError(newByteLength, 0));
336
309
  }
337
- const bucketBytes = SIZE_CLASSES[slot.sizeClassIdx] ?? 0;
310
+ const bucketBytes = slot.buffer.byteLength;
338
311
  if (newByteLength > bucketBytes) {
339
312
  return err(new ManagedBufferOutOfBoundsError(newByteLength, bucketBytes));
340
313
  }
@@ -432,9 +432,8 @@ export class WorldComponentAccess {
432
432
  slotId = column.view[row] as number;
433
433
  }
434
434
  const requiredBytes = (currentLength + 1) * meta.byteSize;
435
- const maximum = Math.floor(262_144 / meta.byteSize);
436
- if (!Number.isSafeInteger(currentLength + 1) || currentLength + 1 > maximum) {
437
- return err(new ManagedBufferOutOfBoundsError(requiredBytes, 262_144));
435
+ if (!Number.isSafeInteger(requiredBytes)) {
436
+ return err(new ManagedBufferOutOfBoundsError(requiredBytes, Number.MAX_SAFE_INTEGER));
438
437
  }
439
438
 
440
439
  const preparation: RelationshipPreparation = {