@zakkster/lite-signal 1.5.0-beta.7 → 1.5.0-beta.8
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 +49 -1
- package/README.md +77 -11
- package/Signal.js +1 -1
- package/llms.txt +18 -2
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,55 @@ 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
|
-
## [
|
|
7
|
+
## [1.5.0-beta.8] -- 2026-07-22
|
|
8
|
+
|
|
9
|
+
### Added -- `box-torture`, and the torture suite reaches the box surface
|
|
10
|
+
|
|
11
|
+
The 1.4.1 torture reorganization -- one runner (`bench/torture/run.mjs`), the
|
|
12
|
+
`semantic` / `soak` split, the shared `helpers/`, and the five semantic
|
|
13
|
+
scenarios -- is the floor this release builds on. 1.5.0 adds a sixth semantic
|
|
14
|
+
scenario, `box-torture`, targeting the new `signalBox` / `computedBox` surface.
|
|
15
|
+
|
|
16
|
+
The boxes are documented as the same `ReactiveNode` and the same zero-GC
|
|
17
|
+
read/write path as the callable forms, with full interop in one graph. That is
|
|
18
|
+
precisely the kind of claim that rots silently: a divergence between the two
|
|
19
|
+
representations produces correct-looking behaviour in any test that exercises
|
|
20
|
+
only one of them. So `box-torture` does not lead with box-specific unit
|
|
21
|
+
assertions. Its centrepiece is the same differential fuzz `oracle-fuzzer` runs --
|
|
22
|
+
a random DAG checked against an independent uncached reference evaluator -- with
|
|
23
|
+
**every node independently realised as either a callable or a box**. The
|
|
24
|
+
reference does not know which is which. If the two representations ever disagree
|
|
25
|
+
on a value, on equality, or on dynamic dependency tracking, a mixed graph is
|
|
26
|
+
where it surfaces and a single-representation suite never would. The remainder
|
|
27
|
+
pins the surface the callables do not have (`subscribe` immediate-fire /
|
|
28
|
+
untracked-callback / idempotent-disposer, `update`) and the allocation-light
|
|
29
|
+
representation itself (zero own enumerable data beyond the two internal handle
|
|
30
|
+
slots, a stable shared prototype, never `setPrototypeOf`) -- the last being a
|
|
31
|
+
design law, not an implementation detail.
|
|
32
|
+
|
|
33
|
+
Mutation-verified, and the mixed-graph dimension is not decorative:
|
|
34
|
+
|
|
35
|
+
| mutant | caught by | missed by |
|
|
36
|
+
| ------ | --------- | --------- |
|
|
37
|
+
| `boxGet` skips dependency tracking | box-torture (299/300 seeds) + unit `24-signalbox` | -- |
|
|
38
|
+
| `computedBox` default equality `Object.is` -> `===` | **box-torture only** (33/300 seeds) | unit `24-signalbox` (12/12 pass), callable-only `oracle-fuzzer` (400/400 pass) |
|
|
39
|
+
|
|
40
|
+
The second row is the reason the scenario exists. A `computedBox` that silently
|
|
41
|
+
downgrades its default equality is invisible to the box unit suite and to the
|
|
42
|
+
callable fuzzer; only a graph that mixes both representations and fuzzes the
|
|
43
|
+
`-0` / `NaN` value boundary at a box-computed node position catches it.
|
|
44
|
+
|
|
45
|
+
`24-signalbox` moves from `{skip:true}` (its state on the 1.4.x line, where the
|
|
46
|
+
API did not exist) to fully live. The unit count rises to **453 passing** (1
|
|
47
|
+
skip, the architectural SSR N/A in `17-reactivity`), up from 405 on 1.4.1.
|
|
48
|
+
|
|
49
|
+
### Changed -- torture sources are ASCII (again)
|
|
50
|
+
|
|
51
|
+
`bench/torture/box-torture.mjs` shipped with em dashes and box-drawing
|
|
52
|
+
characters, and `helpers/index.mjs` had regained them. `Signal.js` is pure ASCII
|
|
53
|
+
and the ecosystem source rule permits only the sanctioned multiplication and
|
|
54
|
+
micro signs, so both were normalised (`--`, `<=`, `-`). The published surface is
|
|
55
|
+
unaffected either way -- `files[]` excludes `bench/`.
|
|
8
56
|
|
|
9
57
|
### Changed -- benchmark harness rewritten (bench protocol v3, breaking)
|
|
10
58
|
|
package/README.md
CHANGED
|
@@ -759,7 +759,7 @@ npm run bench
|
|
|
759
759
|
|
|
760
760
|
## Testing strategy
|
|
761
761
|
|
|
762
|
-
|
|
762
|
+
Four tiers, all reproducible.
|
|
763
763
|
|
|
764
764
|
### Tier 1 -- Behavior (unit tests, fast)
|
|
765
765
|
|
|
@@ -820,12 +820,69 @@ npm run test:gc
|
|
|
820
820
|
npm run bench
|
|
821
821
|
```
|
|
822
822
|
|
|
823
|
-
### Tier 4 -- Torture
|
|
823
|
+
### Tier 4 -- Torture (correctness and resources under chaos)
|
|
824
824
|
|
|
825
|
-
`bench/torture/`
|
|
825
|
+
`bench/torture/` holds nine scenarios in two groups, behind one runner. They are
|
|
826
|
+
not perf benchmarks: the ops/sec figures reflect random workload composition, not
|
|
827
|
+
engine throughput -- `bench/benchmark.mjs` remains the canonical perf harness.
|
|
826
828
|
|
|
827
|
-
|
|
828
|
-
|
|
829
|
+
```bash
|
|
830
|
+
npm run torture # everything
|
|
831
|
+
npm run torture:semantic # correctness only, ~10s, CI-shaped
|
|
832
|
+
npm run torture:soak # resource soaks only
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
```bash
|
|
836
|
+
node bench/torture/run.mjs --list
|
|
837
|
+
node bench/torture/run.mjs --seconds 30 --bail
|
|
838
|
+
node bench/torture/run.mjs oracle box # substring match on names
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
The runner spawns each scenario as a **child process** rather than importing it.
|
|
842
|
+
Several assert on global pool accounting and on the default registry, so running
|
|
843
|
+
two in one process would let the first one's residue poison the second's
|
|
844
|
+
baseline. `--expose-gc` is passed unconditionally -- some scenarios force
|
|
845
|
+
collection to settle finalizers, and without it they would silently degrade to
|
|
846
|
+
asserting nothing.
|
|
847
|
+
|
|
848
|
+
#### `semantic` -- deterministic, fast, asserts on **meaning**
|
|
849
|
+
|
|
850
|
+
Run these on every commit. They pin values, wakeups, work and ordering.
|
|
851
|
+
|
|
852
|
+
| scenario | pins |
|
|
853
|
+
| -------- | ---- |
|
|
854
|
+
| `oracle-fuzzer` | every computed against an independent uncached reference evaluator, over 400 seeds x 120 ops |
|
|
855
|
+
| `glitch-hunter` | glitch freedom across diamonds, plus exact wakeup counts |
|
|
856
|
+
| `work-accounting` | minimum body-execution counts across 10 fixed topologies -- no missing recompute, no surplus one |
|
|
857
|
+
| `concurrent-storm` | eight reentrancy and flush-ordering contracts: self-write, `CycleError` on mutual loops, nested-batch boundaries, cascade ordering, cleanup writes, dispose-mid-flush, self-disposal, async interleaving |
|
|
858
|
+
| `scheduler-storm` | deferred execution under 10,000 effects: the gen-bound thunk's ABA guard, `FLAG_QUEUED` coalescing, a throwing scheduler not taking the pass down |
|
|
859
|
+
| `box-torture` (1.5.0) | `signalBox` / `computedBox` interop: the oracle differential fuzz with every node realised as **either** a callable or a box, plus the box-only surface (`subscribe`, `update`) and the allocation-light representation contract |
|
|
860
|
+
|
|
861
|
+
Why this group exists: the resource soaks below pass green on an engine whose
|
|
862
|
+
computeds return stale values. Flipping the clean short-circuit in `pullComputed`
|
|
863
|
+
from `<= 0` to `<= 1` keeps the pool perfectly balanced and throws nothing --
|
|
864
|
+
`oracle-fuzzer` catches it on 400/400 seeds, and all three soaks report PASS.
|
|
865
|
+
Separately, removing the `node.gen === gen` guard from the cached scheduler thunk
|
|
866
|
+
is caught by `scheduler-storm` and **missed by all 453 unit tests**. And a
|
|
867
|
+
`computedBox` that silently downgrades its default equality from `Object.is` to
|
|
868
|
+
`===` is caught by `box-torture` alone -- the box unit suite and the
|
|
869
|
+
callable-only oracle both pass it, because only a graph mixing both
|
|
870
|
+
representations exercises the divergence.
|
|
871
|
+
|
|
872
|
+
Where no contract is documented, these files pin the *observed* behaviour and say
|
|
873
|
+
so at the scenario, rather than asserting an invented one.
|
|
874
|
+
|
|
875
|
+
#### `soak` -- wall-clock bound, asserts on **resources**
|
|
876
|
+
|
|
877
|
+
Run these nightly or pre-publish. Large randomised graphs (1,500 / 7,500 / 3,300
|
|
878
|
+
nodes) under mixed fuzz -- leaf writes, batched writes, computed and effect
|
|
879
|
+
rewires, nested-batch and untrack reads, microtask-scheduled async flushes. Each
|
|
880
|
+
exits non-zero unless:
|
|
881
|
+
|
|
882
|
+
- zero exceptions were thrown during the run,
|
|
883
|
+
- after teardown `activeNodes` is at or below its leaf-only floor and
|
|
884
|
+
`activeLinks` is exactly `0`, and
|
|
885
|
+
- the JIT sink advanced -- proving the accumulator loops were not optimised away.
|
|
829
886
|
|
|
830
887
|
```bash
|
|
831
888
|
node --expose-gc bench/torture/graph-fuzzer.mjs # 10s random-DAG fuzz, 1500 nodes
|
|
@@ -833,13 +890,19 @@ node --expose-gc bench/torture/torture-soak.mjs # 5s high-volume churn, 750
|
|
|
833
890
|
node --expose-gc bench/torture/scheduler-bench.mjs # 10s microtask-scheduled, 3300 nodes
|
|
834
891
|
```
|
|
835
892
|
|
|
836
|
-
|
|
893
|
+
Any of them takes `TORTURE_SECONDS=N` for a longer soak (the runner's `--seconds`
|
|
894
|
+
sets it for all three). Indicative numbers from a development host:
|
|
895
|
+
|
|
896
|
+
| | duration | ops | errors | post-teardown nodes / links | floor |
|
|
897
|
+
| --------------------- | --------:| --------:| ------:| --------------------------- | -------- |
|
|
898
|
+
| graph-fuzzer | 10 s | 7.6 M | 0 | 500 / 0 | <= 508 |
|
|
899
|
+
| torture-soak | 5 s | 1.2 M | 0 | 2500 / 0 | <= 2508 |
|
|
900
|
+
| scheduler-bench | 10 s | 28.8 M | 0 | 1000 / 0 | <= 1008 |
|
|
837
901
|
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
| scheduler-bench | 10 s | 28.8 M | 0 | 1000 / 0 |
|
|
902
|
+
The floor is the assertion; the pre-soak figure is not. Teardown disposes the
|
|
903
|
+
computeds and effects and leaves the signals alive, so post-teardown is *supposed*
|
|
904
|
+
to sit far below the pre-soak node count. Each soak prints the floor it asserted
|
|
905
|
+
against so the verdict can be checked against the numbers.
|
|
843
906
|
|
|
844
907
|
```bash
|
|
845
908
|
npm run verify # test + test:gc + a sanity bench
|
|
@@ -1254,6 +1317,9 @@ Yes, if your computeFn reads its deps in the same order each invocation. The `cu
|
|
|
1254
1317
|
npm test # behavior suite, ~1.3s
|
|
1255
1318
|
npm run test:gc # zero-gc suite, requires --expose-gc, ~3s
|
|
1256
1319
|
npm run bench # microscope + mirror comparative benches (rb.txt / r.txt), ~5min
|
|
1320
|
+
npm run torture # full torture suite, all 9 scenarios (6 semantic + 3 soak)
|
|
1321
|
+
npm run torture:semantic # correctness scenarios only, ~10s
|
|
1322
|
+
npm run torture:soak # resource soaks only, wall-clock bound
|
|
1257
1323
|
node --expose-gc bench/benchmarkReactive.mjs # DEPRECATED pre-v3 reactivity suite (removed after 1.5.1)
|
|
1258
1324
|
npm run harness:field # verify + cold-child A/B bench (fieldkit)
|
|
1259
1325
|
npm run harness:all # field + dispose + churn probes, in sequence
|
package/Signal.js
CHANGED
package/llms.txt
CHANGED
|
@@ -53,7 +53,22 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
53
53
|
|
|
54
54
|
## Version notes
|
|
55
55
|
|
|
56
|
-
- **1.5.0-beta.
|
|
56
|
+
- **1.5.0-beta.8** (current): the **torture-surface bump**. No engine change --
|
|
57
|
+
the only edit to `Signal.js` is the version string in its banner. The torture
|
|
58
|
+
suite (one runner `bench/torture/run.mjs`, `semantic` / `soak` groups, shared
|
|
59
|
+
`helpers/`) gains a sixth semantic scenario, **`box-torture`**, for the
|
|
60
|
+
`signalBox` / `computedBox` surface. It runs the same differential fuzz as
|
|
61
|
+
`oracle-fuzzer` but realises every node in the random DAG as EITHER a callable
|
|
62
|
+
or a box, checked against an independent uncached reference that does not know
|
|
63
|
+
which is which -- the only test that exercises box<->callable divergence in a
|
|
64
|
+
mixed graph. Mutation-verified: a `computedBox` whose default equality silently
|
|
65
|
+
downgrades from `Object.is` to `===` is caught by `box-torture` alone (33/300
|
|
66
|
+
seeds); the box unit suite (`24-signalbox`, now fully live, 12/12) and the
|
|
67
|
+
callable-only `oracle-fuzzer` (400/400) both pass it. Unit total is now **453
|
|
68
|
+
pass, 1 skip** (the SSR N/A in `17-reactivity`), up from 405 on 1.4.1. Nothing
|
|
69
|
+
here ships: `files[]` excludes `bench/`. Drop-in over 1.5.0-beta.2.
|
|
70
|
+
|
|
71
|
+
- **1.5.0-beta.2**: the re-attach companion to `createRoot`.
|
|
57
72
|
**`getOwner()`** and **`runWithOwner(ownerHandle, fn)`** land as registry
|
|
58
73
|
methods + top-level bindings. **No engine change** from 1.5.0-beta.1 -- the
|
|
59
74
|
hot-path function bodies (`pullComputed`, `markDownstream`, `executeEffect`,
|
|
@@ -723,7 +738,8 @@ function dumpOwnerTree(handle, depth = 0) {
|
|
|
723
738
|
- `bench/benchmark.mjs` -- anti-DCE throughput harness (ops/s; results.txt).
|
|
724
739
|
- `bench/benchmarkReactive.mjs` -- cross-framework reactivity suite vs alien-signals, preact, vue-reactivity, solid (resultsReactive.txt).
|
|
725
740
|
- `bench/dispose-recycle.mjs` -- 1.2.2 targeted microbench: create/dispose/recreate cycle (the free-list invariant audit target).
|
|
726
|
-
- `bench/torture/` --
|
|
741
|
+
- `bench/torture/` -- nine scenarios behind one runner (`run.mjs`), two groups. `semantic` (deterministic, fast, asserts on MEANING; CI on every commit): `oracle-fuzzer` (every computed vs an independent uncached reference, 400 seeds x 120 ops), `glitch-hunter` (glitch freedom + exact wakeups), `work-accounting` (minimum body-execution counts over 10 topologies), `concurrent-storm` (8 reentrancy / flush-ordering contracts), `scheduler-storm` (gen-bound thunk ABA guard, FLAG_QUEUED coalescing, throwing-scheduler containment), `box-torture` (1.5.0: signalBox/computedBox interop -- the oracle differential fuzz with every node realised as callable OR box, plus box-only subscribe/update and the allocation-light representation contract). `soak` (wall-clock bound, asserts on RESOURCES; 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. Runner spawns each scenario as a child process (several assert on global pool accounting) and passes `--expose-gc` unconditionally. Scripts: `npm run torture`, `torture:semantic`, `torture:soak`.
|
|
742
|
+
- `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 carrying 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.
|
|
727
743
|
- `bench/run-all.sh` + `bench/aggregate.mjs` -- cold-process-per-engine protocol + per-scenario aggregation.
|
|
728
744
|
- `harness/run.mjs` -- dispatcher for the run-on-demand probes (field, dispose, churn, owner, creation, all).
|
|
729
745
|
- `harness/fieldkit.mjs` -- single-file portable verify + cold-child A/B bench across six shapes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakkster/lite-signal",
|
|
3
|
-
"version": "1.5.0-beta.
|
|
3
|
+
"version": "1.5.0-beta.8",
|
|
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",
|
|
@@ -44,7 +44,10 @@
|
|
|
44
44
|
"harness:creation": "node harness/run.mjs creation",
|
|
45
45
|
"harness:all": "node harness/run.mjs all",
|
|
46
46
|
"verify": "npm test && npm run bench",
|
|
47
|
-
"gate": "node harness/VersionMatrix/pre-publish.mjs"
|
|
47
|
+
"gate": "node harness/VersionMatrix/pre-publish.mjs",
|
|
48
|
+
"torture": "node bench/torture/run.mjs",
|
|
49
|
+
"torture:semantic": "node bench/torture/run.mjs --group semantic",
|
|
50
|
+
"torture:soak": "node bench/torture/run.mjs --group soak"
|
|
48
51
|
},
|
|
49
52
|
"keywords": [
|
|
50
53
|
"signal",
|
|
@@ -85,8 +88,8 @@
|
|
|
85
88
|
"@zakkster/lite-profiler": "^1.1.0",
|
|
86
89
|
"@zakkster/lite-profiler-signal": "^1.2.0",
|
|
87
90
|
"@zakkster/lite-signal": "^1.3.0 || >=1.4.0-beta.0 || >=1.6.0-preview.0",
|
|
88
|
-
"
|
|
89
|
-
"
|
|
91
|
+
"c8": "^11.0.0",
|
|
92
|
+
"coveralls-next": "^6.0.2"
|
|
90
93
|
},
|
|
91
94
|
"overrides": {
|
|
92
95
|
"@zakkster/lite-time": {
|