@zakkster/lite-signal 1.4.2 → 1.4.3
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 +69 -0
- package/README.md +5 -4
- package/Signal.js +1 -1
- package/llms.txt +26 -2
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,75 @@ All notable changes to `@zakkster/lite-signal` are documented here.
|
|
|
4
4
|
Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
5
|
This project follows [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [1.4.3] -- 2026-08-02
|
|
8
|
+
|
|
9
|
+
The verification-surface patch, round three. **The engine is unchanged**: as in
|
|
10
|
+
1.4.1 and 1.4.2, the only edit to `Signal.js` is the version string in its header
|
|
11
|
+
banner, and `Signal.d.ts` is untouched. Everything here lives in `bench/torture/`,
|
|
12
|
+
which does not ship -- `files[]` excludes it. If you consume the package, 1.4.3 is
|
|
13
|
+
byte-for-byte 1.4.2 plus a version number.
|
|
14
|
+
|
|
15
|
+
1.4.2 completed the forward-compatible torture superset. This release adds the one
|
|
16
|
+
scenario that was still missing: the zero-GC claim, gated. The headline promise --
|
|
17
|
+
writing through an already-built reactive graph allocates nothing -- was, until
|
|
18
|
+
now, asserted only by a hand-rolled `perf_hooks` scavenge counter that lived in a
|
|
19
|
+
`futureVersions/` sketch and never ran in CI. That meter is deleted and replaced by
|
|
20
|
+
a real gate driven by `@zakkster/lite-gc-profiler@^1.15.0`.
|
|
21
|
+
|
|
22
|
+
### Added -- `zerogc-torture.mjs`, the zero-GC gate (suite now 20 scenarios)
|
|
23
|
+
|
|
24
|
+
`bench/torture/zerogc-torture.mjs` turns "zero-GC" from a slogan into a
|
|
25
|
+
re-runnable gate. It measures the steady-state hot path against three independent
|
|
26
|
+
witnesses, gated separately because no single one sees everything:
|
|
27
|
+
|
|
28
|
+
- **per-call RETAINED bytes** -- `measureAllocs` / `checkAllocs` at
|
|
29
|
+
`maxBytesPerCall: 0`, the literal zero-retention assertion. Because it measures
|
|
30
|
+
allocation surviving a forced collection (min across batches), it also proves
|
|
31
|
+
the create+dispose CHURN case: a callable handle allocates transiently, is
|
|
32
|
+
reclaimed, and retains 0 -- the pool absorbing the node.
|
|
33
|
+
- **major GC count and longest pause** -- `measureOps` (`stabilize: 'deep'`) /
|
|
34
|
+
`checkNoGc` at `maxMajor: 0` / `maxPauseMs: 2`. A zero-alloc window forces no
|
|
35
|
+
major collection regardless of length; a nonzero count is transient garbage the
|
|
36
|
+
retained-bytes settling would hide.
|
|
37
|
+
- **the engine's own `stats()` counters** -- steady scenarios: `poolGrowths` and
|
|
38
|
+
`totalAllocations` do not move across the window (no node pulled, pool never
|
|
39
|
+
grew); churn scenarios: `poolGrowths` stays 0 and `activeNodes` returns to its
|
|
40
|
+
baseline (every acquired node recycled, none leaked).
|
|
41
|
+
|
|
42
|
+
The scenario states its non-goal as loudly as its goal: node CREATION is **not**
|
|
43
|
+
zero-alloc (the callable API allocates two closures per `signal`, a `signalBox`
|
|
44
|
+
allocates its wrapper); the pool removes the internal NODE allocation, never the
|
|
45
|
+
public HANDLE. Five deterministic graph shapes are gated -- deep chain x16, wide
|
|
46
|
+
fan-out x32, batched 8-signal writes, and create+dispose churn on both the
|
|
47
|
+
callable and (self-skipping below 1.5.0) the box form. `ZEROGC_BREAK=1` arms an
|
|
48
|
+
effect that pushes a fresh object into a module-level sink on every write:
|
|
49
|
+
mutation-verification that `checkAllocs` rejects a planted allocation, and that
|
|
50
|
+
reaching the PASS line with the break armed is itself a failure (a gate blind to a
|
|
51
|
+
planted leak is blind to a real one). Registered in `run.mjs` as a `semantic`
|
|
52
|
+
scenario; the suite is now **20 scenarios (17 semantic + 3 soak)**.
|
|
53
|
+
|
|
54
|
+
### Removed -- the orphaned hand-rolled meter
|
|
55
|
+
|
|
56
|
+
`futureVersions/zgc/` (the `perf_hooks` scavenge-counting gate, its `Watch.stub.mjs`,
|
|
57
|
+
core, scenarios, and node:test wrapper) is deleted. Its scenario shapes are ported
|
|
58
|
+
into `zerogc-torture.mjs`; its bespoke measurement is superseded by the profiler.
|
|
59
|
+
Also removed: `bench/torture/index.mjs`, a stale non-ASCII duplicate of
|
|
60
|
+
`bench/torture/helpers/index.mjs` that no scenario imported. Neither path ships
|
|
61
|
+
(`files[]` excludes `bench/`).
|
|
62
|
+
|
|
63
|
+
### Changed -- one devDependency
|
|
64
|
+
|
|
65
|
+
`@zakkster/lite-gc-profiler@^1.15.0` added to `devDependencies` (dev-only; the
|
|
66
|
+
package still has zero runtime dependencies and `files[]` ships no test code).
|
|
67
|
+
|
|
68
|
+
### Verified -- full suite green on the 1.4.3 engine (Node 22, `--expose-gc`)
|
|
69
|
+
|
|
70
|
+
- **Torture:** 20/20 -- `zerogc-torture` PASS (three witnesses green across all
|
|
71
|
+
five graph shapes; `churn-box` a clean skip on 1.4.x). `ZEROGC_BREAK=1` exits
|
|
72
|
+
non-zero and names `injected` (retained 32 B/call).
|
|
73
|
+
- The engine is byte-for-byte 1.4.2; the unit suite is unaffected (425 total,
|
|
74
|
+
415 pass, 0 fail, 10 skip).
|
|
75
|
+
|
|
7
76
|
## [1.4.2] -- 2026-07-28
|
|
8
77
|
|
|
9
78
|
The verification-surface patch, round two. **The engine is unchanged**: as in
|
package/README.md
CHANGED
|
@@ -761,13 +761,13 @@ npm run bench
|
|
|
761
761
|
|
|
762
762
|
### Tier 4 -- Torture (correctness and resources under chaos)
|
|
763
763
|
|
|
764
|
-
`bench/torture/` holds **
|
|
764
|
+
`bench/torture/` holds **20 scenarios (17 semantic + 3 soak)** in two groups,
|
|
765
765
|
behind one runner. They are not perf benchmarks: the ops/sec figures reflect
|
|
766
766
|
random workload composition, not engine throughput -- `bench/benchmark.mjs`
|
|
767
767
|
remains the canonical perf harness. Every scenario feature-detects and **skips
|
|
768
768
|
cleanly** below the engine version that introduces its feature (`SKIP: <feature>
|
|
769
769
|
requires <version>+`, exit 0), so the whole directory rides this 1.4.x base
|
|
770
|
-
forward through 1.9. On the 1.4.x engine, **
|
|
770
|
+
forward through 1.9. On the 1.4.x engine, **11 semantic scenarios execute and 6
|
|
771
771
|
self-skip**.
|
|
772
772
|
|
|
773
773
|
```bash
|
|
@@ -805,6 +805,7 @@ Run these on every commit. They pin values, wakeups, work and ordering.
|
|
|
805
805
|
| `lifecycle-torture` | `destroy` (1.4.0+) registry reset: handles staled via gen-bump, stale writes no-op, pool reusable, idempotent. Its `createRoot` half is 1.5.0+ and self-skips on this base |
|
|
806
806
|
| `async-torture` | `watch`/`when`/`whenAsync` contracts + a 300-seed projection-guard storm |
|
|
807
807
|
| `capacity-torture` | the fail-closed pool boundary: exact node/link ceilings, `CapacityError`, `grow` mode crossing the boundary, no partial value escapes |
|
|
808
|
+
| `zerogc-torture` | the zero-GC claim, gated by `@zakkster/lite-gc-profiler`: per-call **retained bytes** (`measureAllocs` at `maxBytesPerCall: 0`), **major-GC count + longest pause** (`measureOps`/`checkNoGc`, `stabilize: 'deep'`), and the engine's own `stats()` counters (`poolGrowths`/`totalAllocations` steady, `activeNodes` restored under churn) across five graph shapes. `ZEROGC_BREAK=1` plants a leak the gate must reject; `churn-box` self-skips below 1.5.0 |
|
|
808
809
|
| `box-torture` (1.5.0+) | `signalBox`/`computedBox` interop + surface -- SKIP on 1.4.x |
|
|
809
810
|
| `scope-torture` (1.6.0+) | `createScope` adoption + the disposal-crash fuzz -- SKIP on 1.4.x |
|
|
810
811
|
| `owner-torture` (1.6.0+) | `getOwner`/`runWithOwner` capture-restore + ABA degradation -- SKIP on 1.4.x |
|
|
@@ -864,7 +865,7 @@ npm run verify # test + a sanity bench
|
|
|
864
865
|
|
|
865
866
|
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.
|
|
866
867
|
|
|
867
|
-
This section will grow. As future versions ship publications that need specific defensive validation (e.g. a `flushStrategy` ship, a TC39-polyfill ship, a
|
|
868
|
+
This section will grow. As future versions ship publications that need specific defensive validation (e.g. a `flushStrategy` ship, a TC39-polyfill ship, a profiler/observability ship), the corresponding harness lands here. (The zero-GC public gate shipped in 1.4.3 as the `zerogc-torture` scenario in Tier 4 above, not as a separate harness.)
|
|
868
869
|
|
|
869
870
|
### `test/ProfilerTests/` -- version-portable hardening suite
|
|
870
871
|
|
|
@@ -1251,7 +1252,7 @@ npm test # behavior suite, ~1.3s
|
|
|
1251
1252
|
npm run test:gc # zero-gc suite, requires --expose-gc, ~3s
|
|
1252
1253
|
npm run bench # comparative benchmark vs alien-signals (results.txt), ~5min
|
|
1253
1254
|
npm run bench-reactive # 5-framework reactivity suite (resultsReactive.txt)
|
|
1254
|
-
npm run torture # full torture suite, all
|
|
1255
|
+
npm run torture # full torture suite, all 20 scenarios
|
|
1255
1256
|
npm run torture:semantic # correctness scenarios only, ~10s
|
|
1256
1257
|
npm run torture:soak # resource soaks only, wall-clock bound
|
|
1257
1258
|
npm run verify # test + sanity bench; run before publishing
|
package/Signal.js
CHANGED
package/llms.txt
CHANGED
|
@@ -50,7 +50,31 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
50
50
|
|
|
51
51
|
## Version notes
|
|
52
52
|
|
|
53
|
-
- **1.4.
|
|
53
|
+
- **1.4.3** (current): the **verification-surface patch, round three**. No engine
|
|
54
|
+
change -- as in 1.4.1 and 1.4.2, the only edit to `Signal.js` is the banner
|
|
55
|
+
version string, `Signal.d.ts` is untouched, and `bench/torture/` stays out of
|
|
56
|
+
`files[]`; for consumers 1.4.3 is byte-for-byte 1.4.2 plus a version number. It
|
|
57
|
+
adds **one** semantic torture scenario -- `zerogc-torture.mjs` -- taking the
|
|
58
|
+
suite to **20 scenarios (17 semantic + 3 soak)**, and deletes the orphaned
|
|
59
|
+
hand-rolled scavenge meter that predated it. The new scenario is what finally
|
|
60
|
+
turns the headline zero-GC claim into a re-runnable GATE, driven by the real
|
|
61
|
+
`@zakkster/lite-gc-profiler@^1.15.0` (added as a devDependency) rather than a
|
|
62
|
+
bespoke `perf_hooks` counter. It gates the steady-state hot path on three
|
|
63
|
+
independent witnesses: per-call RETAINED bytes via `measureAllocs`/`checkAllocs`
|
|
64
|
+
at `maxBytesPerCall: 0` (the literal zero-retention assertion, which also proves
|
|
65
|
+
create+dispose churn leaks nothing even though a handle allocates transiently),
|
|
66
|
+
major-GC count and longest pause via `measureOps`/`checkNoGc` at `maxMajor: 0` /
|
|
67
|
+
`maxPauseMs: 2`, and the engine's exact `stats()` counters (steady:
|
|
68
|
+
`poolGrowths` and `totalAllocations` flat; churn: `poolGrowths` 0 and
|
|
69
|
+
`activeNodes` restored). The non-goal is stated as loudly as the goal: node
|
|
70
|
+
CREATION is not zero-alloc; the pool removes the internal node allocation, never
|
|
71
|
+
the public handle. `ZEROGC_BREAK=1` arms an effect that pushes to a module-level
|
|
72
|
+
sink, mutation-verifying that the gate rejects a planted allocation (and that
|
|
73
|
+
reaching the PASS line with the break armed is itself a failure). `churn-box`
|
|
74
|
+
self-skips below 1.5.0. Verified green: torture 20/20, `zerogc-torture` PASS;
|
|
75
|
+
engine byte-identical to 1.4.2, so the unit suite (425/415/0/10) is unaffected.
|
|
76
|
+
|
|
77
|
+
- **1.4.2**: the **verification-surface patch, round two**. No engine
|
|
54
78
|
change -- as in 1.4.1, the only edit to `Signal.js` is the banner version string,
|
|
55
79
|
`Signal.d.ts` untouched, `bench/torture/` excluded from `files[]`; for consumers
|
|
56
80
|
1.4.2 is byte-for-byte 1.4.1 plus a version number. It completes the torture
|
|
@@ -633,7 +657,7 @@ function dumpOwnerTree(handle, depth = 0) {
|
|
|
633
657
|
- `bench/benchmark.mjs` -- anti-DCE throughput harness (ops/s; results.txt).
|
|
634
658
|
- `bench/benchmarkReactive.mjs` -- cross-framework reactivity suite vs alien-signals, preact, vue-reactivity, solid (resultsReactive.txt).
|
|
635
659
|
- `bench/dispose-recycle.mjs` -- 1.2.2 targeted microbench: create/dispose/recreate cycle (the free-list invariant audit target).
|
|
636
|
-
- `bench/torture/` -- **
|
|
660
|
+
- `bench/torture/` -- **20 scenarios (17 semantic + 3 soak)** behind one runner (`run.mjs`), two groups, forward-compatible through 1.9. Every scenario feature-detects and SKIPS cleanly below the engine version that introduces its feature (`SKIP: <feature> requires <version>+`, exit 0), so the whole directory rides this 1.4.x base forward. `semantic` (deterministic, fast, asserts on MEANING; run in CI) -- the **11 that execute on the 1.4.x engine**: `oracle-fuzzer` (every computed vs an independent uncached reference evaluator, 400 seeds x 120 ops), `glitch-hunter` (glitch freedom + exact wakeup counts), `work-accounting` (minimum body-execution counts over 10 topologies), `op-accounting` (structural work via the `onGraphMutation` opcode lane -- op5 identity, equality cutoff, link/node balance, 400-seed differential), `introspect-torture` (the read-only `describe`/`nodeId`/`forEach*`/`hasObservers`/`isTracking`/`ownerOf`/`observeObservers` surface: walk agreement vs the real edge set incl. dynamic rewiring, and the ABA gen-stamp guard), `lifecycle-torture` (`destroy` 1.4.0+ registry reset -- gen-bump staling, no-op stale writes, pool reuse, idempotence; its `createRoot` half is 1.5.0+ and self-skips), `concurrent-storm` (8 reentrancy / flush-ordering contracts, `CycleError` via `maxFlushPasses`), `scheduler-storm` (gen-bound thunk ABA guard, FLAG_QUEUED coalescing, throwing scheduler containment), `async-torture` (`watch`/`when`/`whenAsync` + a 300-seed storm), `capacity-torture` (the fail-closed pool boundary, `CapacityError`, `grow` crossing it, no partial value escapes), `zerogc-torture` (the zero-GC gate -- steady-state writes retain 0 bytes and force 0 major GCs, node churn leaks nothing, via `@zakkster/lite-gc-profiler`'s `measureAllocs`/`checkAllocs` at `maxBytesPerCall: 0` + `measureOps`/`checkNoGc` at `maxMajor: 0`/`maxPauseMs: 2` + exact `stats()` deltas, mutation-verified by `ZEROGC_BREAK=1`; its `churn-box` witness self-skips below 1.5.0); plus **6 that self-skip** until their feature exists: `box-torture` (1.5.0), `scope-torture` (1.6.0), `owner-torture` (1.6.0), `flush-torture` (1.7.0), `cleanup-return-torture` (1.8.0), `dispose-torture` (1.9.0). `soak` (wall-clock bound, asserts on RESOURCES; run nightly): `graph-fuzzer`, `scheduler-bench`, `torture-soak` -- exit 0 iff zero errors AND post-teardown pool at or below its leaf-only floor AND the JIT sink advanced. The runner spawns each scenario as a child process because several assert on global pool accounting, and passes `--expose-gc` unconditionally. `zerogc-torture` and the soaks require `--expose-gc` (the runner supplies it). Scripts: `npm run torture`, `torture:semantic`, `torture:soak`.
|
|
637
661
|
- `bench/torture/helpers/index.mjs` -- shared torture infrastructure: seeded `mulberry32` (failures replay from their seed), `soakRegistry` / `fixedRegistry`, `createReport` (collects failures rather than throwing on the first), and `VALUE_POOL`, the adversarial value domain containing the pairs where candidate equality definitions disagree (`Object.is` vs `===` on NaN and -0/0; `===` vs `==` on 0/""/false/"0" and null/undefined). Dependency-free and side-effect-free by contract: importing it must not touch the default registry.
|
|
638
662
|
- `bench/run-all.sh` + `bench/aggregate.mjs` -- cold-process-per-engine protocol + per-scenario aggregation.
|
|
639
663
|
- `demo/index.html` -- interactive visualization of the reactive graph.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakkster/lite-signal",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
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",
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"sideEffects": false,
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@zakkster/lite-devtools": "^1.2.0",
|
|
81
|
+
"@zakkster/lite-gc-profiler": "^1.15.0",
|
|
81
82
|
"@zakkster/lite-profiler": "^1.1.0",
|
|
82
83
|
"@zakkster/lite-profiler-signal": "^1.2.0",
|
|
83
84
|
"@zakkster/lite-signal": "^1.3.0 || >=1.4.0-beta.0 || >=1.6.0-preview.0",
|