@zakkster/lite-signal 1.6.0-alpha.3 → 1.6.0-beta

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 CHANGED
@@ -4,7 +4,61 @@ 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
- ## [Unreleased]
7
+ ## [1.6.0-beta] -- 2026-07-27
8
+
9
+ Promotes `1.6.0-alpha.0` to the `beta` dist-tag. The engine gains one behavioural
10
+ fix over alpha.0 -- the dangling re-tracking cursor crash below, which touches
11
+ `disposeNode` / `freeLink` -- plus 100% branch coverage and a completed torture
12
+ surface; `createScope`, the `flushPasses` stat, and the op-6 / op-7 mutation-hook
13
+ opcodes are carried forward from alpha.0 unchanged.
14
+
15
+ ### Added -- torture suite completed: `introspect-torture`, and `scope-torture` now runs
16
+
17
+ `bench/torture/run.mjs` now registers **17 scenarios (14 semantic + 3 soak)** --
18
+ the forward-compatible superset through 1.9. Two changes matter on the 1.6.0
19
+ engine specifically. First, **`scope-torture`** -- present but feature-skipped on
20
+ the 1.5.0 line -- now **executes**, since `createScope` exists: it fuzzes the
21
+ adoption contract (computeds/effects adopted, plain signals not; the
22
+ `signals + computeds + effects === activeNodes` invariant), the disposal-crash
23
+ repro and a 300-seed fuzz of it, `runWithOwner` re-attachment into a scope, and
24
+ pool balance over 200 scope rounds on a hard-ceiling registry. Second, a new
25
+ semantic scenario **`introspect-torture`** closes the one 1.6.0 gap the rest of
26
+ the suite left open: the read-only introspection surface
27
+ (`describe` / `nodeId` / `hasObservers` / `isTracking` /
28
+ `forEachObserver` / `forEachSource` / `forEachOwned` / `ownerOf` /
29
+ `observeObservers`) that lite-devtools and lite-studio build on. Because these
30
+ calls cannot corrupt a value, every value/wakeup/work oracle is blind to them --
31
+ so a wrong `hasObservers` or a `forEachSource` that skips a link is a silent
32
+ correctness bug in every tool that trusts it. It pins two load-bearing
33
+ properties: **walk agreement** (the source/observer walk must match the real edge
34
+ set and track dynamic rewiring, cross-checked against both the reference dep set
35
+ and the op-3/op-4 link lane) and **the ABA gen-stamp guard** (a descriptor
36
+ captured before a node is disposed and its slot recycled must resolve to nothing,
37
+ never the new resident -- the only scenario that catches this guard's removal).
38
+
39
+ Every scenario feature-detects and **skips cleanly** below the engine version
40
+ that introduces its feature, so on the 1.6.0 engine the runner executes **11
41
+ semantic** scenarios and reports a clean SKIP for the three later-version ones
42
+ (`flush-torture` 1.7.0, `cleanup-return-torture` 1.8.0, `dispose-torture` 1.9.0).
43
+
44
+ ### Changed -- test file numbering collision fixed
45
+
46
+ The new `createScope` unit file shipped as `test/28-scope.test.mjs`, colliding on
47
+ the `28-` prefix with `test/28-run-with-owner.test.mjs` (getOwner/runWithOwner).
48
+ It is renamed to `test/29-scope.test.mjs`. Both always ran under the
49
+ `test/*.test.mjs` glob; the rename only restores the one-file-per-number
50
+ convention.
51
+
52
+ ### Verified -- full suite green on the 1.6.0 engine (Node 22, `--expose-gc`)
53
+
54
+ - **Torture:** 17/17 -- `torture:semantic` 14/14 (11 executed, 3 clean skips),
55
+ `torture:soak` 3/3 (zero errors, every pool back to its leaf-only floor).
56
+ - **Unit:** 467 tests, 456 pass, 0 fail, 1 skip (the architectural SSR N/A in
57
+ `17-reactivity`). The 1 skip aside, the only non-passes are the 10 in
58
+ `test/25-devtools-real-boot`, the real-rig that requires the sibling
59
+ `@zakkster/lite-devtools`; with that sibling resolvable the suite is 466 pass +
60
+ 1 skip. Up from alpha.0's 447 total -- the delta is the crash-fix regression
61
+ test and the branch-coverage-closure tests below.
8
62
 
9
63
  ### Removed -- `bench-reactive-legacy` (deprecated in 1.5.0)
10
64
 
package/README.md CHANGED
@@ -844,9 +844,61 @@ npm run test:gc
844
844
  npm run bench
845
845
  ```
846
846
 
847
- ### Tier 4 -- Torture soaks (crash detection under chaos)
847
+ ### Tier 4 -- Torture (correctness and resources under chaos)
848
+
849
+ `bench/torture/` holds the complete **17-scenario superset (14 semantic + 3
850
+ soak)** behind one runner (`run.mjs`), the forward-compatible set through 1.9.
851
+ They are not perf benchmarks: the ops/sec figures reflect random workload
852
+ composition, not engine throughput -- `bench/benchmark.mjs` remains the canonical
853
+ perf harness. Every scenario feature-detects and **skips cleanly** below the
854
+ engine version that introduces its feature, so on the 1.6.0 engine the runner
855
+ executes **11 semantic** scenarios and reports a clean SKIP for the three
856
+ later-version ones (`flush-torture` 1.7.0, `cleanup-return-torture` 1.8.0,
857
+ `dispose-torture` 1.9.0).
848
858
 
849
- `bench/torture/` contains three soak harnesses that build large randomised graphs (1,500 / 7,500 / 3,300 nodes) and run mixed fuzz workloads -- leaf writes, batched writes, computed rewires, effect rewires, nested-batch + untrack reads, and microtask-scheduled async flushes -- for 5-10 seconds. These are not perf benchmarks. The numbers they print (ops/sec) reflect random workload composition, not engine throughput; the existing `bench/benchmark.mjs` is the canonical perf harness. What the soaks DO assert, with a non-zero exit code on failure:
859
+ ```bash
860
+ npm run torture # everything
861
+ npm run torture:semantic # correctness only, CI-shaped
862
+ npm run torture:soak # resource soaks only
863
+ node bench/torture/run.mjs --list
864
+ ```
865
+
866
+ #### `semantic` -- deterministic, fast, asserts on **meaning**
867
+
868
+ Run these on every commit. The nine untagged scenarios run on any 1.4.x+ engine;
869
+ `scope-torture` (1.6.0) runs here because `createScope` exists; the three tagged
870
+ `1.7.0+`/`1.8.0+`/`1.9.0+` feature-detect and SKIP on this engine.
871
+
872
+ | scenario | pins |
873
+ | -------- | ---- |
874
+ | `oracle-fuzzer` | every computed against an independent uncached reference evaluator, 400 seeds x 120 ops |
875
+ | `glitch-hunter` | glitch freedom across diamonds, plus exact wakeup counts |
876
+ | `work-accounting` | minimum body-execution counts across 10 fixed topologies |
877
+ | `op-accounting` | structural work counted from the `onGraphMutation` opcode lane (op 1-5), not wall-clock |
878
+ | `introspect-torture` (1.6.0) | the read-only introspection surface (`describe`/`nodeId`/`hasObservers`/`isTracking`/`forEach*`/`ownerOf`/`observeObservers`): walk-agreement against the reference dep set + op-3/op-4 lane, and the ABA gen-stamp guard on re-walkable descriptors -- the substrate lite-devtools/lite-studio trust, invisible to every value oracle |
879
+ | `concurrent-storm` | eight reentrancy and flush-ordering contracts |
880
+ | `scheduler-storm` | deferred execution under 10,000 effects: gen-bound thunk ABA guard, `FLAG_QUEUED` coalescing, a throwing scheduler contained |
881
+ | `box-torture` (1.5.0) | `signalBox`/`computedBox` interop: the oracle differential fuzz with every node realised as **either** a callable or a box |
882
+ | `scope-torture` (1.6.0) | `createScope` adoption contract, the disposal-crash repro + a 300-seed fuzz, `runWithOwner` re-attachment into a scope, pool balance over 200 rounds |
883
+ | `async-torture` | `watch`/`when`/`whenAsync` contracts + a 300-seed projection-guard storm |
884
+ | `capacity-torture` | the fail-closed pool boundary: exact ceilings, re-throw-on-read, `grow` crossing the same boundary |
885
+ | `flush-torture` (1.7.0+) | `flushStrategy` eager/sab/manual convergence + the `.subscribe()` contract -- SKIP on 1.6.0 |
886
+ | `cleanup-return-torture` (1.8.0+) | an effect's returned cleanup: timing, compose order, self-dispose guard -- SKIP on 1.6.0 |
887
+ | `dispose-torture` (1.9.0+) | `Symbol.dispose` / `using` on lifecycle objects -- SKIP on 1.6.0 |
888
+
889
+ Why `introspect-torture` earns its place: it is the only scenario that catches a
890
+ broken introspection walk or a removed ABA gen-stamp guard. Both are read-only,
891
+ so no value/wakeup/work oracle observes them -- yet a `forEachSource` that skips a
892
+ link, or a descriptor that resolves to a recycled slot's new resident, is a
893
+ silent data-corruption bug in every tool built on the surface.
894
+
895
+ #### `soak` -- wall-clock bound, asserts on **resources**
896
+
897
+ Three soak harnesses build large randomised graphs (1,500 / 7,500 / 3,300 nodes)
898
+ and run mixed fuzz workloads -- leaf writes, batched writes, computed rewires,
899
+ effect rewires, nested-batch + untrack reads, and microtask-scheduled async
900
+ flushes -- for 5-10 seconds. What they assert, with a non-zero exit code on
901
+ failure:
850
902
 
851
903
  - zero thrown exceptions during the run, and
852
904
  - after teardown, `activeNodes` / `activeLinks` return to the leaf-only baseline (the dispose path is sound under sustained churn).
package/Signal.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @zakkster/lite-signal v1.6.0
2
+ * @zakkster/lite-signal v1.6.0-beta
3
3
  * --------------------
4
4
  * Hybrid Doubly-Linked-List Reactive Graph Engine -- decoupled (Signal1_3) base
5
5
  * with the two 1.1.3 performance fixes ported in:
package/llms.txt CHANGED
@@ -54,8 +54,34 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
54
54
 
55
55
  ## Version notes
56
56
 
57
- - **1.6.0-alpha.0** (current): the **observability-and-lifecycle minor**, shipping
58
- on the `alpha` dist-tag while it settles. **Three** additions:
57
+ - **1.6.0-beta** (current): promotes `1.6.0-alpha.0` to the `beta` dist-tag. One
58
+ behavioural fix over alpha.0 -- the dangling re-tracking cursor crash
59
+ (disposing a signal/computed from inside an observer that linked it last run but
60
+ has not re-read it this run; a one-line cursor repair in `disposeNode`, O(1),
61
+ disposal path only) -- plus branch coverage on `Signal.js` closed to **100%**
62
+ and a **completed torture surface**. The alpha.0 API (`createScope`,
63
+ `flushPasses`, the op-6 / op-7 mutation-hook opcodes) is carried forward
64
+ unchanged. The torture runner now registers the full **17-scenario superset
65
+ (14 semantic + 3 soak)**: `scope-torture` -- feature-skipped on 1.5.0 -- now
66
+ **executes** on this engine (`createScope` exists), and a new semantic scenario
67
+ **`introspect-torture`** closes the read-only introspection surface (`describe`,
68
+ `nodeId`, `hasObservers`, `isTracking`, `forEachObserver` / `forEachSource` /
69
+ `forEachOwned`, `ownerOf`, `observeObservers`) that no value/wakeup/work oracle
70
+ can see -- pinning walk-agreement (against the reference dep set + the op-3/op-4
71
+ link lane) and the ABA gen-stamp guard (a descriptor captured before
72
+ dispose+recycle must resolve to nothing, never the new resident). Every
73
+ scenario feature-detects, so on 1.6.0 the runner executes **11 semantic** and
74
+ cleanly SKIPS three later-version ones (`flush` 1.7.0, `cleanup-return` 1.8.0,
75
+ `dispose` 1.9.0). The `28-scope` unit file is renamed to `29-scope` (it
76
+ collided on the `28-` prefix with `28-run-with-owner`). Verified green on the
77
+ 1.6.0 engine: torture 17/17 (semantic 14/14 = 11 run + 3 skip; soak 3/3, pools
78
+ back to their leaf-only floor); unit **467 tests, 456 pass, 0 fail, 1 skip**
79
+ (the SSR N/A in `17-reactivity`) -- 466 pass with the sibling
80
+ `@zakkster/lite-devtools` present, which the 10-test `test/25` real-boot rig
81
+ needs. Drop-in over 1.6.0-alpha.0.
82
+
83
+ - **1.6.0-alpha.0**: the **observability-and-lifecycle minor**, shipped
84
+ on the `alpha` dist-tag while it settled. **Three** additions:
59
85
 
60
86
  **1) `stats()` gains a twelfth key, `flushPasses`** -- advances once per
61
87
  effect-flush drain pass. **2) Two new `onGraphMutation` opcodes for flush
@@ -786,7 +812,7 @@ function dumpOwnerTree(handle, depth = 0) {
786
812
  - `bench/aggregate.mjs` + `bench/report.mjs` -- microscope + mirror aggregators writing `r.txt` / `rb.txt` with `#STAMP` headers (engine + harness sha256, live registry config, host, node).
787
813
  - `bench/AndriiVolynetsReactiveBenchScore/AndriiVolynetsReactiveBench.log` -- Andrii's own 15-framework x 47-test log, checked in for audit; the ranking source of truth.
788
814
  - `bench/dispose-recycle.mjs` -- 1.2.2 targeted microbench: create/dispose/recreate cycle (the free-list invariant audit target).
789
- - `bench/torture/` -- crash-detection soaks: `graph-fuzzer`, `scheduler-bench`, `torture-soak`. Exit 0 iff zero errors AND post-teardown pool clean.
815
+ - `bench/torture/` -- the complete **17-scenario superset (14 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, so the whole set is safe on the 1.6.0 engine and stays green from 1.4.x forward. `semantic` (deterministic, fast, asserts on MEANING; CI on every commit) -- the **11 that execute on 1.6.0**: `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), `op-accounting` (structural work from the `onGraphMutation` opcode lane, not wall-clock), `introspect-torture` (1.6.0: the read-only introspection surface -- `describe`/`nodeId`/`hasObservers`/`isTracking`/`forEachObserver`/`forEachSource`/`forEachOwned`/`ownerOf`/`observeObservers` -- pinning walk-agreement against the reference dep set + op-3/op-4 lane, and the ABA gen-stamp guard on re-walkable descriptors), `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), `scope-torture` (1.6.0: `createScope` adoption contract + the disposal-crash repro and its 300-seed fuzz + `runWithOwner` re-attachment into a scope + pool balance over 200 rounds), `async-torture` (watch / when / whenAsync contracts + a 300-seed projection-guard storm), `capacity-torture` (the fail-closed pool boundary); plus **3 that skip cleanly** as later-version features: `flush-torture` (1.7.0 `flushStrategy`), `cleanup-return-torture` (1.8.0 effect-return cleanup), `dispose-torture` (1.9.0 `Symbol.dispose`). `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`.
790
816
  - `bench/run-all-bench.sh` -- cold-process-per-engine driver (`FW=<engine>` per child), fed to `aggregate.mjs` for medianing.
791
817
  - `harness/run.mjs` -- dispatcher for the run-on-demand probes (field, dispose, churn, owner, creation, all).
792
818
  - `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.6.0-alpha.3",
3
+ "version": "1.6.0-beta",
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",
@@ -47,7 +47,10 @@
47
47
  "profile:burst": "node --expose-gc harness/burst-dag.mjs ./Signal.js",
48
48
  "profile:pull": "node --expose-gc harness/pull-stress.mjs",
49
49
  "verify": "npm test && npm run test:zgc && npm run bench",
50
- "gate": "node harness/VersionMatrix/pre-publish.mjs"
50
+ "gate": "node harness/VersionMatrix/pre-publish.mjs",
51
+ "torture": "node bench/torture/run.mjs",
52
+ "torture:semantic": "node bench/torture/run.mjs --group semantic",
53
+ "torture:soak": "node bench/torture/run.mjs --group soak"
51
54
  },
52
55
  "keywords": [
53
56
  "signal",