@zakkster/lite-signal 1.4.0-beta.0 → 1.4.0-rc.0

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.
Files changed (4) hide show
  1. package/CHANGELOG.md +40 -10
  2. package/README.md +53 -0
  3. package/llms.txt +31 -19
  4. package/package.json +20 -5
package/CHANGELOG.md CHANGED
@@ -60,9 +60,40 @@ with the rest of registry state, so a reused registry reports lifecycle numbers
60
60
  for its current epoch only. Grown pool *capacity* is retained across `destroy()`
61
61
  as before (the reset keeps the arena warm); only the cumulative counts reset.
62
62
 
63
+ ### Added -- dedicated test harness layout
64
+
65
+ The repo now ships **two opt-in test harnesses** alongside the in-tree engine
66
+ suite, each in its own subdirectory with its own `package.json` and setup story.
67
+ They do **not** run on `npm test`; they opt in through dedicated scripts. The
68
+ default `npm test` is now scoped via a Node 22 native glob -- `'test/*.test.mjs'`
69
+ -- so only the 26 root engine test files are discovered. Subdirectory test files
70
+ (e.g. `test/ProfilerTests/test/*.test.mjs`) and out-of-tree test files
71
+ (`harness/ProfilerTools/harness.test.mjs`) are no longer accidentally swept into
72
+ the default run.
73
+
74
+ - **`test/ProfilerTests/`** -- a **version-portable hardening suite** for the
75
+ engine. Imports `@zakkster/lite-signal` as a bare specifier; self-references
76
+ through this repo's own package name when run from inside the tree, resolves
77
+ to the installed version when run standalone (`./run-matrix.sh`). Feature-
78
+ gated: older engines skip the cases for APIs they do not have yet, newer
79
+ cases light up automatically. Pins the diamond / dynamic-dep / cleanup-order /
80
+ cascade-dispose invariants that quietly break reactive engines under retune.
81
+ - **`harness/ProfilerTools/`** -- a **combined integration harness** that points
82
+ `@zakkster/lite-profiler-signal` and `@zakkster/lite-devtools` at the same
83
+ registry and verifies the cross-package zero-GC contract end-to-end (devtools
84
+ inspects a profiler-driven graph non-perturbingly and confirms via the same
85
+ `stats()` it monitors that the profiler allocates no new nodes in steady
86
+ state). Setup is one-time (`bash setup.sh`) and pins specific package
87
+ versions via tarball install so the harness re-runs reproducibly.
88
+
89
+ New root scripts: `test:hardening`, `test:hardening:gc`, `test:harness`,
90
+ `test:all`. The README's new "Test harnesses" section documents the suite, the
91
+ setup, and the expectation that more dedicated harnesses will land as future
92
+ publications need targeted defensive validation.
93
+
63
94
  ### Verified
64
95
 
65
- - **Full suite green** against the 1.4.0 engine: 430 tests, 420 pass, 0 fail,
96
+ - **Full suite green** against the 1.4.0 engine: 429 tests, 419 pass, 0 fail,
66
97
  10 skip. The 10 skips are the 9 `{skip:true}` `signalBox` tests in `24-signalbox`
67
98
  (staged for 1.5.0) plus 1 architecturally-N/A SSR case in `17-reactivity`. The
68
99
  eager-default and the counter additions changed no existing test outcome; 6 new
@@ -78,12 +109,12 @@ as before (the reset keeps the arena warm); only the cumulative counts reset.
78
109
  - **Zero-GC steady state holds**: the counters bump only on acquire / dispose /
79
110
  grow, none of which occur on the steady-state write path after warm-up. Writing
80
111
  through a built graph allocates nothing and moves no counter.
81
- - **`stats()` shape** is now the authoritative 11-key 1.4.x shape; the
82
- introspection-contract test is updated to expect the three counters present
83
- (the 1.2.x/1.3.0 test pinned their *absence*; that pin is correctly inverted
84
- for 1.4.0).
85
-
112
+ - **`stats()` shape** is now the authoritative 11-key 1.4.x shape, pinned by a
113
+ new shape-and-initial-zeros test in `03-pool` -- the first explicit pin for
114
+ the `stats()` surface (the 1.2.x / 1.3.0 entries described the absence of the
115
+ counters in prose; 1.4.0 codifies the new shape as a test assertion).
86
116
 
117
+ ## [1.3.0] -- 2026-06-XX
87
118
 
88
119
  The pool minor: the node and link pools become **growable and incrementally
89
120
  populated**, the propagation mark phase moves to an **intrusive linked-list
@@ -161,7 +192,7 @@ in 1.3.0.
161
192
 
162
193
  ### Verified
163
194
 
164
- - **Full suite green** against the 1.3.0 engine: 424 tests, 414 pass, 0 fail,
195
+ - **Full suite green** against the 1.3.0 engine: 423 tests, 413 pass, 0 fail,
165
196
  10 skip (9 signalBox-staged-for-1.5.0 in `24-signalbox` plus 1 architecturally-N/A
166
197
  SSR case in `17-reactivity`). The eager-default flip changed no test outcome.
167
198
  - **Behavior-preservation difftest**: 20,000 direct + 10,000 batched writes
@@ -173,10 +204,9 @@ in 1.3.0.
173
204
  scenarios.
174
205
  - **`stats()` shape unchanged from 1.2.x** (8 keys). The cumulative allocation
175
206
  counters (`totalAllocations` / `totalDisposals` / `poolGrowths`) remain
176
- reserved for 1.4.0 and are still absent here -- the introspection-contract
177
- test continues to pin their absence.
178
-
207
+ reserved for 1.4.0 and are still absent here.
179
208
 
209
+ ## [1.2.2] -- 2026-06-14
180
210
 
181
211
  A code-deletion ship: a `createNode` audit removes ten redundant field-writes
182
212
  that defended against a state the engine cannot produce on a clean free-list.
package/README.md CHANGED
@@ -65,6 +65,7 @@ Synchronous, glitch-free, push-pull. No microtask queue, no allocations after wa
65
65
  - [Edge cases pinned down](#edge-cases-pinned-down)
66
66
  - [Benchmarks](#benchmarks)
67
67
  - [Testing strategy](#testing-strategy)
68
+ - [Test harnesses](#test-harnesses)
68
69
  - [What this is not](#what-this-is-not)
69
70
  - [Ecosystem](#ecosystem)
70
71
  - [Browser and runtime support](#browser-and-runtime-support)
@@ -783,6 +784,58 @@ npm run verify # test + test:gc + a sanity bench
783
784
 
784
785
  ---
785
786
 
787
+ ## Test harnesses
788
+
789
+ Beyond the engine's own test tiers above, `@zakkster/lite-signal` ships **dedicated harnesses** that live in their own subdirectories with their own `package.json` and setup story. They are version-portable, integration-grade, or otherwise too specialised to belong in the in-tree engine suite -- and they are explicitly opt-in: a plain `npm test` does **not** run them. Each is a self-contained artifact you can run against any installed engine, or carry into a different repo to verify a claim independently.
790
+
791
+ 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.
792
+
793
+ ### `test/ProfilerTests/` -- version-portable hardening suite
794
+
795
+ 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.
796
+
797
+ Pins the invariants that quietly break reactive engines: glitch-freedom on diamonds, dropping the untaken branch on dynamic dependencies, keeping unobserved computeds lazy, cleanup order, surviving a throwing effect, no leaks under churn, cascade-disposing an ownership scope. The same cases worth asking about in an interview, and the same ones that regress when an engine is re-tuned for speed.
798
+
799
+ ```bash
800
+ # Against the local engine (self-references through the root package name):
801
+ npm run test:hardening
802
+ npm run test:hardening:gc
803
+
804
+ # Standalone, against any published version (run from inside test/ProfilerTests):
805
+ cd test/ProfilerTests
806
+ ./run-matrix.sh # tests every published line
807
+ ./run-matrix.sh 1.3.0 1.4.0-beta.1 # pick versions explicitly
808
+ ```
809
+
810
+ The matrix is **ratcheted stricter every release**: a regression in a future version fails loudly, instead of shipping. The README inside the suite (`test/ProfilerTests/README.md`) records the current pass/skip table per published line.
811
+
812
+ ### `harness/ProfilerTools/` -- combined profiler + devtools integration
813
+
814
+ A live cross-package harness that points `@zakkster/lite-profiler-signal` and `@zakkster/lite-devtools` at the **same** lite-signal registry and verifies the integration. `profiler-signal` writes coarse frame telemetry into signals (fps, frameP99, frameClass, per-phase p99); a small dashboard effect reads those signals; `devtools` then inspects that live graph **non-perturbingly** (peek + enumerator walks, never adding an observer) and confirms, via the same `stats()` it monitors, that the profiler allocates no new graph nodes in steady state. This is the externally-runnable proof of the zero-GC contract end-to-end: not just on a microbench, but across the actual published package chain consumers install.
815
+
816
+ ```bash
817
+ # One-time setup -- pulls peer deps + the engine version the harness targets:
818
+ cd harness/ProfilerTools
819
+ bash setup.sh
820
+
821
+ # Then:
822
+ npm test
823
+ npm run test:gc
824
+
825
+ # Or from the root:
826
+ npm run test:harness
827
+ ```
828
+
829
+ The setup script pins specific package versions via tarball install so the harness can be re-run reproducibly without depending on whatever happens to be in the public registry on the day. Treat the setup as a one-time per-checkout cost.
830
+
831
+ ### Notes
832
+
833
+ - The hardening suite and the harness do **not** run on `npm test` from the root. They opt in through the `test:hardening` / `test:harness` scripts (and `test:all`, which chains everything).
834
+ - Both subdirectories have their own `package.json` with local scripts, so you can also `cd` in and run `npm test` directly -- the root scripts are just shortcuts.
835
+ - The `npm --prefix <dir> test` form used in the root scripts is the cross-platform replacement for `cd && npm test` -- works identically on Linux, macOS, and Windows.
836
+
837
+ ---
838
+
786
839
  ## Performance Trade-offs & Topology Scaling
787
840
 
788
841
  <details>
package/llms.txt CHANGED
@@ -68,10 +68,16 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
68
68
  rate (delta totalAllocations / delta t), pool-reuse ratio
69
69
  (1 - poolGrowths*initialCap/totalAllocations), and churn without the engine
70
70
  computing rates -- the series lite-devtools 1.2 / lite-studio 1.2 plot. **Tests:**
71
- 430 total, 420 pass, 0 fail, 10 skip (6 new counter tests in `test/03-pool_test.mjs`
71
+ 429 total, 419 pass, 0 fail, 10 skip (6 new counter tests in `test/03-pool_test.mjs`
72
72
  cover the 11-key shape, the live invariant, poolGrowths firing on growth vs staying
73
73
  0 on a sized eager pool, and destroy() reset). **Coverage:** `Signal.js` 100%
74
74
  statements / 98.26% branches / 100% functions / 100% lines; `Watch.js` 100%.
75
+ **Test layout in 1.4.0:** the repo now ships two opt-in harness subdirectories
76
+ -- `test/ProfilerTests/` (version-portable engine hardening, feature-gated, runs
77
+ via `npm run test:hardening`) and `harness/ProfilerTools/` (combined
78
+ profiler+devtools integration, one-time `bash setup.sh`, runs via `npm run
79
+ test:harness`). The default `npm test` is scoped to `'test/*.test.mjs'` (Node 22
80
+ native glob) so subdirectory and out-of-tree test files are no longer swept in.
75
81
  Drop-in over 1.3.0.
76
82
 
77
83
  - **1.3.0** (drop-in over 1.2.2): the **pool minor**. Node and link pools become
@@ -105,7 +111,7 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
105
111
  `activeNodes`, `activeLinks`, `pooledLinks`, `nodePoolCapacity`,
106
112
  `linkPoolCapacity`); the capacity keys are ledgers under `"lazy"`. Cumulative
107
113
  allocation counters (`totalAllocations` / `totalDisposals` / `poolGrowths`) remain
108
- reserved for 1.4.0 and are still absent. **Tests:** 424 total, 414 pass, 0 fail,
114
+ reserved for 1.4.0 and are still absent. **Tests:** 423 total, 413 pass, 0 fail,
109
115
  10 skip (the 10 skips are 9 signalBox-staged-for-1.5.0 in
110
116
  `test/24-signalbox_test.mjs` plus 1 architecturally-N/A SSR case in
111
117
  `17-reactivity`); 4 new pool tests in `test/03-pool_test.mjs` cover the lazy
@@ -115,6 +121,26 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
115
121
  preservation difftest: 20,000 direct + 10,000 batched writes vs the published
116
122
  1.1.5 reference, 0 disagreements -- pool growth, chunked refill, and the intrusive
117
123
  mark stack do not alter observable propagation. Drop-in over 1.2.2.
124
+ **Bench position** (third-party
125
+ [js-reactivity-benchmark](https://github.com/volynetstyle/js-reactivity-benchmark),
126
+ 15 frameworks, 47 tests): #4 by geomean (75.5) at 1.77x behind alien-signals
127
+ (1.00x), reflex (1.15x), @reactively (1.39x); now ahead of 5th-place Preact
128
+ Signals (79.2, lite ~5% ahead -- the gap widened from 1.2.x). The only
129
+ object-pooled zero-GC engine in the field. Ahead of @vue/reactivity (1.5x),
130
+ Signia (1.7x), MobX (2.3x), @solidjs/signals (2.7x), SolidJS (4.2x). Top-3 on
131
+ 21/47 tests; outright winner on `manyEffectsFromOneSource`,
132
+ `manySourcesIntoOneComputedEffect`, and
133
+ `manySourcesIntoOneComputedEffectWithDirect` (and edges the leader alien on a
134
+ fourth, the 1-source linear-chain pull). (The suite measures reactivity
135
+ libraries -- Vue reactivity core, MobX, Solid, Preact Signals -- not full UI
136
+ frameworks like React/Angular.)
137
+ In the community reactive suite (median-of-10), fastest of 5 frameworks
138
+ on the entire `dyn:*` family (the realistic large-DOM-framework shapes)
139
+ and the entire `S: updateComputations*` family. Behind on the
140
+ construction-cost path (`S: createComputations*`, `cellx`, `createDataSignals`).
141
+ 1.4.0 carries these numbers forward unchanged on hot paths (only added the
142
+ three `stats()` counters, all on existing acquire/dispose/grow edges); a fresh
143
+ 1.4.0 bench run will be published when available.
118
144
 
119
145
  - **1.2.2**: `createNode` clean-free-list invariant audit. Removes
120
146
  ten redundant field-writes that defended against a state the engine cannot
@@ -145,23 +171,7 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
145
171
  Version lineage:
146
172
  this is the engine previously labeled `1.2.3` in dev -- renumbered to
147
173
  `1.2.2` because the deletion is small, isolated, and intentionally
148
- non-behavioral. Drop-in over 1.2.1. **Bench position** (third-party
149
- [js-reactivity-benchmark](https://github.com/volynetstyle/js-reactivity-benchmark),
150
- 15 frameworks, 47 tests): #4 by geomean (75.5) at 1.77x behind alien-signals
151
- (1.00x), reflex (1.15x), @reactively (1.39x); now ahead of 5th-place Preact
152
- Signals (79.2, lite ~5% ahead -- the gap widened from 1.2.x). The only
153
- object-pooled zero-GC engine in the field. Ahead of @vue/reactivity (1.5x),
154
- Signia (1.7x), MobX (2.3x), @solidjs/signals (2.7x), SolidJS (4.2x). Top-3 on
155
- 21/47 tests; outright winner on `manyEffectsFromOneSource`,
156
- `manySourcesIntoOneComputedEffect`, and
157
- `manySourcesIntoOneComputedEffectWithDirect` (and edges the leader alien on a
158
- fourth, the 1-source linear-chain pull). (The suite measures reactivity
159
- libraries -- Vue reactivity core, MobX, Solid, Preact Signals -- not full UI
160
- frameworks like React/Angular.)
161
- In the community reactive suite (median-of-10), fastest of 5 frameworks
162
- on the entire `dyn:*` family (the realistic large-DOM-framework shapes)
163
- and the entire `S: updateComputations*` family. Behind on the
164
- construction-cost path (`S: createComputations*`, `cellx`, `createDataSignals`).
174
+ non-behavioral. Drop-in over 1.2.1.
165
175
 
166
176
  - **1.2.1**: correctness-and-introspection patch. Drop-in over 1.2.0;
167
177
  no public surface removed. **Stale-handle introspection (ABA fix):** the v1.2.0
@@ -550,6 +560,8 @@ function dumpOwnerTree(handle, depth = 0) {
550
560
  - `test/24-signalbox_test.mjs` -- staged for 1.5.0; all tests `{skip: true}` on 1.2.x.
551
561
  - `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).
552
562
  - `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).
563
+ - `test/ProfilerTests/` -- version-portable engine hardening suite. Own `package.json`, own `node:test`. Imports `@zakkster/lite-signal` as bare specifier; self-references in-tree, resolves to the installed version when run standalone. Feature-gated cases activate automatically as the engine gains APIs. Run via `npm run test:hardening` (in-tree) or `./run-matrix.sh` (standalone matrix vs published lines).
564
+ - `harness/ProfilerTools/` -- combined integration harness: `@zakkster/lite-profiler-signal` + `@zakkster/lite-devtools` pointed at the same lite-signal registry. Verifies the cross-package zero-GC contract end-to-end (devtools inspects a profiler-driven graph non-perturbingly; the profiler allocates no new nodes in steady state). Own `package.json`, one-time setup via `bash setup.sh` (pins peer deps via tarball). Run via `npm run test:harness`. Both harnesses are opt-in: `npm test` from root is scoped to `'test/*.test.mjs'` and does NOT sweep them.
553
565
  - `bench/benchmark.mjs` -- anti-DCE throughput harness (ops/s; results.txt).
554
566
  - `bench/benchmarkReactive.mjs` -- cross-framework reactivity suite vs alien-signals, preact, vue-reactivity, solid (resultsReactive.txt).
555
567
  - `bench/dispose-recycle.mjs` -- 1.2.2 targeted microbench: create/dispose/recreate cycle (the free-list invariant audit target).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zakkster/lite-signal",
3
- "version": "1.4.0-beta.0",
3
+ "version": "1.4.0-rc.0",
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",
@@ -26,9 +26,13 @@
26
26
  "CHANGELOG.md"
27
27
  ],
28
28
  "scripts": {
29
- "test": "node --test --test-reporter=spec",
30
- "test:gc": "node --expose-gc --test --test-reporter=spec",
31
- "test:coverage": "c8 node --test --test-reporter=spec",
29
+ "test": "node --test --test-reporter=spec 'test/*.test.mjs'",
30
+ "test:gc": "node --expose-gc --test --test-reporter=spec 'test/*.test.mjs'",
31
+ "test:coverage": "c8 node --test --test-reporter=spec 'test/*.test.mjs'",
32
+ "test:hardening": "npm --prefix test/ProfilerTests test",
33
+ "test:hardening:gc": "npm --prefix test/ProfilerTests run test:gc",
34
+ "test:harness": "npm --prefix harness/ProfilerTools test",
35
+ "test:all": "npm test && npm run test:hardening && npm run test:harness",
32
36
  "bench": "node --expose-gc bench/benchmark.mjs",
33
37
  "bench-reactive": "node --expose-gc bench/benchmarkReactive.mjs",
34
38
  "verify": "npm test && npm run bench"
@@ -69,6 +73,17 @@
69
73
  "sideEffects": false,
70
74
  "devDependencies": {
71
75
  "c8": "^11.0.0",
72
- "@zakkster/lite-devtools": "^1.1.0"
76
+ "@zakkster/lite-devtools": "^1.1.0",
77
+ "@zakkster/lite-signal": "^1.3.0 || >=1.6.0-preview.0",
78
+ "@zakkster/lite-profiler": "^1.0.0",
79
+ "@zakkster/lite-profiler-signal": "^1.1.0"
80
+ },
81
+ "overrides": {
82
+ "@zakkster/lite-time": {
83
+ "@zakkster/lite-signal": "$@zakkster/lite-signal"
84
+ },
85
+ "@zakkster/lite-devtools": {
86
+ "@zakkster/lite-signal": "$@zakkster/lite-signal"
87
+ }
73
88
  }
74
89
  }