@zakkster/lite-signal 1.4.0-beta.1 → 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.
- package/CHANGELOG.md +31 -0
- package/README.md +53 -0
- package/llms.txt +8 -0
- package/package.json +20 -5
package/CHANGELOG.md
CHANGED
|
@@ -60,6 +60,37 @@ 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
96
|
- **Full suite green** against the 1.4.0 engine: 429 tests, 419 pass, 0 fail,
|
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
|
@@ -72,6 +72,12 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
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
|
|
@@ -554,6 +560,8 @@ function dumpOwnerTree(handle, depth = 0) {
|
|
|
554
560
|
- `test/24-signalbox_test.mjs` -- staged for 1.5.0; all tests `{skip: true}` on 1.2.x.
|
|
555
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).
|
|
556
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.
|
|
557
565
|
- `bench/benchmark.mjs` -- anti-DCE throughput harness (ops/s; results.txt).
|
|
558
566
|
- `bench/benchmarkReactive.mjs` -- cross-framework reactivity suite vs alien-signals, preact, vue-reactivity, solid (resultsReactive.txt).
|
|
559
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-
|
|
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
|
}
|