@zakkster/lite-signal 1.8.0-alpha.4 → 1.8.0-alpha.6

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,84 @@ 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.8.0-alpha.5] -- 2026-08-18
8
+
9
+ Brings the `bench/torture/` suite and the throwing-`equals` unit test to **full
10
+ parity with the shipped 1.4.4 canon**. This is a **verification-only** cut: the
11
+ engine (`Signal.js` + `Signal.d.ts`) is **UNCHANGED, byte-identical** to
12
+ `alpha.4` -- every ported scenario was run against the 1.8.0 engine and pins its
13
+ **actual** behaviour; no assertion was softened and no budget widened.
14
+
15
+ ### Added -- torture parity (17 -> 22 scenarios)
16
+
17
+ - Registered the already-present-and-passing `owner-torture` (`getOwner` /
18
+ `runWithOwner` capture-restore + ABA degradation, a 1.6.0 primitive).
19
+ - Ported four scenarios that all run **natively** on the 1.8.0 engine:
20
+ `lifecycle-torture` (`createRoot` detachment + `destroy` registry reset),
21
+ `error-torture` (throwing effect bodies: per-effect buffering, exact-order
22
+ `AggregateError`, buffer drain over 4096 cycles), `deep-chain-torture`
23
+ (`pullComputed` recursion fail-closed with a `RangeError` vs the heap-iterative
24
+ push path), and `zerogc-torture` (the falsifiable zero-GC gate via
25
+ `measureAllocs` / `measureOps` + `stats()` counters, with the `ZEROGC_BREAK`
26
+ self-test). None needed pinning to a divergent behaviour.
27
+ - `capacity-torture` gained section 9: the **16x grow-link ceiling** (multiplier
28
+ confirmed against `Signal.js:285`), fail-closed with a `links` `CapacityError`.
29
+ - The three soaks (`graph-fuzzer`, `scheduler-bench`, `torture-soak`) gained an
30
+ **Int32Array value-oracle** (a fixed shadow window over the writable signals,
31
+ allocated once, zero per-tick allocation, full sweep at teardown).
32
+ - New `test/30-throwing-equals.test.mjs` pins all **five** `equals()` invocation
33
+ sites -- 3 callable (signal set pre-check, batch revert, computed re-eval) plus
34
+ the 2 `signalBox` `boxSet` sites (pre-check, revert).
35
+
36
+ The `cleanup-return`, `owner`, `flush`, `scope` and `createRoot`-based scenarios
37
+ all run natively on this engine. On the 1.8.0 engine the runner now executes
38
+ **18 semantic** scenarios and cleanly SKIPS the one remaining later-version
39
+ scenario (`dispose-torture` 1.9.0); the suite total is **22 (19 semantic + 3
40
+ soak)**.
41
+
42
+ ### Verified -- full suite green on the 1.8.0 engine (Node 22, `--expose-gc`)
43
+
44
+ - **Torture:** 22/22 (`torture:semantic` 19/19 -- 18 executed, 1 clean skip
45
+ `dispose` 1.9.0; `torture:soak` 3/3, value-oracle matched).
46
+ - **Unit (plain `npm test`):** 499 tests, 498 pass, 0 fail, 1 skip (the
47
+ architectural SSR N/A in `17-reactivity`).
48
+ - **Unit (`npm run test:gc`):** 507 tests, 506 pass, 0 fail, 1 skip.
49
+
50
+ ## [1.8.0-alpha.4] -- 2026-07-27
51
+
52
+ Rolls up the post-`1.8.0-preview` changes into the `alpha.4` tag. The
53
+ effect-cleanup-return feature (an effect body may `return` a cleanup) ships in
54
+ the preview and is unchanged here; this cut carries the dangling-cursor crash fix
55
+ (below, now also exercised against the cleanup-return path), 100% coverage on
56
+ `Signal.js`, and the completed torture surface for the cleanup-return feature.
57
+
58
+ ### Added -- `cleanup-return-torture` now executes on the 1.8.0 engine
59
+
60
+ `bench/torture/`'s `cleanup-return-torture` scenario -- present but
61
+ feature-skipped on the 1.5.x-1.7.x lines -- now **runs** (400 seeds), since an
62
+ effect body returning a cleanup is a 1.8.0 primitive. It pins the timing (the
63
+ returned cleanup runs before each re-run and once on dispose, same points as
64
+ imperative `onCleanup`), the **compose order** (a returned cleanup is appended
65
+ after any `onCleanup` registered in the same body, so both fire in call order),
66
+ the self-dispose guard (a body that disposes itself registers nothing), and the
67
+ computed exclusion (a computed returning a function keeps it as the value, never
68
+ a cleanup). On the 1.8.0 engine the runner therefore executes **13 semantic**
69
+ scenarios and cleanly SKIPS the one remaining later-version scenario
70
+ (`dispose-torture` 1.9.0); the suite total is unchanged at **17 (14 semantic +
71
+ 3 soak)**.
72
+
73
+ ### Verified -- full suite green on the 1.8.0 engine (Node 22, `--expose-gc`)
74
+
75
+ - **Torture:** 17/17 -- `torture:semantic` 14/14 (13 executed incl.
76
+ `cleanup-return-torture`, 1 clean skip: `dispose` 1.9.0), `torture:soak` 3/3
77
+ (zero errors, every pool back to its leaf-only floor).
78
+ - **Unit (plain run):** 492 tests, 472 pass, 0 fail, 1 skip (the architectural
79
+ SSR N/A in `17-reactivity`). The only non-passes are the 19 in
80
+ `test/25-devtools-real-boot`, the real-rig that requires the sibling
81
+ `@zakkster/lite-devtools`; with that sibling resolvable the suite is 491 pass +
82
+ 1 skip. Engine-only, excluding `test/25`: 473 tests, 472 pass, 1 skip. (The c8
83
+ coverage run below reports a different count -- perf-smoke budgets skip under
84
+ instrumentation.)
8
85
 
9
86
  ### Changed -- bench protocol v3 (carried forward)
10
87
 
@@ -463,9 +540,9 @@ monomorphic targets and inlines the body. In "eager" mode the inlined body is
463
540
  byte-identical to the 1.6.0 inline check `if (batchDepth === 0) flushEffects()`
464
541
  -- **zero behavioral or performance regression** for any existing user.
465
542
 
466
- This is NOT ledger §0b #6 (per-call closure-var load of a primitive). It is a
543
+ This is NOT ledger S0b #6 (per-call closure-var load of a primitive). It is a
467
544
  hoisted function reference resolved once at registry build time and is a NEW
468
- mechanism by the v1 roadmap §0b line 100 definition.
545
+ mechanism by the v1 roadmap S0b line 100 definition.
469
546
 
470
547
  The `getOwner` / `runWithOwner` port adds new user-API functions but touches no
471
548
  hot path. sha256 over the extracted function bodies of `pullComputed`,
@@ -510,7 +587,7 @@ pristine 1.7.0-preview byte-for-byte; the two new functions are inserted between
510
587
 
511
588
  Real wins, but smaller than the gap to Reflex on the same shapes. The residual
512
589
  gap is structural (per-write `gen` check, batch-revert epoch tracking, global
513
- version bumping) -- design decisions accepted by §0b and not in scope here.
590
+ version bumping) -- design decisions accepted by S0b and not in scope here.
514
591
  Modern V8's `try/finally` elision varies; expect higher absolute speedups on
515
592
  production V8 than on this sandbox.
516
593
 
package/README.md CHANGED
@@ -809,7 +809,10 @@ npm run bench
809
809
 
810
810
  ## Testing strategy
811
811
 
812
- Three tiers, all reproducible.
812
+ Four tiers, all reproducible. The full suite is **507 tests across 31 files**:
813
+ 506 pass, 1 skipped (the architecturally-N/A SSR case in `17-reactivity` -- lite
814
+ has no DOM layer), 0 failing. Plain `npm test` runs **499** of them; the rest are
815
+ gated on `--expose-gc` and need `npm run test:gc` or `npm run test:coverage`.
813
816
 
814
817
  ### Tier 1 -- Behavior (unit tests, fast)
815
818
 
@@ -840,6 +843,9 @@ Three tiers, all reproducible.
840
843
  - **`24-signalbox.test.mjs`** -- the `signalBox` / `computedBox` allocation-light handle API, **activated in 1.5.0** (committed `{skip:true}` since 1.3.0, now running against the real implementation). 12 tests: box get/set/peek/update, `computedBox` derive + memoize, peek-does-not-track, subscribe fires-and-untracks, box<->callable interop both directions, batch coalescing (including set-then-revert net no-op), dispose with ABA-safety, the `equals` short-circuit, `computedBox.peek`, and the top-level helpers bound to the default registry.
841
844
  - **`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. 7 tests, including a top-level-export binding case that closes the otherwise-uncovered top-level `createRoot` path.
842
845
  - **`29-scope.test.mjs`** -- `createScope` (1.6.0), the adopting counterpart to `createRoot`. 4 tests: the scope owner runs exactly once on creation; direct-body signal reads in `fn` are untracked while inner effect/computed bodies track normally; `dispose()` cascade-disposes the owned subtree (effects + computeds) while a directly-allocated signal correctly survives (the engine never owner-adopts signals); a scope created inside a consumer effect SURVIVES that consumer's re-run -- the reconciler-critical detach property; `dispose()` is idempotent; the disposer is introspection-stamped to its owner effect (`describe(dispose).kind === "effect"`); and `totalAllocations - totalDisposals === activeNodes` holds across the entire lifecycle.
846
+ - **`28-run-with-owner.test.mjs`** -- `getOwner` / `runWithOwner` (1.7.0; 16 tests). Capture inside an effect and inside a computed, `undefined` outside any body, adoption, tracking-observer nulling, return-value pass-through, state restoration on return *and* on throw, nested restore; three degradation tests (`null` / `undefined` / a signal handle fall through to rooted execution); and three ABA hazard pins run under allocation pressure (recycled-slot cascade, corpse adoption, and the two composed).
847
+ - **`30-throwing-equals.test.mjs`** -- a user `equals` predicate that THROWS (9 tests), pinned at all **five** engine sites it is called from: the three callable sites (signal `set` pre-check, batch-revert check, computed re-eval) and `signalBox` `boxSet`'s two (pre-check, revert). A pre-check throw propagates the ORIGINAL error unwrapped and leaves the handle unmutated with no downstream firing; a batch-revert throw is PINNED to the engine's actual behaviour (net value written, version left bumped, downstream fires), with a CONTRAST anti-tautology test proving a clean set-X-then-back suppresses the re-run; a computed re-eval throw is cached and re-thrown until a dep change re-evaluates cleanly. The `a-box`/`b-box` cases confirm `boxSet` behaves identically to `read.set`.
848
+ - **`33-cleanup-return.test.mjs`** -- the 1.8.0 effect-cleanup-return contract: an effect body may `return` a cleanup that fires before each re-run and once on dispose, composes after any `onCleanup` from the same body in call order, is ignored for non-function returns, and is excluded for computeds (a returned function stays the VALUE).
843
849
  - **`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.
844
850
  - **`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%).
845
851
 
@@ -870,12 +876,66 @@ npm run test:gc
870
876
  npm run bench
871
877
  ```
872
878
 
873
- ### Tier 4 -- Torture soaks (crash detection under chaos)
879
+ ### Tier 4 -- Torture (correctness and resources under chaos)
874
880
 
875
- `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:
881
+ `bench/torture/` holds the complete **22-scenario superset (19 semantic + 3
882
+ soak)** behind one runner (`run.mjs`), the forward-compatible set through 1.9.
883
+ They are not perf benchmarks: the ops/sec figures reflect random workload
884
+ composition, not engine throughput -- `bench/benchmark.mjs` remains the canonical
885
+ perf harness. Every scenario feature-detects and **skips cleanly** below the
886
+ engine version that introduces its feature, so on the 1.8.0 engine the runner
887
+ executes **18 semantic** scenarios (including `cleanup-return-torture`) and
888
+ reports a clean SKIP for the one remaining later-version scenario
889
+ (`dispose-torture` 1.9.0).
890
+
891
+ ```bash
892
+ npm run torture # everything
893
+ npm run torture:semantic # correctness only, CI-shaped
894
+ npm run torture:soak # resource soaks only
895
+ node bench/torture/run.mjs --list
896
+ ```
897
+
898
+ #### `semantic` -- deterministic, fast, asserts on **meaning**
899
+
900
+ Run these on every commit. Most scenarios run on any 1.4.x+ engine; `box-torture`
901
+ and `lifecycle-torture` (1.5.0), `scope-torture` / `owner-torture` /
902
+ `introspect-torture` (1.6.0), `flush-torture` (1.7.0), and
903
+ `cleanup-return-torture` (1.8.0) run here because their features exist; the one
904
+ tagged `1.9.0+` scenario feature-detects and SKIPs on this engine.
905
+
906
+ | scenario | pins |
907
+ | -------- | ---- |
908
+ | `oracle-fuzzer` | every computed against an independent uncached reference evaluator, 400 seeds x 120 ops |
909
+ | `glitch-hunter` | glitch freedom across diamonds, plus exact wakeup counts |
910
+ | `work-accounting` | minimum body-execution counts across 10 fixed topologies |
911
+ | `op-accounting` | structural work counted from the `onGraphMutation` opcode lane (op 1-5), not wall-clock |
912
+ | `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 |
913
+ | `concurrent-storm` | eight reentrancy and flush-ordering contracts |
914
+ | `scheduler-storm` | deferred execution under 10,000 effects: gen-bound thunk ABA guard, `FLAG_QUEUED` coalescing, a throwing scheduler contained |
915
+ | `box-torture` (1.5.0) | `signalBox`/`computedBox` interop: the oracle differential fuzz with every node realised as **either** a callable or a box |
916
+ | `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 |
917
+ | `owner-torture` (1.6.0) | `getOwner`/`runWithOwner` capture-restore + ABA degradation under allocation pressure |
918
+ | `async-torture` | `watch`/`when`/`whenAsync` contracts + a 300-seed projection-guard storm |
919
+ | `capacity-torture` | the fail-closed pool boundary: exact ceilings, re-throw-on-read, `grow` crossing the same boundary, and the 16x grow-link ceiling (section 9) |
920
+ | `error-torture` | throwing effect bodies: single throw re-thrown unwrapped, 2+ aggregate into an exact-order `AggregateError`, survivor still runs, buffer drains over 4096 cycles with `activeNodes`/`activeLinks` flat |
921
+ | `deep-chain-torture` | `pullComputed` recursion fail-closed (a `RangeError` at some depth <= the ceiling; registry stays usable, deterministic re-throw) vs the heap-iterative push cascade that completes |
922
+ | `flush-torture` (1.7.0) | the three `flushStrategy` modes by cross-strategy differential (same graph + op sequence under eager/sab/manual settling to identical values), per-strategy scheduling, re-entrant/empty `flush()`, and the `.subscribe()` contract under each |
923
+ | `cleanup-return-torture` (1.8.0) | an effect's returned cleanup: timing at re-run/dispose, compose order (appended after `onCleanup` from the same body), the self-dispose guard, and the computed exclusion -- 400 seeds |
924
+ | `zerogc-torture` | the falsifiable zero-GC gate: retained bytes (`measureAllocs`/`checkAllocs`, `maxBytesPerCall: 0`), major/pause window (`measureOps`/`checkNoGc`, `maxMajor: 0`), and `stats()` counters across steady + churn scenarios; `ZEROGC_BREAK=1` self-test |
925
+ | `lifecycle-torture` (1.5.0) | `createRoot` detachment (children survive, deps isolated) + `destroy` full registry reset (handles stale, pool baseline restored) |
926
+ | `dispose-torture` (1.9.0+) | `Symbol.dispose` / `using` on lifecycle objects -- SKIP on 1.8.0 |
927
+
928
+ #### `soak` -- wall-clock bound, asserts on **resources**
929
+
930
+ Three soak harnesses build large randomised graphs (1,500 / 7,500 / 3,300 nodes)
931
+ and run mixed fuzz workloads -- leaf writes, batched writes, computed rewires,
932
+ effect rewires, nested-batch + untrack reads, and microtask-scheduled async
933
+ flushes -- for 5-10 seconds. What they assert, with a non-zero exit code on
934
+ failure:
876
935
 
877
936
  - zero thrown exceptions during the run, and
878
- - after teardown, `activeNodes` / `activeLinks` return to the leaf-only baseline (the dispose path is sound under sustained churn).
937
+ - after teardown, `activeNodes` / `activeLinks` return to the leaf-only baseline (the dispose path is sound under sustained churn), and
938
+ - an Int32Array value-oracle (a fixed shadow window over the writable signals, allocated once, zero per-tick allocation, swept in full at teardown) matched every read -- a wrong value fails the run, not just a crash.
879
939
 
880
940
  ```bash
881
941
  node --expose-gc bench/torture/graph-fuzzer.mjs # 10s random-DAG fuzz, 1500 nodes
package/Signal.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @zakkster/lite-signal v1.8.0-alpha.0 (ledger #18 corrected)
2
+ * @zakkster/lite-signal v1.8.0-alpha.4
3
3
  * Copyright (c) Zahary Shinikchiev <shinikchiev@yahoo.com>
4
4
  * MIT License
5
5
  * --------------------
package/llms.txt CHANGED
@@ -53,7 +53,48 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
53
53
 
54
54
  ## Version notes
55
55
 
56
- - **1.6.0-preview** (current): the **observability-and-lifecycle minor**, shipping
56
+ - **1.8.0-alpha.4** (current): the **effect-cleanup-return minor**. An EFFECT body
57
+ may now `return` a cleanup function (Solid/Vue/Reflex-compatible), run at the same
58
+ points as imperative `onCleanup` -- before each re-run and once on dispose -- and
59
+ APPENDED after any `onCleanup` from the same body, so both compose in call order.
60
+ Non-function returns are ignored; a self-disposed body registers nothing
61
+ (gen-guarded); computeds are excluded (a returned function stays the VALUE). Cost
62
+ is one `typeof` per effect run, off the mark/pull path; `executeEffect` is the only
63
+ hot body whose sha256 changed 1.7.0 -> 1.8.0. `alpha.4` also carries the
64
+ dangling-cursor crash fix (a one-line `disposeNode` cursor repair, which also
65
+ composes with the cleanup-return path; the dead `freeLink` `-1` arms removed) and
66
+ closes `Signal.js` to **100%** statements/branches/functions/lines. Torture: the
67
+ `cleanup-return-torture` scenario now **executes** (400 seeds: timing, compose
68
+ order, self-dispose guard, computed exclusion). `alpha.5` brings the bench/torture
69
+ suite to **full parity with the shipped 1.4.4 canon** -- verification-only, engine
70
+ UNCHANGED (`Signal.js` byte-identical): registers the already-present-and-passing
71
+ `owner-torture` and ports four scenarios that run NATIVELY on the 1.8.0 engine
72
+ (`lifecycle-torture` createRoot detachment + destroy reset; `error-torture`
73
+ throwing-effect buffering + AggregateError + buffer drain; `deep-chain-torture`
74
+ pullComputed fail-closed RangeError vs the iterative push path; `zerogc-torture`
75
+ the falsifiable zero-GC gate). So the runner is now **22 scenarios (19 semantic +
76
+ 3 soak)**, of which **18 semantic EXECUTE on the 1.8.0 engine** -- only
77
+ `dispose-torture` (1.9.0 `Symbol.dispose`) still self-skips. `capacity-torture`
78
+ gained section 9 (the 16x grow-link ceiling); the three soaks gained an
79
+ Int32Array value-oracle. New `test/30-throwing-equals.test.mjs` pins all five
80
+ `equals()` invocation sites (3 callable + 2 signalBox boxSet). Verified green:
81
+ torture 22/22; unit (plain `npm test`) **499 tests, 498 pass, 0 fail, 1 skip**
82
+ (the 1 skip is SSR N/A); `npm run test:gc` **507 tests, 506 pass, 0 fail, 1 skip**.
83
+ Drop-in over 1.7.0.
84
+
85
+ - **1.7.0**: the **flush-strategy minor**. `createRegistry({flushStrategy})` gives
86
+ per-registry control over *when* effects deliver (`"eager"` default | `"sab"` |
87
+ `"manual"`), plus an explicit `r.flush()` on every registry; the lever resolves
88
+ once at init into two closure-captured `const` booleans, so the `"eager"` body is
89
+ byte-identical to 1.6.0. Also forward-ported `getOwner` / `runWithOwner` (the
90
+ gen-stamped capture-and-restore companion to `createRoot`) from 1.5.0-beta.2, and
91
+ fixed the propagation benchmark harness (every lite adapter had been built with
92
+ `flushStrategy: "sab"` while driving un-batched `.set` and never flushing, so
93
+ effects ran once at creation and never again -- every pre-1.7.0 number in
94
+ `bench/results.txt` is void). Torture added `flush-torture` (the three modes by
95
+ cross-strategy differential + `.subscribe()`).
96
+
97
+ - **1.6.0-preview**: the **observability-and-lifecycle minor**, shipping
57
98
  on the `preview` dist-tag while it settles. Two additions, both on existing
58
99
  hot-path-adjacent edges:
59
100
 
@@ -687,7 +728,7 @@ function dumpOwnerTree(handle, depth = 0) {
687
728
  - `bench/benchmark.mjs` -- anti-DCE throughput harness (ops/s; results.txt).
688
729
  - `bench/benchmarkReactive.mjs` -- cross-framework reactivity suite vs alien-signals, preact, vue-reactivity, solid (resultsReactive.txt).
689
730
  - `bench/dispose-recycle.mjs` -- 1.2.2 targeted microbench: create/dispose/recreate cycle (the free-list invariant audit target).
690
- - `bench/torture/` -- crash-detection soaks: `graph-fuzzer`, `scheduler-bench`, `torture-soak`. Exit 0 iff zero errors AND post-teardown pool clean.
731
+ - `bench/torture/` -- the complete **22-scenario superset (19 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.8.0 engine and stays green from 1.4.x forward. `semantic` (deterministic, fast, asserts on MEANING; CI on every commit) -- the **18 that execute on 1.8.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: read-only introspection surface -- `describe`/`nodeId`/`hasObservers`/`isTracking`/`forEach*`/`ownerOf`/`observeObservers` -- walk-agreement + the ABA gen-stamp guard), `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 + disposal-crash fuzz + `runWithOwner` re-attachment), `owner-torture` (1.6.0: `getOwner`/`runWithOwner` capture-restore + ABA degradation), `async-torture` (watch / when / whenAsync contracts + a 300-seed projection-guard storm), `capacity-torture` (the fail-closed pool boundary + `CapacityError` + the 16x grow-link ceiling), `error-torture` (throwing effect bodies: per-effect buffering, exact-order `AggregateError`, buffer drain over 4096 cycles), `deep-chain-torture` (`pullComputed` recursion fail-closed with a `RangeError` vs the heap-iterative push path), `flush-torture` (1.7.0: the three `flushStrategy` modes by cross-strategy differential + per-strategy scheduling + `.subscribe()`), `cleanup-return-torture` (1.8.0: an effect's returned cleanup -- timing at re-run/dispose, compose order appended after `onCleanup`, self-dispose guard, computed exclusion; 400 seeds), `zerogc-torture` (the falsifiable zero-GC gate: `measureAllocs`/`measureOps` + `stats()` counters, `ZEROGC_BREAK` self-test), `lifecycle-torture` (`createRoot` detachment + `destroy` registry reset); plus **1 that skips cleanly** as a later-version feature: `dispose-torture` (1.9.0 `Symbol.dispose`). `soak` (wall-clock bound, asserts on RESOURCES; nightly): `graph-fuzzer`, `scheduler-bench`, `torture-soak` -- each now carries an Int32Array value-oracle (a fixed shadow window over the writable signals, allocated once, zero per-tick alloc, full sweep at teardown) so a wrong value fails the run, not just a crash; exit 0 iff zero errors AND post-teardown pool at or below its leaf-only floor AND the value-oracle matched 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`.
691
732
  - `bench/run-all.sh` + `bench/aggregate.mjs` -- cold-process-per-engine protocol + per-scenario aggregation.
692
733
  - `harness/run.mjs` -- dispatcher for the run-on-demand probes (smoke, field, dispose, churn, owner, creation, perf, burst, pull, toe, all).
693
734
  - `harness/smoke.mjs` -- 1.7 flushStrategy semantics (eager/sab/manual) + `flush()`, and the 1.8 effect-cleanup-return contract (fires before re-run + on dispose, composes with onCleanup in call order, non-function returns ignored, computed-returning-a-function still yields the VALUE). ASSERTS, so it fails loudly on a regression. First in `harness:all` and `verify`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zakkster/lite-signal",
3
- "version": "1.8.0-alpha.4",
3
+ "version": "1.8.0-alpha.6",
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",
@@ -45,7 +45,10 @@
45
45
  "profile:burst": "node --expose-gc harness/burst-dag.mjs ./Signal.js",
46
46
  "profile:pull": "node --expose-gc harness/pull-stress.mjs",
47
47
  "gate": "node harness/VersionMatrix/pre-publish.mjs",
48
- "verify": "npm test && npm run harness:smoke && npm run bench"
48
+ "verify": "npm test && npm run harness:smoke && npm run bench",
49
+ "torture": "node bench/torture/run.mjs",
50
+ "torture:semantic": "node bench/torture/run.mjs --group semantic",
51
+ "torture:soak": "node bench/torture/run.mjs --group soak"
49
52
  },
50
53
  "keywords": [
51
54
  "signal",
@@ -83,6 +86,7 @@
83
86
  "sideEffects": false,
84
87
  "devDependencies": {
85
88
  "@zakkster/lite-devtools": "^1.2.0",
89
+ "@zakkster/lite-gc-profiler": "^1.15.0",
86
90
  "@zakkster/lite-profiler": "^1.1.0",
87
91
  "@zakkster/lite-profiler-signal": "^1.2.0",
88
92
  "@zakkster/lite-signal": "^1.3.0 || >=1.4.0-beta.0 || >=1.6.0-preview.0",