@zakkster/lite-signal 1.6.0-beta → 1.6.0-beta-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 CHANGED
@@ -14,9 +14,12 @@ opcodes are carried forward from alpha.0 unchanged.
14
14
 
15
15
  ### Added -- torture suite completed: `introspect-torture`, and `scope-torture` now runs
16
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
17
+ `bench/torture/run.mjs` now registers **22 scenarios (19 semantic + 3 soak)** --
18
+ full parity with the shipped 1.4.4 sibling, the forward-compatible superset
19
+ through 1.9. This is a **verification-only** parity pass: the engine
20
+ (`Signal.js` / `Signal.d.ts`) is **UNCHANGED** -- byte-identical shasum before
21
+ and after. Two changes matter on the 1.6.0 engine
22
+ specifically. First, **`scope-torture`** -- present but feature-skipped on
20
23
  the 1.5.0 line -- now **executes**, since `createScope` exists: it fuzzes the
21
24
  adoption contract (computeds/effects adopted, plain signals not; the
22
25
  `signals + computeds + effects === activeNodes` invariant), the disposal-crash
@@ -36,8 +39,27 @@ and the op-3/op-4 link lane) and **the ABA gen-stamp guard** (a descriptor
36
39
  captured before a node is disposed and its slot recycled must resolve to nothing,
37
40
  never the new resident -- the only scenario that catches this guard's removal).
38
41
 
42
+ Beyond `scope-torture` and `introspect-torture`, five further scenarios are
43
+ ported from the 1.4.4 sibling to close the parity gap: **`lifecycle-torture`**
44
+ (createRoot detachment + destroy registry reset), **`owner-torture`** (getOwner /
45
+ runWithOwner capture-restore, live-adoption cascade, and stale-handle ABA
46
+ degradation to rooted), **`error-torture`** (throwing effect bodies: per-effect
47
+ buffering, single re-throw vs `AggregateError`, and a 4096-cycle buffer drain),
48
+ **`deep-chain-torture`** (pullComputed recursion fail-closed with a `RangeError`
49
+ vs the iterative push path), and **`zerogc-torture`** (the zero-GC hot path made
50
+ falsifiable via `measureAllocs` / `measureOps` + `stats()` counters, with a
51
+ `ZEROGC_BREAK` self-test). Because 1.6.0 ships `createScope` / `getOwner` /
52
+ `runWithOwner` / `createRoot` **natively**, the owner/scope/createRoot scenarios
53
+ that SKIPPED on 1.4.4 (which lacks `createScope`) **run natively here** and passed
54
+ exactly as written -- no assertion needed pinning to a divergent behaviour; the
55
+ `churn-box` lane in `zerogc-torture` activates because `signalBox` exists. The
56
+ three soaks (`graph-fuzzer`, `scheduler-bench`, `torture-soak`) gain a
57
+ value-correctness oracle: a preallocated `Int32Array` shadow of every signal,
58
+ checked over a rotating window per tick and swept in full at teardown, alongside
59
+ the existing liveness assertions and the module-scoped int32 JIT sink.
60
+
39
61
  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
62
+ that introduces its feature, so on the 1.6.0 engine the runner executes **16
41
63
  semantic** scenarios and reports a clean SKIP for the three later-version ones
42
64
  (`flush-torture` 1.7.0, `cleanup-return-torture` 1.8.0, `dispose-torture` 1.9.0).
43
65
 
@@ -49,16 +71,25 @@ It is renamed to `test/29-scope.test.mjs`. Both always ran under the
49
71
  `test/*.test.mjs` glob; the rename only restores the one-file-per-number
50
72
  convention.
51
73
 
74
+ A new unit file **`test/30-throwing-equals.test.mjs`** (numbered 30 -- 28 is
75
+ still occupied by both `28-run-with-owner` and the renamed history, and 29 is
76
+ taken) pins the behaviour of a user `equals` predicate that throws. It covers all
77
+ five physical `eq()` sites: the three callable sites (signal set pre-check
78
+ :1105, batch-revert check :1112, computed re-eval :986) with a contrast
79
+ anti-tautology test, plus the two `signalBox` boxSet sites (pre-check :1210,
80
+ revert :1217) -- confirmed to behave identically to the callable path.
81
+
52
82
  ### Verified -- full suite green on the 1.6.0 engine (Node 22, `--expose-gc`)
53
83
 
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.
84
+ - **Torture:** 22/22 -- `torture:semantic` 19/19 (16 executed, 3 clean skips),
85
+ `torture:soak` 3/3 (zero errors, value oracle clean, every pool back to its
86
+ leaf-only floor).
87
+ - **Unit:** 472 tests, 471 pass, 0 fail, 1 skip (the architectural SSR N/A in
88
+ `17-reactivity`), measured with the sibling `@zakkster/lite-devtools` resolvable
89
+ so the 10-test `test/25-devtools-real-boot` real-rig runs. The +9 over the
90
+ previous cut is the new `test/30-throwing-equals.test.mjs` (throwing-`equals`
91
+ site audit). Without the devtools sibling the 10 real-boot tests do not pass;
92
+ that rig is the only sibling-dependent surface.
62
93
 
63
94
  ### Removed -- `bench-reactive-legacy` (deprecated in 1.5.0)
64
95
 
package/README.md CHANGED
@@ -816,6 +816,7 @@ Three tiers, all reproducible.
816
816
  - **`27-create-root.test.mjs`** -- `createRoot` (1.5.0), the ownership escape hatch. A watcher spawned inside a consumer effect via `createRoot` survives the consumer's re-run (the exact `lite-query` lazy-watcher pattern); the contrast case confirms an *unwrapped* spawn is cascade-disposed; `createRoot` returns `fn`'s value, detaches tracking in `fn`'s direct body while inner effect bodies still track, and composes with box handles.
817
817
  - **`25-devtools-real-boot.test.mjs`** -- Devtools/Studio contract (10 tests). Boots the actual `Devtools.js` against the 1.5.0 engine and exercises all 19 Devtools exports plus the 10 symbols Studio imports from Devtools. Pins the ghost contract: heavy introspection (graph walk, owner-tree, observer descriptors) adds **zero** nodes to the live graph. Catches the real-rig failure mode where importing the package by its own name from a repo whose `package.json` declares `name: "@zakkster/lite-signal"` resolves to the published build instead of the local engine.
818
818
  - **`26-free-list-invariant.test.mjs`** -- the 1.2.2 audit's cleanliness pins (3 invariant tests + 1 targeted coverage test). Asserts directly -- by inspecting freshly-allocated nodes through the documented `describe()` -> `NODE_PTR` introspection protocol -- that the `ReactiveNode` constructor and the fresh-pool-growth path initialize the ten fields the audit removed from `createNode` to identical values, so the deleted writes were defending against a state the engine cannot produce on a clean free list. The 4th test covers the swallow-on-self-dispose-then-throw branch in `pullComputed` (the path that lifted branch coverage from 98.07% to 98.43%).
819
+ - **`30-throwing-equals.test.mjs`** -- a user `equals` predicate that throws, pinned at all five physical `eq()` sites (9 tests). The three callable sites -- signal set pre-check, batch-revert check, computed re-eval -- with a contrast anti-tautology test proving the pinned batch-revert behaviour is caused by the throw and not the set-then-back shape; plus the two `signalBox` boxSet sites (pre-check + revert), confirmed to behave identically to the callable path. Pins that a throwing pre-check leaves the value unmutated and fires no downstream, and that a throwing batch-revert propagates the net value with the version bump stranded.
819
820
 
820
821
  ```bash
821
822
  npm test
@@ -846,13 +847,17 @@ npm run bench
846
847
 
847
848
  ### Tier 4 -- Torture (correctness and resources under chaos)
848
849
 
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
850
+ `bench/torture/` holds the complete **22-scenario superset (19 semantic + 3
851
+ soak)** behind one runner (`run.mjs`), the forward-compatible set through 1.9 --
852
+ full parity with the shipped 1.4.4 sibling (verification-only; the engine is
853
+ unchanged). They are not perf benchmarks: the ops/sec figures reflect random
854
+ workload composition, not engine throughput -- `bench/benchmark.mjs` remains the
855
+ canonical perf harness. Every scenario feature-detects and **skips cleanly** below
856
+ the engine version that introduces its feature, so on the 1.6.0 engine the runner
857
+ executes **16 semantic** scenarios (including `lifecycle-torture`, `owner-torture`,
858
+ `error-torture`, `deep-chain-torture`, and `zerogc-torture` -- the owner/scope/
859
+ createRoot scenarios run natively here because 1.6.0 ships `createScope` /
860
+ `getOwner` / `runWithOwner` / `createRoot`) and reports a clean SKIP for the three
856
861
  later-version ones (`flush-torture` 1.7.0, `cleanup-return-torture` 1.8.0,
857
862
  `dispose-torture` 1.9.0).
858
863
 
package/llms.txt CHANGED
@@ -61,21 +61,35 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
61
61
  disposal path only) -- plus branch coverage on `Signal.js` closed to **100%**
62
62
  and a **completed torture surface**. The alpha.0 API (`createScope`,
63
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
64
+ unchanged. The torture runner now registers the full **22-scenario superset
65
+ (19 semantic + 3 soak)** -- full parity with the shipped 1.4.4 sibling. This is
66
+ a verification-only parity pass: the engine (`Signal.js` / `Signal.d.ts`) is
67
+ UNCHANGED. `scope-torture` -- feature-skipped on 1.5.0 -- now **executes** on
68
+ this engine (`createScope` exists), and a new semantic scenario
67
69
  **`introspect-torture`** closes the read-only introspection surface (`describe`,
68
70
  `nodeId`, `hasObservers`, `isTracking`, `forEachObserver` / `forEachSource` /
69
71
  `forEachOwned`, `ownerOf`, `observeObservers`) that no value/wakeup/work oracle
70
72
  can see -- pinning walk-agreement (against the reference dep set + the op-3/op-4
71
73
  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
+ dispose+recycle must resolve to nothing, never the new resident). Five more
75
+ scenarios are ported to full parity: **`lifecycle-torture`** (createRoot
76
+ detachment + destroy registry reset), **`owner-torture`** (getOwner /
77
+ runWithOwner capture-restore + ABA degradation), **`error-torture`**
78
+ (throwing effect bodies: per-effect buffering, AggregateError, buffer drain),
79
+ **`deep-chain-torture`** (pullComputed recursion fail-closed vs iterative push
80
+ path), and **`zerogc-torture`** (zero-GC hot path via measureAllocs / measureOps
81
+ + `stats()` counters; ZEROGC_BREAK self-test). Because 1.6.0 ships createScope /
82
+ getOwner / runWithOwner / createRoot natively, the owner/scope/createRoot
83
+ scenarios that SKIPPED on 1.4.4 **run natively here** and passed as written --
84
+ no assertion needed pinning to a divergent behaviour. Every later-version
85
+ scenario feature-detects, so on 1.6.0 the runner executes **16 semantic** and
74
86
  cleanly SKIPS three later-version ones (`flush` 1.7.0, `cleanup-return` 1.8.0,
75
87
  `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**
88
+ collided on the `28-` prefix with `28-run-with-owner`), and a new
89
+ `30-throwing-equals` unit file pins a user `equals` that throws at all five
90
+ physical eq() sites (three callable + the two signalBox boxSet sites). Verified
91
+ green on the 1.6.0 engine: torture 22/22 (semantic 19/19 = 16 run + 3 skip;
92
+ soak 3/3, pools back to their leaf-only floor); unit **472 tests, 471 pass, 0 fail, 1 skip**
79
93
  (the SSR N/A in `17-reactivity`) -- 466 pass with the sibling
80
94
  `@zakkster/lite-devtools` present, which the 10-test `test/25` real-boot rig
81
95
  needs. Drop-in over 1.6.0-alpha.0.
@@ -812,7 +826,7 @@ function dumpOwnerTree(handle, depth = 0) {
812
826
  - `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).
813
827
  - `bench/AndriiVolynetsReactiveBenchScore/AndriiVolynetsReactiveBench.log` -- Andrii's own 15-framework x 47-test log, checked in for audit; the ranking source of truth.
814
828
  - `bench/dispose-recycle.mjs` -- 1.2.2 targeted microbench: create/dispose/recreate cycle (the free-list invariant audit target).
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`.
829
+ - `bench/torture/` -- the complete **22-scenario superset (19 semantic + 3 soak)** behind one runner (`run.mjs`), two groups, forward-compatible through 1.9 -- full parity with the shipped 1.4.4 sibling (verification-only; the engine is UNCHANGED). 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 **16 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), `lifecycle-torture` (1.5.0+: createRoot detachment + destroy registry reset -- runs natively here), `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), `owner-torture` (1.6.0: getOwner / runWithOwner capture-restore + live-adoption cascade + stale-handle ABA degradation to rooted -- runs natively here), `async-torture` (watch / when / whenAsync contracts + a 300-seed projection-guard storm), `capacity-torture` (the fail-closed pool boundary + the 16x grow ceiling), `error-torture` (throwing effect bodies: per-effect buffering, single re-throw vs AggregateError, 4096-cycle buffer drain), `deep-chain-torture` (pullComputed recursion fail-closed with a RangeError vs the iterative push path), `zerogc-torture` (zero-GC hot path via `measureAllocs`/`measureOps` + `stats()` counters; ZEROGC_BREAK self-test; churn-box activates on 1.6.0); 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` -- each now carries a value-correctness oracle (a preallocated `Int32Array` shadow, rotating window per tick, full sweep at teardown) alongside the liveness assertions -- exit 0 iff zero errors AND value-oracle clean 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`.
816
830
  - `bench/run-all-bench.sh` -- cold-process-per-engine driver (`FW=<engine>` per child), fed to `aggregate.mjs` for medianing.
817
831
  - `harness/run.mjs` -- dispatcher for the run-on-demand probes (field, dispose, churn, owner, creation, all).
818
832
  - `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-beta",
3
+ "version": "1.6.0-beta-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",
@@ -88,6 +88,7 @@
88
88
  "sideEffects": false,
89
89
  "devDependencies": {
90
90
  "@zakkster/lite-devtools": "^1.2.0",
91
+ "@zakkster/lite-gc-profiler": "^1.15.0",
91
92
  "@zakkster/lite-profiler": "^1.1.0",
92
93
  "@zakkster/lite-profiler-signal": "^1.2.0",
93
94
  "@zakkster/lite-signal": "^1.3.0 || >=1.4.0-beta.0 || >=1.6.0-preview.0",