@zakkster/lite-signal 1.6.0-preview.1 → 1.6.0-preview.2
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 +41 -0
- package/README.md +2 -0
- package/llms.txt +10 -0
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -64,6 +64,47 @@ pure-owner node transparently.
|
|
|
64
64
|
Exported as a registry method and a top-level helper bound to the default registry,
|
|
65
65
|
mirroring `createRoot`.
|
|
66
66
|
|
|
67
|
+
### Added -- characterization harnesses (`burst-dag.mjs`, `pull-stress.mjs`)
|
|
68
|
+
|
|
69
|
+
Two root-level standalone harnesses that exercise the new 1.6.0 instrumentation
|
|
70
|
+
surface against the engine's two main hot paths. Both are engine-agnostic
|
|
71
|
+
(`./Signal.js` + public `onGraphMutation` only), both expose a CLI + module
|
|
72
|
+
exports, both stay out of `npm test` and the published tarball.
|
|
73
|
+
|
|
74
|
+
**`burst-dag.mjs`** (`npm run profile:burst`, also `node --expose-gc burst-dag.mjs
|
|
75
|
+
[--width=512 --layers=32 ...]`) reconstructs the published
|
|
76
|
+
`js-reactivity-benchmark` burst shape (sources -> width x layers, fanIn 8, burst
|
|
77
|
+
16) and characterizes lite-signal's own flush behavior. The standalone path uses
|
|
78
|
+
the new `stats().flushPasses` counter as a cross-check against the opcode-6 pass
|
|
79
|
+
count -- by construction they must match when the hook is attached for exactly
|
|
80
|
+
one burst, which the harness asserts inline. Also exports `burstDagScenario`
|
|
81
|
+
(for plugging into a steady-state allocation gate) and `multiPassProbe` (a
|
|
82
|
+
controlled two-effect write-back that forces a `passes > 1` case so the opcode
|
|
83
|
+
dispatch can be smoke-tested on an engine where multi-pass actually occurs).
|
|
84
|
+
|
|
85
|
+
**`pull-stress.mjs`** (`npm run profile:pull`, also `node --expose-gc
|
|
86
|
+
pull-stress.mjs [--maxDepth=3584 --step=512 ...]`) is the pull-path companion:
|
|
87
|
+
characterizes how the recursive pull scales with chain depth and binary-searches
|
|
88
|
+
the exact overflow point. Three answers per run: (1) the exact deepest chain
|
|
89
|
+
that pulls successfully (the roadmap's "~5,000 chained computeds" pinned to a
|
|
90
|
+
number for the current engine), (2) per-level cold cost across a depth sweep
|
|
91
|
+
(should be roughly linear; superlinear flags a per-node bookkeeping cost
|
|
92
|
+
growing with depth), and (3) cached-read cost (should be O(1) regardless of
|
|
93
|
+
depth via the 1.1.4 `markEpoch` short-circuit). Structure pass at a safe fixed
|
|
94
|
+
depth confirms the opcode triple (0 flush passes, 0 effect runs, recomputes ==
|
|
95
|
+
depth) -- the pull path is doing nothing it shouldn't. Also exports
|
|
96
|
+
`pullStressScenario` for steady-state allocation gates and `probeOverflow`
|
|
97
|
+
for the binary search alone. Both `--kind=callable` and `--kind=box` are
|
|
98
|
+
supported and surface a real engine difference (box pulls overflow earlier
|
|
99
|
+
because `box.get()` adds a prototype-method frame per level, and cached box
|
|
100
|
+
reads are several times more expensive than cached callable reads).
|
|
101
|
+
|
|
102
|
+
Both files import only `./Signal.js`, so the same harness runs against any
|
|
103
|
+
engine build: point `Signal.js` at 1.5.x to compare without the counters
|
|
104
|
+
(`burst-dag` adapts -- only opcode 5 fires on that engine -- and `pull-stress`
|
|
105
|
+
works identically), or at a rejected candidate to re-verify on. The numbers
|
|
106
|
+
they produce are reproducible, comparable, and engine-version-aware.
|
|
107
|
+
|
|
67
108
|
### Verified
|
|
68
109
|
|
|
69
110
|
- **Full suite green** against the 1.6.0 engine: 443 tests, 442 pass, 0 fail,
|
package/README.md
CHANGED
|
@@ -485,6 +485,8 @@ A registry-level (and top-level) debug hook for push-based tooling -- the connec
|
|
|
485
485
|
|
|
486
486
|
**1.6.0 -- flush-profiling opcodes.** Opcodes `6` (flush pass) and `7` (effect run in pass) extend the surface to cover the flush dimension lite-devtools 1.2 / lite-studio 1.2 read through `watchAllocations`. The matching `stats().flushPasses` counter (the 12th `stats()` key) advances once per drain pass. Both the counter bump and the opcode dispatch sit behind the same `mutationHook !== null` gate, so when no listener is attached they are inert and `flushPasses` is frozen -- the flush loop is byte-identical to 1.5.0.
|
|
487
487
|
|
|
488
|
+
**Characterization harnesses (`burst-dag.mjs`, `pull-stress.mjs`).** Two root-level standalone harnesses that exercise the 1.6.0 instrumentation against the engine's two main hot paths. `burst-dag.mjs` (`npm run profile:burst`) reconstructs the layered DAG burst shape (sources -> width x layers, fanIn 8, burst 16) and uses opcodes 5/6/7 to characterize a single steady-state burst: flush passes, recomputes per node, effects enqueued vs short-circuited. Exports `burstDagScenario` for a steady-state allocation gate, and `multiPassProbe` for a controlled two-effect write-back that forces a `passes > 1` case so the opcode dispatch can be smoke-tested where multi-pass actually occurs. `pull-stress.mjs` (`npm run profile:pull`) is the pull-path companion: binary-searches the exact recursive-pull depth limit (the ~5,000-computed bound named in the roadmap, pinned to a number for the current engine), sweeps cold cost per level across depths to flag any superlinear bookkeeping, and confirms cached reads are O(1) regardless of depth (the 1.1.4 `markEpoch` short-circuit holds). Exports `pullStressScenario` for steady-state gates and `probeOverflow` for the bisection alone; supports both `--kind=callable` and `--kind=box`, which surface a real engine difference (box pulls overflow earlier because `box.get()` adds a prototype-method frame per level). Both import only `./Signal.js` + the public `onGraphMutation` hook, so the same files run against any engine build (point `Signal.js` at 1.5.x to compare without the counters). Neither is part of `npm test` or the published tarball -- they ship in source for reproducibility.
|
|
489
|
+
|
|
488
490
|
### onCleanup
|
|
489
491
|
|
|
490
492
|
```ts
|
package/llms.txt
CHANGED
|
@@ -87,6 +87,16 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
87
87
|
|
|
88
88
|
**The callable API and hot paths are unchanged**; this is purely additive
|
|
89
89
|
instrumentation and a second ownership primitive. Drop-in over 1.5.0.
|
|
90
|
+
Two root-level characterization harnesses ship in source (not in the
|
|
91
|
+
tarball): **`burst-dag.mjs`** (`npm run profile:burst`) reconstructs the
|
|
92
|
+
layered DAG burst shape and uses opcodes 5/6/7 + `stats().flushPasses` to
|
|
93
|
+
report flush passes, max recomputes per node, and per-burst us; also exports
|
|
94
|
+
`burstDagScenario` + `multiPassProbe`. **`pull-stress.mjs`** (`npm run
|
|
95
|
+
profile:pull`) is the pull-path companion: binary-searches the recursive-pull
|
|
96
|
+
depth limit (~5,000 named in the roadmap, pinned to a number per engine),
|
|
97
|
+
sweeps cold cost per level, confirms cached reads are O(1) via markEpoch;
|
|
98
|
+
exports `pullStressScenario` + `probeOverflow`. Both import only
|
|
99
|
+
`./Signal.js` + public `onGraphMutation`, run against any engine build.
|
|
90
100
|
**Tests:** 443 total, 442 pass, 0 fail, 1 skip (only the architecturally-N/A
|
|
91
101
|
SSR case in `17-reactivity`); +4 `createScope` tests in `test/28-scope_test.mjs`
|
|
92
102
|
and the 1.4.0 pool tests carry the 11-key shape pin forward to the new 12-key
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakkster/lite-signal",
|
|
3
|
-
"version": "1.6.0-preview.
|
|
3
|
+
"version": "1.6.0-preview.2",
|
|
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",
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
"test:coverage": "c8 node --test --test-reporter=spec",
|
|
32
32
|
"bench": "node --expose-gc bench/benchmark.mjs",
|
|
33
33
|
"bench-reactive": "node --expose-gc bench/benchmarkReactive.mjs",
|
|
34
|
+
"profile:burst": "node --expose-gc burst-dag.mjs",
|
|
35
|
+
"profile:pull": "node --expose-gc pull-stress.mjs",
|
|
34
36
|
"verify": "npm test && npm run bench"
|
|
35
37
|
},
|
|
36
38
|
"keywords": [
|