@zakkster/lite-signal 1.10.0-preview → 1.10.0-preview.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,38 @@ 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.10.0-preview.1] -- 2026-09-20
8
+
9
+ Verification + docs increment over `1.10.0-preview`; **no engine change past the
10
+ version banner comment** (`Signal.js` byte-identical, banner line only). Migration
11
+ 7 of the campaign: ports the standing perf-gate lane from the canonical 1.5.2
12
+ line onto this engine.
13
+
14
+ ### Added -- perf-gate lane (`@zakkster/lite-perf-gate`, devDependency only)
15
+
16
+ - `test/38-perf-gate.test.mjs` + `npm run test:gate`
17
+ (`node --expose-gc --max-semi-space-size=4 --test test/38-perf-gate.test.mjs`),
18
+ chained into `test:all` after `test:zgc`. Where the existing `test:zgc` lane
19
+ (lite-gc-profiler) is the suite's bespoke zero-GC harness, this lane wires
20
+ `@zakkster/lite-perf-gate`'s `zgcSuite` as a standing, self-validating verdict:
21
+ five signals (scavenges / engine counters / retainedKB / oldGen /
22
+ arrayBuffersKB), two scales (N and k*N), positive+negative+large detector
23
+ controls on every run, and permanent `mustFail` negative controls.
24
+ - Seven claimed-zero steady-state scenarios, each anchored to its `llms.txt`
25
+ claim: `set-propagate` (1 signal -> 8 computeds -> 1 effect, sync flush),
26
+ `computed-cache-hit`, `computed-recompute-stable`, `effect-rerun-stable`,
27
+ `peek`, `batch-flush` (3 sets/batch), `box-set-propagate`. `statsOf` reads each
28
+ scenario's isolated registry ledger; `counters` pins
29
+ `totalAllocations`/`totalDisposals`/`poolGrowths` at 0-delta.
30
+ - Two `mustFail` controls that MUST trip the gate: a per-op `{x,y,z,w}` object
31
+ allocator, and the documented `signal()`+dispose churn (264 B/op). lite-perf-gate
32
+ DEFAULT thresholds, untouched (maxScavenges 2, maxRetainedKB 64, maxOldGen 0,
33
+ maxArrayBuffersKB 64).
34
+ - **Result on this engine (node v26.x): green and REAL, 10/10** -- all seven
35
+ claimed-zero paths pass under defaults, both `mustFail` controls trip. Plain
36
+ `npm test` is undisturbed (the in-glob file emits one loud named skip unless
37
+ BOTH `--expose-gc` and `--max-semi-space-size=4` are present).
38
+
7
39
  ## [1.10.0-preview] -- 2026-09-06
8
40
 
9
41
  The **verification-infrastructure parity cut** for the named-nodes + `whyDirty()`
package/README.md CHANGED
@@ -829,8 +829,8 @@ Three tiers, all reproducible.
829
829
 
830
830
  ### Tier 1 -- Behavior (unit tests, fast)
831
831
 
832
- On the 1.10.0 engine `npm test` reports **553 tests, 552 pass, 0 fail, 1 skip**, and
833
- `npm run test:gc` (Tier 2, `--expose-gc`) reports **561 tests, 560 pass, 0 fail, 1
832
+ On the 1.10.0 engine `npm test` reports **559 tests, 558 pass, 0 fail, 1 skip**, and
833
+ `npm run test:gc` (Tier 2, `--expose-gc`) reports **567 tests, 566 pass, 0 fail, 1
834
834
  skip**. `npm test` runs the glob-scoped suite in `test/`, covering:
835
835
 
836
836
  - **`01-core.test.mjs`** -- signal/computed/effect basics, equality semantics, NaN/+/-0, subscribe/peek/update, untrack, batch, cleanup ordering, first-run error recovery, nested object reference-identity gotchas.
@@ -858,14 +858,14 @@ skip**. `npm test` runs the glob-scoped suite in `test/`, covering:
858
858
  - **`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.
859
859
  - **`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.
860
860
  - **`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.
861
- - **`25-devtools-real-boot.test.mjs`** -- the devtools pairing contract (14 tests). Boots the REAL installed `@zakkster/lite-devtools` 1.6.2 against this engine through an import-rewrite rig (both share ONE engine instance -- the rig catches the two-instance failure mode where the package resolves to the published build instead of the local engine). Pins the live-probed ground truth: all 22 function exports + the `VERSION` const, the EXACT 13-key `capabilities()` fingerprint (1.5 through 1.8 all true, `statsKeys: 14` -- devtools 1.6.2 has no 1.9 or 1.10 cap key, so the exact key set is itself the pin), the `burstProfile()` live-handle and `stop()` summary shapes, and the 1.6.x `Symbol.dispose` stamps on devtools' own stopper handles.
861
+ - **`25-devtools-real-boot.test.mjs`** -- the devtools pairing contract (20 tests). Boots the REAL installed `@zakkster/lite-devtools` 1.8.0 against this engine through an import-rewrite rig (both share ONE engine instance -- the rig catches the two-instance failure mode where the package resolves to the published build instead of the local engine). Pins the live-probed ground truth: all 25 function exports + the `VERSION` const, the EXACT 16-key `capabilities()` fingerprint (`names`/`whyDirty` finally read true from devtools' own behaviour probes; `settled` reads **false** -- this engine's validation rejects the unknown key, so devtools fails closed, and the VALUE rather than the key set discriminates this pairing from 1.11.0), the named-node flow (`inspect().name` absent-not-empty on unnamed handles, serialize v2 name round-trip, `toDot`/`toTree` label precedence resolver > engine name > kind#id), the `whyDirty`/`explain` non-perturbing passthroughs, `watchSettled`'s documented fail-closed null, the `burstProfile()` live-handle and `stop()` summary shapes, and the `Symbol.dispose` stamps on devtools' own stopper handles.
862
862
  - **`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%).
863
863
  - **`30-throwing-equals.test.mjs`** -- a user `equals` that THROWS, pinned at all five 1.10.0 invocation sites (9 tests): the three callable sites (signal set pre-check, batch revert, computed re-eval -- with a CONTRAST anti-tautology test proving the batch-revert pin is caused by the throw, not the set-then-back shape) and the two `signalBox` `boxSet` sites (pre-check leaves the box unmutated; batch-revert strands the version bump so the net value fires downstream).
864
864
  - **`33-cleanup-return.test.mjs`** -- the 1.8.0 effect cleanup-return contract at unit grain (7 tests): timing (fires before re-run + on dispose), compose order with `onCleanup`, non-function returns ignored, the computed exclusion.
865
865
  - **`34-computed-selfdirty-prev-owner.test.mjs`** -- forward-compat suite for the roadmap 1.10.x+ surface (11 tests): `computed(fn(prev), {initial})` and the gen-guarded owner APIs, feature-discriminated so legacy engines degrade cleanly; plus the DELIBERATE #179/#15 absorption pin (a computed writing its own tracked dep ABSORBS) that holds on every 1.x engine.
866
866
  - **`35-config-validation.test.mjs`** -- the 1.4.5 `createRegistry` validation matrix on the 6-key config family incl `flushStrategy` (13 tests): per-option `TypeError`s, did-you-mean hints, the eager-construction ceiling, the two pool-population stats keys, and OOM rows spawned as child processes under a 256 MB cap via `35-config-oom.child.mjs`.
867
867
  - **`36-named-and-whydirty.test.mjs`** -- the 1.10.0 discriminator (6 tests): `signal(v, {name})` / `computed` / `effect` names surface in `describe().name` (and are absent for unnamed nodes -- zero node-shape change); `whyDirty(computed)` returns EXACTLY the dep whose version moved past the observer's `evalVersion` (never the whole dep set -- the rejected-sketch bug), traces transitively to the root signal write, and is read-only (a `whyDirty` call never pulls, so it cannot perturb the clock it describes).
868
- - **`37-devtools-zerogc-probe.test.mjs`** -- the zero-GC claim on the reactive-benchmark weak-group shapes (5 tests), through both the engine's `stats().poolGrowths` counter and devtools 1.6.2's `watchAllocations()` feed: the pool never grows its backing store (`poolGrowths` delta == 0).
868
+ - **`37-devtools-zerogc-probe.test.mjs`** -- the zero-GC claim on the reactive-benchmark weak-group shapes (5 tests), through both the engine's `stats().poolGrowths` counter and devtools 1.8.0's `watchAllocations()` feed: the pool never grows its backing store (`poolGrowths` delta == 0).
869
869
 
870
870
  ```bash
871
871
  npm test
@@ -886,6 +886,15 @@ If these fail, something allocates in the hot path and we want to find it before
886
886
  npm run test:gc
887
887
  ```
888
888
 
889
+ Two standing zero-GC gates back this tier. `npm run test:zgc` runs the suite's own lite-gc-profiler harness (`test/zgc/*`). `npm run test:gate` (added 1.10.0-preview.1) runs **`test/38-perf-gate.test.mjs`**, a second, library-owned judge built on **`@zakkster/lite-perf-gate`** (devDependency only): its `zgcSuite` watches five signals (scavenges / engine `stats()` counters / retainedKB / oldGen / arrayBuffersKB) at two scales with positive+negative+large detector controls, over seven claimed-zero steady-state scenarios (`set-propagate`, `computed-cache-hit`, `computed-recompute-stable`, `effect-rerun-stable`, `peek`, `batch-flush`, `box-set-propagate`) plus two permanent `mustFail` controls (a per-op `{x,y,z,w}` allocator and the documented `signal()`+dispose 264 B/op churn). Thresholds are lite-perf-gate DEFAULTS (maxScavenges 2, maxRetainedKB 64, maxOldGen 0, maxArrayBuffersKB 64) -- a claimed-zero path that cannot meet defaults is a finding, not a config knob. Both lanes are chained by `test:all`.
890
+
891
+ ```bash
892
+ npm run test:zgc # lite-gc-profiler harness (requires --expose-gc --max-semi-space-size=4)
893
+ npm run test:gate # lite-perf-gate judge; same two flags, else one loud named skip
894
+ ```
895
+
896
+ `test:gate` runs REAL only under both `--expose-gc` and `--max-semi-space-size=4` (young-gen sensitivity); the script sets both. Under plain `npm test` / `test:gc` the in-glob file emits one loud named skip -- never a silent pass, never a false red.
897
+
889
898
  ### Tier 3 -- Performance (comparative benchmark)
890
899
 
891
900
  `npm run bench` runs the **microscope** -- lite's recommended eager config on six first-party shapes; the aggregate output is [`bench/r.txt`](./bench/r.txt) (four engines: lite, alien, preact, solid). Cross-framework standing comes from the **mirror** (`node --expose-gc bench/mirror.mjs --self-verify` then `bench/sweep.mjs`), which runs Andrii's canonical adapter verbatim so rows diff 1:1 against his log; the aggregate output is [`bench/rb.txt`](./bench/rb.txt) (lite vs alien, all 47 shapes). Every output carries a machine-generated `#STAMP` (engine + harness sha256, the live registry config, host, node), so a header can never disagree with the code that ran. The pre-v3 five-framework reactivity suite was **removed after 1.5.1** (bench protocol v3). Full methodology: [`bench/README.md`](./bench/README.md).
package/Signal.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @zakkster/lite-signal v1.10.0-preview
2
+ * @zakkster/lite-signal v1.10.0-preview.1
3
3
  * Copyright (c) Zahary Shinikchiev <shinikchiev@yahoo.com>
4
4
  * MIT License
5
5
  * --------------------
package/llms.txt CHANGED
@@ -54,7 +54,8 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
54
54
 
55
55
  ## Version notes
56
56
 
57
- - **1.10.0-preview** (current): **named nodes + `whyDirty()`** -- the tracing foundation, two cold-path diagnostics the profilers consume directly (`signal/computed/effect(v, {name})` into a cold registry-side `Map<id,name>`; `whyDirty(computed)` returns the deps whose version moved past the observer's `evalVersion`, tracing to the root signal write, read-only and never pulling). Zero node-shape change, zero cost for unnamed nodes; the four hot propagation bodies are byte-identical to 1.9.0 (sha-proven, see WHY-1_10.md). Module 33 exports / registry 27 fns. This cut ALSO lands the verification-infrastructure parity that the rest of the line carries: torture 22 -> **27 scenarios** (all 23 semantic execute, zero floor-skips), unit suite glob-scoped to **553 tests** (test/25 rewritten against the live devtools-1.6.2 pairing; new `test/36-named-and-whydirty` discriminator + `test/37` zero-GC probe), the `test/zgc` + `test/ProfilerTests` + `harness/ProfilerTools` lanes, the phase-1/2/3 harness instruments (mint measured IDENTICAL for the sixth engine; visit 21/21 no re-anchor; jit strict 4x monomorphic), and the VersionMatrix gate (PASSED 5/5, counters 288/0). devDeps: devtools ^1.6.2, gc-profiler ^1.16.0. ENGINE NOTE: the folder's v1.10.0-canary.1 engine had forked the rebuilt-1.9 line before two later cold-path fixes; the disposeNode cursor-repair and the 1.4.5 createRegistry validation (+ 2 stats keys) were ported verbatim from 1.9.0 (no hot body touched), fixing a real dispose-mid-retrack crash. See CHANGELOG `[1.10.0-preview]`.
57
+ - **1.10.0-preview.1** (current): verification + docs increment -- no engine change past the banner comment (`Signal.js` byte-identical, banner line only). Ports the standing **perf-gate lane** from the canonical 1.5.2 line: `test/38-perf-gate.test.mjs` + `npm run test:gate` (`node --expose-gc --max-semi-space-size=4`), chained into `test:all` after `test:zgc`. Wires **`@zakkster/lite-perf-gate`** (devDependency only) as a second, library-owned zero-GC judge beside the bespoke `test:zgc` harness: `zgcSuite` watches five signals (scavenges / engine `stats()` counters / retainedKB / oldGen / arrayBuffersKB) at two scales with positive+negative+large detector controls, over seven claimed-zero steady-state scenarios (set-propagate, computed-cache-hit, computed-recompute-stable, effect-rerun-stable, peek, batch-flush, box-set-propagate) plus two permanent `mustFail` controls (per-op `{x,y,z,w}` allocator; the documented `signal()`+dispose 264 B/op churn). Thresholds are lite-perf-gate DEFAULTS, untouched. Green and REAL on this engine (10/10); the in-glob file emits one loud named skip unless both flags are set, so plain `npm test` is undisturbed. See CHANGELOG `[1.10.0-preview.1]`.
58
+ - **1.10.0-preview**: **named nodes + `whyDirty()`** -- the tracing foundation, two cold-path diagnostics the profilers consume directly (`signal/computed/effect(v, {name})` into a cold registry-side `Map<id,name>`; `whyDirty(computed)` returns the deps whose version moved past the observer's `evalVersion`, tracing to the root signal write, read-only and never pulling). Zero node-shape change, zero cost for unnamed nodes; the four hot propagation bodies are byte-identical to 1.9.0 (sha-proven, see WHY-1_10.md). Module 33 exports / registry 27 fns. This cut ALSO lands the verification-infrastructure parity that the rest of the line carries: torture 22 -> **27 scenarios** (all 23 semantic execute, zero floor-skips), unit suite glob-scoped to **559 tests** (test/25 rewritten against the live devtools-1.8.0 pairing -- 25 exports, the exact 16-key `capabilities()` fingerprint with `settled:false` as this engine's discriminator, plus the names/whyDirty/serialize-v2/label-precedence/watchSettled-null cross-package lanes; new `test/36-named-and-whydirty` discriminator + `test/37` zero-GC probe), the `test/zgc` + `test/ProfilerTests` + `harness/ProfilerTools` lanes, the phase-1/2/3 harness instruments (mint measured IDENTICAL for the sixth engine; visit 21/21 no re-anchor; jit strict 4x monomorphic), and the VersionMatrix gate (PASSED 5/5, counters 288/0). devDeps: devtools ^1.8.0 (its 1.7.0 `names`/`whyDirty` capability flags finally read TRUE against this engine's own features; its 1.8.0 `settled` flag reads FALSE here -- the 1.11.0-pairing discriminator), gc-profiler ^1.16.0. ENGINE NOTE: the folder's v1.10.0-canary.1 engine had forked the rebuilt-1.9 line before two later cold-path fixes; the disposeNode cursor-repair and the 1.4.5 createRegistry validation (+ 2 stats keys) were ported verbatim from 1.9.0 (no hot body touched), fixing a real dispose-mid-retrack crash. See CHANGELOG `[1.10.0-preview]`.
58
59
  - **1.9.0-preview.6**: backports the **1.4.5 `createRegistry` input validation** (all four findings) onto the 1.9.0-preview.5 engine. Only `createRegistry`'s *cold* path moved; hot paths stay byte-identical and `bench/torture/run.mjs` is unchanged at 22/22. Bad config now throws a named `TypeError` (unknown keys get a did-you-mean); an absurd eager capacity is refused before it can OOM the process; `stats()` grows to 14 keys (adds `nodePoolPopulation`/`linkPoolPopulation`, purely additive). New `test/*-config-validation.test.mjs` (matrix + ceiling + population + OOM child processes). See CHANGELOG `[1.9.0-preview.6]`.
59
60
  - **1.9.0-preview.5**: a **packaging-only cut** -- the engine is
60
61
  behaviourally unchanged from preview.4 (`Signal.js` differs only in its header
@@ -772,7 +773,7 @@ function dumpOwnerTree(handle, depth = 0) {
772
773
  - `test/22-mutation-hook.test.mjs` -- 1.2.1 `onGraphMutation` registration + opcode emission (12 tests).
773
774
  - `test/23-owner-introspection.test.mjs` -- `ownerOf`, `forEachOwned`, gen-guarded introspection (14 tests).
774
775
  - `test/24-signalbox.test.mjs` -- the signalBox/computedBox handle API, active since 1.5.0: get/set/peek/update, derive + memoize, interop both directions, batch coalescing, dispose ABA-safety, plus the 1.9.0 `Symbol.dispose` box test (`using`-path disposal via the shared prototype stamp) (13 tests).
775
- - `test/25-devtools-real-boot.test.mjs` -- real **devtools 1.6.2** boot against the 1.10.0 engine via the single-instance import-rewrite rig: all 22 exports + `VERSION`, the exact 13-key `capabilities()` fingerprint probed live (`flushControl:T`, `cleanupReturn:T`, `statsKeys:14`; devtools 1.6.2 has NO 1.9 cap key, so the exact key set is itself the 1.9-era pin), live `burstProfile()` stop-summary, the 1.6.x `Symbol.dispose` stamps (14 tests).
776
+ - `test/25-devtools-real-boot.test.mjs` -- real **devtools 1.8.0** boot against the 1.10.0 engine via the single-instance import-rewrite rig: all 25 exports + `VERSION`, the exact 16-key `capabilities()` fingerprint probed live (`names:T`, `whyDirty:T`, `settled:F` -- the VALUE, not the key set, discriminates this engine from the 1.11.0 pairing), the named-node flow (inspect `name` absent-not-empty, serialize v2 round-trip, toDot/toTree precedence resolver > name > kind#id), `whyDirty`/`explain` non-perturbing passthrough, `watchSettled` fail-closed null, live `burstProfile()` stop-summary, the `Symbol.dispose` stamps (20 tests).
776
777
  - `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).
777
778
  - `test/27-create-root.test.mjs` -- `createRoot` (1.5.0), the ownership escape hatch; includes the top-level-export binding case (7 tests).
778
779
  - `test/28-run-with-owner.test.mjs` -- `getOwner`/`runWithOwner`: 7 basic shapes, 3 degradation cases (null/undefined/signal-handle fall through to rooted execution), 3 HAZARD PINS under allocation pressure so the ABA guard is genuinely exercised (16 tests).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zakkster/lite-signal",
3
- "version": "1.10.0-preview",
3
+ "version": "1.10.0-preview.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",
@@ -35,7 +35,8 @@
35
35
  "test:harness": "npm --prefix harness/ProfilerTools test",
36
36
  "test:zgc": "node --expose-gc --max-semi-space-size=4 --test 'test/zgc/*.test.mjs'",
37
37
  "test:zgc:report": "node --expose-gc test/zgc/zero-gc-gate.mjs",
38
- "test:all": "npm test && npm run test:hardening && npm run test:harness && npm run test:zgc",
38
+ "test:gate": "node --expose-gc --max-semi-space-size=4 --test test/38-perf-gate.test.mjs",
39
+ "test:all": "npm test && npm run test:hardening && npm run test:harness && npm run test:zgc && npm run test:gate",
39
40
  "bench": "node --expose-gc bench/benchmark.mjs",
40
41
  "harness": "node harness/run.mjs",
41
42
  "harness:smoke": "node harness/run.mjs smoke",
@@ -90,8 +91,9 @@
90
91
  },
91
92
  "sideEffects": false,
92
93
  "devDependencies": {
93
- "@zakkster/lite-devtools": "^1.6.2",
94
+ "@zakkster/lite-devtools": "^1.8.0",
94
95
  "@zakkster/lite-gc-profiler": "^1.16.0",
96
+ "@zakkster/lite-perf-gate": "^1.4.2",
95
97
  "@zakkster/lite-profiler": "^1.1.0",
96
98
  "@zakkster/lite-profiler-signal": "^1.2.0",
97
99
  "@zakkster/lite-signal": "^1.3.0 || >=1.4.0-beta.0 || >=1.6.0-preview.0",