@zakkster/lite-signal 1.5.0 → 1.5.2

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,118 @@ All notable changes to `@zakkster/lite-signal` are documented here.
4
4
  Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
  This project follows [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [1.5.2] -- 2026-09-19
8
+
9
+ Dev-only session: a standing, self-validating zero-GC judge. `Signal.js` is
10
+ byte-identical to 1.5.1 except the version banner comment; no API change, no
11
+ behavior change, no engine logic moved. `Watch.js`, `bench/`, `harness/`, and
12
+ `conformance/` are untouched.
13
+
14
+ ### Added -- perf-gate lane (dev-only, engine-frozen)
15
+
16
+ `@zakkster/lite-perf-gate` (`^1.4.2`, devDependency only -- runtime `dependencies`
17
+ stay empty) joins as the standing verdict on lite-signal's headline zero-GC
18
+ claim. New file `test/32-perf-gate.test.mjs` wires `zgcSuite()` over seven
19
+ claimed-zero steady-state paths, each anchored to its `llms.txt` "Performance
20
+ characteristics" claim and warmed inside `setup()` so the measurement window
21
+ sees only steady state: `set-propagate` (1 signal -> 8 computeds -> 1 effect,
22
+ synchronous flush), `computed-cache-hit`, `computed-recompute-stable`,
23
+ `effect-rerun-stable`, `peek`, `batch-flush` (3 sets/batch), and
24
+ `box-set-propagate` (the 1.5.0 `signalBox`/`computedBox` surface). Five signals
25
+ judge every run -- scavenges, engine counters (`totalAllocations` /
26
+ `totalDisposals` / `poolGrowths`, all budgeted to 0 via per-scenario
27
+ `statsOf`), retained heap, old-gen, and external/arrayBuffers -- at two scales
28
+ (N and k*N), with positive/negative/large detector controls validated on every
29
+ invocation. Two permanent negative controls keep the gate honest: a per-op
30
+ object allocator and a per-op `signal()`+`dispose` churn (the documented
31
+ 264 B/op creation path); both MUST trip the gate.
32
+
33
+ New script `test:gate` (`node --expose-gc --max-semi-space-size=4 --test
34
+ test/32-perf-gate.test.mjs`) runs the gate for real; it is appended to
35
+ `test:all`. The gate file guards on `--expose-gc` AND `--max-semi-space-size=4`
36
+ and otherwise emits ONE loud named skip, so plain `npm test` stays green: this
37
+ lane adds exactly one loud named skip over 1.5.1 (pass count unchanged; the
38
+ other skip is the architecturally-N/A SSR case). `node:test`'s absolute leaf
39
+ tally is node-version-sensitive -- on node v26.8.2 `npm test` reports 513 pass /
40
+ 2 skip. The 16MB `test:gc` lane never produces a false red. Thresholds are lite-perf-gate
41
+ defaults, untouched.
42
+
43
+ ### Docs
44
+
45
+ `llms.txt` gains the perf-gate version note and the fixed 13-key `RegistryStats`
46
+ interface block (`nodePoolPopulation` / `linkPoolPopulation` were described in
47
+ prose since 1.5.0 but missing from the interface listing). README Testing
48
+ strategy gains the gate lane.
49
+
50
+ ## [1.5.1] -- 2026-09-05
51
+
52
+ Docs + verification patch. `Signal.js` is byte-identical to 1.5.0 except the
53
+ version banner comment; no API change, no behavior change. Ships the corrected
54
+ allocation economics below to the `latest` line while `1.6.0-rc` bakes.
55
+
56
+ ### Added -- mint-cycle allocation anatomy probe (harness, no engine change)
57
+
58
+ A dedicated probe (`harness/mint-anatomy.mjs`, dispatched as `mint`) pins the
59
+ per-op heap cost of every creation primitive's mint+dispose cycle on a pre-grown
60
+ fixed-ceiling registry (`createRegistry({maxNodes:1<<16, maxLinks:1<<18,
61
+ onCapacityExceeded:"throw"})`). Fresh child process per (variant, warmup) cell --
62
+ JIT tier state poisons same-process comparisons. `Signal.js` / `Signal.d.ts`
63
+ untouched; this is verification + attribution only.
64
+
65
+ **Corrected numbers** (all-space B/op, node v26.3.1 darwin/arm64, pre-grown
66
+ throw-policy registry, slope over ops windows {1000,4000,16000} so the sampler
67
+ constant cancels):
68
+
69
+ | cycle (mint + dispose) | all-space B/op | note |
70
+ | ---------------------- | -------------: | --------------------------------------- |
71
+ | `signal(1)` + dispose | 264 | tier-invariant |
72
+ | `computed(fn)` + dispose | 208 | 4 own props, no `set`/`update` |
73
+ | `effect(fn)` + disposeFn() | 160 | 2-prop disposer + 3-slot context |
74
+ | `signalBox(1)` + dispose | 56 | `Object.create(proto)` handle, 0 closures |
75
+ | `computedBox(fn)` + dispose | 56 | same |
76
+ | dispose side (all forms) | 0 | mint-and-hold equals the cycle to +-0.3 B |
77
+
78
+ LiteStore LS-06's ~209 B for the signal cycle was a **new-space-only reading at a
79
+ pre-TurboFan tier**: below ~15-25k lifetime mints, ~56 B/op of closure-feedback
80
+ plumbing lands in OLD space, invisible to a `new_space` delta. The total was
81
+ always 264. `--no-turbofan` freezes the new-space witness at 208 forever;
82
+ `--no-maglev` shows 264 immediately; all-space totals never move (264.3 at every
83
+ tier). Hence the methodology rule this probe enforces (P3, and the sampling-profiler
84
+ cross-check in the findings): **allocation accounting must sum `space_used_size`
85
+ over ALL heap spaces** -- a new-space-only delta is valid only for scavenge-churn
86
+ characterization, never for per-op cost.
87
+
88
+ **Pooling accessor closures with their nodes -- evaluated and REJECTED (fail-open).**
89
+ Reusing one accessor-closure identity across dispose/reuse makes a retained stale
90
+ handle and a fresh handle *the same object* (`a === b`), so both holders share one
91
+ captured `birthGen` and the ABA gen-guard -- checked at the only place it runs and
92
+ pinned by `probe-c1-stale-set` / `probe-c1-stale-read` -- becomes undecidable: a
93
+ stale `a()` reads the recycled slot's new resident, a stale `a.set()` overwrites
94
+ it. That fails open; suite law is fail closed. **Fresh accessor identity per mint
95
+ is load-bearing** for the stale-handle contract and cannot be repaired by any stamp
96
+ placement. The callable path's ~264 B is therefore the documented, irreducible
97
+ price of `count()` / `count.set(x)` ergonomics; **`signalBox` (56 B/op, same graph,
98
+ same but DECIDABLE guard -- each box carries its own `NODE_GEN`) is the sanctioned
99
+ cheap path** (-79%). FinalizationRegistry-gated recycling is semantically sound but
100
+ allocates per mint, makes reuse GC-scheduled, and retains every accessor until
101
+ finalization -- rejected too.
102
+
103
+ Run it: `node harness/run.mjs mint [--verify]` (`--verify` applies relative pins
104
+ P1..P5; exit 0 iff every cell succeeded and every pin passed).
105
+
106
+ ### Added -- attribution instrument set (harness-only, none ship in the tarball)
107
+
108
+ - `harness/costmodel.mjs`, `creation-anatomy.mjs` (+ child), `floors.mjs`
109
+ (+ `floors-history.json`), `jit-health.mjs` (+ `jit-baseline.json`),
110
+ `trend.mjs`, `visit-anatomy.mjs`; VersionMatrix `creation-churn` workload +
111
+ same-host 1.3.0/1.5.0 reference baselines. Verification instruments only.
112
+
113
+ ### Changed
114
+
115
+ - devDependencies: `@zakkster/lite-devtools` ^1.2.0 -> ^1.3.1,
116
+ `@zakkster/lite-gc-profiler` ^1.15.0 -> ^1.16.0 (the instrument versions the
117
+ suite is gated with). Runtime dependencies remain zero.
118
+
7
119
  ## [1.5.0] -- 2026-08-21
8
120
 
9
121
  **Stable 1.5.0.** Graduates `1.5.0-rc.3` to the release line with **no further engine
package/README.md CHANGED
@@ -559,7 +559,7 @@ Default sizing for a Twitch-extension-style budget:
559
559
  | Heavy dashboard (variable scale) | 2048 | 16384 | `"eager"` | `"grow"` |
560
560
  | Per-viewer sandbox / short-lived | 512 | 2048 | `"lazy"` | `"throw"` |
561
561
 
562
- `stats()` reports 11 keys: eight live gauges -- `signals`, `computeds`, `effects`, `activeNodes`, `activeLinks`, `pooledLinks`, `nodePoolCapacity`, `linkPoolCapacity` (the capacity keys are ledgers under `"lazy"`) -- plus three cumulative lifecycle counters added in **1.4.0**: `totalAllocations`, `totalDisposals`, and `poolGrowths` (monotonic over the registry's life, reset only by `destroy()`). Sample them over time to chart allocation rate, pool-reuse ratio, and graph churn; in a quiescent registry `totalAllocations - totalDisposals === activeNodes`. Drop it on screen for live observability.
562
+ `stats()` reports 13 keys: ten live gauges -- `signals`, `computeds`, `effects`, `activeNodes`, `activeLinks`, `pooledLinks`, `nodePoolCapacity`, `linkPoolCapacity` (the capacity keys are ledgers under `"lazy"`), plus `nodePoolPopulation` / `linkPoolPopulation` (**1.5.0**: the true constructed-object counts, distinct from the capacity ledgers) -- plus three cumulative lifecycle counters added in **1.4.0**: `totalAllocations`, `totalDisposals`, and `poolGrowths` (monotonic over the registry's life, reset only by `destroy()`). Sample them over time to chart allocation rate, pool-reuse ratio, and graph churn; in a quiescent registry `totalAllocations - totalDisposals === activeNodes`. Drop it on screen for live observability.
563
563
 
564
564
  </details>
565
565
 
@@ -767,7 +767,7 @@ Four tiers, all reproducible.
767
767
 
768
768
  - **`01-core.test.mjs`** -- signal/computed/effect basics, equality semantics, NaN/+/-0, subscribe/peek/update, untrack, batch, cleanup ordering, first-run error recovery, nested object reference-identity gotchas.
769
769
  - **`02-topology.test.mjs`** -- diamond glitch-freedom, 256-deep and 1024-deep computed chains, wide fan-out (1000 effects from one signal), dynamic dependency switching, conditional fan-out, nested effects, cycle detection (`CycleError`).
770
- - **`03-pool.test.mjs`** -- `CapacityError` under both `"throw"` and `"grow"` policies, the 16× link ceiling, stable pool reuse across thousands of create/dispose cycles, registry isolation, (1.3.0) the lazy-prealloc paths: on-demand construction reaching the same steady state as eager, a never-allocated lazy registry surviving `destroy()`, and `"grow"` extending both pool ledgers past their initial capacity, and (1.4.0) the `stats()` lifecycle counters: the 11-key shape, `totalAllocations` / `totalDisposals` tracking the `activeNodes` live invariant, `poolGrowths` firing on growth and staying 0 on a correctly-sized eager pool, and `destroy()` resetting all three.
770
+ - **`03-pool.test.mjs`** -- `CapacityError` under both `"throw"` and `"grow"` policies, the 16× link ceiling, stable pool reuse across thousands of create/dispose cycles, registry isolation, (1.3.0) the lazy-prealloc paths: on-demand construction reaching the same steady state as eager, a never-allocated lazy registry surviving `destroy()`, and `"grow"` extending both pool ledgers past their initial capacity, and (1.4.0) the `stats()` lifecycle counters: the 13-key shape (1.5.0 adds `nodePoolPopulation` / `linkPoolPopulation`), `totalAllocations` / `totalDisposals` tracking the `activeNodes` live invariant, `poolGrowths` firing on growth and staying 0 on a correctly-sized eager pool, and `destroy()` resetting all three.
771
771
  - **`05-scheduler.test.mjs`** -- scheduler-deferred effects, dispose-during-schedule races, microtask integration, 32-bit version wrap (simulated), `setDefaultRegistry`, `onCleanup` inside computeds.
772
772
  - **`06-nested-objects.test.mjs`** -- array mutation patterns (push/splice/spread), deep nested paths, Map/Set/Date inside signals, custom structural equality, computed memoisation cutoffs over object slices, signal-of-signals composition, high-frequency object updates, batched immutable updates.
773
773
  - **`07-dispose.test.mjs`** -- unified `dispose(api)` across signals, computeds and effect handles, idempotency, cross-registry isolation (per-registry Symbol prevents pool corruption), foreign-value safety, top-level helper routing, 500-cycle balanced churn leaving pool and stats stable.
@@ -813,6 +813,47 @@ If these fail, something allocates in the hot path and we want to find it before
813
813
  npm run test:gc
814
814
  ```
815
815
 
816
+ ### Tier 2b -- Perf gate (self-validating zero-GC judge)
817
+
818
+ `npm run test:gate` runs `test/32-perf-gate.test.mjs` through
819
+ [`@zakkster/lite-perf-gate`](https://www.npmjs.com/package/@zakkster/lite-perf-gate)
820
+ (a **dev-only** dependency; runtime `dependencies` stay empty). Where Tier 2
821
+ observes retained heap with hand-written bounds, this lane is the standing
822
+ **verdict**: it measures each hot path at two scales (N and k*N) and judges
823
+ **five signals** every run --
824
+
825
+ 1. **scavenges** -- transient young-gen allocation (the reliable detector);
826
+ 2. **engine counters** -- `stats().totalAllocations` / `totalDisposals` /
827
+ `poolGrowths`, all budgeted to **0** via a per-scenario `statsOf`;
828
+ 3. **retained heap** delta;
829
+ 4. **old-gen** GC activity;
830
+ 5. **external / arrayBuffers** delta.
831
+
832
+ Seven claimed-zero steady-state paths are gated, each warmed inside `setup()`
833
+ so the window sees only steady state, and each anchored to its Performance-
834
+ characteristics claim (see the [Allocation profile](#allocation-profile) and
835
+ `llms.txt`): `set-propagate` (1 signal -> 8 computeds -> 1 effect, synchronous flush),
836
+ `computed-cache-hit`, `computed-recompute-stable`, `effect-rerun-stable`,
837
+ `peek`, `batch-flush` (3 sets/batch), and `box-set-propagate` (the 1.5.0
838
+ `signalBox`/`computedBox` surface, which shares the read/write hot path). The
839
+ gate is self-validating: positive, negative, and large detector controls run on
840
+ every invocation, and two permanent **mustFail** controls -- a per-op object
841
+ allocator and the documented 264 B/op `signal()`+`dispose` churn -- MUST trip
842
+ the gate, so a lane that has gone blind fails loudly instead of passing.
843
+
844
+ The file guards on **both** `--expose-gc` and `--max-semi-space-size=4`; without
845
+ them it emits one loud named skip. This lane adds **exactly one loud named skip
846
+ over 1.5.1 (pass count unchanged)** -- `node:test`'s absolute leaf tally is
847
+ node-version-sensitive, so on node v26.8.2 plain `npm test` reports **513 pass /
848
+ 2 skip** (the second skip is the architecturally-N/A SSR case). The 16MB
849
+ `npm run test:gc` lane never false-reds on the control floor. Thresholds are
850
+ lite-perf-gate defaults, untouched -- a claimed-zero path that cannot meet them
851
+ is a finding, not a config knob.
852
+
853
+ ```bash
854
+ npm run test:gate
855
+ ```
856
+
816
857
  ### Tier 3 -- Performance (comparative benchmark)
817
858
 
818
859
  `npm run bench` runs the **microscope** -- lite's recommended eager config on six first-party shapes; the aggregate output is [`bench/rb.txt`](bench/rb.txt) (four engines: lite, alien, preact, solid). Cross-framework standing comes from the **mirror** (`node --expose-gc bench/mirror.mjs --self-verify` then `bench/sweep.mjs`), which runs Andrii's canonical adapter verbatim so rows diff 1:1 against his log; the aggregate output is [`bench/r.txt`](bench/r.txt) (lite vs alien, all 47 shapes). Every output carries a machine-generated `#STAMP` (engine + harness sha256, the live registry config, host, node), so a header can never disagree with the code that ran. The pre-v3 five-framework reactivity suite is retained one release as `bench-reactive-legacy` (**deprecated -- removed after 1.5.1**). Full methodology: [`bench/README.md`](./bench/README.md).
package/Signal.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @zakkster/lite-signal v1.5.0
2
+ * @zakkster/lite-signal v1.5.2
3
3
  * --------------------
4
4
  * Hybrid Doubly-Linked-List Reactive Graph Engine -- decoupled (Signal1_3) base
5
5
  * with the two 1.1.3 performance fixes ported in:
package/llms.txt CHANGED
@@ -16,7 +16,7 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
16
16
  - **Signal**: root reactive cell. `signal(initial, { equals? })` returns a function. Call it to read (tracked), use `.peek()` to read without tracking, `.set(v)` to notify downstream, `.update(fn)` for read-modify-write, `.subscribe(fn)` for an effect-backed listener.
17
17
  - **Computed**: lazy memoized derivation. `computed(fn, { equals? })`. Cache hits return in O(deps) (version comparison only). Cache misses re-run the body and refresh `evalVersion`. Errors are cached via `FLAG_HAS_ERROR` and re-thrown on every read until a dep changes.
18
18
  - **Effect**: side-effect runner. `effect(fn, { scheduler? })`. Runs immediately on creation, then on any tracked dep change. Returns a dispose function. Optional scheduler defers execution (e.g., to rAF, microtask, custom frame loop).
19
- - **Box (1.5.0)**: non-callable, allocation-light variants. `signalBox(initial, { equals? })` returns `{ get, set, peek, update, subscribe }`; `computedBox(fn, { equals? })` returns `{ get, peek, subscribe }` (no set/update -- derived). Same `ReactiveNode` and zero-GC read/write path as the callable forms, full interop in one graph (a callable can read `box.get()` and vice versa). Construction is ~1.7x cheaper than the callable (an `Object.create(proto)` handle, not a closure). Built on a shared prototype from the start -- never `setPrototypeOf` (which would deopt the method-call ICs to megamorphic). Exported as registry methods and top-level helpers.
19
+ - **Box (1.5.0)**: non-callable, allocation-light variants. `signalBox(initial, { equals? })` returns `{ get, set, peek, update, subscribe }`; `computedBox(fn, { equals? })` returns `{ get, peek, subscribe }` (no set/update -- derived). Same `ReactiveNode` and zero-GC read/write path as the callable forms, full interop in one graph (a callable can read `box.get()` and vice versa). Construction is ~1.7x cheaper than the callable (an `Object.create(proto)` handle, not a closure): measured at **56 B/op per mint+dispose cycle vs 264 B/op for the callable** (all-space, node v26.3.1; the callable's cost is two accessor closures + shared context + property store + closure feedback -- see `harness/run.mjs mint`). The box guard stays DECIDABLE because each box is a fresh identity carrying its own `NODE_GEN`, so pooling closure identity is not needed to cut the cost. Built on a shared prototype from the start -- never `setPrototypeOf` (which would deopt the method-call ICs to megamorphic). Exported as registry methods and top-level helpers.
20
20
  - **createRoot (1.5.0)**: `createRoot(fn)` runs `fn` in a detached ownership scope and returns `fn`'s value. Effects/computeds created directly in `fn` are NOT adopted by the enclosing owner, so they survive its re-runs/disposal (the caller owns their lifecycle). Both ownership and tracking are detached for `fn`'s direct body; inner effect/computed bodies still establish their own scopes. The escape hatch for lazily spawning a long-lived node from inside a consumer effect (e.g. `lite-query`'s query-watcher) -- without it, the consumer owns the watcher and cascade-disposes it on its next re-run. Mirrors Solid's `createRoot`.
21
21
  - **getOwner / runWithOwner (1.5.0-beta.2)**: the re-attach companion. `getOwner()` returns the current lifecycle owner as an opaque gen-stamped handle (`undefined` outside any effect/computed body); `runWithOwner(handle, fn)` runs `fn` with that owner reinstated so effects/computeds created directly in `fn` are adopted by it (and cascade-dispose when it re-runs). Nulls the tracking observer for `fn`'s direct body (same pairing as `createRoot`). Handles are **safe to hold across async boundaries**: they use the `describeNode` / `liveNode` ABA-guard machinery (`NODE_GEN` stamp checked against the pool slot's current gen), so stale handles -- owner disposed, slot recycled by an unrelated effect via the LIFO free list -- degrade to rooted execution rather than corrupting the graph. A raw-pointer implementation would (i) silently adopt continuations into the recycled slot's new resident (measured: continuation dies with a stranger on its next disposal), or (ii) crash the engine with `RangeError: Maximum call stack size exceeded` on a corpse handle (owner disposed, slot not yet recycled -- the disposal walk recurses without termination). Both hazards pinned in `test/28-run-with-owner.test.mjs`, empirically reproduced via `harness/owner-hazard-repro.mjs`. Also exported as registry methods + top-level helpers.
22
22
  - **dispose(api)**: universal disposal. Accepts a signal, computed, or effect dispose handle; idempotent; cross-registry calls are silent no-ops (per-registry `Symbol("node_ptr")` keys the node-identity slot on the returned API function, foreign signals fail the lookup and fall through). Passing an unrelated value is also safe; passing an arbitrary function invokes it (effect-handle contract).
@@ -53,7 +53,37 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
53
53
 
54
54
  ## Version notes
55
55
 
56
- - **1.5.0** (current): stable. Graduates rc.3 with **no further engine change** --
56
+ - **1.5.2** (current): dev-only perf-gate lane -- engine byte-identical to 1.5.1
57
+ past the version banner; no API or behavior change, no engine logic moved.
58
+ Adds `@zakkster/lite-perf-gate` (`^1.4.2`, devDependency only; runtime deps stay
59
+ empty) as the standing zero-GC judge, wired in `test/32-perf-gate.test.mjs` via
60
+ `zgcSuite()` over seven claimed-zero steady-state paths (`set-propagate`,
61
+ `computed-cache-hit`, `computed-recompute-stable`, `effect-rerun-stable`,
62
+ `peek`, `batch-flush`, `box-set-propagate`), each warmed inside `setup()` and
63
+ anchored to its Performance-characteristics claim. Five signals judge every
64
+ run (scavenges / engine counters `totalAllocations`+`totalDisposals`+
65
+ `poolGrowths` all budgeted to 0 via per-scenario `statsOf` / retained heap /
66
+ old-gen / arrayBuffers) at two scales (N and k*N), with positive+negative+large
67
+ detector controls on every invocation and two permanent mustFail controls (a
68
+ per-op object allocator and the documented 264 B/op `signal()`+`dispose`
69
+ churn). New script `test:gate` (`node --expose-gc --max-semi-space-size=4
70
+ --test test/32-perf-gate.test.mjs`) runs it for real and is appended to
71
+ `test:all`; the file guards on `--expose-gc` AND `--max-semi-space-size=4`,
72
+ emitting ONE loud named skip otherwise, so plain `npm test` stays green: this
73
+ lane adds **exactly one loud named skip over 1.5.1, pass count unchanged** (the
74
+ SSR N/A is the other skip). `node:test`'s absolute leaf tally is
75
+ node-version-sensitive; on node v26.8.2 `npm test` reports **513 pass / 2 skip**
76
+ and `test:gc` **521 pass / 2 skip**. The 16MB `test:gc` lane never false-reds on
77
+ the control floor. Thresholds are
78
+ lite-perf-gate defaults, untouched. devDeps: perf-gate ^1.4.2, devtools ^1.3.1,
79
+ gc-profiler ^1.16.0. See CHANGELOG `[1.5.2]`.
80
+ - **1.5.1**: docs + verification patch -- engine byte-identical to 1.5.0
81
+ past the version banner; no API or behavior change. Adds the mint-cycle allocation
82
+ anatomy probe (`node harness/run.mjs mint [--verify]`) and ships the corrected
83
+ creation economics it measured (callable mint+dispose 264 B/op all-space,
84
+ tier-invariant; `signalBox`/`computedBox` 56 B/op; dispose adds 0). devDeps:
85
+ devtools ^1.3.1, gc-profiler ^1.16.0. See CHANGELOG `[1.5.1]`.
86
+ - **1.5.0**: stable. Graduates rc.3 with **no further engine change** --
57
87
  `Signal.js`/`Signal.d.ts` byte-identical to rc.3 past the header, `bench/torture/run.mjs`
58
88
  unchanged at 22/22. First stable to carry the **1.4.5 `createRegistry` input
59
89
  validation** (folded in at rc.3) atop the 1.5.0 surface (`signalBox`/`computedBox`,
@@ -177,8 +207,10 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
177
207
  allocation-light primitives -- `signalBox(initial, opts?)` returning
178
208
  `{ get, set, peek, update, subscribe }` and `computedBox(fn, opts?)` returning
179
209
  `{ get, peek, subscribe }` -- land alongside the callable `signal` / `computed`,
180
- plus **`createRoot(fn)`** as the ownership escape hatch. **The callable API, hot
181
- paths, and `stats()` shape (11 keys) are unchanged from 1.4.0**; this is an
210
+ plus **`createRoot(fn)`** as the ownership escape hatch. **The callable API and
211
+ hot paths are unchanged from 1.4.0**; `stats()` grows to **13 keys** -- adds
212
+ `nodePoolPopulation` / `linkPoolPopulation` (the true constructed-object counts,
213
+ distinct from the `*Capacity` ledgers). This is an
182
214
  additive surface, not a second engine. Boxes wrap the same `ReactiveNode` and
183
215
  interoperate freely with callables in one graph (verified both directions);
184
216
  ownership, batching, glitch-freedom, and introspection apply uniformly, and box
@@ -274,7 +306,7 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
274
306
  (1 - poolGrowths*initialCap/totalAllocations), and churn without the engine
275
307
  computing rates -- the series lite-devtools 1.2 / lite-studio 1.2 plot. **Tests:**
276
308
  429 total, 419 pass, 0 fail, 10 skip (6 new counter tests in `test/03-pool.test.mjs`
277
- cover the 11-key shape, the live invariant, poolGrowths firing on growth vs staying
309
+ cover the 13-key shape (1.5.0: +nodePoolPopulation/+linkPoolPopulation), the live invariant, poolGrowths firing on growth vs staying
278
310
  0 on a sized eager pool, and destroy() reset). **Coverage:** `Signal.js` 100%
279
311
  statements / 98.26% branches / 100% functions / 100% lines; `Watch.js` 100%.
280
312
  Drop-in over 1.3.0.
@@ -570,7 +602,7 @@ interface RegistryConfig {
570
602
  onCapacityExceeded?: "throw" | "grow"; // default "throw"; "grow" = chunked refill, ledger doubles, 16x link ceiling
571
603
  }
572
604
 
573
- interface RegistryStats { // 11 keys as of 1.4.0
605
+ interface RegistryStats { // 13 keys as of 1.5.0
574
606
  signals: number;
575
607
  computeds: number;
576
608
  effects: number;
@@ -578,6 +610,8 @@ interface RegistryStats { // 11 keys as of 1.4.0
578
610
  pooledLinks: number;
579
611
  linkPoolCapacity: number; // ledger; doubles under "grow"
580
612
  nodePoolCapacity: number; // ledger; doubles under "grow"
613
+ nodePoolPopulation: number; // 1.5.0: TRUE constructed node count (nodePool.length); 0 under lazy prealloc
614
+ linkPoolPopulation: number; // 1.5.0: TRUE constructed link count (linkPool.length); 0 under lazy prealloc
581
615
  activeNodes: number; // live gauge
582
616
  totalAllocations: number; // 1.4.0: cumulative node acquires; reset by destroy()
583
617
  totalDisposals: number; // 1.4.0: cumulative node disposals; totalAllocations - totalDisposals === activeNodes
@@ -791,7 +825,8 @@ function dumpOwnerTree(handle, depth = 0) {
791
825
  - `bench/torture/` -- the complete **16-scenario superset (13 semantic + 3 soak)** behind one runner (`run.mjs`), two groups, forward-compatible through 1.9. Every scenario feature-detects and SKIPS cleanly below the engine version that introduces its feature, so the whole set is safe on the 1.5.0 engine and stays green from 1.4.x forward. `semantic` (deterministic, fast, asserts on MEANING; CI on every commit) -- the **9 that execute on 1.5.0**: `oracle-fuzzer` (every computed vs an independent uncached reference, 400 seeds x 120 ops), `glitch-hunter` (glitch freedom + exact wakeups), `work-accounting` (minimum body-execution counts over 10 topologies), `concurrent-storm` (8 reentrancy / flush-ordering contracts), `scheduler-storm` (gen-bound thunk ABA guard, FLAG_QUEUED coalescing, throwing-scheduler containment), `box-torture` (1.5.0: signalBox/computedBox interop -- the oracle differential fuzz with every node realised as callable OR box, plus box-only subscribe/update and the allocation-light representation contract), `async-torture` (watch / when / whenAsync contracts + a 300-seed projection-guard storm), `capacity-torture` (the fail-closed pool boundary -- exact ceilings, re-throw-on-read, `grow` crossing the same boundary), `op-accounting` (structural work counted from the engine's own `onGraphMutation` opcode lane, not wall-clock); plus **4 that skip cleanly** as later-version features: `scope-torture` (1.6.0 `createScope`), `flush-torture` (1.7.0 `flushStrategy`), `cleanup-return-torture` (1.8.0 effect-return cleanup), `dispose-torture` (1.9.0 `Symbol.dispose`). `soak` (wall-clock bound, asserts on RESOURCES; nightly): `graph-fuzzer`, `scheduler-bench`, `torture-soak` -- exit 0 iff zero errors AND post-teardown pool at or below its leaf-only floor AND the JIT sink advanced. Runner spawns each scenario as a child process (several assert on global pool accounting) and passes `--expose-gc` unconditionally. Scripts: `npm run torture`, `torture:semantic`, `torture:soak`.
792
826
  - `bench/torture/helpers/index.mjs` -- shared torture infrastructure: seeded `mulberry32` (failures replay from their seed), `soakRegistry` / `fixedRegistry`, `createReport` (collects failures rather than throwing on the first), and `VALUE_POOL`, the adversarial value domain carrying the pairs where candidate equality definitions disagree (`Object.is` vs `===` on NaN and -0/0; `===` vs `==` on 0/""/false/"0" and null/undefined). Dependency-free and side-effect-free by contract: importing it must not touch the default registry.
793
827
  - `bench/run-all.sh` + `bench/aggregate.mjs` -- cold-process-per-engine protocol + per-scenario aggregation.
794
- - `harness/run.mjs` -- dispatcher for the run-on-demand probes (field, dispose, churn, owner, creation, all).
828
+ - `harness/run.mjs` -- dispatcher for the run-on-demand probes (field, dispose, churn, owner, creation, mint, all).
829
+ - `harness/mint-anatomy.mjs` -- mint+dispose cycle allocation anatomy (`mint` / `mint --verify`): per-op all-space vs new-space heap bytes for every creation primitive on a pre-grown throw-policy registry, fresh child per (variant, warmup) cell. Documents the 264 B/op callable cycle vs 56 B/op signalBox and the ALL-space accounting rule (a new-space-only witness undercounts by ~56 B/op of pre-TurboFan closure-feedback -- the LS-06 correction). `--verify` applies relative pins P1..P5.
795
830
  - `harness/fieldkit.mjs` -- single-file portable verify + cold-child A/B bench across six shapes.
796
831
  - `harness/owner-hazard-repro.mjs` -- async-gap owner-recycling hazard verdict (cited by getOwner/runWithOwner).
797
832
  - `harness/VersionMatrix/` -- cold-process-per-version performance regression gate (wired as prepublishOnly).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zakkster/lite-signal",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "Zero-GC reactive graph. Monomorphic object pool, versioned push-pull propagation, 32-bit modular versioning. Built for hot paths and long-running processes.",
5
5
  "author": "Zahary Shinikchiev <shinikchiev@yahoo.com>",
6
6
  "license": "MIT",
@@ -28,12 +28,13 @@
28
28
  "scripts": {
29
29
  "test": "node --test --test-reporter=spec 'test/*.test.mjs'",
30
30
  "test:gc": "node --expose-gc --test --test-reporter=spec 'test/*.test.mjs'",
31
+ "test:gate": "node --expose-gc --max-semi-space-size=4 --test test/32-perf-gate.test.mjs",
31
32
  "test:coverage": "c8 node --test --test-reporter=spec 'test/*.test.mjs'",
32
33
  "test:report": "c8 --reporter=lcov --reporter=text node --test --test-reporter=spec 'test/*.test.mjs'",
33
34
  "test:hardening": "npm --prefix test/ProfilerTests test",
34
35
  "test:hardening:gc": "npm --prefix test/ProfilerTests run test:gc",
35
36
  "test:harness": "npm --prefix harness/ProfilerTools test",
36
- "test:all": "npm test && npm run test:hardening && npm run test:harness",
37
+ "test:all": "npm test && npm run test:hardening && npm run test:harness && npm run test:gate",
37
38
  "bench": "node --expose-gc bench/benchmark.mjs",
38
39
  "bench-reactive": "node --expose-gc bench/benchmarkReactive.mjs",
39
40
  "harness": "node harness/run.mjs",
@@ -84,8 +85,9 @@
84
85
  },
85
86
  "sideEffects": false,
86
87
  "devDependencies": {
87
- "@zakkster/lite-devtools": "^1.2.0",
88
- "@zakkster/lite-gc-profiler": "^1.15.0",
88
+ "@zakkster/lite-devtools": "^1.3.1",
89
+ "@zakkster/lite-gc-profiler": "^1.16.0",
90
+ "@zakkster/lite-perf-gate": "^1.4.2",
89
91
  "@zakkster/lite-profiler": "^1.1.0",
90
92
  "@zakkster/lite-profiler-signal": "^1.2.0",
91
93
  "@zakkster/lite-signal": "^1.3.0 || >=1.4.0-beta.0 || >=1.6.0-preview.0",