@zakkster/lite-signal 1.6.0-alpha → 1.6.0-alpha.1
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 +104 -23
- package/README.md +55 -33
- package/Signal.js +29 -1
- package/llms.txt +63 -48
- package/package.json +14 -8
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,41 @@ 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
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
### Fixed -- dangling re-tracking cursor on source disposal (crash)
|
|
10
|
+
|
|
11
|
+
Disposing a signal/computed from inside an observer that had linked it on the
|
|
12
|
+
previous run, but had not yet re-read it on the current run, crashed with
|
|
13
|
+
`TypeError: Cannot set properties of null (setting 'headSub')`. `disposeNode`'s
|
|
14
|
+
sub-list teardown freed the link while the observer's re-tracking cursor
|
|
15
|
+
(`activeObserverCurrentDep`) was still parked on it; `severTail` then walked from
|
|
16
|
+
a freed link, wiped the observer's `headDep`, and double-freed the link. Reachable
|
|
17
|
+
from the plain public API (see `COVERAGE-NOTES.md` for the repro). Fixed with a
|
|
18
|
+
one-line cursor repair in `disposeNode` (advance the cursor to the next surviving
|
|
19
|
+
dep before the free); O(1), disposal path only, no steady-state cost. The now-dead
|
|
20
|
+
`freeLink` `-1` defensive ternaries were removed with it. Pinned by a regression
|
|
21
|
+
test in `test/12-coverage.test.mjs`.
|
|
22
|
+
|
|
23
|
+
**Hot-path parity note:** this touches `disposeNode` and `freeLink`, so their
|
|
24
|
+
sha256 no longer matches the `1.6.0-alpha.0` baseline. The steady-state read /
|
|
25
|
+
propagation bodies (`pullComputed`, `markDownstream`, `executeEffect`,
|
|
26
|
+
`flushEffects`, `allocateLink`, `severTail`, `createNode`, `runCleanup`) are
|
|
27
|
+
unchanged. Re-baseline the VersionMatrix engine sha256 on the next publish.
|
|
28
|
+
|
|
29
|
+
### Changed -- branch coverage closed to 100%
|
|
30
|
+
|
|
31
|
+
Branch coverage on `Signal.js` went `96.96% -> 100%`. The gap the `1.6.0-alpha.0`
|
|
32
|
+
notes described -- the hook-attached side of the new op-6 / op-7 gates, which the
|
|
33
|
+
active suite never exercised because it never attached a hook -- is now closed by
|
|
34
|
+
a test that attaches a mutation hook and asserts both opcodes fire on the flush
|
|
35
|
+
path. Alongside it: the three reachable branches ported from the 1.4.0-rc pass
|
|
36
|
+
(`allocateLink` dead-target, `executeEffect` scheduler re-entrancy, `computed`
|
|
37
|
+
stale-handle read), the 1.5.0 box + owner surface (box stale-handle guards,
|
|
38
|
+
`computedBox` `equals`, top-level `getOwner` / `runWithOwner`), and the two
|
|
39
|
+
provably-unreachable clamps (link-ledger, `batchEpoch` wraparound) now carrying
|
|
40
|
+
`/* c8 ignore */` with proofs. See `COVERAGE-NOTES.md`; reconfirm under codify.
|
|
41
|
+
|
|
7
42
|
## [1.6.0-alpha.0] -- 2026-07-XX
|
|
8
43
|
|
|
9
44
|
The observability-and-lifecycle minor, shipping on the `alpha` dist-tag while it
|
|
@@ -100,7 +135,7 @@ its pool slot recycled by an unrelated effect via the LIFO free list, the gen
|
|
|
100
135
|
no longer matches and `runWithOwner` degrades to **rooted execution** rather
|
|
101
136
|
than corrupting the graph. Two hazards on the raw-pointer alternative were
|
|
102
137
|
empirically reproduced against a 1.5.0-beta engine patched with the naive
|
|
103
|
-
implementation (`
|
|
138
|
+
implementation (`harness/owner-hazard-repro.mjs`) and are pinned in
|
|
104
139
|
`test/28-run-with-owner.test.mjs`:
|
|
105
140
|
|
|
106
141
|
- **Recycled-slot cascade death** -- capture, dispose owner, allocate a stranger
|
|
@@ -121,24 +156,31 @@ Exported as registry methods and top-level helpers, mirroring `createRoot` /
|
|
|
121
156
|
|
|
122
157
|
### Added -- characterization harnesses (`burst-dag.mjs`, `pull-stress.mjs`)
|
|
123
158
|
|
|
124
|
-
Two
|
|
125
|
-
surface against the engine's
|
|
126
|
-
(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
(
|
|
137
|
-
|
|
138
|
-
|
|
159
|
+
Two standalone harnesses in `harness/` that exercise the new 1.6.0 instrumentation
|
|
160
|
+
surface against the engine's hot paths, both consuming public `onGraphMutation`
|
|
161
|
+
(opcodes 5/6/7) and both staying out of `npm test` and the published tarball.
|
|
162
|
+
`pull-stress.mjs` imports `../Signal.js` and exposes a CLI + module exports;
|
|
163
|
+
`burst-dag.mjs` takes the engine path as an argument and is CLI-only.
|
|
164
|
+
|
|
165
|
+
**`burst-dag.mjs`** (`npm run profile:burst`, also `node --expose-gc
|
|
166
|
+
harness/burst-dag.mjs <Signal.js>`) reproduces Andrii's actual generator: the
|
|
167
|
+
layer edges use his **verbatim strided picker** (`base = (node*13 + layer*17) %
|
|
168
|
+
prevW`, strided step), `staticFraction = 1` (all-static computeds, per-batch pull
|
|
169
|
+
reads, no effects) -- the real `layered burst flush warm` shape. It runs that
|
|
170
|
+
head-to-head against the earlier contiguous-window guess it embeds and reports
|
|
171
|
+
structure (passes/burst, recomputed, maxRecompute/node, poolGrowths) plus median
|
|
172
|
+
us/burst for each. On 1.6.0-alpha the strided real topology recomputes ~2x the
|
|
173
|
+
nodes (15928 vs 8120) at ~26% higher us/burst, both with `passes = 0` (pure pull,
|
|
174
|
+
nothing to flush) and `maxRecompute/node = 1`: no redundant work either way, so
|
|
175
|
+
the ~2x gap is **locality** on the correct topology. This resolves the ROADMAP S5
|
|
176
|
+
open question (was the contiguous guess faithful to Andrii's generator?). The
|
|
177
|
+
earlier contiguous version -- with its `--width` / `--layers` CLI and its
|
|
178
|
+
`burstDagScenario` / `multiPassProbe` exports for the zero-GC gate -- is archived
|
|
179
|
+
as `harness/attic/burst-dag.mjs`; nothing mounted those exports, so retiring it
|
|
180
|
+
is inert.
|
|
139
181
|
|
|
140
182
|
**`pull-stress.mjs`** (`npm run profile:pull`, also `node --expose-gc
|
|
141
|
-
pull-stress.mjs [--maxDepth=3584 --step=512 ...]`) is the pull-path companion:
|
|
183
|
+
harness/pull-stress.mjs [--maxDepth=3584 --step=512 ...]`) is the pull-path companion:
|
|
142
184
|
characterizes how the recursive pull scales with chain depth and binary-searches
|
|
143
185
|
the exact overflow point. Three answers per run: (1) the exact deepest chain
|
|
144
186
|
that pulls successfully (the roadmap's "~5,000 chained computeds" pinned to a
|
|
@@ -154,11 +196,12 @@ supported and surface a real engine difference (box pulls overflow earlier
|
|
|
154
196
|
because `box.get()` adds a prototype-method frame per level, and cached box
|
|
155
197
|
reads are several times more expensive than cached callable reads).
|
|
156
198
|
|
|
157
|
-
|
|
158
|
-
engine build: point
|
|
159
|
-
(`burst-dag` adapts -- only opcode 5 fires on
|
|
160
|
-
|
|
161
|
-
they produce are reproducible,
|
|
199
|
+
`pull-stress` imports only `../Signal.js`, and `burst-dag` takes the engine path
|
|
200
|
+
as an argument, so both run against any engine build: point them at 1.5.x to
|
|
201
|
+
compare without the new counters (`burst-dag` adapts -- only opcode 5 fires on
|
|
202
|
+
that engine, so `passes` reads 0 -- and `pull-stress` works identically), or at a
|
|
203
|
+
rejected candidate to re-verify on. The numbers they produce are reproducible,
|
|
204
|
+
comparable, and engine-version-aware.
|
|
162
205
|
|
|
163
206
|
### Verified
|
|
164
207
|
|
|
@@ -237,7 +280,45 @@ run_1.txt` ... `run_10.txt` so anyone can re-median independently.
|
|
|
237
280
|
solid-js 1.9.13). No peer bumps this cycle -- the deltas here are the 1.6
|
|
238
281
|
engine's own footprint plus host noise.
|
|
239
282
|
|
|
240
|
-
|
|
283
|
+
### Tooling -- harness reorganization (no published-surface change)
|
|
284
|
+
|
|
285
|
+
The loose `harness/` probes are routed through a single dispatcher
|
|
286
|
+
(`harness/run.mjs`) and exposed as npm scripts: `harness:field`,
|
|
287
|
+
`harness:dispose`, `harness:churn`, `harness:owner`, `harness:creation`, and
|
|
288
|
+
`harness:all` (field + dispose + churn in sequence). `harness:field` is the
|
|
289
|
+
portable fieldkit verify + cold-child A/B bench; the rest map one-to-one to the
|
|
290
|
+
existing probe files. Paths resolve from the dispatcher, so the working
|
|
291
|
+
directory no longer matters.
|
|
292
|
+
|
|
293
|
+
- **`churnprobe.mjs` corrected.** It read link churn from `stats().totalLink*`
|
|
294
|
+
fields that never existed on this engine (`stats()` tracks only NODE lifecycle
|
|
295
|
+
plus a live `activeLinks` gauge), so every row printed `NaN`. It now counts
|
|
296
|
+
gross link churn off `onGraphMutation` -- opcode `3` (link-add) and `4`
|
|
297
|
+
(link-sever) -- which is strictly better: a net `activeLinks` delta would read
|
|
298
|
+
zero on `dep-flip` because each sever is matched by an add, hiding exactly the
|
|
299
|
+
retracking the probe exists to catch. Stable shapes now read `churn/recompute
|
|
300
|
+
= 0`; `dep-flip` reads `2.0`. Opcodes `3`/`4`/`5` are unchanged from 1.5; the
|
|
301
|
+
probe does not use the new `6`/`7` flush opcodes.
|
|
302
|
+
- **`burst-dag.mjs` reconciled.** The contiguous-window guess was first promoted
|
|
303
|
+
from `futureVersions/` into `harness/` (wiring up the `profile:burst` script
|
|
304
|
+
that already pointed there), then superseded by the verbatim-Andrii strided
|
|
305
|
+
reconciliation now carrying that name (see Added above); the contiguous guess
|
|
306
|
+
and its `burstDagScenario` / `multiPassProbe` exports are preserved in
|
|
307
|
+
`harness/attic/`. `pull-stress.mjs` -- the pull-path companion documented
|
|
308
|
+
alongside it -- landed in `harness/`.
|
|
309
|
+
- **The owner-recycling reproducer** is documented at its real home,
|
|
310
|
+
`harness/owner-hazard-repro.mjs`; the earlier `Publications/...` citations
|
|
311
|
+
in README / CHANGELOG / llms.txt pointed at a path the file was never in, and
|
|
312
|
+
are corrected. The createComputations matrix parent/child link
|
|
313
|
+
(`creation-isolated.mjs` -> `andrii-isolated-child.mjs`) is repaired.
|
|
314
|
+
- **Six settled one-off probes** -- the five from the 1.2.0 -> 1.2.1
|
|
315
|
+
construction-shape regression hunt, plus the superseded
|
|
316
|
+
`repro-set-after-dispose.mjs` (its invariant now pinned by `test/07-dispose`
|
|
317
|
+
and `test/26-free-list-invariant`) -- are parked in `harness/attic/` with a
|
|
318
|
+
README explaining each.
|
|
319
|
+
|
|
320
|
+
`Signal.js` and the published `files[]` whitelist are untouched by any of the
|
|
321
|
+
above; this is a repo-tooling change only.
|
|
241
322
|
|
|
242
323
|
## [1.5.0] -- 2026-06-XX
|
|
243
324
|
|
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
[](https://bundlephobia.com/result?p=@zakkster/lite-signal)
|
|
10
10
|
[](https://www.npmjs.com/package/@zakkster/lite-signal)
|
|
11
11
|
[](https://www.npmjs.com/package/@zakkster/lite-signal)
|
|
12
|
+

|
|
12
13
|

|
|
13
14
|

|
|
14
15
|
[](./LICENSE)
|
|
@@ -381,7 +382,7 @@ effect(() => {
|
|
|
381
382
|
|
|
382
383
|
`getOwner()` returns the current owner as an **opaque, gen-stamped handle** (or `undefined` outside any effect/computed body). `runWithOwner(handle, fn)` runs `fn` with the captured lifecycle scope reinstated: effects and computeds created directly in `fn` are adopted by that owner and cascade-dispose when it re-runs or is disposed. Reads directly in `fn` do not link -- tracking is detached the same way `createRoot` detaches it, so accidental cross-async edges cannot form. Compose with an inner effect if you want tracking under the restored owner.
|
|
383
384
|
|
|
384
|
-
**Handles are safe to hold across async boundaries.** This is where a raw-pointer implementation would corrupt the graph: node objects are pooled and the LIFO free list recycles a disposed owner's slot into whatever effect/computed is allocated next. A stale raw pointer would silently adopt continuations into that stranger. Instead, `getOwner` returns a `describeNode` handle stamped with the pool slot's generation; `runWithOwner` resolves via `liveNode()`, and if the gen has moved (slot recycled) or the handle refers to a signal (not a tracker), it degrades to **rooted execution** -- the continuation runs, stays alive, and is simply not owned by anyone. That is the only honest semantics for "the scope you captured no longer exists": the alternative was a silent cascade-dispose by an unrelated stranger, or, if the slot was disposed but not yet recycled, a `RangeError: Maximum call stack size exceeded` inside the cleanup recursion. Both hazards are pinned in `test/28-run-with-owner.test.mjs` and empirically demonstrated in `
|
|
385
|
+
**Handles are safe to hold across async boundaries.** This is where a raw-pointer implementation would corrupt the graph: node objects are pooled and the LIFO free list recycles a disposed owner's slot into whatever effect/computed is allocated next. A stale raw pointer would silently adopt continuations into that stranger. Instead, `getOwner` returns a `describeNode` handle stamped with the pool slot's generation; `runWithOwner` resolves via `liveNode()`, and if the gen has moved (slot recycled) or the handle refers to a signal (not a tracker), it degrades to **rooted execution** -- the continuation runs, stays alive, and is simply not owned by anyone. That is the only honest semantics for "the scope you captured no longer exists": the alternative was a silent cascade-dispose by an unrelated stranger, or, if the slot was disposed but not yet recycled, a `RangeError: Maximum call stack size exceeded` inside the cleanup recursion. Both hazards are pinned in `test/28-run-with-owner.test.mjs` and empirically demonstrated in `harness/owner-hazard-repro.mjs`.
|
|
385
386
|
|
|
386
387
|
The handles do **not** keep owners alive -- they are snapshots, not references. Node lifetime is controlled by the owner tree, not by outstanding handles.
|
|
387
388
|
|
|
@@ -791,32 +792,32 @@ Three tiers, all reproducible.
|
|
|
791
792
|
|
|
792
793
|
`npm test` runs the suite in `test/`, covering:
|
|
793
794
|
|
|
794
|
-
- **`01-
|
|
795
|
-
- **`02-
|
|
796
|
-
- **`03-
|
|
797
|
-
- **`05-
|
|
798
|
-
- **`06-nested-
|
|
799
|
-
- **`07-
|
|
800
|
-
- **`08-
|
|
801
|
-
- **`09-
|
|
802
|
-
- **`10-is-
|
|
803
|
-
- **`11-adopted-
|
|
804
|
-
- **`12-
|
|
805
|
-
- **`13-
|
|
806
|
-
- **`14-lifecycle-
|
|
807
|
-
- **`15-owner-lazy-
|
|
808
|
-
- **`16-alien-
|
|
809
|
-
- **`17-
|
|
810
|
-
- **`18-
|
|
811
|
-
- **`19-v12-
|
|
812
|
-
- **`20-axis-
|
|
813
|
-
- **`21-perf-
|
|
814
|
-
- **`22-mutation-
|
|
815
|
-
- **`23-owner-
|
|
816
|
-
- **`24-
|
|
817
|
-
- **`27-create-
|
|
818
|
-
- **`25-devtools-real-
|
|
819
|
-
- **`26-free-list-
|
|
795
|
+
- **`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.
|
|
796
|
+
- **`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`).
|
|
797
|
+
- **`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.
|
|
798
|
+
- **`05-scheduler.test.mjs`** -- scheduler-deferred effects, dispose-during-schedule races, microtask integration, 32-bit version wrap (simulated), `setDefaultRegistry`, `onCleanup` inside computeds.
|
|
799
|
+
- **`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.
|
|
800
|
+
- **`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.
|
|
801
|
+
- **`08-watch.test.mjs`** -- Validates the user-land observer utilities (watch, when, whenAsync). Covers lifecycle teardown, old/new value tracking, and Promise-based asynchronous state resolution.
|
|
802
|
+
- **`09-conformance.test.mjs`** -- Industry-standard conformance tests. Validates the engine against extreme edge cases from the johnsoncodehk reactive test suite, ensuring strict zero-GC invariants, correct cleanup isolation, and re-entrant stability.
|
|
803
|
+
- **`10-is-tracking.test.mjs`** -- The `isTracking()` observer-context predicate. 11 tests across 5 describe blocks: true inside effect/computed bodies; false inside `untrack`, `subscribe` callbacks, `onCleanup` bodies, and `watch` callbacks (the untracked-window cases that catch an observer-only misimplementation); false outside any observer including at the call site of an unobserved computed read; state-restoration after a thrown body; per-registry isolation; top-level binding.
|
|
804
|
+
- **`11-adopted-reactive.test.mjs`** -- 24 engine-agnostic edge cases adopted from across the ecosystem: alien-signals' parent-child link-integrity regression (#226-228), equality-predicate corners (preact/solid/vue), `signal.update(fn)` functional setter (vue/solid), `peek()` non-subscription depth (preact/vue), and the `subscribe` behavioral contract (preact/mobx).
|
|
805
|
+
- **`12-coverage.test.mjs`** -- 34 targeted exercises for public surface and hot-path branches the behavioral suites don't incidentally hit: top-level routing to the default registry, the computed clean-read short-circuit (`markEpoch` O(1) skip), dependency-set shrink severing the stale tail, error/structural edge paths, scheduler ABA across a recycled pool slot, and the v1.2 owner-tree paths (direct-child detach, cascade tolerates an already-freed child). The coverage-closure block adds: the `allocateLink` dead-target gate, the `executeEffect` scheduler-reentrancy cycle throw, the `computed` stale-handle read, the `disposeNode` cursor-repair regression (the dangling-cursor crash fix), the box stale-handle guards (`boxUpdate`/`boxComputedGet`/`boxComputedPeek`), the `computedBox` `equals` option, the top-level `getOwner`/`runWithOwner` delegators, and the 1.6.0 flush-path opcodes (op 7 effect-enqueue, op 6 flush-pass) on the hook-attached branch. Capability-gated via runtime probes, so the same file runs unchanged across engines.
|
|
806
|
+
- **`13-introspection.test.mjs`** -- The observer-lifecycle surface (1.1.4). 10 tests across 3 describe blocks: `hasObservers` (live observation reflects; a peek doesn't count), `observeObservers` auto-pause lifecycle (start-on-first / stop-on-last, no extra connect for a 2nd observer, re-observe fires again, no churn on re-track, conditional reads toggle honestly, transition-only registration, works for computeds), and `forEachObserver`/`forEachSource` enumeration (both directions; descriptor carries kind + value).
|
|
807
|
+
- **`14-lifecycle-teardown.test.mjs`** -- Effect-teardown guards against the alien-signals@3.2.1 regressions (4 tests). A stopped effect must not re-subscribe to a signal read later in the same run; self-dispose must leave no orphaned link (clean `activeLinks`); a throwing setup must leave no live subscription; normal and dynamic re-tracking stay unaffected by the `allocateLink` eligibility gate.
|
|
808
|
+
- **`15-owner-lazy-alloc.test.mjs`** -- Owner-adoption contract for the 1.2.0 owner tree (5 tests). A signal allocated lazily *inside* a computed/effect must **not** be owner-adopted (it survives the owner's re-run -- the lite-store/lite-form lazy-field shape) and sibling lazy signals must not cross-wire, while observers (nested effect/computed) *are* still auto-disposed on the owner's re-run.
|
|
809
|
+
- **`16-alien-parity.test.mjs`** -- Differential regression guards (3 tests) reproducing the *properties* behind alien-signals@3.2.0 fixed bugs: reads inside a cleanup create no spurious dependencies (the dispose-cleanup fix); an inner-effect write does not block later propagation through a computed chain (#112); a dynamic dependency-set change stays correct under dirty-check (#109/#110).
|
|
810
|
+
- **`17-reactivity.test.mjs`** -- Behavioral suite (~30 tests across 11 groups) mirroring universal signal-system bug classes: subscription lifecycle, cleanup ordering, stale-dependency tracking, batching/timing (incl. set-then-revert), equality cutoff (NaN/+/-0/custom), nested invalidation + glitch-free diamond, memory/retained nodes, the synchronous async-boundary, scheduler & loops (self-write termination, self-reading computed), and differential-review additions (cached computed errors, mid-batch pull, self-disposing getter, pooled-slot return). SSR hydration is a documented N/A -- lite has no DOM layer.
|
|
811
|
+
- **`18-identity.test.mjs`** -- Node identity (1.1.5; 5 tests). Unique/stable ids; `nodeId`/`describe` return `undefined` for a non-handle; the descriptor's visible shape is `{ id, kind, value }`; `forEach*` descriptors carry `id` and are **re-walkable** (`nodeId`/`forEachSource` accept a descriptor); identity walks are non-perturbing (add no observers).
|
|
812
|
+
- **`19-v12-additions.test.mjs`** -- v1.2.0 release-prep regressions (24 tests across 8 suites). Shared `peek` (one closure per registry, identical reference across primitives, no tracking, two registries hold independent peeks). Owner-adoption rule (signals not adopted, computeds/effects adopted, cascade drains correctly). Pre-batch revert (signal-level, propagates through computeds, respects custom `equals`, nested batches, final-different-value still fires). Multi-throw aggregation (`AggregateError` with both errors carried, single-throw unwrapped, engine survives). `CycleError` via `maxFlushPasses` (default + custom). `maxLinks` config branch under `throw` and `grow`. Documented disposed-signal semantics (read undefined, set silent no-op, dispose idempotent). Scheduler-thunk ABA guard across a recycled pool slot.
|
|
813
|
+
- **`20-axis-stress.test.mjs`** -- engine-invariant regression guards along eight orthogonal "axes" (16 tests across 9 suites). Pins lite-signal's actual contract on: batch semantics under exception (writes commit; pre-batch revert holds; effects see the post-throw value), connect/disconnect lifecycle re-entrancy (`observeObservers` from inside an `onConnect`, transition-only registration), untrack does NOT suppress owner adoption (a nested effect created via `untrack` is still owner-cascaded), untrack inside a computed body (no hidden dep leaks; tracked source re-evaluates), queue safety under self-dispose mid-flush (no UAF), value-dependent cycle detection (computed graph closes a cycle, `CycleError` thrown), nested-effect creation order (effects run synchronously on creation; immediately-stopped one still ran), synchronous flush (no scheduler in the default path; batch coalesces). Plus a bonus suite: 1,000 effect-create-then-dispose cycles return pool to baseline; `dispose()` idempotent; `dispose()` on foreign values safe.
|
|
814
|
+
- **`21-perf-pins.test.mjs`** -- v1.2.1 construction-shape pins (6 tests). Locks the canonical handle shapes (`signal` 6 own props: peek/set/update/subscribe + NODE_PTR/NODE_GEN; `computed` 4: peek/subscribe + NODE_PTR/NODE_GEN) so a future "let's unify them" change has to be explicit. Locks the 1.2.1 ABA guards: detached `const {set} = signal()` keeps working on a LIVE signal; `read()` returns `undefined` and skips dep-tracking on a stale handle (no phantom subscription to the recycled slot); `set()` on a stale handle is a no-op across three corruption tiers (disposed slot, recycled slot, downstream propagation); `peek()` returns `undefined` for stale signal and computed handles.
|
|
815
|
+
- **`22-mutation-hook.test.mjs`** -- 1.2.1 `onGraphMutation` semantics (12 tests across 2 suites). Registration: unsubscribe returns a function; `null` argument clears and the unsub restores the prior listener; non-function/non-null throws `TypeError`; multiple registrations stack LIFO; registries are isolated (no cross-talk). Opcode emission: `1` node-create fires with `(id, flags)` for signal (32) / computed (1) / effect (2); `2` node-dispose fires for cascade-disposed owned children; `3` link-add fires with `(source.id, target.id)` on dependency record; `4` link-remove fires when a dep-set flip severs the tail; `5` recompute fires on initial eval AND re-eval; the hook fires synchronously inside the mutation (listener sees its own event before the caller returns); payload is always three plain numbers -- no objects, no closures.
|
|
816
|
+
- **`23-owner-introspection.test.mjs`** -- 1.2.1 owner-tree introspection + effect-disposer regression (22 tests across 4 suites). `ownerOf`: undefined for top-level / garbage input / stale handle; returns the enclosing effect's descriptor for a child created inside an effect body. `forEachOwned`: no-op for handles with no owned children / garbage input / stale handle; iterates owned children as `{id, kind, value}` descriptors. Gen-guarded introspection (ABA fix): `nodeId` / `describe` / `hasObservers` return undefined / false for stale handles; `observeObservers` throws `TypeError`; `forEachObserver` / `forEachSource` are no-ops; descriptors returned by `describeNode` are themselves gen-stamped so a descriptor obtained pre-recycle correctly walks as a no-op post-recycle (the "descriptors are re-walkable handles" contract survives the guard). Plus the 1.2.1 effect-dispose-handle fix: passing the effect's disposer directly to `describe` / `nodeId` / `forEachSource` / `forEachOwned` / `ownerOf` / `hasObservers` works as a first-class introspection handle (pre-fix it was a bare closure and returned `undefined` for a *live* effect); after `fx()` dispose the same handle correctly goes stale on every entry point; the disposer's `NODE_GEN` mirrors the effect node's birthGen exactly.
|
|
817
|
+
- **`24-signalbox.test.mjs`** -- the `signalBox` / `computedBox` allocation-light handle API, **activated in 1.5.0** (committed `{skip:true}` since 1.3.0, now running against the real implementation). 12 tests: box get/set/peek/update, `computedBox` derive + memoize, peek-does-not-track, subscribe fires-and-untracks, box<->callable interop both directions, batch coalescing (including set-then-revert net no-op), dispose with ABA-safety, the `equals` short-circuit, `computedBox.peek`, and the top-level helpers bound to the default registry.
|
|
818
|
+
- **`27-create-root.test.mjs`** -- `createRoot` (1.5.0), the ownership escape hatch. A watcher spawned inside a consumer effect via `createRoot` survives the consumer's re-run (the exact `lite-query` lazy-watcher pattern); the contrast case confirms an *unwrapped* spawn is cascade-disposed; `createRoot` returns `fn`'s value, detaches tracking in `fn`'s direct body while inner effect bodies still track, and composes with box handles.
|
|
819
|
+
- **`25-devtools-real-boot.test.mjs`** -- Devtools/Studio contract (10 tests). Boots the actual `Devtools.js` against the 1.5.0 engine and exercises all 19 Devtools exports plus the 10 symbols Studio imports from Devtools. Pins the ghost contract: heavy introspection (graph walk, owner-tree, observer descriptors) adds **zero** nodes to the live graph. Catches the real-rig failure mode where importing the package by its own name from a repo whose `package.json` declares `name: "@zakkster/lite-signal"` resolves to the published build instead of the local engine.
|
|
820
|
+
- **`26-free-list-invariant.test.mjs`** -- the 1.2.2 audit's cleanliness pins (3 invariant tests + 1 targeted coverage test). Asserts directly -- by inspecting freshly-allocated nodes through the documented `describe()` -> `NODE_PTR` introspection protocol -- that the `ReactiveNode` constructor and the fresh-pool-growth path initialize the ten fields the audit removed from `createNode` to identical values, so the deleted writes were defending against a state the engine cannot produce on a clean free list. The 4th test covers the swallow-on-self-dispose-then-throw branch in `pullComputed` (the path that lifted branch coverage from 98.07% to 98.43%).
|
|
820
821
|
|
|
821
822
|
```bash
|
|
822
823
|
npm test
|
|
@@ -824,7 +825,7 @@ npm test
|
|
|
824
825
|
|
|
825
826
|
### Tier 2 -- Memory (allocation-free verification)
|
|
826
827
|
|
|
827
|
-
`npm run test:gc` runs `test/04-zero-
|
|
828
|
+
`npm run test:gc` runs `test/04-zero-gc.test.mjs` with `--expose-gc`:
|
|
828
829
|
|
|
829
830
|
- 100,000 `set()` calls on a graph with effects retain **< 200 KB** of heap.
|
|
830
831
|
- 1,000 create/dispose cycles retain **< 50 KB**.
|
|
@@ -878,6 +879,23 @@ Beyond the engine's own test tiers above, `@zakkster/lite-signal` ships **dedica
|
|
|
878
879
|
|
|
879
880
|
This section will grow. As future versions ship publications that need specific defensive validation (e.g. a `flushStrategy` ship, a TC39-polyfill ship, a zero-GC public gate, a profiler/observability ship), the corresponding harness lands here.
|
|
880
881
|
|
|
882
|
+
### `harness/` -- run-on-demand probes
|
|
883
|
+
|
|
884
|
+
Single-file probes that don't warrant their own subdirectory. One dispatcher (`harness/run.mjs`) routes them; each keeps its own node flags, and paths resolve from the dispatcher so the working directory never matters. Run against the local engine, or pass an explicit `Signal.js` to profile a candidate build:
|
|
885
|
+
|
|
886
|
+
```bash
|
|
887
|
+
npm run harness:field # verify + cold-child A/B bench (fieldkit)
|
|
888
|
+
npm run harness:field -- ./Signal.js ./archived/1.5.0.js # A/B two engines
|
|
889
|
+
npm run harness:dispose # creation cost: signal() vs signalBox() vs alien
|
|
890
|
+
npm run harness:churn # topology-churn-per-recompute (1.11 cone-cache gate)
|
|
891
|
+
npm run harness:owner # async-gap owner-recycling hazard verdict
|
|
892
|
+
npm run harness:creation # per-framework createComputations matrix
|
|
893
|
+
npm run harness:all # field + dispose + churn, in sequence
|
|
894
|
+
npm run profile:burst # 1.6 burst-shape characterization (Andrii strided vs contiguous guess)
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
`owner-hazard-repro.mjs` is the reproducer cited in the `getOwner` / `runWithOwner` notes: it prints `VERDICT: SAFE` on the shipping engine and `VERDICT: CORRUPTED` on a raw-pointer sketch. `churnprobe.mjs` reads link churn off `onGraphMutation` (opcodes `3` link-add / `4` link-sever), not `stats()`, so it reports gross retracking a net `activeLinks` gauge would hide -- stable shapes read `0`, `dep-flip` reads `2.0`. `burst-dag.mjs` runs Andrii's verbatim strided burst shape head-to-head against the earlier contiguous-window guess (now archived in `harness/attic/`) to answer whether the burst gap is redundant work or locality. The `dispose` and `creation` probes compare against `alien-signals`, which is **not** a declared dependency -- without it, `dispose` runs the two lite columns only, and `creation` needs it plus `LITE_V120_PATH` to light the extra columns (`npm i -D alien-signals` unlocks them). Settled one-off probes -- the 1.2.0 -> 1.2.1 construction-shape regression hunt -- are parked in `harness/attic/`, kept for provenance and wired into nothing.
|
|
898
|
+
|
|
881
899
|
### `test/ProfilerTests/` -- version-portable hardening suite
|
|
882
900
|
|
|
883
901
|
An adversarial, **version-portable** conformance + hardening suite for `@zakkster/lite-signal`. `node:test` only, zero test deps. Each file imports the **bare** package (`@zakkster/lite-signal`), so it resolves to whatever version is installed when run standalone, and self-references through this repo's own package name when run inside the source tree. Advanced cases are **feature-gated**: an older engine skips the cases for APIs it does not have yet, and they light up automatically as the surface grows.
|
|
@@ -957,9 +975,9 @@ Both flags are required (`--expose-gc` for the explicit `gc()` calls in the mete
|
|
|
957
975
|
|
|
958
976
|
### `harness/burst-dag.mjs` and `harness/pull-stress.mjs` -- 1.6 profiling harnesses
|
|
959
977
|
|
|
960
|
-
Two standalone profiling harnesses that consume the new op 6/7 mutation-hook counters to characterise **shape**-specific engine behaviour that the throughput benches can only aggregate over.
|
|
978
|
+
Two standalone profiling harnesses that consume the new op 6/7 mutation-hook counters to characterise **shape**-specific engine behaviour that the throughput benches can only aggregate over. `pull-stress.mjs` imports `../Signal.js` and is dual-mode (standalone runner or mountable zero-GC scenario); `burst-dag.mjs` takes the engine path as an argument (`node --expose-gc harness/burst-dag.mjs <Signal.js>`) so the same contrast runs against any build. Wired as `npm run profile:burst` and `npm run profile:pull`.
|
|
961
979
|
|
|
962
|
-
**`burst-dag.mjs`** -- the burst-
|
|
980
|
+
**`burst-dag.mjs`** -- the burst-shape characterisation harness, built on Andrii's **verbatim strided generator** (`base = (node*13 + layer*17) % prevW`, strided step; `staticFraction = 1`, all-static computeds read per-batch by pull -- his real *layered burst flush warm* shape). It answers the question the roadmap hinges on: is the ~2x gap on that shape **redundant work** (multi-pass flush re-marking already-clean cones, fixable by coalescing) or **locality at scale** (touching ~16k nodes' worth of marks + pulls per burst, not fixable without a layout change -- and layout changes have been shown to deopt the propagation hot path)? To settle it, the harness runs Andrii's strided topology head-to-head against the earlier *contiguous-window* guess it embeds, reporting structure (passes/burst, recomputed, max recomputes per node) and median us/burst for each. On 1.6.0-alpha the strided real shape recomputes ~2x the nodes of the contiguous guess (15928 vs 8120) at ~26% higher us/burst, both with `passes/burst = 0` (pure pull -- nothing to flush) and `maxRecompute/node = 1` -- no redundant work in either, so the gap is **locality** (the strided edges spread the cone wider across each layer). The standalone contiguous guess that preceded this reconciliation (ROADMAP S5, now closed) is preserved as `harness/attic/burst-dag.mjs`, complete with its `burstDagScenario` / `multiPassProbe` exports.
|
|
963
981
|
|
|
964
982
|
**`pull-stress.mjs`** -- the pull-mode recursion characterisation harness. Answers three questions on the current engine:
|
|
965
983
|
|
|
@@ -970,11 +988,11 @@ Two standalone profiling harnesses that consume the new op 6/7 mutation-hook cou
|
|
|
970
988
|
Also verifies the structure of the cold-pull correctness: opcode 6 (flush pass) MUST be 0, opcode 7 (effect enqueued) MUST be 0, opcode 5 (recompute) MUST equal depth. A correct engine produces this exact triple; deviation is a real finding, reported as a STRUCTURE FAILED verdict that suppresses the timing summary.
|
|
971
989
|
|
|
972
990
|
```bash
|
|
973
|
-
npm run profile:burst #
|
|
991
|
+
npm run profile:burst # Andrii's strided burst shape vs the contiguous guess, head-to-head
|
|
974
992
|
npm run profile:pull # per-level cost + exact overflow depth + O(1) cached-read sanity
|
|
975
993
|
```
|
|
976
994
|
|
|
977
|
-
|
|
995
|
+
These harnesses land in 1.6 alongside the mutation-hook opcodes they consume; they are not test files (no assertion budget beyond the structure invariants), they are characterisation tools intended to make the "is this shape's cost redundant work or locality?" question answerable reproducibly on any engine build.
|
|
978
996
|
|
|
979
997
|
### Notes
|
|
980
998
|
|
|
@@ -1042,7 +1060,7 @@ The cross-framework reactivity suite agrees independently, re-run on **1.6.0-alp
|
|
|
1042
1060
|
- **1.3.0** -- the **pool minor**: node and link pools become growable and incrementally populated. New `prealloc` config (`"eager"` default | `"lazy"`) chooses up-front vs on-demand construction; `onCapacityExceeded: "grow"` extends pools via chunked refill (runs of up to 1024 links / 256 nodes, ledger doubles) bounded by the 16x link ceiling; `maxFlushPasses` is now a public config. Internally the propagation mark phase moved to an intrusive linked-list stack (a `nextMark` field) -- the only node-shape change. The hot paths and public callable API are byte-identical to 1.2.2; steady-state zero-GC is unchanged. *Shipped.*
|
|
1043
1061
|
- **1.4.0** -- the **observability minor**: `stats()` gains three cumulative lifecycle counters (`totalAllocations`, `totalDisposals`, `poolGrowths`), the surface reserved for it in the 1.2.x/1.3.0 notes. Monotonic over the registry's life, reset by `destroy()`, bumped on the existing acquire/dispose/grow edges -- no hot-path change, no public callable API change. This is what lite-devtools / lite-studio read to chart allocation rate, pool-reuse ratio, and graph churn. Also adds the `harness/VersionMatrix/` regression gate (cold-process, same-host, two baselines) as a `prepublish` step, so a release that regresses `frame.avg` on the four reference workloads (reactive-graph-mix, deep-chain, broadcast-fanout, dynamic-dep-churn) fails the publish. Drop-in over 1.3.0. *Shipped.*
|
|
1044
1062
|
- **1.5.0** -- the **API-surface minor**: two non-callable, allocation-light primitives `signalBox` / `computedBox` land alongside the callable `signal` / `computed` (same `ReactiveNode`, full interop, ~1.7x cheaper construction), and **`createRoot`** lands as the ownership escape hatch the owner tree was designed for (detached scope for lazily spawning long-lived nodes from inside a consumer effect -- the pattern `lite-query` needs). The callable API, hot paths, and `stats()` shape are unchanged; the `24-signalbox` suite (staged since 1.3.0) now runs and passes. VersionMatrix gains an **identical-code guard** (SHA-256 of the engine source per baseline): a re-versioned publish with byte-identical `Signal.js` is marked `SKIP` structurally rather than flagged by noisy median variance. *Shipped (beta).* **1.5.0-beta.2** adds the re-attach companions **`getOwner` / `runWithOwner`** (gen-stamped handles that degrade to rooted execution when the captured owner has been recycled; both async-gap hazards -- recycled-slot cascade death and corpse-adoption crash -- pinned in `test/28-run-with-owner.test.mjs`). **1.5.1** promotes the zero-GC gate from `futureVersions/zgc/` to `test/zgc/` (six scenarios + controls + injected-allocation self-test), wired into `test:zgc` / `test:all` / `verify` -- CI-wireable proof that the steady-state hot path allocates nothing.
|
|
1045
|
-
- **1.6.0-alpha** -- the **observability + lifecycle minor**. Two additions to the mutation-hook stream: op 6 (`flush-pass-start`, once per pass in `flushEffects`) and op 7 (`effect-enqueue`, in `markDownstream` when a dirty subscriber is enqueued) -- both branch-predicted-free when detached, allocation-free when attached, letting lite-devtools/profiler chart flush structure and per-burst enqueue counts without instrumentation. Plus the `flushPasses` counter on `stats()` (the 12th key) advancing only while a hook is attached. Adds **`createScope`** as the third ownership primitive alongside `createRoot` / `runWithOwner`: an adopting scope that returns one disposer for the whole subtree, exactly the per-item lifecycle a keyed-list or scene reconciler needs. Ships the
|
|
1063
|
+
- **1.6.0-alpha** -- the **observability + lifecycle minor**. Two additions to the mutation-hook stream: op 6 (`flush-pass-start`, once per pass in `flushEffects`) and op 7 (`effect-enqueue`, in `markDownstream` when a dirty subscriber is enqueued) -- both branch-predicted-free when detached, allocation-free when attached, letting lite-devtools/profiler chart flush structure and per-burst enqueue counts without instrumentation. Plus the `flushPasses` counter on `stats()` (the 12th key) advancing only while a hook is attached. Adds **`createScope`** as the third ownership primitive alongside `createRoot` / `runWithOwner`: an adopting scope that returns one disposer for the whole subtree, exactly the per-item lifecycle a keyed-list or scene reconciler needs. Ships the profiling harnesses `harness/burst-dag.mjs` (Andrii's verbatim strided burst shape, resolving ROADMAP S5 -- the earlier contiguous guess is archived in `harness/attic/`) and `harness/pull-stress.mjs` (see the Test harnesses section). The engine hot path is no longer byte-identical to 1.5 -- `markDownstream` and `flushEffects` picked up the new gate branches -- and the observable cost is a few percent on the cheap propagation shapes (KAIROS -7 -> -12%, DEEP CHAIN -14 -> -21% vs alien); the wide-aggregation wins are unchanged because the gate is round-off there. *Shipped (alpha).*
|
|
1046
1064
|
- **Next** -- the pull-mode recursion depth limit (~5,000 chained computeds; `pull-stress.mjs` now pins the exact number on the current engine and will be the before/after baseline for the eventual iterative pull rewrite) remains the main outstanding architectural item.
|
|
1047
1065
|
|
|
1048
1066
|
> Note: the retracking rewrite that closes the dynamic-topology gap shipped in **1.1.4**, not a future release. The earlier roadmap that listed it under "v1.2" is superseded.
|
|
@@ -1295,6 +1313,10 @@ npm test # behavior suite, ~1.3s
|
|
|
1295
1313
|
npm run test:gc # zero-gc suite, requires --expose-gc, ~3s
|
|
1296
1314
|
npm run bench # comparative benchmark vs alien-signals (results.txt), ~5min
|
|
1297
1315
|
npm run bench-reactive # 5-framework reactivity suite (resultsReactive.txt)
|
|
1316
|
+
npm run harness:field # verify + cold-child A/B bench (fieldkit)
|
|
1317
|
+
npm run harness:all # field + dispose + churn probes, in sequence
|
|
1318
|
+
npm run profile:burst # 1.6 burst/flush characterization harness
|
|
1319
|
+
npm run gate # cold-process version-matrix regression gate (also runs on prepublish)
|
|
1298
1320
|
npm run verify # test + test:gc + sanity bench; gate for publish
|
|
1299
1321
|
```
|
|
1300
1322
|
|
package/Signal.js
CHANGED
|
@@ -385,6 +385,14 @@ export function createRegistry(config) {
|
|
|
385
385
|
if (linkPool.length > currentLinkCapacity) {
|
|
386
386
|
let doubled = currentLinkCapacity;
|
|
387
387
|
while (doubled < linkPool.length) doubled *= 2;
|
|
388
|
+
// The `> maxLinkLimit` arm is provably unreachable, retained as a clamp.
|
|
389
|
+
// Proof: maxLinkLimit === initialLinkCapacity * 16, currentLinkCapacity is
|
|
390
|
+
// only ever assigned a power-of-2 multiple of that same initial capacity,
|
|
391
|
+
// so 16x is ON the doubling chain (m, 2m, 4m, 8m, 16m). The guard above
|
|
392
|
+
// (`linkPool.length >= maxLinkLimit -> CapacityError`) plus the chunk math
|
|
393
|
+
// (`chunk = limit - linkPool.length`) cap linkPool.length AT maxLinkLimit,
|
|
394
|
+
// so `doubled` terminates at exactly 16m and can never exceed it.
|
|
395
|
+
/* c8 ignore next -- unreachable clamp; see proof above + COVERAGE-NOTES.md */
|
|
388
396
|
currentLinkCapacity = doubled > maxLinkLimit ? maxLinkLimit : doubled;
|
|
389
397
|
statPoolGrowths++; // 1.4: link capacity ledger crossed
|
|
390
398
|
}
|
|
@@ -417,7 +425,12 @@ export function createRegistry(config) {
|
|
|
417
425
|
|
|
418
426
|
/** Return a link to the free pool and unlink it from the source's sub list. @private */
|
|
419
427
|
function freeLink(link, target, source) {
|
|
420
|
-
|
|
428
|
+
// Every caller (allocateLink sever, severTail, disposeNode dep-walk) passes a
|
|
429
|
+
// LIVE link: `source === link.source`, `target === link.target`. The 1.3.x
|
|
430
|
+
// `link.source !== null ? ... : -1` guards existed only to survive a cursor
|
|
431
|
+
// dangling at an already-freed link -- a state disposeNode's CURSOR REPAIR now
|
|
432
|
+
// makes unreachable. Reading the params directly is equivalent and branch-free.
|
|
433
|
+
if (mutationHook !== null) mutationHook(4, source.id, target.id);
|
|
421
434
|
const pSub = link.prevSub;
|
|
422
435
|
const nSub = link.nextSub;
|
|
423
436
|
if (pSub !== null) pSub.nextSub = nSub; else source.headSub = nSub;
|
|
@@ -528,6 +541,17 @@ export function createRegistry(config) {
|
|
|
528
541
|
if (pDep !== null) pDep.nextDep = nDep; else target.headDep = nDep;
|
|
529
542
|
if (nDep !== null) nDep.prevDep = pDep; else target.tailDep = pDep;
|
|
530
543
|
|
|
544
|
+
// CURSOR REPAIR (1.4.0): `target` may be an observer that is MID-RUN with
|
|
545
|
+
// its re-tracking cursor parked on this very link -- it linked `source` on
|
|
546
|
+
// the previous run, has not reached that read yet on this one, and now
|
|
547
|
+
// disposes `source` from its own body. Splicing the link out and handing it
|
|
548
|
+
// to the free list would leave activeObserverCurrentDep dangling at a freed
|
|
549
|
+
// slot: severTail would then read a nulled prevDep, wipe target.headDep
|
|
550
|
+
// (orphaning every surviving dep), and double-free the link -- freeLink
|
|
551
|
+
// null-derefs on `source.headSub`. Advance the cursor to the next surviving
|
|
552
|
+
// dep instead. Disposal path only; no steady-state cost.
|
|
553
|
+
if (activeObserverCurrentDep === sLink) activeObserverCurrentDep = nDep;
|
|
554
|
+
|
|
531
555
|
sLink.source = null;
|
|
532
556
|
sLink.target = null;
|
|
533
557
|
sLink.prevDep = null;
|
|
@@ -1405,6 +1429,10 @@ export function createRegistry(config) {
|
|
|
1405
1429
|
function batch(fn) {
|
|
1406
1430
|
if (batchDepth === 0) {
|
|
1407
1431
|
batchEpoch = (batchEpoch + 1) | 0;
|
|
1432
|
+
// 2^32 wraparound sentinel: batchEpoch is bumped ONLY here (and reset to 1 by
|
|
1433
|
+
// destroy()), so reaching 0 costs 4,294,967,295 top-level batch() calls. Kept
|
|
1434
|
+
// because revertEpoch comparisons treat 0 as "no capture".
|
|
1435
|
+
/* c8 ignore next -- 2^32 wraparound; unreachable without ~4.3e9 batches */
|
|
1408
1436
|
if (batchEpoch === 0) batchEpoch = 1;
|
|
1409
1437
|
}
|
|
1410
1438
|
batchDepth = (batchDepth + 1) | 0;
|
package/llms.txt
CHANGED
|
@@ -18,7 +18,7 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
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
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.
|
|
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
|
-
- **getOwner / runWithOwner (1.5.0-beta.2, carried into 1.6)**: 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 `
|
|
21
|
+
- **getOwner / runWithOwner (1.5.0-beta.2, carried into 1.6)**: 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
|
- **createScope (1.6.0)**: `createScope(fn)` runs `fn(dispose)` in a detached, untracked scope and returns whatever `fn` returns, having handed `fn` a single `dispose` that cascade-disposes every effect and computed created inside `fn`. The lifecycle complement to `createRoot`: where `createRoot` only *detaches* (caller disposes each child by hand), `createScope` *adopts*, so one disposer tears down a subtree of unknown shape -- the per-item lifecycle a keyed-list or scene reconciler needs. Plain signals created directly in `fn` are NOT adopted (consistent with the 1.2.0 ownership rule); computeds and effects are. The scope owner is backed by a never-re-running effect node (counts as one effect in `stats()`), the pinned `signals + computeds + effects === activeNodes` invariant is untouched, and the disposer is the same gen-guarded ABA-safe handle `effect()` returns (`describe` / `nodeId` / `forEachOwned` resolve it to the owner). A scope created inside a consumer effect SURVIVES that consumer's re-run -- the reconciler-critical detach property.
|
|
23
23
|
- **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).
|
|
24
24
|
- **Batch**: `batch(fn)` defers effect flush until the outermost batch closes. Nestable.
|
|
@@ -101,7 +101,7 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
101
101
|
degrading to rooted execution on stale/null/non-tracker handles. The two
|
|
102
102
|
hazards (recycled-slot cascade death, corpse-adoption crash) are pinned in
|
|
103
103
|
`test/28-run-with-owner.test.mjs` with allocation pressure applied so the
|
|
104
|
-
ABA guard is genuinely exercised. `
|
|
104
|
+
ABA guard is genuinely exercised. `harness/owner-hazard-repro.mjs`
|
|
105
105
|
reports `VERDICT: SAFE` on the 1.6.0-alpha engine on both cases. The port
|
|
106
106
|
was verified via sha256 over the extracted function bodies of `pullComputed`,
|
|
107
107
|
`executeEffect`, `allocateLink`, `severTail`, `createNode`, `runCleanup`,
|
|
@@ -111,16 +111,21 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
111
111
|
hash-tracked from this cycle instead.
|
|
112
112
|
|
|
113
113
|
Drop-in over 1.5.1-beta.1 modulo the small gate cost on the cheapest shapes.
|
|
114
|
-
Two
|
|
115
|
-
tarball): **`burst-dag.mjs`** (`npm run profile:burst`)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
114
|
+
Two characterization harnesses in `harness/` ship in source (not in the
|
|
115
|
+
tarball): **`burst-dag.mjs`** (`npm run profile:burst`) reproduces Andrii's
|
|
116
|
+
verbatim strided generator (`base=(node*13+layer*17)%prevW`, staticFraction=1,
|
|
117
|
+
pull reads -- his real `layered burst flush warm` shape) and runs it
|
|
118
|
+
head-to-head against the earlier contiguous-window guess it embeds, using
|
|
119
|
+
opcodes 5/6 + `stats().flushPasses`; the strided real topology recomputes ~2x
|
|
120
|
+
the nodes at ~26% higher us/burst, both single-pass -- locality, not
|
|
121
|
+
redundancy (ROADMAP S5 closed). The contiguous guess it replaced, with its
|
|
122
|
+
`burstDagScenario` + `multiPassProbe` exports, is archived in `harness/attic/`.
|
|
123
|
+
**`pull-stress.mjs`** (`npm run profile:pull`) is the pull-path companion:
|
|
124
|
+
binary-searches the recursive-pull depth limit (~5,000 named in the roadmap,
|
|
125
|
+
pinned to a number per engine), sweeps cold cost per level, confirms cached
|
|
126
|
+
reads are O(1) via markEpoch; exports `pullStressScenario` + `probeOverflow`.
|
|
127
|
+
`pull-stress` imports `../Signal.js`; `burst-dag` takes the engine path as an
|
|
128
|
+
argument; both run against any engine build via public `onGraphMutation`.
|
|
124
129
|
**Tests:** 447 total (443 from 1.6-preview + the 4 createScope tests
|
|
125
130
|
+ 16 getOwner/runWithOwner tests already counted; the 447 aggregates the
|
|
126
131
|
full green suite on the merged engine), 436 pass, 0 fail, 1 skip (only the
|
|
@@ -171,8 +176,9 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
171
176
|
total, 438 pass, 0 fail, **1 skip** (only the architecturally-N/A SSR case in
|
|
172
177
|
`17-reactivity`; the 9 originally-staged signalBox tests are now active and
|
|
173
178
|
the suite carries +3 box-coverage additions for a 12-test file, +7 `createRoot`
|
|
174
|
-
tests in `test/27-create-
|
|
175
|
-
100% statements /
|
|
179
|
+
tests in `test/27-create-root.test.mjs`). **Coverage:** `Signal.js`
|
|
180
|
+
100% statements / 100% branches / 100% functions / 100% lines; `Watch.js` 100%
|
|
181
|
+
(coverage-closure pass; reconfirm under codify).
|
|
176
182
|
Drop-in over 1.4.0.
|
|
177
183
|
**VersionMatrix (identical-code guard, new in 1.5.0-beta):** the
|
|
178
184
|
`harness/VersionMatrix/` regression gate now records the sha256 of the engine
|
|
@@ -240,7 +246,7 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
240
246
|
rate (delta totalAllocations / delta t), pool-reuse ratio
|
|
241
247
|
(1 - poolGrowths*initialCap/totalAllocations), and churn without the engine
|
|
242
248
|
computing rates -- the series lite-devtools 1.2 / lite-studio 1.2 plot. **Tests:**
|
|
243
|
-
429 total, 419 pass, 0 fail, 10 skip (6 new counter tests in `test/03-
|
|
249
|
+
429 total, 419 pass, 0 fail, 10 skip (6 new counter tests in `test/03-pool.test.mjs`
|
|
244
250
|
cover the 11-key shape, the live invariant, poolGrowths firing on growth vs staying
|
|
245
251
|
0 on a sized eager pool, and destroy() reset). **Coverage:** `Signal.js` 100%
|
|
246
252
|
statements / 98.26% branches / 100% functions / 100% lines; `Watch.js` 100%.
|
|
@@ -279,8 +285,8 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
279
285
|
allocation counters (`totalAllocations` / `totalDisposals` / `poolGrowths`) remain
|
|
280
286
|
reserved for 1.4.0 and are still absent. **Tests:** 423 total, 413 pass, 0 fail,
|
|
281
287
|
10 skip (the 10 skips are 9 signalBox-staged-for-1.5.0 in
|
|
282
|
-
`test/24-
|
|
283
|
-
`17-reactivity`); 4 new pool tests in `test/03-
|
|
288
|
+
`test/24-signalbox.test.mjs` plus 1 architecturally-N/A SSR case in
|
|
289
|
+
`17-reactivity`); 4 new pool tests in `test/03-pool.test.mjs` cover the lazy
|
|
284
290
|
on-demand / never-allocated-destroy / grow-extends-ledger / link-ceiling paths.
|
|
285
291
|
**Coverage** (c8@11, Node 22): `Signal.js` 100% statements / 98.26% branches /
|
|
286
292
|
100% functions / 100% lines; `Watch.js` 100% across all four. Behavior-
|
|
@@ -298,17 +304,17 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
298
304
|
the `ReactiveNode` constructor initializes them to the same values on the
|
|
299
305
|
fresh-pool-growth path -- so the redundant writes in `createNode` were
|
|
300
306
|
defense against a state that cannot exist. **No public surface change, no
|
|
301
|
-
semantic change.** New `test/26-free-list-
|
|
307
|
+
semantic change.** New `test/26-free-list-invariant.test.mjs` (3 invariant
|
|
302
308
|
tests + 1 targeted coverage test for the swallow-on-self-dispose-then-throw
|
|
303
309
|
branch in `pullComputed`) asserts the invariant directly by inspecting
|
|
304
310
|
freshly-allocated nodes via the documented `describe()` -> `NODE_PTR`
|
|
305
|
-
introspection protocol; new `test/25-devtools-real-
|
|
311
|
+
introspection protocol; new `test/25-devtools-real-boot.test.mjs` (10 tests)
|
|
306
312
|
boots the actual `Devtools.js` against the 1.2.2 engine and pins the 1.2.x
|
|
307
313
|
introspection contract for downstream tooling, including the 8-key
|
|
308
314
|
`stats()` shape (`signals`, `computeds`, `effects`, `activeNodes`,
|
|
309
315
|
`activeLinks`, `pooledLinks`, `nodePoolCapacity`, `linkPoolCapacity`).
|
|
310
316
|
408 tests total: 398 pass, 10 skip, 0 fail (the 10 skips are 9
|
|
311
|
-
signalBox-staged-for-1.5.0 in `test/24-
|
|
317
|
+
signalBox-staged-for-1.5.0 in `test/24-signalbox.test.mjs` plus 1
|
|
312
318
|
architecturally-N/A SSR case in `17-reactivity`). Coverage on `Signal.js`:
|
|
313
319
|
100% statements / 98.43% branches / 100% functions / 100% lines; `Watch.js`
|
|
314
320
|
100% across all four (c8@11, Node 22) -- a branch-coverage gain over the
|
|
@@ -410,7 +416,7 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
410
416
|
own `{ id, kind, value }` descriptor, **re-walkable** (pass it back into
|
|
411
417
|
`forEachObserver`/`forEachSource` to walk the full DAG); `forEach*` descriptors now carry
|
|
412
418
|
`id`. One SMI write at allocation, node shape kept monomorphic -- **zero steady-state
|
|
413
|
-
cost**. Drop-in over 1.1.4, no breaking changes. New `test/18-
|
|
419
|
+
cost**. Drop-in over 1.1.4, no breaking changes. New `test/18-identity.test.mjs` (5 tests); plus `14-lifecycle-teardown`, `16-alien-parity`, and the `17-reactivity` behavioral suite.
|
|
414
420
|
|
|
415
421
|
- **1.1.4**: combined release -- a retracking rewrite plus an observer-lifecycle
|
|
416
422
|
introspection surface. Drop-in over 1.1.3. **Retracking:** version-stamped O(1)
|
|
@@ -421,7 +427,7 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
421
427
|
wide dense` 5115ms->912ms (verified by `retracking.difftest.mjs`: 20k direct + 10k batched, 0
|
|
422
428
|
disagreements; no regressions elsewhere). **Introspection:** `hasObservers`,
|
|
423
429
|
`observeObservers`, `forEachObserver`, `forEachSource` (top-level + per-registry), gated by
|
|
424
|
-
an internal counter so zero steady-state cost when unused. New `test/13-
|
|
430
|
+
an internal counter so zero steady-state cost when unused. New `test/13-introspection.test.mjs`
|
|
425
431
|
(10 tests). Internally staged as 1.1.4 + 1.1.5; ships as a single 1.1.4.
|
|
426
432
|
|
|
427
433
|
- **1.1.3**: adds `isTracking()` (top-level + per-registry). Returns true iff a
|
|
@@ -736,37 +742,46 @@ function dumpOwnerTree(handle, depth = 0) {
|
|
|
736
742
|
|
|
737
743
|
- `Signal.js` -- full implementation, single file.
|
|
738
744
|
- `Signal.d.ts` -- TypeScript declarations for all public API.
|
|
739
|
-
- `test/01-
|
|
740
|
-
- `test/02-
|
|
741
|
-
- `test/03-
|
|
742
|
-
- `test/04-zero-
|
|
743
|
-
- `test/05-
|
|
744
|
-
- `test/06-nested-
|
|
745
|
-
- `test/07-
|
|
746
|
-
- `test/08-
|
|
747
|
-
- `test/09-
|
|
748
|
-
- `test/10-is-
|
|
749
|
-
- `test/11-adopted-
|
|
750
|
-
- `test/12-
|
|
751
|
-
- `test/13-
|
|
752
|
-
- `test/14-lifecycle-
|
|
753
|
-
- `test/15-owner-lazy-
|
|
754
|
-
- `test/16-alien-
|
|
755
|
-
- `test/17-
|
|
756
|
-
- `test/18-
|
|
757
|
-
- `test/19-v12-
|
|
758
|
-
- `test/20-axis-
|
|
759
|
-
- `test/21-perf-
|
|
760
|
-
- `test/22-mutation-
|
|
761
|
-
- `test/23-owner-
|
|
762
|
-
- `test/24-
|
|
763
|
-
- `test/25-devtools-real-
|
|
764
|
-
- `test/26-free-list-
|
|
745
|
+
- `test/01-core.test.mjs` -- signal/computed/effect basics, equality, untrack.
|
|
746
|
+
- `test/02-topology.test.mjs` -- diamonds, chains, fan-out/in, cycle detection.
|
|
747
|
+
- `test/03-pool.test.mjs` -- capacity errors, grow policy, pool reuse.
|
|
748
|
+
- `test/04-zero-gc.test.mjs` -- heap retention (run with --expose-gc).
|
|
749
|
+
- `test/05-scheduler.test.mjs` -- scheduler races, dispose, gen counter, version wrap.
|
|
750
|
+
- `test/06-nested-objects.test.mjs` -- nested-object & reference-identity behaviours.
|
|
751
|
+
- `test/07-dispose.test.mjs` -- universal disposal: registry.dispose(api).
|
|
752
|
+
- `test/08-watch.test.mjs` -- new watch reactivity tests.
|
|
753
|
+
- `test/09-conformance.test.mjs` -- johnsoncodehk/reactive-framework-test-suite conformance fixes tests.
|
|
754
|
+
- `test/10-is-tracking.test.mjs` -- `isTracking()` across observer bodies, untracked windows, and outside any observer.
|
|
755
|
+
- `test/11-adopted-reactive.test.mjs` -- engine-agnostic edge cases adopted from the wider ecosystem (alien-signals link-integrity #226-228, equality-predicate corners, `update()`/`peek()`/`subscribe` contracts).
|
|
756
|
+
- `test/12-coverage.test.mjs` -- targeted public-surface + hot-path branch coverage (top-level routing, clean-read short-circuit, tail severance, scheduler ABA); owner-tree block capability-gated.
|
|
757
|
+
- `test/13-introspection.test.mjs` -- observer-lifecycle surface: `hasObservers`, `observeObservers` auto-pause, `forEach*` enumeration (10 tests).
|
|
758
|
+
- `test/14-lifecycle-teardown.test.mjs` -- effect-teardown guards: stopped effect doesn't re-subscribe to a signal read later in the same run, self-dispose leaves no orphan link, throwing setup leaves no live subscription (4 tests).
|
|
759
|
+
- `test/15-owner-lazy-alloc.test.mjs` -- owner-adoption contract for the 1.2.0 owner tree (lazy signals never adopted; observers still auto-disposed); capability-gated, skipped on 1.1.x (4 tests).
|
|
760
|
+
- `test/16-alien-parity.test.mjs` -- differential guards vs alien-signals@3.2.0 fixed-bug classes: cleanup reads create no deps, inner write doesn't block computed-chain propagation, dynamic dep-set correct under dirty-check (3 tests).
|
|
761
|
+
- `test/17-reactivity.test.mjs` -- behavioral suite over universal signal-system bug classes (subscription lifecycle, cleanup ordering, stale-dep tracking, batching, equality, nested invalidation, memory, sync async-boundary, scheduler/loops, + differential-review additions); SSR is N/A (~30 tests).
|
|
762
|
+
- `test/18-identity.test.mjs` -- node identity (1.1.5): `nodeId`/`describe`, descriptor `id`, re-walkable descriptors, non-perturbing (5 tests).
|
|
763
|
+
- `test/19-v12-additions.test.mjs` -- 1.2.0 surface coverage: shared-peek, owner-adoption rule, pre-batch revert (24 tests).
|
|
764
|
+
- `test/20-axis-stress.test.mjs` -- eight orthogonal stress axes (batch-under-exception, connect/disconnect re-entrancy, untrack vs owner cascade, etc.) (23 tests).
|
|
765
|
+
- `test/21-perf-pins.test.mjs` -- 1.2.1 construction-shape + ABA-guard pins (6 tests).
|
|
766
|
+
- `test/22-mutation-hook.test.mjs` -- 1.2.1 `onGraphMutation` registration + opcode emission (12 tests).
|
|
767
|
+
- `test/23-owner-introspection.test.mjs` -- `ownerOf`, `forEachOwned`, gen-guarded introspection (14 tests).
|
|
768
|
+
- `test/24-signalbox.test.mjs` -- staged for 1.5.0; all tests `{skip: true}` on 1.2.x.
|
|
769
|
+
- `test/25-devtools-real-boot.test.mjs` -- 1.2.2: real `Devtools.js` boot against the engine, ghost-contract pin, `stats()` shape pin (10 tests).
|
|
770
|
+
- `test/26-free-list-invariant.test.mjs` -- 1.2.2: the audit's clean-free-list invariant, asserted by inspecting freshly-allocated nodes (4 tests).
|
|
765
771
|
- `bench/benchmark.mjs` -- anti-DCE throughput harness (ops/s; results.txt).
|
|
766
772
|
- `bench/benchmarkReactive.mjs` -- cross-framework reactivity suite vs alien-signals, preact, vue-reactivity, solid (resultsReactive.txt).
|
|
767
773
|
- `bench/dispose-recycle.mjs` -- 1.2.2 targeted microbench: create/dispose/recreate cycle (the free-list invariant audit target).
|
|
768
774
|
- `bench/torture/` -- crash-detection soaks: `graph-fuzzer`, `scheduler-bench`, `torture-soak`. Exit 0 iff zero errors AND post-teardown pool clean.
|
|
769
775
|
- `bench/run-all.sh` + `bench/aggregate.mjs` -- cold-process-per-engine protocol + per-scenario aggregation.
|
|
776
|
+
- `harness/run.mjs` -- dispatcher for the run-on-demand probes (field, dispose, churn, owner, creation, all).
|
|
777
|
+
- `harness/fieldkit.mjs` -- single-file portable verify + cold-child A/B bench across six shapes.
|
|
778
|
+
- `harness/churnprobe.mjs` -- topology-churn-per-recompute via onGraphMutation opcodes 3/4 (link add/sever); the 1.11 cone-cache gate.
|
|
779
|
+
- `harness/burst-dag.mjs` -- 1.6 burst-shape characterization: Andrii's verbatim strided topology vs the contiguous guess it embeds (ROADMAP S5 closed); CLI, takes engine-path arg.
|
|
780
|
+
- `harness/pull-stress.mjs` -- 1.6 pull-mode depth characterization: per-level cost, exact overflow depth, O(1) cached-read; CLI + pullStressScenario/probeOverflow exports.
|
|
781
|
+
- `harness/owner-hazard-repro.mjs` -- async-gap owner-recycling hazard verdict (cited by getOwner/runWithOwner).
|
|
782
|
+
- `harness/VersionMatrix/` -- cold-process-per-version performance regression gate (wired as prepublishOnly).
|
|
783
|
+
- `harness/ProfilerTools/` -- profiler-signal x devtools composition harness (wired as test:harness).
|
|
784
|
+
- `harness/attic/` -- parked probes: the 1.2.0->1.2.1 shape-regression hunt + the superseded contiguous burst-dag guess (with its burstDagScenario/multiPassProbe exports); wired into nothing.
|
|
770
785
|
- `demo/index.html` -- interactive visualization of the reactive graph.
|
|
771
786
|
|
|
772
787
|
## Install
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakkster/lite-signal",
|
|
3
|
-
"version": "1.6.0-alpha",
|
|
3
|
+
"version": "1.6.0-alpha.1",
|
|
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",
|
|
@@ -37,11 +37,17 @@
|
|
|
37
37
|
"test:all": "npm test && npm run test:hardening && npm run test:harness && npm run test:zgc",
|
|
38
38
|
"bench": "node --expose-gc bench/benchmark.mjs",
|
|
39
39
|
"bench-reactive": "node --expose-gc bench/benchmarkReactive.mjs",
|
|
40
|
-
"
|
|
40
|
+
"harness": "node harness/run.mjs",
|
|
41
|
+
"harness:field": "node harness/run.mjs field",
|
|
42
|
+
"harness:dispose": "node harness/run.mjs dispose",
|
|
43
|
+
"harness:churn": "node harness/run.mjs churn",
|
|
44
|
+
"harness:owner": "node harness/run.mjs owner",
|
|
45
|
+
"harness:creation": "node harness/run.mjs creation",
|
|
46
|
+
"harness:all": "node harness/run.mjs all",
|
|
47
|
+
"profile:burst": "node --expose-gc harness/burst-dag.mjs ./Signal.js",
|
|
41
48
|
"profile:pull": "node --expose-gc harness/pull-stress.mjs",
|
|
42
49
|
"verify": "npm test && npm run test:zgc && npm run bench",
|
|
43
|
-
"gate": "node harness/VersionMatrix/pre-publish.mjs"
|
|
44
|
-
"prepublishOnly": "node harness/VersionMatrix/pre-publish.mjs"
|
|
50
|
+
"gate": "node harness/VersionMatrix/pre-publish.mjs"
|
|
45
51
|
},
|
|
46
52
|
"keywords": [
|
|
47
53
|
"signal",
|
|
@@ -78,11 +84,11 @@
|
|
|
78
84
|
},
|
|
79
85
|
"sideEffects": false,
|
|
80
86
|
"devDependencies": {
|
|
81
|
-
"
|
|
82
|
-
"@zakkster/lite-devtools": "^1.1.0",
|
|
83
|
-
"@zakkster/lite-signal": "^1.3.0 || >=1.4.0-beta.0 || >=1.6.0-preview.0",
|
|
87
|
+
"@zakkster/lite-devtools": "^1.2.0",
|
|
84
88
|
"@zakkster/lite-profiler": "^1.1.0",
|
|
85
|
-
"@zakkster/lite-profiler-signal": "^1.2.0"
|
|
89
|
+
"@zakkster/lite-profiler-signal": "^1.2.0",
|
|
90
|
+
"@zakkster/lite-signal": "^1.3.0 || >=1.4.0-beta.0 || >=1.6.0-preview.0",
|
|
91
|
+
"c8": "^11.0.0"
|
|
86
92
|
},
|
|
87
93
|
"overrides": {
|
|
88
94
|
"@zakkster/lite-time": {
|