@zakkster/lite-signal 1.4.0 → 1.4.1

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,6 +4,202 @@ 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
+ ## [1.4.1] -- 2026-07-21
8
+
9
+ The verification-surface patch. **The engine is unchanged**: the only edit to
10
+ `Signal.js` is the version string in its header banner, and `Signal.d.ts` is
11
+ untouched. Everything here lives in `bench/torture/`, which does not ship --
12
+ `files[]` excludes it. If you consume the package, 1.4.1 is byte-for-byte 1.4.0
13
+ plus a version number.
14
+
15
+ What changed is what the repo can *prove* about that engine. The torture
16
+ directory used to answer two questions -- did anything throw, and did the pool
17
+ come back -- and both are liveness questions. Neither reads a value and asks
18
+ whether it is right. This release adds five scenarios that assert on meaning,
19
+ and fixes the three existing soaks, which had been lying in small ways.
20
+
21
+ ### Added -- five semantic torture scenarios
22
+
23
+ The three pre-1.4.1 soaks (`graph-fuzzer`, `scheduler-bench`, `torture-soak`)
24
+ pass green on an engine whose computeds return stale values. That is not a
25
+ hypothesis. Flipping the clean short-circuit in `pullComputed` from `<= 0` to
26
+ `<= 1` -- a one-character edit, exactly the shape a perf tweak makes -- keeps the
27
+ pool perfectly balanced, throws nothing, and all three soaks report PASS. The
28
+ new scenarios exist to close that gap.
29
+
30
+ - **`oracle-fuzzer.mjs`** -- differential correctness. Drives a random DAG and,
31
+ after every operation, compares **every** computed against an independent
32
+ reference evaluator that recomputes from the leaves with no caching, no
33
+ versioning and no short-circuit. The reference shares no code with the engine,
34
+ so a bug in the engine's invalidation cannot hide in the oracle too. Node
35
+ shapes cover static fan-in (`sum`), dynamic dependency sets (`select`, which
36
+ reads a selector then exactly one dep, so the source set moves between
37
+ evaluations), and value passthrough (`identity`, which preserves `-0` and `NaN`
38
+ where a `sum` would normalise them away). Failures print the seed and a
39
+ minimised operation log so they replay.
40
+ - **`glitch-hunter.mjs`** -- glitch freedom across diamond topologies plus exact
41
+ wakeup accounting. An engine may not expose an intermediate state in which two
42
+ branches of a diamond disagree about which epoch they reflect.
43
+ - **`work-accounting.mjs`** -- minimum body-execution counts across 10 fixed
44
+ topologies. Pins that the engine does *exactly* the necessary work: no
45
+ recompute of an unaffected node, and no skipped recompute of an affected one.
46
+ Both directions fail loudly.
47
+ - **`concurrent-storm.mjs`** -- reentrancy, nesting and flush ordering against
48
+ eight documented contracts: self-write termination, mutual A->B->A loops
49
+ tripping `CycleError` rather than hanging, nested batches flushing only at the
50
+ outermost boundary, effects scheduled *by* a pass draining in the *next* pass,
51
+ writes and reads inside cleanup, dispose-mid-flush, self-disposal from inside
52
+ a body, and async writes interleaved with flushes.
53
+ - **`scheduler-storm.mjs`** -- deferred-execution hazards under saturation. The
54
+ cached `schedulerThunk` is gen-bound; `dispose` bumps `gen`, so a `run` the
55
+ scheduler is still holding must become a silent no-op and must **not** fire the
56
+ new resident once that pool slot is recycled. That is a textbook ABA hazard and
57
+ the guard is one `===` away from being wrong. Also pins that `FLAG_QUEUED` is
58
+ cleared only inside `executeEffect` (which is what makes a microtask scheduler
59
+ coalesce N writes into one run), and that a throwing scheduler does not take
60
+ the rest of the flush pass down with it.
61
+
62
+ Where no contract is documented, these files **pin the observed behaviour** and
63
+ say so at the scenario, rather than asserting an invented one.
64
+
65
+ #### Measured discrimination
66
+
67
+ Each scenario was validated by mutating the engine and confirming the scenario
68
+ fails, then restoring. Recorded because a torture suite nobody has mutation-
69
+ tested is decoration:
70
+
71
+ | mutant | caught by | missed by |
72
+ | ------ | --------- | --------- |
73
+ | `pullComputed` short-circuit `<= 0` -> `<= 1` | oracle-fuzzer (400/400 seeds), glitch-hunter, work-accounting | all three legacy soaks |
74
+ | drop `node.gen === gen` from the cached thunk | scheduler-storm | **the entire 405-test unit suite** |
75
+ | `batch` flushing at every boundary, not the outermost | concurrent-storm | -- (unit suite catches it too) |
76
+
77
+ The ABA row is the reason this release exists: 405 unit tests pass on an engine
78
+ whose stale thunks fire into recycled pool slots.
79
+
80
+ ### Added -- one entry point, two groups
81
+
82
+ `bench/torture/run.mjs` replaces the ad-hoc shell loops people were writing
83
+ around six separate `node --expose-gc bench/torture/<file>.mjs` invocations.
84
+
85
+ ```bash
86
+ npm run torture # everything
87
+ npm run torture:semantic # correctness only, ~10s, CI-shaped
88
+ npm run torture:soak # resource soaks only
89
+ node bench/torture/run.mjs --list
90
+ node bench/torture/run.mjs --seconds 30 --bail
91
+ node bench/torture/run.mjs oracle glitch # substring match on names
92
+ ```
93
+
94
+ Scenarios are split into **`semantic`** (deterministic, fast, assert on meaning
95
+ -- belong in CI on every commit) and **`soak`** (wall-clock bound, assert on
96
+ resources -- belong in a nightly or pre-publish job). Each scenario stays a
97
+ standalone executable module, and the runner **spawns them as child processes**
98
+ rather than importing them. That is deliberate: several assert on global pool
99
+ accounting and on the default registry, so running two in one process would let
100
+ the first one's residue poison the second's baseline. Process isolation is the
101
+ only thing that makes those assertions mean anything.
102
+
103
+ `--expose-gc` is passed by the runner unconditionally. It is not optional:
104
+ several scenarios force collection to settle finalizers, and without it they
105
+ would silently degrade to asserting nothing rather than failing loudly.
106
+
107
+ ### Added -- shared torture infrastructure
108
+
109
+ `bench/torture/helpers/index.mjs` collects what every soak had grown its own
110
+ copy of: the seeded `mulberry32` PRNG (so a failure replays from its seed
111
+ alone), the `soakRegistry` / `fixedRegistry` constructors, and `createReport`,
112
+ which **collects failures instead of throwing on the first one** -- torture
113
+ output is read once, usually in CI, and "fix, rerun, discover the next one" is a
114
+ slow loop.
115
+
116
+ It also holds `VALUE_POOL`, the adversarial value domain. An earlier draft of
117
+ the oracle used integers only, and a mutant that swapped the default equality
118
+ from `Object.is` to `==` sailed straight through, because on integers the two
119
+ agree. The pool now contains the pairs where the candidate definitions
120
+ disagree: `Object.is` vs `===` differ on `NaN` and on `-0`/`0`; `===` vs `==`
121
+ differ on `0`/`""`/`false`/`"0"` and `null`/`undefined`. Equality decides whether
122
+ a write propagates at all, so it has to be fuzzed with values that can tell the
123
+ definitions apart.
124
+
125
+ The module is deliberately dependency-free and side-effect-free: importing it
126
+ must not touch the default registry, or an import would quietly allocate and
127
+ poison the pool baselines the scenarios assert on.
128
+
129
+ ### Fixed -- the soaks printed `impossible` on a healthy run
130
+
131
+ All three legacy soaks used a magic-constant guard as a JIT sink
132
+ (`if (acc === 1234567) console.log("impossible")`) to stop V8 eliminating the
133
+ accumulator loops that make the engine do real work. Those constants are
134
+ **reachable**: a 1.4.0 soak run printed `impossible` for real, because the
135
+ accumulator genuinely landed on the sentinel. The sink polluted stdout on a
136
+ passing run, which is how a CI log teaches people to ignore it.
137
+
138
+ Replaced with a module-scoped int32 sink accumulated in the loop and read at
139
+ teardown. It never prints -- and it now carries an assertion the old form could
140
+ not: **if the sink never advances, the run fails**, because that means the work
141
+ loops were optimised away and the soak measured nothing. Previously that failure
142
+ mode was undetectable.
143
+
144
+ ### Fixed -- "pool returned to baseline" was not what was being asserted
145
+
146
+ The soaks printed a `baseline` (e.g. `7500 / 17992`), a post-teardown figure
147
+ (`2500 / 0`), and then declared that the pool had "returned to baseline". Those
148
+ numbers never match and were never supposed to: teardown disposes the computeds
149
+ and effects and leaves only the signals alive, so the real assertion is a
150
+ leaf-only floor of `N_SIGNALS + 8`. The verdict did not describe the check.
151
+
152
+ - the pre-run stat is now labelled `pre-soak`, not `baseline`;
153
+ - the floor actually asserted on is printed
154
+ (`post-teardown floor asserted: <= 2508 nodes / 0 links`), so a reader can
155
+ check the verdict against the numbers instead of trusting it;
156
+ - the pass line reads `pool drained to its leaf-only floor`.
157
+
158
+ ### Fixed -- `helpers/` resolution
159
+
160
+ The helpers module was committed at `bench/torture/index.mjs` while the
161
+ scenarios -- and the module's own header docstring -- referenced
162
+ `bench/torture/helpers/index.mjs`. Four of the five semantic scenarios died with
163
+ `ERR_MODULE_NOT_FOUND` before executing a single assertion, leaving the suite at
164
+ 1/5 with three stack traces in the log. Moved to the path everything already
165
+ expected. `run.mjs` propagated the failure correctly; nothing else would have
166
+ caught it, because the torture suite is not wired into `npm test` or
167
+ `npm run gate`.
168
+
169
+ ### Changed -- torture sources are ASCII
170
+
171
+ `bench/torture/*.mjs` carried em dashes, less-than-or-equal glyphs, and 1,820
172
+ box-drawing characters. `Signal.js` is pure ASCII and `bench/benchmark.mjs` uses
173
+ only the sanctioned multiplication sign, which made the torture directory the
174
+ lone outlier against the ecosystem's ASCII-only source rule. Normalised to
175
+ `--`, `<=` and `-`. The directory's `README.md` is left as it is, consistent
176
+ with `bench/README.md`.
177
+
178
+ ### Added -- `harness/ProfilerTools/` is now checked in
179
+
180
+ The combined profiler + devtools integration harness has been described in the
181
+ README and wired into `test:harness` / `test:all` since 1.4.0, but its four files
182
+ were never committed. They land here: `harness.test.mjs`, `package.json`,
183
+ `setup.sh`, `README.md`. Verified working -- 5/5 passing, a 7-node / 6-edge
184
+ telemetry DAG discovered through devtools, and `activeNodes 22 -> 22` across
185
+ 2,000 driven frames, which is the zero-GC contract holding end-to-end across
186
+ three packages rather than on a microbench.
187
+
188
+ Its scope is now stated explicitly in the README and `llms.txt`, because it was
189
+ previously ambiguous and the ambiguity was dangerous: **`setup.sh` hard-pins
190
+ `@zakkster/lite-signal@1.6.0-preview.2` from the registry and nothing resolves
191
+ to `../../Signal.js`.** The harness does not test the working tree. Since
192
+ `npm run test:all` chains it, a passing `test:all` is not by itself clearance to
193
+ publish -- `npm test`, `npm run torture` and `npm run test:hardening` are the
194
+ legs that exercise local changes.
195
+
196
+ ### Not changed
197
+
198
+ - `Signal.js` behaviour, `Signal.d.ts`, the public API, the hot path, bundle
199
+ size, and the 1.4.0 `stats()` surface.
200
+ - `npm test` still runs `test/*.test.mjs` only: **405 passing**, unchanged.
201
+ - The torture suite remains opt-in and unpublished.
202
+
7
203
  ## [1.4.0] -- 2026-06-XX
8
204
 
9
205
  The observability minor: `stats()` gains **three cumulative lifecycle counters**
package/README.md CHANGED
@@ -700,7 +700,7 @@ npm run bench
700
700
 
701
701
  ## Testing strategy
702
702
 
703
- Three tiers, all reproducible.
703
+ Four tiers, all reproducible.
704
704
 
705
705
  ### Tier 1 -- Behavior (unit tests, fast)
706
706
 
@@ -759,12 +759,64 @@ npm run test:gc
759
759
  npm run bench
760
760
  ```
761
761
 
762
- ### Tier 4 -- Torture soaks (crash detection under chaos)
762
+ ### Tier 4 -- Torture (correctness and resources under chaos)
763
763
 
764
- `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:
764
+ `bench/torture/` holds eight scenarios in two groups, behind one runner. They are
765
+ not perf benchmarks: the ops/sec figures reflect random workload composition, not
766
+ engine throughput -- `bench/benchmark.mjs` remains the canonical perf harness.
765
767
 
766
- - zero thrown exceptions during the run, and
767
- - after teardown, `activeNodes` / `activeLinks` return to the leaf-only baseline (the dispose path is sound under sustained churn).
768
+ ```bash
769
+ npm run torture # everything
770
+ npm run torture:semantic # correctness only, ~10s, CI-shaped
771
+ npm run torture:soak # resource soaks only
772
+ ```
773
+
774
+ ```bash
775
+ node bench/torture/run.mjs --list
776
+ node bench/torture/run.mjs --seconds 30 --bail
777
+ node bench/torture/run.mjs oracle glitch # substring match on names
778
+ ```
779
+
780
+ The runner spawns each scenario as a **child process** rather than importing it.
781
+ Several assert on global pool accounting and on the default registry, so running
782
+ two in one process would let the first one's residue poison the second's
783
+ baseline. `--expose-gc` is passed unconditionally -- some scenarios force
784
+ collection to settle finalizers, and without it they would silently degrade to
785
+ asserting nothing.
786
+
787
+ #### `semantic` -- deterministic, fast, asserts on **meaning**
788
+
789
+ Run these on every commit. They pin values, wakeups, work and ordering.
790
+
791
+ | scenario | pins |
792
+ | -------- | ---- |
793
+ | `oracle-fuzzer` | every computed against an independent uncached reference evaluator, over 400 seeds x 120 ops |
794
+ | `glitch-hunter` | glitch freedom across diamonds, plus exact wakeup counts |
795
+ | `work-accounting` | minimum body-execution counts across 10 fixed topologies -- no missing recompute, no surplus one |
796
+ | `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 |
797
+ | `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 |
798
+
799
+ Why this group exists: the resource soaks below pass green on an engine whose
800
+ computeds return stale values. Flipping the clean short-circuit in `pullComputed`
801
+ from `<= 0` to `<= 1` keeps the pool perfectly balanced and throws nothing --
802
+ `oracle-fuzzer` catches it on 400/400 seeds, and all three soaks report PASS.
803
+ Separately, removing the `node.gen === gen` guard from the cached scheduler thunk
804
+ is caught by `scheduler-storm` and **missed by all 405 unit tests**.
805
+
806
+ Where no contract is documented, these files pin the *observed* behaviour and say
807
+ so at the scenario, rather than asserting an invented one.
808
+
809
+ #### `soak` -- wall-clock bound, asserts on **resources**
810
+
811
+ Run these nightly or pre-publish. Large randomised graphs (1,500 / 7,500 / 3,300
812
+ nodes) under mixed fuzz -- leaf writes, batched writes, computed and effect
813
+ rewires, nested-batch and untrack reads, microtask-scheduled async flushes. Each
814
+ exits non-zero unless:
815
+
816
+ - zero exceptions were thrown during the run,
817
+ - after teardown `activeNodes` is at or below its leaf-only floor and
818
+ `activeLinks` is exactly `0`, and
819
+ - the JIT sink advanced -- proving the accumulator loops were not optimised away.
768
820
 
769
821
  ```bash
770
822
  node --expose-gc bench/torture/graph-fuzzer.mjs # 10s random-DAG fuzz, 1500 nodes
@@ -772,13 +824,19 @@ node --expose-gc bench/torture/torture-soak.mjs # 5s high-volume churn, 750
772
824
  node --expose-gc bench/torture/scheduler-bench.mjs # 10s microtask-scheduled, 3300 nodes
773
825
  ```
774
826
 
775
- Run any of them with `TORTURE_SECONDS=N` for a longer soak. Indicative numbers from a development host (post-teardown pool returns to baseline in all three):
827
+ Any of them takes `TORTURE_SECONDS=N` for a longer soak (the runner's `--seconds`
828
+ sets it for all three). Indicative numbers from a development host:
829
+
830
+ | | duration | ops | errors | post-teardown nodes / links | floor |
831
+ | --------------------- | --------:| --------:| ------:| --------------------------- | -------- |
832
+ | graph-fuzzer | 10 s | 7.6 M | 0 | 500 / 0 | <= 508 |
833
+ | torture-soak | 5 s | 1.2 M | 0 | 2500 / 0 | <= 2508 |
834
+ | scheduler-bench | 10 s | 28.8 M | 0 | 1000 / 0 | <= 1008 |
776
835
 
777
- | | duration | ops | errors | post-teardown nodes / links |
778
- | --------------------- | --------:| --------:| ------:| --------------------------- |
779
- | graph-fuzzer | 10 s | 7.6 M | 0 | 500 / 0 |
780
- | torture-soak | 5 s | 1.2 M | 0 | 2500 / 0 |
781
- | scheduler-bench | 10 s | 28.8 M | 0 | 1000 / 0 |
836
+ The floor is the assertion; the pre-soak figure is not. Teardown disposes the
837
+ computeds and effects and leaves the signals alive, so post-teardown is *supposed*
838
+ to sit far below the pre-soak node count. Each soak prints the floor it asserted
839
+ against so the verdict can be checked against the numbers.
782
840
 
783
841
  ```bash
784
842
  npm run verify # test + a sanity bench
@@ -856,6 +914,14 @@ npm run test:harness
856
914
 
857
915
  The setup script pins specific package versions via tarball install so the harness can be re-run reproducibly without depending on whatever happens to be in the public registry on the day. Treat the setup as a one-time per-checkout cost.
858
916
 
917
+ > **This harness does not test the tree you are standing in.** `setup.sh` hard-pins `@zakkster/lite-signal@1.6.0-preview.2` from the registry and extracts it into the harness's own `node_modules`; nothing resolves to `../../Signal.js`. That is deliberate -- the point is to prove the contract holds **across the published package chain a consumer actually installs**, where `lite-profiler-signal` and `lite-devtools` meet an engine none of them were built against. It is emphatically *not* a gate on local changes. A green run here says nothing about uncommitted work in `Signal.js`, and because `npm run test:all` chains it, a passing `test:all` is **not** by itself clearance to publish.
918
+ >
919
+ > For the local engine, use `npm test` (in-tree, 405 tests), `npm run torture` (in-tree), and `npm run test:hardening` -- `test/ProfilerTests/` self-references in-tree and therefore *does* exercise the working copy.
920
+ >
921
+ > When the pinned version goes stale, bump it in `setup.sh` and re-check the two capability assertions in `harness.test.mjs` (`cap.owners`, `cap.mutationHook`), which are written against the 1.6 surface.
922
+
923
+ Last verified run (engine `1.6.0-preview.2`, devtools 1.2.0, profiler 1.2.0): 5/5 passing; `capabilities: {"floor":"1.1.5","owners":true,"mutationHook":true,"burst":true}`; 7-node / 6-edge telemetry DAG discovered; `activeNodes 22 -> 22` across 2,000 driven frames with `poolCap` flat at 1024 -- the zero-GC contract holding end-to-end across three packages.
924
+
859
925
  ### Notes
860
926
 
861
927
  - The hardening suite and the profiler integration do **not** run on `npm test` from the root. They opt in through the `test:hardening` / `test:harness` scripts (and `test:all`, which chains everything).
@@ -1165,11 +1231,14 @@ Yes, if your computeFn reads its deps in the same order each invocation. The `cu
1165
1231
  ## npm scripts
1166
1232
 
1167
1233
  ```bash
1168
- npm test # behavior suite, ~1.3s
1169
- npm run test:gc # zero-gc suite, requires --expose-gc, ~3s
1170
- npm run bench # comparative benchmark vs alien-signals (results.txt), ~5min
1171
- npm run bench-reactive # 5-framework reactivity suite (resultsReactive.txt)
1172
- npm run verify # test + sanity bench; run before publishing
1234
+ npm test # behavior suite, ~1.3s
1235
+ npm run test:gc # zero-gc suite, requires --expose-gc, ~3s
1236
+ npm run bench # comparative benchmark vs alien-signals (results.txt), ~5min
1237
+ npm run bench-reactive # 5-framework reactivity suite (resultsReactive.txt)
1238
+ npm run torture # full torture suite, all 8 scenarios
1239
+ npm run torture:semantic # correctness scenarios only, ~10s
1240
+ npm run torture:soak # resource soaks only, wall-clock bound
1241
+ npm run verify # test + sanity bench; run before publishing
1173
1242
  ```
1174
1243
 
1175
1244
  ---
package/Signal.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @zakkster/lite-signal v1.4.0
2
+ * @zakkster/lite-signal v1.4.1
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
@@ -50,7 +50,22 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
50
50
 
51
51
  ## Version notes
52
52
 
53
- - **1.4.0-beta** (current): the **observability minor**. `stats()` gains three
53
+ - **1.4.1** (current): the **verification-surface patch**. No engine change --
54
+ the only edit to `Signal.js` is the version string in its header banner, and
55
+ `Signal.d.ts` is untouched. `bench/torture/` gains five deterministic
56
+ correctness scenarios (`oracle-fuzzer`, `glitch-hunter`, `work-accounting`,
57
+ `concurrent-storm`, `scheduler-storm`), one runner (`bench/torture/run.mjs`)
58
+ with `semantic` / `soak` groups, and shared helpers. The three pre-existing
59
+ soaks assert only on liveness -- nothing threw, the pool came back -- and pass
60
+ green on an engine whose computeds return stale values; the semantic group
61
+ closes that gap. Mutation-verified: removing the `node.gen === gen` guard from
62
+ the cached scheduler thunk is caught by `scheduler-storm` and missed by all
63
+ 405 unit tests. Also fixes a reachable JIT-sink sentinel that printed
64
+ `impossible` to stdout on a healthy 1.4.0 soak run, and a pass line that
65
+ claimed the pool "returned to baseline" when the assertion was a leaf-only
66
+ floor. Nothing here ships: `files[]` excludes `bench/`.
67
+
68
+ - **1.4.0**: the **observability minor**. `stats()` gains three
54
69
  cumulative lifecycle counters -- `totalAllocations`, `totalDisposals`,
55
70
  `poolGrowths` -- the surface reserved for 1.4.0 in the 1.2.x/1.3.0 notes, now
56
71
  delivered. **The hot paths and public callable API are byte-identical to 1.3.0**;
@@ -598,11 +613,12 @@ function dumpOwnerTree(handle, depth = 0) {
598
613
  - `test/25-devtools-real-boot.test.mjs` -- 1.2.2: real `Devtools.js` boot against the engine, ghost-contract pin, `stats()` shape pin (10 tests).
599
614
  - `test/26-free-list-invariant.test.mjs` -- 1.2.2: the audit's clean-free-list invariant, asserted by inspecting freshly-allocated nodes (4 tests).
600
615
  - `test/ProfilerTests/` -- version-portable engine hardening suite. Own `package.json`, own `node:test`. Imports `@zakkster/lite-signal` as bare specifier; self-references in-tree, resolves to the installed version when run standalone. Feature-gated cases activate automatically as the engine gains APIs. Run via `npm run test:hardening` (in-tree) or `./run-matrix.sh` (standalone matrix vs published lines).
601
- - `harness/ProfilerTools/` -- combined integration harness: `@zakkster/lite-profiler-signal` + `@zakkster/lite-devtools` pointed at the same lite-signal registry. Verifies the cross-package zero-GC contract end-to-end (devtools inspects a profiler-driven graph non-perturbingly; the profiler allocates no new nodes in steady state). Own `package.json`, one-time setup via `bash setup.sh` (pins peer deps via tarball). Run via `npm run test:harness`. Both harnesses are opt-in: `npm test` from root is scoped to `'test/*.test.mjs'` and does NOT sweep them.
616
+ - `harness/ProfilerTools/` -- combined integration harness: `@zakkster/lite-profiler-signal` + `@zakkster/lite-devtools` pointed at the same lite-signal registry. Verifies the cross-package zero-GC contract end-to-end (devtools inspects a profiler-driven graph non-perturbingly; the profiler allocates no new nodes in steady state). Own `package.json`, one-time setup via `bash setup.sh`. IMPORTANT SCOPE NOTE: `setup.sh` hard-pins `@zakkster/lite-signal@1.6.0-preview.2` from the registry and extracts it into the harness's own `node_modules` -- nothing resolves to `../../Signal.js`, so this harness does NOT exercise the local working tree. It proves the cross-package contract across the PUBLISHED chain a consumer installs, not local changes; a green `npm run test:all` is therefore not by itself clearance to publish. For the local engine use `npm test`, `npm run torture`, and `npm run test:hardening` (`test/ProfilerTests/` self-references in-tree). Last verified: 5/5 passing, `activeNodes 22 -> 22` across 2,000 driven frames. The two capability assertions in `harness.test.mjs` (`cap.owners`, `cap.mutationHook`) are written against the 1.6 surface and must be rechecked when the pin is bumped. Run via `npm run test:harness`. Both harnesses are opt-in: `npm test` from root is scoped to `'test/*.test.mjs'` and does NOT sweep them.
602
617
  - `bench/benchmark.mjs` -- anti-DCE throughput harness (ops/s; results.txt).
603
618
  - `bench/benchmarkReactive.mjs` -- cross-framework reactivity suite vs alien-signals, preact, vue-reactivity, solid (resultsReactive.txt).
604
619
  - `bench/dispose-recycle.mjs` -- 1.2.2 targeted microbench: create/dispose/recreate cycle (the free-list invariant audit target).
605
- - `bench/torture/` -- crash-detection soaks: `graph-fuzzer`, `scheduler-bench`, `torture-soak`. Exit 0 iff zero errors AND post-teardown pool clean.
620
+ - `bench/torture/` -- eight scenarios behind one runner (`run.mjs`), two groups. `semantic` (deterministic, fast, asserts on MEANING; run in CI): `oracle-fuzzer` (every computed vs an independent uncached reference evaluator, 400 seeds x 120 ops), `glitch-hunter` (glitch freedom + exact wakeup counts), `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). `soak` (wall-clock bound, asserts on RESOURCES; run 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. The runner spawns each scenario as a child process because several assert on global pool accounting, and passes `--expose-gc` unconditionally. Scripts: `npm run torture`, `torture:semantic`, `torture:soak`.
621
+ - `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 containing 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.
606
622
  - `bench/run-all.sh` + `bench/aggregate.mjs` -- cold-process-per-engine protocol + per-scenario aggregation.
607
623
  - `demo/index.html` -- interactive visualization of the reactive graph.
608
624
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zakkster/lite-signal",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
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",
@@ -37,7 +37,10 @@
37
37
  "bench": "node --expose-gc bench/benchmark.mjs",
38
38
  "bench-reactive": "node --expose-gc bench/benchmarkReactive.mjs",
39
39
  "verify": "npm test && npm run bench",
40
- "gate": "node harness/VersionMatrix/pre-publish.mjs"
40
+ "gate": "node harness/VersionMatrix/pre-publish.mjs",
41
+ "torture": "node bench/torture/run.mjs",
42
+ "torture:semantic": "node bench/torture/run.mjs --group semantic",
43
+ "torture:soak": "node bench/torture/run.mjs --group soak"
41
44
  },
42
45
  "keywords": [
43
46
  "signal",