@zakkster/lite-signal 1.7.0-alpha.1 → 1.7.0-alpha.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 +32 -10
- package/README.md +30 -32
- package/llms.txt +47 -45
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,19 @@ This project follows [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
### Changed -- bench protocol v3 (carried forward)
|
|
10
|
+
|
|
11
|
+
The `bench/` harness is bench protocol v3: three instruments (microscope / mirror /
|
|
12
|
+
version-economics), each with a fixed config and a machine-generated `#STAMP`
|
|
13
|
+
(engine + harness sha256, live registry config, host, node). The pre-v3
|
|
14
|
+
five-framework reactivity suite was removed after 1.5.1. See `bench/README.md`.
|
|
15
|
+
|
|
16
|
+
### Added -- Coveralls coverage badge
|
|
17
|
+
|
|
18
|
+
README carries a Coveralls badge; lcov is produced by `npm run test:report`
|
|
19
|
+
(`coveralls-next` in devDependencies).
|
|
20
|
+
|
|
21
|
+
|
|
9
22
|
### Fixed -- dangling re-tracking cursor on source disposal (crash)
|
|
10
23
|
|
|
11
24
|
Disposing a signal/computed from inside an observer that had linked it on the
|
|
@@ -305,10 +318,13 @@ entry in `llms.txt`.
|
|
|
305
318
|
|
|
306
319
|
### Regenerated -- every published benchmark number
|
|
307
320
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
321
|
+
The v3 microscope and mirror have been re-run on the 1.7.0-preview engine on **Apple
|
|
322
|
+
M4 Pro darwin/arm64, Node 26.3.1** and their outputs committed to `bench/r.txt`
|
|
323
|
+
(microscope aggregate, 4 engines across the six first-party shapes) and `bench/rb.txt`
|
|
324
|
+
(mirror sweep, Andrii's canonical adapter verbatim, lite vs alien across 47 rows,
|
|
325
|
+
isolated-per-row, 10 reps). Both benchmark sections of the README and the llms.txt
|
|
326
|
+
Benchmark snapshot are rebuilt from these outputs rather than carried forward. Two
|
|
327
|
+
consequences worth stating out loud:
|
|
312
328
|
|
|
313
329
|
- **The headline ranking improved.** On Andrii's 1.7.0 run (`bench/AndriiVolynetsReactiveBench1.7.0.log`,
|
|
314
330
|
15 frameworks x 47 tests, checked in), lite-signal is **4th of 15 by geomean at
|
|
@@ -317,13 +333,19 @@ stating out loud:
|
|
|
317
333
|
which was **5.7x behind** the leaders on the 1.1.2 engine Andrii first measured, is
|
|
318
334
|
now the **fastest result in the entire field**.
|
|
319
335
|
- **Two local results got worse, and are now stated plainly instead of buried.**
|
|
320
|
-
**DEEP CHAIN is a -
|
|
336
|
+
**DEEP CHAIN is a -74.3% loss to alien-signals** (172 ms vs 99 ms), not the -18% the
|
|
321
337
|
old (invalid) table reported -- it is the engine's largest open performance gap and
|
|
322
|
-
it is structural. And **DYNAMIC DAG, while +
|
|
323
|
-
(
|
|
324
|
-
every `dyn` row" and "ahead on all seven `updateComputations` rows" do
|
|
325
|
-
the re-measurement
|
|
326
|
-
|
|
338
|
+
it is structural. And **DYNAMIC DAG, while +17.0% over alien, loses to preact-signals**
|
|
339
|
+
(3718 ms vs 2760 ms on this sweep). The old `resultsReactive.txt` claims "fastest of
|
|
340
|
+
all five on every `dyn` row" and "ahead on all seven `updateComputations` rows" do
|
|
341
|
+
not survive the re-measurement. Both retracted.
|
|
342
|
+
- **The microscope wins moved slightly since 1.6.0-alpha's M4 Pro sweep.** MUX +32.6%
|
|
343
|
+
(was +35.3%), SELECTIVE DAG +20.4% (was +20.6%), DYNAMIC DAG +17.0% (was +17.7%) --
|
|
344
|
+
same magnitudes, host-noise drift. **BROADCAST narrowed from +12.0% to +6.2%** but
|
|
345
|
+
stayed on the win side of parity, keeping the 4/6 speed-win count. **KAIROS widened
|
|
346
|
+
slightly from -9.9% to -11.7%**. DEEP CHAIN unchanged at -74.3%. Heap column is
|
|
347
|
+
intact: one to four orders of magnitude below alien on every shape where GC pressure
|
|
348
|
+
exists at all.
|
|
327
349
|
|
|
328
350
|
### Migration
|
|
329
351
|
|
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
|
+
[](https://coveralls.io/github/PeshoVurtoleta/lite-signal?branch=main)
|
|
12
13
|

|
|
13
14
|

|
|
14
15
|

|
|
@@ -795,31 +796,29 @@ These are the questions you'd ask in a code review, with the answers:
|
|
|
795
796
|
|
|
796
797
|
> **The pre-1.7.0 numbers in this section were invalid and have been discarded.** Every lite-signal adapter in `bench/benchmark.mjs` built its registry with `flushStrategy: "sab"` while driving un-batched `.set` calls, and the harness never called `batch()` or `flush()`. In SAB mode a `.set` outside a batch *enqueues* effects but does not deliver them -- so the effect ran exactly once, at creation, and never again inside the timed loop. The loop was timing a bare mark-dirty against dead-code-eliminated downstream work; MUX reported 22,032K ops/s against a real ~219K. The harness printed the symptom (`sink=[ ]`, `BENCH_SINK_SUM: 0.00`) on nine of eleven rows and nobody read it. 1.7.0 moves the adapters to **eager** -- the only mode comparable to alien/preact/vue/solid, all of which deliver eagerly -- and adds a **validity guard** that exits non-zero with an `INVALID RUN` block if any scenario finishes with a dead sink. Everything below is from the first honest sweep.
|
|
797
798
|
|
|
798
|
-
All measurements: **Node
|
|
799
|
+
All measurements: **Node 26.3.1, Apple M4 Pro (darwin/arm64)**, **one engine per cold process**, **median across reps**, machine-stamped `#STAMP` (engine + harness sha256, live registry config, host, node) on every output, lite-signal **@1.7.0-preview.0** on the default `prealloc: "eager"` / `flushStrategy: "eager"`. Raw reps are checked in under [`bench/bench-runs/`](./bench/bench-runs/) (microscope, six first-party shapes) and [`bench/mirror-runs/`](./bench/mirror-runs/) (mirror, Andrii's canonical 47-shape adapter), and every table re-derives with `cd bench && node aggregate.mjs` / `node report.mjs`. Note this is a **different host** from every sweep through 1.5.0-beta.0 (a 2016-era Intel MacBook Pro / Node 22): absolute times are ~2.5-3x faster and do not compare across the boundary. Full outputs: [`bench/r.txt`](./bench/r.txt) (this microscope aggregate across four engines) and [`bench/rb.txt`](./bench/rb.txt) (the mirror sweep, lite vs alien).
|
|
799
800
|
|
|
800
801
|
| Scenario | What it stresses | lite-signal | alien-signals | lite vs alien | transient heap (lite / alien) |
|
|
801
802
|
| ---------- | -------------------------------- | ----------- | ------------- | ------------- | ----------------------------- |
|
|
802
|
-
| **MUX** | 256 signals -> 1 sum -> 1 effect (fan-in) | **23.
|
|
803
|
-
| **SELECTIVE DAG** | sqrt-layered, set churn, 2 read/iter | **
|
|
804
|
-
| **DYNAMIC DAG** | sqrt-layered, FAN=6, read flips each iter | **
|
|
805
|
-
| **
|
|
806
|
-
| **
|
|
807
|
-
| **
|
|
808
|
-
| **LARGE WEB APP** | 12 layers x ~80 wide, conditional reads | 1142 ms | **1062 ms** | -8% | **1.4 KB / 2.6 MB** (1889x less) |
|
|
809
|
-
| **KAIROS** | 1 signal -> 1000 computeds -> 1 effect | 524 ms | **460 ms** | -14% | **201.8 KB / 2.1 MB** (10.6x less) |
|
|
810
|
-
| **DEEP CHAIN** | 256-deep computed chain -> 1 effect | 172 ms | **99 ms** | **-73%** | **4.5 KB / 2.7 MB** (591x less) |
|
|
803
|
+
| **MUX** | 256 signals -> 1 sum -> 1 effect (fan-in) | **23.43 ms** | 34.78 ms | **+32.6% faster** | **0 KB / 781 KB** (100% less) |
|
|
804
|
+
| **SELECTIVE DAG** | sqrt-layered, set churn, 2 read/iter | **2030 ms** | 2550 ms | **+20.4% faster** | **7.6 MB / 77.0 MB** (90.1% less, 10.1x) |
|
|
805
|
+
| **DYNAMIC DAG** | sqrt-layered, FAN=6, read flips each iter | **3718 ms** | 4477 ms | **+17.0% faster** | **3.4 MB / 59.8 MB** (94.3% less, 17.6x) |
|
|
806
|
+
| **BROADCAST** | 1 signal -> 1000 effects (fan-out) | **434.81 ms** | 463.64 ms | **+6.2% faster** | ~0 KB / ~0 KB (both fit under GC floor) |
|
|
807
|
+
| **KAIROS** | 1 signal -> 1000 computeds -> 1 effect | 516.98 ms | 462.79 ms | -11.7% | **23 KB / 802 KB** (97.1% less, 34.3x) |
|
|
808
|
+
| **DEEP CHAIN** | 256-deep computed chain -> 1 effect | 172.28 ms | **98.83 ms** | -74.3% | **0.5 KB / 1062 KB** (100% less, >2000x) |
|
|
811
809
|
|
|
812
810
|
*(lower time = faster; transient heap = average delta-heap per rep, lower = less GC pressure)*
|
|
813
811
|
|
|
814
|
-
**Reading the table -- including the parts that don't flatter the engine.** lite-signal's time wins cluster exactly where its zero-GC design pays off: **fan-in aggregation (MUX +
|
|
812
|
+
**Reading the table -- including the parts that don't flatter the engine.** lite-signal's time wins cluster exactly where its zero-GC design pays off: **fan-in aggregation (MUX +32.6%)** and the **allocation-heavy dynamic shapes** (SELECTIVE DAG +20.4%, DYNAMIC DAG +17.0%), where alien-signals churns the nursery and the object pool allocates near-nothing, plus **BROADCAST +6.2%** (narrowed from +12.0% on 1.6.0-alpha but still on the win side of parity). That is **4 wins of 6**. The two losses are real:
|
|
815
813
|
|
|
816
|
-
- **DEEP CHAIN (-
|
|
817
|
-
- **
|
|
818
|
-
- **KAIROS (-14%)** widened from parity: 1 source -> 1000 computeds has almost nothing to retrack, so the pooled representation pays its per-node indirection with no allocation saving to show for it.
|
|
814
|
+
- **DEEP CHAIN (-74.3%)** is the engine's structurally worst shape and the largest open performance gap it has. On a 256-deep pull chain alien's flatter representation wins outright (99 ms vs 172 ms), and this host's faster memory subsystem rewards that layout *more* than the old Intel box did -- the gap widened from the -14% the (already-suspect) 1.5.0-beta table reported. It is not closed and it is not going to be closed by tuning. Note the inversion: **lite loses the row on time by 74% while allocating >2000x less heap**.
|
|
815
|
+
- **KAIROS (-11.7%)** widened slightly from -9.9% on 1.6.0-alpha: 1 source -> 1000 computeds has almost nothing to retrack, so the pooled representation pays its per-node indirection with no allocation saving to show for it.
|
|
819
816
|
|
|
820
|
-
On **allocation pressure** lite-signal wins **
|
|
817
|
+
On **allocation pressure** lite-signal wins **5 of 6** and is one to four orders of magnitude below alien on every shape where GC pressure exists at all: DEEP CHAIN 0.5 KB vs 1062 KB (>2000x less -- yes, on the shape where lite is behind on time), MUX 0 KB vs 781 KB, KAIROS 23 KB vs 802 KB (34.3x), DYNAMIC DAG 3.4 MB vs 59.8 MB (17.6x), SELECTIVE DAG 7.6 MB vs 77.0 MB (10.1x). On BROADCAST both engines are effectively zero. Against preact-signals and solid-signals the heap gap is even wider on the fan-in / fan-out family -- solid allocates ~17 MB on MUX and ~16 MB on SELECTIVE DAG where lite allocates 0 KB and 7.6 MB respectively (`bench/r.txt`).
|
|
821
818
|
|
|
822
|
-
DEEP CHAIN is the honest summary of the whole trade in one row: **lite loses the row on time by
|
|
819
|
+
DEEP CHAIN is the honest summary of the whole trade in one row: **lite loses the row on time by 74% while allocating >2000x less heap.** Both numbers are true, and neither cancels the other. If your workload is a long pull chain and you can afford GC pauses, use alien-signals. If you cannot afford GC at all -- a 16 ms frame budget, a multi-day extension session -- that is the deal on offer.
|
|
820
|
+
|
|
821
|
+
The mirror-sweep companion ([`bench/rb.txt`](./bench/rb.txt)) reproduces the picture across Andrii's 47 shapes: lite runs **parity-to-behind alien on throughput**, wins outright on **4 of the 47** (`1000x5 - 25 sources (wide dense)` +11.7%, both `manySourcesIntoOne*ComputedEffect` fan-ins ~+31%, and `molBench` +1.8%), weak on the deep/layered-burst family. Every row carries a `#STAMP` and the counters (`nodesRecomputed` / `edgesTraversed` / `sinkReads`) match Andrii's published suite exactly, so a lite-vs-alien delta here is identical work, not DCE.
|
|
823
822
|
|
|
824
823
|
> Note on the retained heap lite-signal shows on KAIROS: that is the pre-allocated pool sitting in memory holding the live graph (1002 nodes + ~2000 links). The pool *is* the working memory -- see [The case for object pooling](#the-case-for-object-pooling).
|
|
825
824
|
|
|
@@ -918,7 +917,7 @@ npm run test:gc
|
|
|
918
917
|
|
|
919
918
|
### Tier 3 -- Performance (comparative benchmark)
|
|
920
919
|
|
|
921
|
-
`npm run bench` runs the
|
|
920
|
+
`npm run bench` runs the **microscope** -- lite's recommended eager config on six first-party shapes; the aggregate output is [`bench/r.txt`](./bench/r.txt) (four engines: lite, alien, preact, solid). Cross-framework standing comes from the **mirror** (`node --expose-gc bench/mirror.mjs --self-verify` then `bench/sweep.mjs`), which runs Andrii's canonical adapter verbatim so rows diff 1:1 against his log; the aggregate output is [`bench/rb.txt`](./bench/rb.txt) (lite vs alien, all 47 shapes). Every output carries a machine-generated `#STAMP` (engine + harness sha256, the live registry config, host, node), so a header can never disagree with the code that ran. The pre-v3 five-framework reactivity suite was **removed after 1.5.1** (bench protocol v3). Full methodology: [`bench/README.md`](./bench/README.md).
|
|
922
921
|
|
|
923
922
|
**As of 1.7.0 the propagation harness fails loudly instead of lying quietly.** Every scenario's anti-DCE sink is checked after the timed loop; a dead sink prints an `INVALID RUN` block naming the offending rows and exits non-zero. This is the guard that would have caught the pre-1.7.0 `flushStrategy: "sab"`-without-flush bug on day one -- see the note at the top of [Benchmarks](#benchmarks).
|
|
924
923
|
|
|
@@ -967,7 +966,7 @@ Through **v1.1.2**, that came with a mathematical trade-off: while memory alloca
|
|
|
967
966
|
**1.7.0 on the official [js-reactivity-benchmark](https://github.com/volynetstyle/js-reactivity-benchmark) (15 libraries, 47 tests, raw log checked in at [`bench/AndriiVolynetsReactiveBench1.7.0.log`](./bench/AndriiVolynetsReactiveBench1.7.0.log)):** `lite-signal` holds **4th overall by geomean (71.5 ms)**, behind alien-signals (44.2, the field leader -- lite runs at 0.62x), reflex (51.5), and @reactively (56.8), and now **20% ahead of 5th-place Preact Signals (85.7)** -- a gap that widened from ~5% on the 1.3.0 run. It finishes **top-3 on 21 of 47 tests** and is the **outright fastest of all 15** on four: `manyEffectsFromOneSource`, `manySourcesIntoOneComputedEffect`, `updateComputations2to1`, and the `1000x5 - 25 sources` wide-dense DAG. It remains the only object-pooled, zero-GC engine in the field.
|
|
968
967
|
|
|
969
968
|
#### 1. Stable Topologies (Fan-in / Fan-out / Broadcast)
|
|
970
|
-
In stable environments (game engines, particle systems, visualizers), `lite-signal` maintains a near-zero allocation profile and keeps frame times flat -- unchanged through 1.7.0. On fan-in it is the fastest engine in the field (MUX +
|
|
969
|
+
In stable environments (game engines, particle systems, visualizers), `lite-signal` maintains a near-zero allocation profile and keeps frame times flat -- unchanged through 1.7.0. On fan-in it is the fastest engine in the field (MUX +32.6% vs alien on the local microscope; fastest of all 15 on Andrii's `manySourcesIntoOneComputedEffect`).
|
|
971
970
|
|
|
972
971
|
#### 2. Dynamic Topologies (Web Apps / Layered DAGs) -- closed in 1.1.4, and it stayed closed
|
|
973
972
|
|
|
@@ -987,22 +986,21 @@ In stable environments (game engines, particle systems, visualizers), `lite-sign
|
|
|
987
986
|
|
|
988
987
|
The 3.4x-11x deficits of 1.1.2 are gone. The wide-dense shape -- the worst of the three in 1.1.2, at 5.7x behind -- is now the fastest result in the entire field.
|
|
989
988
|
|
|
990
|
-
*1.7.0 (default eager) on the
|
|
991
|
-
| Scenario | alien-signals | lite-signal (1.7.0) | result |
|
|
989
|
+
*1.7.0-preview (default eager) on the v3 microscope (`bench/r.txt`, Apple M4 Pro darwin/arm64, Node 26.3.1, one engine per cold process -- compare within-column, lite vs alien):*
|
|
990
|
+
| Scenario | alien-signals | lite-signal (1.7.0-preview) | result |
|
|
992
991
|
| :--- | :--- | :--- | :--- |
|
|
993
|
-
| **MUX** (256 ->
|
|
994
|
-
| **SELECTIVE DAG** (sqrt-layered, set churn)
|
|
995
|
-
| **DYNAMIC DAG** (sqrt-layered, FAN=6)
|
|
996
|
-
| **
|
|
997
|
-
| **
|
|
998
|
-
| **
|
|
999
|
-
| **DEEP CHAIN** (256-deep pull) | 99ms | 172ms | **alien +73%** |
|
|
992
|
+
| **MUX** (256 sigs -> sum -> effect) | 34.78 ms | 23.43 ms | **lite +32.6%** |
|
|
993
|
+
| **SELECTIVE DAG** (sqrt-layered, set churn) | 2550 ms | 2030 ms | **lite +20.4%** |
|
|
994
|
+
| **DYNAMIC DAG** (sqrt-layered, FAN=6) | 4477 ms | 3718 ms | **lite +17.0%** |
|
|
995
|
+
| **BROADCAST** (1 -> 1000 effects) | 463.64 ms | 434.81 ms | **lite +6.2%** (narrowed from +12.0% on 1.6.0-alpha) |
|
|
996
|
+
| **KAIROS** (1 -> 1000 computeds) | 462.79 ms | 516.98 ms | alien +11.7% (widened slightly from -9.9% on 1.6.0-alpha) |
|
|
997
|
+
| **DEEP CHAIN** (256-deep pull) | 98.83 ms | 172.28 ms | **alien +74.3%** |
|
|
1000
998
|
|
|
1001
|
-
> **Honest note (1.7.0):** these
|
|
999
|
+
> **Honest note (1.7.0-preview):** these numbers come from the first *valid* microscope this harness has produced -- every sweep before 1.7.0 timed a dead sink (see [Benchmarks](#benchmarks)). Two results are worse than the old, invalid table claimed: **DEEP CHAIN is a -74.3% loss** (not -18%), and it is the largest open performance gap the engine has, and **DYNAMIC DAG, while a +17.0% win over alien, is a loss to preact-signals** (3718 ms vs preact's 2760 ms on this sweep -- see `bench/r.txt`). lite still wins 4/6 on time (MUX, SELECTIVE DAG, DYNAMIC DAG, BROADCAST) and 5/6 on heap; the sixth is a shared-zero on BROADCAST. lite remains one to four orders of magnitude below alien on transient heap on every shape where GC pressure exists at all.
|
|
1002
1000
|
|
|
1003
|
-
The
|
|
1001
|
+
The mirror sweep ([`bench/rb.txt`](./bench/rb.txt), Andrii's canonical adapter verbatim, isolated-per-row, 10 reps, lite vs alien across all 47 shapes on the same M4 Pro host) reproduces the same picture: lite runs **parity-to-behind alien on throughput**, wins outright on **4/47** (`1000x5 - 25 sources (wide dense)` +11.7%, `manySourcesIntoOneComputedEffectWithDirect` +31.8%, `manySourcesIntoOneComputedEffect` +30.7%, and `molBench` +1.8%), weak on the deep/layered-burst family. Every row carries a `#STAMP` and the counters (`nodesRecomputed` / `edgesTraversed` / `sinkReads`) match Andrii's published suite exactly, so a lite-vs-alien delta here is identical work, not DCE. The retracking is verified correct by `harness/retracking.difftest.mjs` -- 20,000 direct + 10,000 batched writes, 0 disagreements against the published reference engine.
|
|
1004
1002
|
|
|
1005
|
-
**The Takeaway:** as of 1.1.4 you no longer have to choose, and 1.7.0 holds the line -- the engine ranks **4th of 15** on the official js-reactivity-benchmark and is the only zero-GC library in the field. `lite-signal` keeps the zero-GC, flat-arena profile for 120fps Canvas/WebGL **and** wins on the high-churn dynamic and fan-in topologies that dominate live UI. It runs at parity-to-slightly-behind on cheap stable shapes. The one shape where alien's flatter representation leads decisively is the **256-deep computed pipeline (DEEP CHAIN, -
|
|
1003
|
+
**The Takeaway:** as of 1.1.4 you no longer have to choose, and 1.7.0-preview holds the line -- the engine ranks **4th of 15** on the official js-reactivity-benchmark and is the only zero-GC library in the field. `lite-signal` keeps the zero-GC, flat-arena profile for 120fps Canvas/WebGL **and** wins on the high-churn dynamic and fan-in topologies that dominate live UI. It runs at parity-to-slightly-behind on cheap stable shapes. The one shape where alien's flatter representation leads decisively is the **256-deep computed pipeline (DEEP CHAIN, -74.3%)** -- and that gap is structural, not a tuning bug.
|
|
1006
1004
|
|
|
1007
1005
|
### Roadmap
|
|
1008
1006
|
- **1.1.5** -- additions in service of `lite-devtools` (node identity/traversability on the introspection walkers, for full auto-discovered graph rendering). *Shipped.*
|
|
@@ -1377,8 +1375,8 @@ npm test # behaviour suite: 476 tests, 29 files, ~5s
|
|
|
1377
1375
|
npm run test:gc # all 484 -- adds --expose-gc (8 tests are gated on it)
|
|
1378
1376
|
npm run test:coverage # the same suite under c8 (100% stmts / 100% funcs / 100% branch)
|
|
1379
1377
|
npm run test:harness # profiler-tools hardening suite
|
|
1380
|
-
npm run bench #
|
|
1381
|
-
|
|
1378
|
+
npm run bench # microscope + mirror comparative benches (r.txt / rb.txt)
|
|
1379
|
+
node --expose-gc bench/mirror.mjs --self-verify # cross-framework mirror sweep (bench protocol v3)
|
|
1382
1380
|
npm run harness:smoke # flushStrategy semantics (eager/sab/manual) -- ASSERTS
|
|
1383
1381
|
npm run harness:all # smoke + field + dispose + churn probes
|
|
1384
1382
|
npm run gate # cold-process version-matrix regression gate (also runs on prepublish)
|
package/llms.txt
CHANGED
|
@@ -291,7 +291,7 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
291
291
|
Version lineage:
|
|
292
292
|
this is the engine previously labeled `1.2.3` in dev -- renumbered to
|
|
293
293
|
`1.2.2` because the deletion is small, isolated, and intentionally
|
|
294
|
-
non-behavioral. Drop-in over 1.2.1. **Bench position** (third-party
|
|
294
|
+
non-behavioral. Drop-in over 1.2.1. **Bench harness (protocol v3):** rebuilt around three fixed-config instruments -- microscope (`benchmark.mjs`, recommended eager config, six first-party shapes), mirror (`mirror.mjs` + `sweep.mjs`, Andrii's canonical adapter verbatim, rows diff 1:1 against his log), version-economics (`harness/toe-to-toe`) -- each output carrying a machine-generated `#STAMP` (engine + harness sha256, live registry config, host, node). Pre-v3 five-framework suite removed after 1.5.1. Methodology in `bench/README.md`. **Bench position** (third-party
|
|
295
295
|
[js-reactivity-benchmark](https://github.com/volynetstyle/js-reactivity-benchmark),
|
|
296
296
|
15 frameworks, 47 tests): #4 by geomean (75.5) at 1.77x behind alien-signals
|
|
297
297
|
(1.00x), reflex (1.15x), @reactively (1.39x); now ahead of 5th-place Preact
|
|
@@ -589,58 +589,60 @@ None of these touch the reactive engine -- no `FLAG_WATCHER` on `ReactiveNode`,
|
|
|
589
589
|
|
|
590
590
|
The deliberate engineering for `watch`'s "0 per fire" is the hoisted `untrackedFire` closure with `currentNewValue` shared mutable state -- see source comment in `watch.js`. Inline arrow function inside the effect body would allocate per fire and break the zero-GC contract.
|
|
591
591
|
|
|
592
|
-
## Benchmark snapshot (Node
|
|
592
|
+
## Benchmark snapshot (Node 26.3.1, Apple M4 Pro darwin/arm64, default eager, median across reps -- @1.7.0-preview.0)
|
|
593
593
|
|
|
594
594
|
**Every pre-1.7.0 number from this harness is void** -- the lite-signal adapters ran
|
|
595
595
|
`flushStrategy: "sab"` without ever calling `batch()` or `flush()`, so the timed loop
|
|
596
596
|
was measuring a dead sink (see Version notes). What follows is the first valid sweep.
|
|
597
|
-
The host is also new (Apple M4 Pro, not the 2016 Intel MacBook
|
|
598
|
-
absolute times are ~2.5-3x faster and do not compare across the
|
|
597
|
+
The host is also new (Apple M4 Pro / Node 26, not the 2016 Intel MacBook / Node 22 of
|
|
598
|
+
every prior table): absolute times are ~2.5-3x faster and do not compare across the
|
|
599
|
+
boundary.
|
|
599
600
|
|
|
600
|
-
`benchmark.mjs` head-to-head vs
|
|
601
|
-
|
|
601
|
+
v3 microscope (`benchmark.mjs`, six first-party shapes, `bench/r.txt`) head-to-head vs
|
|
602
|
+
alien-signals (time = median execution; heap = average transient delta-heap per rep):
|
|
602
603
|
|
|
603
604
|
| Scenario | lite | alien | lite vs alien (time) | transient heap (lite / alien) |
|
|
604
605
|
| -------------------------------- | -------- | -------- | -------------------- | ----------------------------- |
|
|
605
|
-
| MUX (256 sigs -> sum -> effect) | 23.
|
|
606
|
-
| SELECTIVE DAG (set churn) |
|
|
607
|
-
| DYNAMIC DAG (FAN=6, read flips) |
|
|
608
|
-
|
|
|
609
|
-
|
|
|
610
|
-
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
band (~1.4 KB transient across an entire run on the stable app shapes).
|
|
606
|
+
| MUX (256 sigs -> sum -> effect) | 23.43 ms | 34.78 ms | **+32.6% faster** | 0 KB / 781 KB (100% less) |
|
|
607
|
+
| SELECTIVE DAG (set churn) | 2030 ms | 2550 ms | **+20.4% faster** | 7.6 MB / 77.0 MB (10.1x) |
|
|
608
|
+
| DYNAMIC DAG (FAN=6, read flips) | 3718 ms | 4477 ms | **+17.0% faster** | 3.4 MB / 59.8 MB (17.6x) |
|
|
609
|
+
| BROADCAST (1 -> 1000 effects) | 434.81 ms | 463.64 ms | **+6.2% faster** | ~0 KB / ~0 KB (both zero) |
|
|
610
|
+
| KAIROS (1 -> 1000 computeds) | 516.98 ms | 462.79 ms | -11.7% | 23 KB / 802 KB (34.3x) |
|
|
611
|
+
| DEEP CHAIN (256-deep -> effect) | 172.28 ms | 98.83 ms | **-74.3%** | 0.5 KB / 1062 KB (>2000x) |
|
|
612
|
+
|
|
613
|
+
Time: lite wins 4 of 6 -- fan-in (MUX), the allocation-heavy dynamic shapes, plus
|
|
614
|
+
BROADCAST +6.2% (narrowed from +12.0% on 1.6.0-alpha but still on the win side of
|
|
615
|
+
parity), exactly where the object pool's zero allocation converts into a GC tailwind
|
|
616
|
+
that alien (which churns the nursery) does not get. Heap: lite wins 5 of 6 and is one
|
|
617
|
+
to four orders of magnitude below alien on every shape where GC pressure exists at
|
|
618
|
+
all; the sixth is a shared-zero on BROADCAST.
|
|
619
619
|
|
|
620
620
|
**The two losses that matter, stated plainly:**
|
|
621
|
-
- **DEEP CHAIN -
|
|
622
|
-
and its largest open performance gap. alien's flatter representation wins when
|
|
623
|
-
propagation path is long rather than wide. The gap WIDENED on this host (it was
|
|
624
|
-
reported as -18% under the old, invalid harness
|
|
625
|
-
not closed. Note the inversion: lite loses the row on
|
|
626
|
-
|
|
627
|
-
- **
|
|
628
|
-
|
|
629
|
-
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
621
|
+
- **DEEP CHAIN -74.3%.** The 256-deep pull chain is the engine's structurally worst
|
|
622
|
+
shape and its largest open performance gap. alien's flatter representation wins when
|
|
623
|
+
the propagation path is long rather than wide. The gap WIDENED on this host (it was
|
|
624
|
+
reported as -18% under the old, invalid harness, -14% on the older Intel host). It
|
|
625
|
+
is not a tuning bug and it is not closed. Note the inversion: lite loses the row on
|
|
626
|
+
time by 74% while allocating >2000x less heap. Both are true.
|
|
627
|
+
- **KAIROS -11.7%** widened slightly from -9.9% on 1.6.0-alpha: 1 source -> 1000
|
|
628
|
+
computeds has almost nothing to retrack, so the pooled representation pays its
|
|
629
|
+
per-node indirection with no allocation saving to show for it.
|
|
630
|
+
|
|
631
|
+
**The differentiated position is ALLOCATION, not raw propagation speed** -- competitive-
|
|
632
|
+
to-winning throughput with dramatically lower GC pressure, not "fastest dynamic-graph
|
|
633
|
+
engine". That headline reproduces across hosts, sweeps, and third-party version bumps
|
|
634
|
+
because the object pool is the mechanism, not a tuning knob.
|
|
635
|
+
|
|
636
|
+
Mirror sweep (`bench/rb.txt`, Andrii's canonical adapter verbatim, isolated-per-row,
|
|
637
|
+
10 reps, lite vs alien only on the same M4 Pro host) reproduces the same picture
|
|
638
|
+
across all 47 shapes: lite runs parity-to-behind alien on throughput, wins outright
|
|
639
|
+
on **4/47**: `1000x5 - 25 sources (wide dense)` +11.7%,
|
|
640
|
+
`manySourcesIntoOneComputedEffectWithDirect` +31.8%, `manySourcesIntoOneComputedEffect`
|
|
641
|
+
+30.7%, and `molBench` +1.8%. Weak on the deep/layered-burst family. Every row carries
|
|
642
|
+
a `#STAMP` and the counters (`nodesRecomputed` / `edgesTraversed` / `sinkReads`) match
|
|
643
|
+
Andrii's published suite exactly, so a lite-vs-alien delta here is identical work,
|
|
644
|
+
not DCE. Retracking verified correct by `harness/retracking.difftest.mjs` (20,000
|
|
645
|
+
direct + 10,000 batched writes, 0 disagreements vs the published reference engine).
|
|
644
646
|
|
|
645
647
|
Independent ranking (Andrii Volynets' js-reactivity-benchmark fork, 15 frameworks,
|
|
646
648
|
47 tests, raw log at `bench/AndriiVolynetsReactiveBench1.7.0.log`): lite-signal is
|
|
@@ -654,7 +656,7 @@ geomean: @vue/reactivity 1.62x, Oby 1.73x, Signia 1.76x, MobX 2.40x, s-js 2.57x,
|
|
|
654
656
|
engine in the field.
|
|
655
657
|
|
|
656
658
|
Retained heap after forced GC: typically negative for all libs (V8 compacts).
|
|
657
|
-
The one exception: lite-signal shows
|
|
659
|
+
The one exception: lite-signal shows ~+23 KB retained on KAIROS, which is the
|
|
658
660
|
pre-allocated pool holding the live 1002-node graph in steady state. This is the design:
|
|
659
661
|
the pool IS the working memory. Not a leak.
|
|
660
662
|
|
|
@@ -767,7 +769,7 @@ function dumpOwnerTree(handle, depth = 0) {
|
|
|
767
769
|
- `test/29-scope.test.mjs` (4) -- `createScope` (1.6.0), the adopting counterpart to `createRoot`.
|
|
768
770
|
NOTE: `28-run-with-owner` and `29-scope` collide on the `28-` prefix. Both are live; one should be renumbered to `29-`.
|
|
769
771
|
- `bench/benchmark.mjs` -- anti-DCE throughput harness (ops/s; results.txt).
|
|
770
|
-
- `bench/
|
|
772
|
+
- `bench/mirror.mjs` + `bench/sweep.mjs` -- Andrii's canonical adapter verbatim, cross-framework rows diffing 1:1 against his log; aggregate output `rb.txt` (lite vs alien across 47 shapes, isolated-per-row).
|
|
771
773
|
- `bench/dispose-recycle.mjs` -- 1.2.2 targeted microbench: create/dispose/recreate cycle (the free-list invariant audit target).
|
|
772
774
|
- `bench/torture/` -- crash-detection soaks: `graph-fuzzer`, `scheduler-bench`, `torture-soak`. Exit 0 iff zero errors AND post-teardown pool clean.
|
|
773
775
|
- `bench/run-all.sh` + `bench/aggregate.mjs` -- cold-process-per-engine protocol + per-scenario aggregation.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakkster/lite-signal",
|
|
3
|
-
"version": "1.7.0-alpha.
|
|
3
|
+
"version": "1.7.0-alpha.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",
|