@zakkster/lite-signal 1.6.0-beta-0 → 1.6.0-experimental
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 +631 -473
- package/README.md +248 -179
- package/Signal.d.ts +121 -31
- package/Signal.js +732 -328
- package/llms.txt +248 -225
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -4,104 +4,432 @@ 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
|
-
## [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
`
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
Experimental fork. Two changes: a public **snapshot / restore** surface for
|
|
10
|
+
in-process time-travel / undo, and an internal move of the reactive graph's link
|
|
11
|
+
representation to a hybrid Structure-of-Arrays layout. The public callable / box
|
|
12
|
+
API and the steady-state hot path are unchanged; snapshot/restore is a cold path
|
|
13
|
+
and the SoA change is invisible above the engine boundary. Targets **1.7.0**
|
|
14
|
+
(canonical 1.6.0 ships first): this fork is the proven reference at the 1.5.2
|
|
15
|
+
engine base, and the SoA + snapshot/restore work forward-ports onto the 1.7.0
|
|
16
|
+
engine -- with all its intervening features -- before release. The fork stays at
|
|
17
|
+
1.5.2 here so its version-floored gates remain honest.
|
|
18
|
+
|
|
19
|
+
### Added -- `snapshot()` / `restore()` (in-process time-travel / undo)
|
|
20
|
+
|
|
21
|
+
- **`snapshot(registry) -> Snapshot`** captures the live graph's STATE in a single
|
|
22
|
+
cold walk of the node pool: per node `{ id, kind, flags, value, version,
|
|
23
|
+
ownerId, deps, clean }`, keyed by the stable in-process `node.id`; `ownerId` and
|
|
24
|
+
`deps` reference other nodes by that id. Values are held **by reference**
|
|
25
|
+
(in-process; no serialization constraint). Compute functions, equality
|
|
26
|
+
predicates, and schedulers are NOT captured. It does not perturb the graph and
|
|
27
|
+
allocates nothing on any hot path.
|
|
28
|
+
- **`restore(snapshot, { fnsById, config?, handles? }) -> Registry`** rebuilds a
|
|
29
|
+
FRESH registry from a snapshot. Compute / effect bodies are re-supplied by stable
|
|
30
|
+
id through `fnsById` -- functions do not serialize, so re-supplying them is the
|
|
31
|
+
rehydration contract; pass `handles` to receive the rebuilt handles keyed by id
|
|
32
|
+
(the natural way to wire the `fnsById` bodies to the new graph -- the bodies
|
|
33
|
+
close over that object and are only invoked after restore has populated it).
|
|
34
|
+
Signals and boxes restore with their value + version. A CLEAN, evaluated
|
|
35
|
+
computed is trusted (deps rebuilt, first read is a cache hit); a
|
|
36
|
+
NEVER-EVALUATED or DIRTY computed (`clean: false`) is rebuilt UNCOMPUTED, so its
|
|
37
|
+
first read re-runs the body and re-tracks deps. Boxes (`signalBox` /
|
|
38
|
+
`computedBox`) restore as their box handle shape, not as callables.
|
|
39
|
+
- **Effects restore their state but do NOT re-fire** -- no user side effect runs
|
|
40
|
+
during restore; a restored effect fires on the next dependency change. This is
|
|
41
|
+
the undo / time-travel semantic (restoring a past state must not replay its side
|
|
42
|
+
effects).
|
|
43
|
+
- **Fail closed** on every unverified state. `snapshot()` throws `[lite-signal]
|
|
44
|
+
snapshot: graph not settled (flush/batch/track in progress)` when called
|
|
45
|
+
mid-flush, mid-batch, or mid-track -- a cut taken there would be torn.
|
|
46
|
+
`restore()` throws on a missing fn for a computed / effect (`[lite-signal]
|
|
47
|
+
restore: missing fn for id <id> (<kind>)`), a duplicate id, a dangling dep id,
|
|
48
|
+
or an unknown owner id. The fresh registry is sized from the snapshot (node
|
|
49
|
+
count + total dep edges, with headroom) so a graph larger than the default
|
|
50
|
+
1024-node capacity restores without a `CapacityError`; pass `config` to pin
|
|
51
|
+
`prealloc` / `onCapacityExceeded` / an explicit capacity.
|
|
52
|
+
- **Two limits, stated plainly.** (1) An effect that had NEVER run at snapshot
|
|
53
|
+
time (a pending scheduled effect) restores DORMANT -- it is not re-scheduled,
|
|
54
|
+
and fires on the next dependency change like any other restored effect. (2)
|
|
55
|
+
Cross-realm / worker transfer and persistence are NOT supported: values are
|
|
56
|
+
captured by reference for in-process time-travel, so a snapshot is not a
|
|
57
|
+
structured-cloneable document. Serializing across a realm boundary would require
|
|
58
|
+
a structured-cloneable value constraint and a different engine layout -- out of
|
|
59
|
+
scope here, a possible future direction.
|
|
60
|
+
- **Cold path only.** snapshot/restore add ZERO cost to the steady-state hot path;
|
|
61
|
+
the propagation / read path is untouched, so 0 B/op and throughput are
|
|
62
|
+
unaffected.
|
|
63
|
+
- Pinned by `test/33-snapshot.test.mjs`: a 200-seed round-trip oracle (value +
|
|
64
|
+
version + propagation, both the pre-read and never-pre-read variants), the
|
|
65
|
+
effects-do-not-re-fire contract, box round-trip, owner-tree rebuild from ids, a
|
|
66
|
+
1000-cycle retention check, the clean / dirty / never-read computed cases, and
|
|
67
|
+
the full fail-closed battery.
|
|
68
|
+
- Dedicated harness tooling for the new surface: `bench/torture/snapshot-torture.mjs`
|
|
69
|
+
(a 27th torture scenario in `run.mjs`) fuzzes the round-trip over 40 seeds tying
|
|
70
|
+
every restored computed's recompute count to the snapshot's own `clean` bit,
|
|
71
|
+
message-pins the fail-closed battery + unsettled-graph guards, and adds a
|
|
72
|
+
retained-heap witness (cold paths allocate, so it gates per-cycle retention, not
|
|
73
|
+
0 B/op). `bench/snapshot-bench.mjs` profiles snapshot / restore ns/node and
|
|
74
|
+
serialized bytes/node across graph sizes (median-of-N), and feature-detects so it
|
|
75
|
+
prints N/A and exits 0 on an engine without the surface.
|
|
76
|
+
|
|
77
|
+
### Changed -- reactive graph link pool moved to a hybrid Structure-of-Arrays layout
|
|
78
|
+
|
|
79
|
+
The reactive graph's link pool moved from pointer-threaded link objects to a
|
|
80
|
+
hybrid Structure-of-Arrays layout: `Int32Array` threading columns for the dep /
|
|
81
|
+
sub list wiring plus packed reference columns for the node / value payloads. This
|
|
82
|
+
is an INTERNAL representation change only -- the public callable / box API is
|
|
83
|
+
unchanged, and the steady-state hot path (propagation, reads) and its 0 B/op
|
|
84
|
+
profile are unchanged.
|
|
85
|
+
|
|
86
|
+
The win is retained-heap and GC-mark time for long-running processes and large
|
|
87
|
+
graphs, not throughput. Measured on this engine (node v26.8.2), at 1e5 nodes /
|
|
88
|
+
4e5 links:
|
|
89
|
+
|
|
90
|
+
| metric | before | after | delta |
|
|
91
|
+
| ----------------------------- | -----: | ----: | ------------ |
|
|
92
|
+
| GC-traced pointers (resident) | 4.60M | 2.20M | ~2.09x fewer |
|
|
93
|
+
| retained heap | 87 MB | 58 MB | ~33% denser |
|
|
94
|
+
|
|
95
|
+
Major-GC mark time drops correspondingly (fewer traced pointers to walk).
|
|
96
|
+
Steady-state throughput and the 0 B/op hot path are unchanged -- this is a
|
|
97
|
+
mark-time / retained-heap win, not a throughput change.
|
|
98
|
+
|
|
99
|
+
## [1.5.2] -- 2026-09-19
|
|
100
|
+
|
|
101
|
+
Dev-only session: a standing, self-validating zero-GC judge. `Signal.js` is
|
|
102
|
+
byte-identical to 1.5.1 except the version banner comment; no API change, no
|
|
103
|
+
behavior change, no engine logic moved. `Watch.js`, `bench/`, `harness/`, and
|
|
104
|
+
`conformance/` are untouched.
|
|
105
|
+
|
|
106
|
+
### Added -- perf-gate lane (dev-only, engine-frozen)
|
|
107
|
+
|
|
108
|
+
`@zakkster/lite-perf-gate` (`^1.4.2`, devDependency only -- runtime `dependencies`
|
|
109
|
+
stay empty) joins as the standing verdict on lite-signal's headline zero-GC
|
|
110
|
+
claim. New file `test/32-perf-gate.test.mjs` wires `zgcSuite()` over seven
|
|
111
|
+
claimed-zero steady-state paths, each anchored to its `llms.txt` "Performance
|
|
112
|
+
characteristics" claim and warmed inside `setup()` so the measurement window
|
|
113
|
+
sees only steady state: `set-propagate` (1 signal -> 8 computeds -> 1 effect,
|
|
114
|
+
synchronous flush), `computed-cache-hit`, `computed-recompute-stable`,
|
|
115
|
+
`effect-rerun-stable`, `peek`, `batch-flush` (3 sets/batch), and
|
|
116
|
+
`box-set-propagate` (the 1.5.0 `signalBox`/`computedBox` surface). Five signals
|
|
117
|
+
judge every run -- scavenges, engine counters (`totalAllocations` /
|
|
118
|
+
`totalDisposals` / `poolGrowths`, all budgeted to 0 via per-scenario
|
|
119
|
+
`statsOf`), retained heap, old-gen, and external/arrayBuffers -- at two scales
|
|
120
|
+
(N and k*N), with positive/negative/large detector controls validated on every
|
|
121
|
+
invocation. Two permanent negative controls keep the gate honest: a per-op
|
|
122
|
+
object allocator and a per-op `signal()`+`dispose` churn (the documented
|
|
123
|
+
264 B/op creation path); both MUST trip the gate.
|
|
124
|
+
|
|
125
|
+
New script `test:gate` (`node --expose-gc --max-semi-space-size=4 --test
|
|
126
|
+
test/32-perf-gate.test.mjs`) runs the gate for real; it is appended to
|
|
127
|
+
`test:all`. The gate file guards on `--expose-gc` AND `--max-semi-space-size=4`
|
|
128
|
+
and otherwise emits ONE loud named skip, so plain `npm test` stays green: this
|
|
129
|
+
lane adds exactly one loud named skip over 1.5.1 (pass count unchanged; the
|
|
130
|
+
other skip is the architecturally-N/A SSR case). `node:test`'s absolute leaf
|
|
131
|
+
tally is node-version-sensitive -- on node v26.8.2 `npm test` reports 513 pass /
|
|
132
|
+
2 skip. The 16MB `test:gc` lane never produces a false red. Thresholds are lite-perf-gate
|
|
133
|
+
defaults, untouched.
|
|
134
|
+
|
|
135
|
+
### Docs
|
|
136
|
+
|
|
137
|
+
`llms.txt` gains the perf-gate version note and the fixed 13-key `RegistryStats`
|
|
138
|
+
interface block (`nodePoolPopulation` / `linkPoolPopulation` were described in
|
|
139
|
+
prose since 1.5.0 but missing from the interface listing). README Testing
|
|
140
|
+
strategy gains the gate lane.
|
|
141
|
+
|
|
142
|
+
## [1.5.1] -- 2026-09-05
|
|
143
|
+
|
|
144
|
+
Docs + verification patch. `Signal.js` is byte-identical to 1.5.0 except the
|
|
145
|
+
version banner comment; no API change, no behavior change. Ships the corrected
|
|
146
|
+
allocation economics below to the `latest` line while `1.6.0-rc` bakes.
|
|
147
|
+
|
|
148
|
+
### Added -- mint-cycle allocation anatomy probe (harness, no engine change)
|
|
149
|
+
|
|
150
|
+
A dedicated probe (`harness/mint-anatomy.mjs`, dispatched as `mint`) pins the
|
|
151
|
+
per-op heap cost of every creation primitive's mint+dispose cycle on a pre-grown
|
|
152
|
+
fixed-ceiling registry (`createRegistry({maxNodes:1<<16, maxLinks:1<<18,
|
|
153
|
+
onCapacityExceeded:"throw"})`). Fresh child process per (variant, warmup) cell --
|
|
154
|
+
JIT tier state poisons same-process comparisons. `Signal.js` / `Signal.d.ts`
|
|
155
|
+
untouched; this is verification + attribution only.
|
|
156
|
+
|
|
157
|
+
**Corrected numbers** (all-space B/op, node v26.3.1 darwin/arm64, pre-grown
|
|
158
|
+
throw-policy registry, slope over ops windows {1000,4000,16000} so the sampler
|
|
159
|
+
constant cancels):
|
|
160
|
+
|
|
161
|
+
| cycle (mint + dispose) | all-space B/op | note |
|
|
162
|
+
| ---------------------- | -------------: | --------------------------------------- |
|
|
163
|
+
| `signal(1)` + dispose | 264 | tier-invariant |
|
|
164
|
+
| `computed(fn)` + dispose | 208 | 4 own props, no `set`/`update` |
|
|
165
|
+
| `effect(fn)` + disposeFn() | 160 | 2-prop disposer + 3-slot context |
|
|
166
|
+
| `signalBox(1)` + dispose | 56 | `Object.create(proto)` handle, 0 closures |
|
|
167
|
+
| `computedBox(fn)` + dispose | 56 | same |
|
|
168
|
+
| dispose side (all forms) | 0 | mint-and-hold equals the cycle to +-0.3 B |
|
|
169
|
+
|
|
170
|
+
LiteStore LS-06's ~209 B for the signal cycle was a **new-space-only reading at a
|
|
171
|
+
pre-TurboFan tier**: below ~15-25k lifetime mints, ~56 B/op of closure-feedback
|
|
172
|
+
plumbing lands in OLD space, invisible to a `new_space` delta. The total was
|
|
173
|
+
always 264. `--no-turbofan` freezes the new-space witness at 208 forever;
|
|
174
|
+
`--no-maglev` shows 264 immediately; all-space totals never move (264.3 at every
|
|
175
|
+
tier). Hence the methodology rule this probe enforces (P3, and the sampling-profiler
|
|
176
|
+
cross-check in the findings): **allocation accounting must sum `space_used_size`
|
|
177
|
+
over ALL heap spaces** -- a new-space-only delta is valid only for scavenge-churn
|
|
178
|
+
characterization, never for per-op cost.
|
|
179
|
+
|
|
180
|
+
**Pooling accessor closures with their nodes -- evaluated and REJECTED (fail-open).**
|
|
181
|
+
Reusing one accessor-closure identity across dispose/reuse makes a retained stale
|
|
182
|
+
handle and a fresh handle *the same object* (`a === b`), so both holders share one
|
|
183
|
+
captured `birthGen` and the ABA gen-guard -- checked at the only place it runs and
|
|
184
|
+
pinned by `probe-c1-stale-set` / `probe-c1-stale-read` -- becomes undecidable: a
|
|
185
|
+
stale `a()` reads the recycled slot's new resident, a stale `a.set()` overwrites
|
|
186
|
+
it. That fails open; suite law is fail closed. **Fresh accessor identity per mint
|
|
187
|
+
is load-bearing** for the stale-handle contract and cannot be repaired by any stamp
|
|
188
|
+
placement. The callable path's ~264 B is therefore the documented, irreducible
|
|
189
|
+
price of `count()` / `count.set(x)` ergonomics; **`signalBox` (56 B/op, same graph,
|
|
190
|
+
same but DECIDABLE guard -- each box carries its own `NODE_GEN`) is the sanctioned
|
|
191
|
+
cheap path** (-79%). FinalizationRegistry-gated recycling is semantically sound but
|
|
192
|
+
allocates per mint, makes reuse GC-scheduled, and retains every accessor until
|
|
193
|
+
finalization -- rejected too.
|
|
194
|
+
|
|
195
|
+
Run it: `node harness/run.mjs mint [--verify]` (`--verify` applies relative pins
|
|
196
|
+
P1..P5; exit 0 iff every cell succeeded and every pin passed).
|
|
197
|
+
|
|
198
|
+
### Added -- attribution instrument set (harness-only, none ship in the tarball)
|
|
199
|
+
|
|
200
|
+
- `harness/costmodel.mjs`, `creation-anatomy.mjs` (+ child), `floors.mjs`
|
|
201
|
+
(+ `floors-history.json`), `jit-health.mjs` (+ `jit-baseline.json`),
|
|
202
|
+
`trend.mjs`, `visit-anatomy.mjs`; VersionMatrix `creation-churn` workload +
|
|
203
|
+
same-host 1.3.0/1.5.0 reference baselines. Verification instruments only.
|
|
204
|
+
|
|
205
|
+
### Changed
|
|
206
|
+
|
|
207
|
+
- devDependencies: `@zakkster/lite-devtools` ^1.2.0 -> ^1.3.1,
|
|
208
|
+
`@zakkster/lite-gc-profiler` ^1.15.0 -> ^1.16.0 (the instrument versions the
|
|
209
|
+
suite is gated with). Runtime dependencies remain zero.
|
|
210
|
+
|
|
211
|
+
## [1.5.0] -- 2026-08-21
|
|
212
|
+
|
|
213
|
+
**Stable 1.5.0.** Graduates `1.5.0-rc.3` to the release line with **no further engine
|
|
214
|
+
change** -- `Signal.js` / `Signal.d.ts` are byte-identical to rc.3 past the version
|
|
215
|
+
header, and the zero-GC gates (`bench/torture/run.mjs` 22/22) are unchanged. This is
|
|
216
|
+
the first stable to carry the **1.4.5 `createRegistry` input validation** (folded in
|
|
217
|
+
at rc.3; see below) on top of the 1.5.0 surface: `signalBox` / `computedBox`,
|
|
218
|
+
`createRoot`, and `getOwner` / `runWithOwner`. Drop-in over 1.4.5 for the callable
|
|
219
|
+
API; the only observable delta on existing code is `stats()` growing 11 -> 13 keys
|
|
220
|
+
(purely additive). The full rc/beta history is retained below.
|
|
221
|
+
|
|
222
|
+
## [1.5.0-rc.3] -- 2026-08-20
|
|
223
|
+
|
|
224
|
+
Backports the **1.4.5 `createRegistry` input validation** (all four findings) onto
|
|
225
|
+
the rc.2 engine. This is the first engine change since the RC line began -- the hot
|
|
226
|
+
paths are still byte-identical to 1.4.0; only `createRegistry`'s *cold* construction
|
|
227
|
+
path gained validation, so the zero-GC gates (`bench/torture/run.mjs` 22/22) are
|
|
228
|
+
unchanged. If you had a typo in your registry config, you will now hear about it.
|
|
229
|
+
|
|
230
|
+
### Added -- createRegistry validates its config (fail closed)
|
|
231
|
+
|
|
232
|
+
- **Bounded eager construction.** `prealloc:"eager"` with a non-finite or absurd
|
|
233
|
+
capacity (`maxNodes:Infinity`, `maxNodes:1e9`) previously ran an unbounded
|
|
234
|
+
construction loop and killed the process with an **uncatchable SIGABRT**. It now
|
|
235
|
+
throws a `TypeError` **by name**, before allocating, gated on `(maxNodes+maxLinks)`
|
|
236
|
+
against a ceiling of `1<<24` (16,777,216) objects. `prealloc:"lazy"` keeps its
|
|
237
|
+
unbounded on-demand ledger, untouched.
|
|
238
|
+
- **Per-option validation by name.** `maxNodes` / `maxLinks` / `maxFlushPasses` must
|
|
239
|
+
be finite integers `>= 1`; `prealloc` must be exactly `"eager"` | `"lazy"`;
|
|
240
|
+
`onCapacityExceeded` must be exactly `"throw"` | `"grow"`. Each bad value throws a
|
|
241
|
+
`TypeError` prefixed `createRegistry: "<option>"` at construction -- not a delayed
|
|
242
|
+
internal `nextFree` TypeError on first use.
|
|
243
|
+
- **Config-shape gate.** A non-object, `null`, or array `config` throws
|
|
244
|
+
`createRegistry: "config"` rather than dying later.
|
|
245
|
+
- **Unknown-key rejection with did-you-mean.** An unrecognized key throws with a
|
|
246
|
+
Levenshtein suggestion (`maxNods` -> `maxNodes`, `preAlloc` -> `prealloc`) instead
|
|
247
|
+
of being silently ignored.
|
|
248
|
+
- **`stats()` gains `nodePoolPopulation` / `linkPoolPopulation`** -- the TRUE count
|
|
249
|
+
of physically constructed nodes/links (`nodePool.length` / `linkPool.length`),
|
|
250
|
+
distinct from the `*Capacity` ledgers. A silently mis-set `prealloc` is now
|
|
251
|
+
observable (population 0 under lazy) instead of telemetry-blind. **This is the one
|
|
252
|
+
observable API change: `stats()` grows 11 -> 13 keys, purely additive** -- no
|
|
253
|
+
existing key changed; only an exact key-*count* assertion is affected (updated
|
|
254
|
+
in `test/03-pool.test.mjs`).
|
|
255
|
+
|
|
256
|
+
### Tests
|
|
257
|
+
|
|
258
|
+
`test/30-config-validation.test.mjs` adds the full 25-config matrix, the did-you-mean
|
|
259
|
+
cases, the eager ceiling, the population contract, and the three OOM rows as isolated
|
|
260
|
+
child-process cases (`test/30-config-oom.child.mjs`) proving the fixed engine throws
|
|
261
|
+
+ exits 0 under a 256 MB cap where the unvalidated engine died.
|
|
262
|
+
|
|
263
|
+
## [1.5.0-rc.2] -- 2026-08-18
|
|
264
|
+
|
|
265
|
+
Version-only bump over rc.1; engine byte-identical past the header. Superseded by
|
|
266
|
+
rc.3, the first entry to carry an engine change.
|
|
267
|
+
|
|
268
|
+
## [1.5.0-rc.1] -- 2026-07-27
|
|
269
|
+
|
|
270
|
+
Release candidate for 1.5.0. Promotes `1.5.0-beta.8` with **no engine change** --
|
|
271
|
+
`Signal.js` and `Signal.d.ts` are FROZEN: byte-identical to beta.8, hot paths
|
|
272
|
+
byte-identical to 1.4.0. What this RC finalises is the *torture surface*: it is
|
|
273
|
+
brought to full **parity with 1.4.4** at **22 scenarios (19 semantic + 3 soak)**.
|
|
274
|
+
This work is **verification-only** -- the added test/bench material OBSERVES the
|
|
275
|
+
frozen engine and pins its ACTUAL behaviour; nothing in the engine moved.
|
|
276
|
+
|
|
277
|
+
### Changed -- the torture suite is now at full 1.4.4 parity (22 scenarios)
|
|
278
|
+
|
|
279
|
+
The `bench/torture/` runner (`run.mjs`) now registers **22** scenarios in two
|
|
280
|
+
groups -- **19 semantic + 3 soak** -- up from the sixteen (13 semantic + 3 soak)
|
|
281
|
+
the earlier RC listed. Six scenarios are finalised here, ported from 1.4.4 and
|
|
282
|
+
re-pointed / re-targeted to the surface 1.5.0 actually ships:
|
|
283
|
+
|
|
284
|
+
- `owner-torture` -- getOwner/runWithOwner capture-restore, live adoption +
|
|
285
|
+
cascade-dispose, ABA stale-handle -> rooted degradation, dep isolation. 1.5.0
|
|
286
|
+
has no `createScope`, so every owner scope is built from an **effect as the
|
|
287
|
+
unit of ownership** (getOwner() inside an effect body captures that effect;
|
|
288
|
+
its stop() cascade-disposes adopted children).
|
|
289
|
+
- `error-torture` -- throwing effect bodies: per-effect buffering, exact-order
|
|
290
|
+
`AggregateError`, single-throw re-thrown unwrapped, buffer drain flat over
|
|
291
|
+
4096 throw/clean cycles. Confirmed byte-identical to 1.4.4 (Signal.js :816 /
|
|
292
|
+
:823-825 / :829-839).
|
|
293
|
+
- `deep-chain-torture` -- `pullComputed` recursion fails closed with a
|
|
294
|
+
**RangeError** at depth; the iterative push path stays open at equal depth.
|
|
295
|
+
- `zerogc-torture` -- the zero-GC hot path made falsifiable via
|
|
296
|
+
`@zakkster/lite-gc-profiler` (a **dev-only** dependency; `dependencies` stays
|
|
297
|
+
empty). `ZEROGC_BREAK=1` self-test confirmed to reject a planted allocation.
|
|
298
|
+
- `introspect-torture` -- describe/forEach*/hasObservers/ownerOf + the ABA
|
|
299
|
+
gen-stamp guard. Section 7 (ownerOf/forEachOwned) re-targeted off `createScope`
|
|
300
|
+
onto an effect-body owner.
|
|
301
|
+
- `lifecycle-torture` -- createRoot detachment + destroy registry reset; the
|
|
302
|
+
root-vs-owner scenario nests `createRoot` inside an effect body so detachment
|
|
303
|
+
is observable. `destroy()` leaves `stats().activeNodes === 0`.
|
|
304
|
+
|
|
305
|
+
**First-time execution on the 1.5.0 engine.** Several lanes that only ever
|
|
306
|
+
SKIPPED on earlier cuts now EXECUTE here for the first time: `box-torture`
|
|
307
|
+
(signalBox/computedBox), the **`churn-box`** lane inside `zerogc-torture`
|
|
308
|
+
(signalBox create+dispose churn -- retains 0 B/call, `poolGrowths` delta 0,
|
|
309
|
+
`activeNodes` back to baseline), and the owner/root lifecycle scenarios
|
|
310
|
+
(`lifecycle-torture` + `owner-torture` via getOwner/runWithOwner/createRoot).
|
|
311
|
+
|
|
312
|
+
Every scenario feature-detects and **skips cleanly** below the version that
|
|
313
|
+
introduces its feature. On the 1.5.0 engine the runner executes **15 semantic
|
|
314
|
+
scenarios** and reports a clean SKIP for the four feature-gated later-version
|
|
315
|
+
ones: `scope-torture` (1.6.0 `createScope`), `flush-torture` (1.7.0
|
|
316
|
+
`flushStrategy`), `cleanup-return-torture` (1.8.0 effect-return cleanup), and
|
|
317
|
+
`dispose-torture` (1.9.0 `Symbol.dispose`). Each of the three soaks now carries
|
|
318
|
+
an `Int32Array` value-correctness oracle (allocated once, a rotating sampled
|
|
319
|
+
window per tick with zero per-tick allocation, a full sweep at teardown).
|
|
320
|
+
|
|
321
|
+
**Final verification for this RC (`--expose-gc`):**
|
|
322
|
+
|
|
323
|
+
| group | result |
|
|
324
|
+
| ----- | ------ |
|
|
325
|
+
| `torture:semantic` | 19/19 pass -- 15 executed, 4 clean skips (scope/flush/cleanup-return/dispose) |
|
|
326
|
+
| `torture:soak` | 3/3 pass -- zero errors, every pool back to its leaf-only floor, oracle sweeps 0 mismatches |
|
|
327
|
+
|
|
328
|
+
The mutation-evidence table in `bench/torture/README.md` is unchanged and still
|
|
329
|
+
holds: the soaks catch 1 of 5 injected engine defects, the semantic files catch
|
|
330
|
+
5 of 5, and each of the feature-scoped mutants is caught only by its dedicated
|
|
331
|
+
scenario.
|
|
332
|
+
|
|
333
|
+
### Changed -- README and llms.txt torture sections corrected
|
|
334
|
+
|
|
335
|
+
Both root docs now describe the **22-scenario suite (19 semantic + 3 soak)**, the
|
|
336
|
+
15-run / 4-skip split on the 1.5.0 engine, the six scenarios finalised in this RC,
|
|
337
|
+
and the feature gates -- matching `bench/torture/run.mjs`. The unit test count is
|
|
338
|
+
updated for the new `test/29-throwing-equals` (7 tests).
|
|
339
|
+
|
|
340
|
+
### Added -- test/29-throwing-equals
|
|
341
|
+
|
|
342
|
+
A new `test/29-throwing-equals.test.mjs` (7 `it()` across three call sites)
|
|
343
|
+
pins the behaviour of a user `equals` predicate that THROWS at each of the three
|
|
344
|
+
LOGICAL sites the engine invokes it on the callable surface: signal-set pre-check
|
|
345
|
+
(Signal.js :1096), batch-revert check (:1103), and computed re-eval (:977). A
|
|
346
|
+
raw grep shows five physical `eq()` calls because 1.5.0's `signalBox` mirrors the
|
|
347
|
+
callable set path with its own pre-check/revert pair (:1201 / :1208); they
|
|
348
|
+
collapse to the same three logical sites and are byte-identical in logic. No
|
|
349
|
+
behavioral divergence from 1.4.4 was observed -- every assertion holds identically.
|
|
350
|
+
|
|
351
|
+
### Notes -- unit suite and the devtools real-boot rig
|
|
352
|
+
|
|
353
|
+
The unit suite is **461 tests: 460 pass + 1 skip, 0 fail** (the architectural SSR
|
|
354
|
+
N/A in `17-reactivity`) in the full workspace, i.e. with the sibling
|
|
355
|
+
`@zakkster/lite-devtools` resolvable, and now includes the 7-test
|
|
356
|
+
`test/29-throwing-equals`. `test/25-devtools-real-boot.test.mjs` is a 10-test
|
|
357
|
+
real-rig that boots the installed Devtools against the local engine; a bare
|
|
358
|
+
checkout without that sibling cannot resolve the specifier and reports 10 fewer.
|
|
359
|
+
No engine test regressed; the gap is purely the sibling package's presence.
|
|
360
|
+
`@zakkster/lite-gc-profiler` is added to `devDependencies` for `zerogc-torture`;
|
|
361
|
+
it is dev-only and `dependencies` stays empty (zero runtime deps).
|
|
362
|
+
|
|
363
|
+
Nothing new ships in the tarball: `files[]` still excludes `bench/`, so this RC's
|
|
364
|
+
publishable surface (`Signal.js`, `Signal.d.ts`, `Watch.js`, docs) is identical
|
|
365
|
+
in bytes to beta.8 apart from the version strings. Drop-in over 1.5.0-beta.8.
|
|
366
|
+
|
|
367
|
+
## [1.5.0-beta.8] -- 2026-07-22
|
|
368
|
+
|
|
369
|
+
### Added -- `box-torture`, and the torture suite reaches the box surface
|
|
370
|
+
|
|
371
|
+
The 1.4.1 torture reorganization -- one runner (`bench/torture/run.mjs`), the
|
|
372
|
+
`semantic` / `soak` split, the shared `helpers/`, and the five semantic
|
|
373
|
+
scenarios -- is the floor this release builds on. 1.5.0 adds a sixth semantic
|
|
374
|
+
scenario, `box-torture`, targeting the new `signalBox` / `computedBox` surface.
|
|
375
|
+
|
|
376
|
+
The boxes are documented as the same `ReactiveNode` and the same zero-GC
|
|
377
|
+
read/write path as the callable forms, with full interop in one graph. That is
|
|
378
|
+
precisely the kind of claim that rots silently: a divergence between the two
|
|
379
|
+
representations produces correct-looking behaviour in any test that exercises
|
|
380
|
+
only one of them. So `box-torture` does not lead with box-specific unit
|
|
381
|
+
assertions. Its centrepiece is the same differential fuzz `oracle-fuzzer` runs --
|
|
382
|
+
a random DAG checked against an independent uncached reference evaluator -- with
|
|
383
|
+
**every node independently realised as either a callable or a box**. The
|
|
384
|
+
reference does not know which is which. If the two representations ever disagree
|
|
385
|
+
on a value, on equality, or on dynamic dependency tracking, a mixed graph is
|
|
386
|
+
where it surfaces and a single-representation suite never would. The remainder
|
|
387
|
+
pins the surface the callables do not have (`subscribe` immediate-fire /
|
|
388
|
+
untracked-callback / idempotent-disposer, `update`) and the allocation-light
|
|
389
|
+
representation itself (zero own enumerable data beyond the two internal handle
|
|
390
|
+
slots, a stable shared prototype, never `setPrototypeOf`) -- the last being a
|
|
391
|
+
design law, not an implementation detail.
|
|
392
|
+
|
|
393
|
+
Mutation-verified, and the mixed-graph dimension is not decorative:
|
|
394
|
+
|
|
395
|
+
| mutant | caught by | missed by |
|
|
396
|
+
| ------ | --------- | --------- |
|
|
397
|
+
| `boxGet` skips dependency tracking | box-torture (299/300 seeds) + unit `24-signalbox` | -- |
|
|
398
|
+
| `computedBox` default equality `Object.is` -> `===` | **box-torture only** (33/300 seeds) | unit `24-signalbox` (12/12 pass), callable-only `oracle-fuzzer` (400/400 pass) |
|
|
399
|
+
|
|
400
|
+
The second row is the reason the scenario exists. A `computedBox` that silently
|
|
401
|
+
downgrades its default equality is invisible to the box unit suite and to the
|
|
402
|
+
callable fuzzer; only a graph that mixes both representations and fuzzes the
|
|
403
|
+
`-0` / `NaN` value boundary at a box-computed node position catches it.
|
|
404
|
+
|
|
405
|
+
`24-signalbox` moves from `{skip:true}` (its state on the 1.4.x line, where the
|
|
406
|
+
API did not exist) to fully live. The unit count rises to **453 passing** (1
|
|
407
|
+
skip, the architectural SSR N/A in `17-reactivity`), up from 405 on 1.4.1.
|
|
408
|
+
|
|
409
|
+
### Changed -- torture sources are ASCII (again)
|
|
410
|
+
|
|
411
|
+
`bench/torture/box-torture.mjs` shipped with em dashes and box-drawing
|
|
412
|
+
characters, and `helpers/index.mjs` had regained them. `Signal.js` is pure ASCII
|
|
413
|
+
and the ecosystem source rule permits only the sanctioned multiplication and
|
|
414
|
+
micro signs, so both were normalised (`--`, `<=`, `-`). The published surface is
|
|
415
|
+
unaffected either way -- `files[]` excludes `bench/`.
|
|
416
|
+
|
|
417
|
+
### Changed -- benchmark harness rewritten (bench protocol v3, breaking)
|
|
418
|
+
|
|
419
|
+
`bench/` is rebuilt around three instruments with fixed, non-shared configs and a
|
|
420
|
+
machine-generated `#STAMP` on every output (engine + harness sha256, the live
|
|
421
|
+
registry config echoed from the same frozen object handed to `createRegistry`,
|
|
422
|
+
host, node): the **microscope** (`benchmark.mjs` -- lite's recommended eager config
|
|
423
|
+
on six first-party shapes), the **mirror** (`mirror.mjs` + `sweep.mjs` -- Andrii's
|
|
424
|
+
canonical adapter verbatim, cross-framework rows diffing 1:1 against his log), and
|
|
425
|
+
**version economics** (`harness/toe-to-toe`). Hand-written result headers are
|
|
426
|
+
abolished; nothing is publishable without a `#STAMP`. See `bench/README.md`.
|
|
427
|
+
|
|
428
|
+
### Deprecated -- `bench-reactive-legacy`
|
|
429
|
+
|
|
430
|
+
The pre-v3 five-framework reactivity suite (`benchmarkReactive.mjs`) is retained one
|
|
431
|
+
release as `bench-reactive-legacy` and will be **removed after 1.5.1**. Use the
|
|
432
|
+
mirror for cross-framework standing.
|
|
105
433
|
|
|
106
434
|
### Added -- Coveralls coverage badge
|
|
107
435
|
|
|
@@ -123,317 +451,19 @@ dep before the free); O(1), disposal path only, no steady-state cost. The now-de
|
|
|
123
451
|
`freeLink` `-1` defensive ternaries were removed with it. Pinned by a regression
|
|
124
452
|
test in `test/12-coverage.test.mjs`.
|
|
125
453
|
|
|
126
|
-
**Hot-path parity note:** this touches `disposeNode` and `freeLink`, so their
|
|
127
|
-
sha256 no longer matches the `1.6.0-alpha.0` baseline. The steady-state read /
|
|
128
|
-
propagation bodies (`pullComputed`, `markDownstream`, `executeEffect`,
|
|
129
|
-
`flushEffects`, `allocateLink`, `severTail`, `createNode`, `runCleanup`) are
|
|
130
|
-
unchanged. Re-baseline the VersionMatrix engine sha256 on the next publish.
|
|
131
|
-
|
|
132
454
|
### Changed -- branch coverage closed to 100%
|
|
133
455
|
|
|
134
|
-
Branch coverage on `Signal.js` went `
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
`computedBox` `equals`, top-level `getOwner` / `runWithOwner`), and the two
|
|
142
|
-
provably-unreachable clamps (link-ledger, `batchEpoch` wraparound) now carrying
|
|
143
|
-
`/* c8 ignore */` with proofs. See `COVERAGE-NOTES.md`; reconfirm under codify.
|
|
144
|
-
|
|
145
|
-
## [1.6.0-alpha.0] -- 2026-07-XX
|
|
146
|
-
|
|
147
|
-
The observability-and-lifecycle minor, shipping on the `alpha` dist-tag while it
|
|
148
|
-
settles. Three additions: `stats()` gains a twelfth key, **`flushPasses`**, plus two
|
|
149
|
-
flush-profiling mutation-hook opcodes -- the flush/recompute dimension
|
|
150
|
-
lite-devtools 1.2 / lite-studio 1.2 read through `watchAllocations`;
|
|
151
|
-
**`createScope(fn)`**, the disposable-owner counterpart to
|
|
152
|
-
`createRoot` that a keyed-list / scene reconciler needs for per-item teardown;
|
|
153
|
-
and **`getOwner` / `runWithOwner`** carried forward from 1.5.0-beta.2 as the
|
|
154
|
-
capture-and-restore companion to `createRoot`. The engine hot path is **no
|
|
155
|
-
longer byte-identical to 1.5** for the first time since 1.2.2 -- `markDownstream`
|
|
156
|
-
and `flushEffects` picked up hook-gated fires for the two new opcodes -- but
|
|
157
|
-
the gate is a single branch-predicted `null` check per fire site and the
|
|
158
|
-
observable cost only shows on the cheapest propagation shapes (KAIROS, DEEP
|
|
159
|
-
CHAIN); the wide-aggregation and dynamic-DAG wins are unchanged. Drop-in over
|
|
160
|
-
1.5.1-beta.1.
|
|
161
|
-
|
|
162
|
-
### Added -- `flushPasses` on `stats()` + flush-profiling opcodes
|
|
163
|
-
|
|
164
|
-
`stats()` now returns **12 keys**: the 11 from 1.4.x plus `flushPasses`, a counter
|
|
165
|
-
that advances once per effect-flush drain pass. Two `onGraphMutation` opcodes back
|
|
166
|
-
the flush dimension:
|
|
167
|
-
|
|
168
|
-
- **`6` flush pass** -- `(passCount, effectsToRun)`, at the top of each drain pass.
|
|
169
|
-
- **`7` effect run in pass** -- `(id, 0)`, before each effect re-run inside a pass.
|
|
170
|
-
|
|
171
|
-
Both the counter bump and the opcode dispatch sit behind the existing
|
|
172
|
-
`if (mutationHook !== null)` gate, so when no profiler is attached they are inert:
|
|
173
|
-
`flushPasses` is frozen and the flush loop is byte-identical to 1.5.0 EXCEPT for
|
|
174
|
-
the added `null` check itself. The residual cost is one branch-predicted `null`
|
|
175
|
-
check per fire site (per pass in `flushEffects`, per enqueued dirty subscriber
|
|
176
|
-
in `markDownstream`'s inner loop). Measurable on the very cheapest propagation
|
|
177
|
-
shapes where every iteration matters -- KAIROS moves from -7% -> -12% vs alien
|
|
178
|
-
on the 1.6.0-alpha sweep, DEEP CHAIN from -14% -> -21% -- and invisible on the
|
|
179
|
-
allocation-dominated shapes where the ratio of pool retracking to marker walks
|
|
180
|
-
favors lite by orders of magnitude (SELECTIVE DAG +49%, DYNAMIC DAG +43%, MUX
|
|
181
|
-
+35%, SMALL SELECTIVE +29% -- all unchanged from the 1.5.0-beta sweep). When a
|
|
182
|
-
profiler is actually attached the observable becomes the profiler's own cost and
|
|
183
|
-
the gate itself disappears from the picture. This is what lets `watchAllocations`
|
|
184
|
-
chart recompute/flush activity alongside the 1.4.0 allocation counters
|
|
185
|
-
(`totalAllocations` / `poolGrowths` / `totalDisposals`), which remain available
|
|
186
|
-
from 1.4.0 on every engine -- only the flush series requires 1.6.
|
|
187
|
-
|
|
188
|
-
The `03-pool` test for the `stats()` shape is bumped from "11-key 1.4.0 shape"
|
|
189
|
-
to "12-key 1.6 shape" with `flushPasses` in the expected key list.
|
|
190
|
-
|
|
191
|
-
### Added -- `createScope(fn)` (disposable owner scope)
|
|
192
|
-
|
|
193
|
-
`createScope` runs `fn(dispose)` in a detached scope and returns whatever `fn`
|
|
194
|
-
returns, having handed `fn` a single `dispose` that **cascade-disposes every effect
|
|
195
|
-
and computed created inside `fn`**. It is the lifecycle complement to `createRoot`:
|
|
196
|
-
|
|
197
|
-
- `createRoot(fn)` only **detaches** -- nodes created inside are unowned and the
|
|
198
|
-
caller must dispose each one by hand (there is no owner to do it automatically).
|
|
199
|
-
Correct for spawning one known long-lived watcher (lite-query's pattern).
|
|
200
|
-
- `createScope(fn)` **adopts** -- it owns whatever `fn` builds, so one disposer tears
|
|
201
|
-
down a subtree of *unknown* shape. This is what a per-item scope in a keyed-list or
|
|
202
|
-
scene reconciler requires, where the item's reactive graph is the consumer's
|
|
203
|
-
`mapFn`, not something the reconciler can enumerate.
|
|
204
|
-
|
|
205
|
-
**Semantics.** `fn` runs once in a detached, untracked context: no ownership and no
|
|
206
|
-
dependency leak from `fn`'s direct body into the enclosing scope, and the scope owner
|
|
207
|
-
never re-runs. Reactive bindings belong in inner effect/computed bodies inside `fn`
|
|
208
|
-
(those track normally and are owned by the scope); direct-body reads are untracked.
|
|
209
|
-
Consistent with the 1.2.0 ownership rule, **plain signals created directly in `fn` are
|
|
210
|
-
not adopted** -- dispose those explicitly (the creator holds the handle) or let them
|
|
211
|
-
fall out of reference; computeds and effects are adopted and cascade.
|
|
212
|
-
|
|
213
|
-
**Implementation.** The scope owner is backed by a never-re-running effect node, so it
|
|
214
|
-
counts as one effect in `stats()` and its disposer is the same gen-guarded, ABA-safe,
|
|
215
|
-
introspection-stamped handle `effect()` returns (`describe` / `nodeId` / `forEachOwned`
|
|
216
|
-
resolve it to the owner). No new node kind, flag, or `stats()` key -- the pinned
|
|
217
|
-
`signals + computeds + effects === activeNodes` invariant is untouched. The API
|
|
218
|
-
(`fn => dispose`) is the stable contract; a future engine may swap in a lighter
|
|
219
|
-
pure-owner node transparently.
|
|
220
|
-
|
|
221
|
-
Exported as a registry method and a top-level helper bound to the default registry,
|
|
222
|
-
mirroring `createRoot`.
|
|
223
|
-
|
|
224
|
-
### Added -- `getOwner` / `runWithOwner` (carried forward from 1.5.0-beta.2)
|
|
225
|
-
|
|
226
|
-
The re-attach companion to `createRoot`, ported forward from 1.5.0-beta.2
|
|
227
|
-
unchanged. `getOwner()` returns the current owner as an **opaque, gen-stamped
|
|
228
|
-
handle** (or `undefined` outside any effect/computed body); `runWithOwner(handle,
|
|
229
|
-
fn)` runs `fn` with the captured lifecycle scope reinstated so effects/computeds
|
|
230
|
-
created directly in `fn` are adopted by that owner. Nulls the tracking observer
|
|
231
|
-
for the duration of `fn` (same pairing as `createRoot`) so accidental cross-async
|
|
232
|
-
edges cannot form.
|
|
233
|
-
|
|
234
|
-
Handles are gen-stamped (the same `NODE_GEN` ABA-guard machinery
|
|
235
|
-
`describe` / `nodeId` / `forEachOwned` / `ownerOf` have used since 1.2.1) --
|
|
236
|
-
safe to hold across async boundaries. If the captured owner is disposed and
|
|
237
|
-
its pool slot recycled by an unrelated effect via the LIFO free list, the gen
|
|
238
|
-
no longer matches and `runWithOwner` degrades to **rooted execution** rather
|
|
239
|
-
than corrupting the graph. Two hazards on the raw-pointer alternative were
|
|
240
|
-
empirically reproduced against a 1.5.0-beta engine patched with the naive
|
|
241
|
-
implementation (`harness/owner-hazard-repro.mjs`) and are pinned in
|
|
242
|
-
`test/28-run-with-owner.test.mjs`:
|
|
243
|
-
|
|
244
|
-
- **Recycled-slot cascade death** -- capture, dispose owner, allocate a stranger
|
|
245
|
-
effect that reuses the slot, `runWithOwner(captured)` silently adopts
|
|
246
|
-
continuation into the stranger, stranger's re-run cascade-disposes it.
|
|
247
|
-
- **Corpse adoption = engine crash** -- capture, dispose owner but not-yet-
|
|
248
|
-
recycled, `runWithOwner(captured, () => effect(...))` splices a child into
|
|
249
|
-
a disposed owner's `firstOwned` and the next disposal walk recurses without
|
|
250
|
-
termination (`RangeError: Maximum call stack size exceeded`).
|
|
251
|
-
|
|
252
|
-
Both fail on the raw-pointer sketch; both pass on the shipped `describeNode` /
|
|
253
|
-
`liveNode` implementation. Test coverage: 16 tests in `test/28-run-with-owner`
|
|
254
|
-
(basic shape, degradation, and the three hazard pins with allocation pressure
|
|
255
|
-
applied so the ABA guard is genuinely exercised).
|
|
256
|
-
|
|
257
|
-
Exported as registry methods and top-level helpers, mirroring `createRoot` /
|
|
258
|
-
`createScope`.
|
|
259
|
-
|
|
260
|
-
### Added -- characterization harnesses (`burst-dag.mjs`, `pull-stress.mjs`)
|
|
261
|
-
|
|
262
|
-
Two standalone harnesses in `harness/` that exercise the new 1.6.0 instrumentation
|
|
263
|
-
surface against the engine's hot paths, both consuming public `onGraphMutation`
|
|
264
|
-
(opcodes 5/6/7) and both staying out of `npm test` and the published tarball.
|
|
265
|
-
`pull-stress.mjs` imports `../Signal.js` and exposes a CLI + module exports;
|
|
266
|
-
`burst-dag.mjs` takes the engine path as an argument and is CLI-only.
|
|
267
|
-
|
|
268
|
-
**`burst-dag.mjs`** (`npm run profile:burst`, also `node --expose-gc
|
|
269
|
-
harness/burst-dag.mjs <Signal.js>`) reproduces Andrii's actual generator: the
|
|
270
|
-
layer edges use his **verbatim strided picker** (`base = (node*13 + layer*17) %
|
|
271
|
-
prevW`, strided step), `staticFraction = 1` (all-static computeds, per-batch pull
|
|
272
|
-
reads, no effects) -- the real `layered burst flush warm` shape. It runs that
|
|
273
|
-
head-to-head against the earlier contiguous-window guess it embeds and reports
|
|
274
|
-
structure (passes/burst, recomputed, maxRecompute/node, poolGrowths) plus median
|
|
275
|
-
us/burst for each. On 1.6.0-alpha the strided real topology recomputes ~2x the
|
|
276
|
-
nodes (15928 vs 8120) at ~26% higher us/burst, both with `passes = 0` (pure pull,
|
|
277
|
-
nothing to flush) and `maxRecompute/node = 1`: no redundant work either way, so
|
|
278
|
-
the ~2x gap is **locality** on the correct topology. This resolves the ROADMAP S5
|
|
279
|
-
open question (was the contiguous guess faithful to Andrii's generator?). The
|
|
280
|
-
earlier contiguous version -- with its `--width` / `--layers` CLI and its
|
|
281
|
-
`burstDagScenario` / `multiPassProbe` exports for the zero-GC gate -- is archived
|
|
282
|
-
as `harness/attic/burst-dag.mjs`; nothing mounted those exports, so retiring it
|
|
283
|
-
is inert.
|
|
284
|
-
|
|
285
|
-
**`pull-stress.mjs`** (`npm run profile:pull`, also `node --expose-gc
|
|
286
|
-
harness/pull-stress.mjs [--maxDepth=3584 --step=512 ...]`) is the pull-path companion:
|
|
287
|
-
characterizes how the recursive pull scales with chain depth and binary-searches
|
|
288
|
-
the exact overflow point. Three answers per run: (1) the exact deepest chain
|
|
289
|
-
that pulls successfully (the roadmap's "~5,000 chained computeds" pinned to a
|
|
290
|
-
number for the current engine), (2) per-level cold cost across a depth sweep
|
|
291
|
-
(should be roughly linear; superlinear flags a per-node bookkeeping cost
|
|
292
|
-
growing with depth), and (3) cached-read cost (should be O(1) regardless of
|
|
293
|
-
depth via the 1.1.4 `markEpoch` short-circuit). Structure pass at a safe fixed
|
|
294
|
-
depth confirms the opcode triple (0 flush passes, 0 effect runs, recomputes ==
|
|
295
|
-
depth) -- the pull path is doing nothing it shouldn't. Also exports
|
|
296
|
-
`pullStressScenario` for steady-state allocation gates and `probeOverflow`
|
|
297
|
-
for the binary search alone. Both `--kind=callable` and `--kind=box` are
|
|
298
|
-
supported and surface a real engine difference (box pulls overflow earlier
|
|
299
|
-
because `box.get()` adds a prototype-method frame per level, and cached box
|
|
300
|
-
reads are several times more expensive than cached callable reads).
|
|
301
|
-
|
|
302
|
-
`pull-stress` imports only `../Signal.js`, and `burst-dag` takes the engine path
|
|
303
|
-
as an argument, so both run against any engine build: point them at 1.5.x to
|
|
304
|
-
compare without the new counters (`burst-dag` adapts -- only opcode 5 fires on
|
|
305
|
-
that engine, so `passes` reads 0 -- and `pull-stress` works identically), or at a
|
|
306
|
-
rejected candidate to re-verify on. The numbers they produce are reproducible,
|
|
307
|
-
comparable, and engine-version-aware.
|
|
456
|
+
Branch coverage on `Signal.js` went `97.35% -> 100%`. Three reachable branches
|
|
457
|
+
gained tests (`allocateLink` dead-target gate, `executeEffect` scheduler
|
|
458
|
+
re-entrancy, `computed` stale-handle read), the new box + owner surface gained
|
|
459
|
+
tests (box stale-handle guards, `computedBox` `equals`, top-level `getOwner` /
|
|
460
|
+
`runWithOwner` delegators), and the two provably-unreachable clamps (link-ledger,
|
|
461
|
+
`batchEpoch` wraparound) carry `/* c8 ignore */` with proofs. See
|
|
462
|
+
`COVERAGE-NOTES.md`; reconfirm under codify.
|
|
308
463
|
|
|
309
|
-
###
|
|
464
|
+
### Tooling -- harness reorganization (no engine change)
|
|
310
465
|
|
|
311
|
-
|
|
312
|
-
merged in from 1.5.0-beta.2): **447 tests**, 436 pass, 0 fail, 1 skip
|
|
313
|
-
(only the architecturally-N/A SSR case in `17-reactivity`), 10 cancelled
|
|
314
|
-
(the `25-devtools-real-boot` cases that need `@zakkster/lite-devtools`
|
|
315
|
-
installed as a peer -- pre-existing, unrelated to any 1.6 change). +4
|
|
316
|
-
`createScope` tests in `test/28-scope_test.mjs`; +16 `getOwner` /
|
|
317
|
-
`runWithOwner` tests in `test/28-run-with-owner.test.mjs` (basic shape,
|
|
318
|
-
degradation, and the three hazard pins -- recycled-slot cascade / corpse
|
|
319
|
-
adoption / composed with allocation pressure); the 1.5.0 box and createRoot
|
|
320
|
-
suites carry forward unchanged. `test/03-pool` "stats() shape" test
|
|
321
|
-
updated from the 11-key 1.4.0 shape to the 12-key 1.6 shape (adds
|
|
322
|
-
`flushPasses`). **Coverage** (c8@11, Node 22): `Signal.js` 100% statements /
|
|
323
|
-
96.96% branches / 100% functions / 100% lines; `Watch.js` 100% across all
|
|
324
|
-
four. The branch drop vs 1.5.0 (97.35% -> 96.96%) is the zero-cost gate on
|
|
325
|
-
`flushPasses` / opcode 6 / opcode 7 -- the `if (mutationHook !== null)`
|
|
326
|
-
mutation-hook-attached branch is not exercised by the active test suite,
|
|
327
|
-
which never attaches a hook; the inert path is covered.
|
|
328
|
-
- **`createScope` behavior** (4 tests, `node --expose-gc`): returns `fn`'s value and
|
|
329
|
-
runs the owner exactly once even when `fn` reads signals in its direct body
|
|
330
|
-
(untracked); inner effects/computeds track and update; `dispose()` cascade-disposes
|
|
331
|
-
the owned subtree (effects + computeds) while an un-adopted signal correctly
|
|
332
|
-
survives; a disposed scope's inner effects stop firing; **a scope created inside a
|
|
333
|
-
consumer effect survives that consumer's re-run** (the reconciler-critical detach
|
|
334
|
-
property); `dispose()` is an idempotent no-op on the second call; the disposer is
|
|
335
|
-
introspection-stamped to its owner effect; and `totalAllocations - totalDisposals
|
|
336
|
-
=== activeNodes` holds after teardown. Plus a smoke confirming signal -> computed ->
|
|
337
|
-
effect is unaffected by the additive change.
|
|
338
|
-
- **`getOwner` / `runWithOwner` port**: sha256 over the extracted function bodies of
|
|
339
|
-
`pullComputed`, `executeEffect`, `allocateLink`, `severTail`, `createNode`,
|
|
340
|
-
`runCleanup`, `disposeNode`, `createRoot`, `createScope` matches the pristine
|
|
341
|
-
1.6.0-alpha engine byte-for-byte -- port touched no hot path. `Publications/
|
|
342
|
-
owner-hazard-repro.mjs` reports **`VERDICT: SAFE`** on the merged engine on both
|
|
343
|
-
hazards (continuation runs 2 times before stranger disposal, 3 after; corpse
|
|
344
|
-
case runs 2 without `RangeError`).
|
|
345
|
-
- **Instrumentation is zero-cost when unobserved**: `flushPasses` advances and opcodes
|
|
346
|
-
6/7 fire only while a mutation-hook listener is attached; with none, the two hook
|
|
347
|
-
fire sites are pure `null`-check branches (branch-predicted-free after warmup).
|
|
348
|
-
|
|
349
|
-
### Verified -- fresh 1.6.0-alpha bench sweep (dual-host: Apple M4 Pro + 2016 Intel MacBook)
|
|
350
|
-
|
|
351
|
-
Both v3 instruments were re-run in full on the 1.6.0-alpha engine on **two hosts**:
|
|
352
|
-
the current authoritative machine **Apple M4 Pro darwin/arm64, Node 26.3.1** (with
|
|
353
|
-
`#STAMP`-verified outputs committed to `bench/r.txt` -- microscope aggregate, 4
|
|
354
|
-
engines across the six first-party shapes -- and `bench/rb.txt` -- mirror sweep,
|
|
355
|
-
Andrii's canonical adapter verbatim, lite vs alien across 47 rows, isolated-per-row,
|
|
356
|
-
10 reps) and the older reference host **2016 Intel MacBook Pro, Node 22** (kept
|
|
357
|
-
sweep-over-sweep for cross-host reference; `bench/results.txt` propagation, 9
|
|
358
|
-
scenarios, and `bench/resultsReactive.txt` cross-framework reactivity, median-of-10,
|
|
359
|
-
34 tests -- the 10 raw reactive-suite runs sit under `bench/bench-runs-reactive/
|
|
360
|
-
run_1.txt` ... `run_10.txt` so anyone can re-median independently). The M4 Pro host
|
|
361
|
-
has a lower run-to-run noise floor than the Intel host, so the sub-percent parity
|
|
362
|
-
band tightens; conversely the Intel host makes small branch-cost swings visible
|
|
363
|
-
that the M4 Pro's frontend absorbs.
|
|
364
|
-
|
|
365
|
-
- **Microscope aggregate on M4 Pro (r.txt):** on the six v3 microscope shapes, lite
|
|
366
|
-
wins vs alien on **MUX +35.3%** (fan-in), **SELECTIVE DAG +20.6%**, **DYNAMIC DAG
|
|
367
|
-
+17.7%**, and -- new this sweep -- **BROADCAST +12.0%** (flipped from -1.2%
|
|
368
|
-
parity on 1.5.0-beta; fan-out is now a fourth speed win). The three allocation-
|
|
369
|
-
heavy wins hold their 1.5.0-beta M4 Pro magnitudes within noise because the
|
|
370
|
-
mutation-hook gate is round-off relative to per-iteration retracking work.
|
|
371
|
-
**KAIROS narrowed from -15.7% to -9.9%** -- the exact opposite of what the Intel
|
|
372
|
-
host shows for the same engine, which is what you would expect if branch
|
|
373
|
-
prediction on the M4's frontend is absorbing the two hook-gate `null` checks
|
|
374
|
-
completely. DEEP CHAIN stays firmly in alien's column at -73.8% (the
|
|
375
|
-
architectural weak spot the honest framing has always named: recursive JS-stack
|
|
376
|
-
computed resolution against a flat chain). Speed wins vs alien: **4/6** (was
|
|
377
|
-
3/6 on 1.5.0-beta); heap wins: **5/6** with the sixth being a shared-zero on
|
|
378
|
-
BROADCAST.
|
|
379
|
-
- **Propagation bench on Intel (results.txt):** lite +49% / +43% / +35% / +29% on
|
|
380
|
-
the four allocation-heavy scenarios (SELECTIVE DAG / DYNAMIC DAG / MUX / SMALL
|
|
381
|
-
SELECTIVE) -- unchanged in character from the 1.5.0-beta Intel sweep, confirming
|
|
382
|
-
the gate is round-off on allocation-dominated shapes. Parity on LARGE WEB APP
|
|
383
|
-
(-3%) and WIDE DENSE (-6%), inside host noise. **Alien-signals ahead on
|
|
384
|
-
BROADCAST (-10%), KAIROS (-12%, was -7% on 1.5.0-beta), and DEEP CHAIN (-21%,
|
|
385
|
-
was -14% on 1.5.0-beta)** -- the KAIROS and DEEP CHAIN widening IS the observable
|
|
386
|
-
gate cost on this slower host, one predicted `null` check per inner-loop
|
|
387
|
-
iteration on shapes that iterate 1000-25000 times per rep. That the same
|
|
388
|
-
engine reads KAIROS -12% on Intel and -9.9% on M4 Pro is not a contradiction;
|
|
389
|
-
it is what a cross-host branch-cost artifact looks like when only one of the two
|
|
390
|
-
frontends can hide it. Speed wins vs alien on Intel: **4/9** (was 5/9); heap
|
|
391
|
-
wins: **8/9** (unchanged).
|
|
392
|
-
- **Microscope heap (the actual story) on M4 Pro:** on every shape where GC
|
|
393
|
-
pressure exists at all, lite allocates **one to four orders of magnitude less
|
|
394
|
-
transient heap than alien** -- DEEP CHAIN 0.5 KB vs 1062 KB (>2000x, on the
|
|
395
|
-
shape lite loses on time), MUX 0 KB vs 781 KB, KAIROS 23 KB vs 802 KB (34.3x),
|
|
396
|
-
DYNAMIC DAG 3.4 MB vs 60.0 MB (17.9x), SELECTIVE DAG 7.6 MB vs 78.2 MB (10.3x).
|
|
397
|
-
Against preact-signals and solid-signals the heap gap is even wider on the
|
|
398
|
-
fan-in / fan-out family; solid allocates ~17 MB on MUX and ~15 MB on SELECTIVE
|
|
399
|
-
DAG where lite allocates 0 KB and 7.6 MB on the same shapes. The
|
|
400
|
-
differentiated position is ALLOCATION, not raw propagation speed --
|
|
401
|
-
competitive-to-winning throughput with dramatically lower GC pressure, and
|
|
402
|
-
that is the headline that reproduces across hosts.
|
|
403
|
-
- **Mirror sweep on M4 Pro (rb.txt):** Andrii's canonical 47-shape suite re-run
|
|
404
|
-
isolated-per-row lite vs alien on M4 Pro reproduces the same honest framing:
|
|
405
|
-
lite runs **parity-to-behind alien on throughput** across the suite (wins
|
|
406
|
-
outright on **5/47** -- `1000x5 - 25 sources (wide dense)` +12.2%,
|
|
407
|
-
`manySourcesIntoOneComputedEffectWithDirect` +31.8%,
|
|
408
|
-
`manySourcesIntoOneComputedEffect` +31.4%, `molBench` +1.0% (new this sweep),
|
|
409
|
-
and `createComputations4to1` +9.5%; up from 4/47 on 1.5.0-beta), weak on the
|
|
410
|
-
deep/layered-burst family. Every row carries a `#STAMP` and the counters
|
|
411
|
-
(`nodesRecomputed` / `edgesTraversed` / `sinkReads`) match Andrii's published
|
|
412
|
-
suite exactly (`mirror.mjs --self-verify`), so a lite-vs-alien delta here is
|
|
413
|
-
identical work, not DCE.
|
|
414
|
-
- **Reactive suite on Intel (resultsReactive.txt):** fastest of five frameworks
|
|
415
|
-
on all five `dyn` rows (simple +19%, dynamic +13%, large web app +11%, wide
|
|
416
|
-
dense +4%, deep +16%). On the `S: updateComputations` micro-rows lite trades
|
|
417
|
-
the lead with alien: **4/7 wins this sweep** (was 7/7 on 1.5.0-beta),
|
|
418
|
-
consistent with the gate cost on 50-70ms rows that iterate many thousands of
|
|
419
|
-
times per measurement on the Intel host.
|
|
420
|
-
- **Andrii Volynets js-reactivity-benchmark position holds at 4th of 15** with
|
|
421
|
-
geomean **73.1ms** (raw log `bench/AndriiVolynetsReactiveBench.log`, all 15
|
|
422
|
-
x 47 rows); lite is ahead of 5th-place Preact Signals (79.9) by ~9%.
|
|
423
|
-
Outright-fastest-of-15 wins jumped to **6 shapes**: `broadPropagation`,
|
|
424
|
-
`manyEffectsFromOneSource`, `manySourcesIntoOneComputedEffect`,
|
|
425
|
-
`manySourcesIntoOneComputedEffectWithDirect`, `molBench`, and the `32x8 - 4
|
|
426
|
-
sources - pull` DAG. Top-3 count: 23/47. (Outright wins swing at the top of
|
|
427
|
-
a very tight leaderboard; the stable metric across every sweep is the
|
|
428
|
-
geomean rank at 4th of 15.)
|
|
429
|
-
- **Third-party engine versions carried forward** from the 1.5.0-beta sweep
|
|
430
|
-
(alien-signals 3.2.1, @preact/signals-core 1.14.2, @vue/reactivity 3.5.35,
|
|
431
|
-
solid-js 1.9.13). No peer bumps this cycle -- the deltas here are the 1.6
|
|
432
|
-
engine's own footprint plus host noise.
|
|
433
|
-
|
|
434
|
-
### Tooling -- harness reorganization (no published-surface change)
|
|
435
|
-
|
|
436
|
-
The loose `harness/` probes are routed through a single dispatcher
|
|
466
|
+
The loose `harness/` probes are now routed through a single dispatcher
|
|
437
467
|
(`harness/run.mjs`) and exposed as npm scripts: `harness:field`,
|
|
438
468
|
`harness:dispose`, `harness:churn`, `harness:owner`, `harness:creation`, and
|
|
439
469
|
`harness:all` (field + dispose + churn in sequence). `harness:field` is the
|
|
@@ -441,37 +471,139 @@ portable fieldkit verify + cold-child A/B bench; the rest map one-to-one to the
|
|
|
441
471
|
existing probe files. Paths resolve from the dispatcher, so the working
|
|
442
472
|
directory no longer matters.
|
|
443
473
|
|
|
444
|
-
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
474
|
+
The empirical owner-recycling reproducer is documented at its real home,
|
|
475
|
+
`harness/owner-hazard-repro.mjs`; the earlier `Publications/...` citations in
|
|
476
|
+
README / CHANGELOG / llms.txt pointed at a path the file was never in, and are
|
|
477
|
+
corrected. The broken parent/child link in the createComputations matrix
|
|
478
|
+
(`creation-isolated.mjs` now resolves `andrii-isolated-child.mjs`) is repaired.
|
|
479
|
+
|
|
480
|
+
Six settled one-off probes -- the five from the 1.2.0 -> 1.2.1 construction-
|
|
481
|
+
shape regression hunt, plus the superseded `repro-set-after-dispose.mjs` (its
|
|
482
|
+
invariant now pinned by `test/07-dispose` and `test/26-free-list-invariant`) --
|
|
483
|
+
are parked in `harness/attic/` with a README explaining each. `Signal.js` is
|
|
484
|
+
untouched and the published `files[]` whitelist is unchanged, so installed
|
|
485
|
+
tarballs are byte-identical; this is a repo-tooling change only.
|
|
486
|
+
|
|
487
|
+
## [1.5.0-beta.2] -- 2026-07-XX
|
|
488
|
+
|
|
489
|
+
The re-attach companion to `createRoot`: **`getOwner`** and **`runWithOwner`**
|
|
490
|
+
ship on the same additive-surface story as 1.5.0. **No engine change.** The
|
|
491
|
+
hot-path function bodies (`pullComputed`, `markDownstream`, `executeEffect`,
|
|
492
|
+
`flushEffects`, `allocateLink`, `severTail`, `createNode`, `runCleanup`,
|
|
493
|
+
`disposeNode`) are **verified byte-identical to 1.5.0-beta.1** via sha256 over
|
|
494
|
+
their extracted bodies. The new primitives are ~20 lines of user-API code plus
|
|
495
|
+
two top-level bindings; every read of `currentOwner` still happens at the same
|
|
496
|
+
sites (creation, effect body save/restore, cleanup), and the propagation path
|
|
497
|
+
remains owner-free per the `markDownstream` invariant comment. Drop-in over
|
|
498
|
+
1.5.0-beta.1.
|
|
499
|
+
|
|
500
|
+
### Added -- `getOwner()` and `runWithOwner(ownerHandle, fn)`
|
|
501
|
+
|
|
502
|
+
`getOwner()` returns an **opaque, gen-stamped handle** for the current
|
|
503
|
+
lifecycle owner (or `undefined` outside any effect/computed body).
|
|
504
|
+
`runWithOwner(handle, fn)` runs `fn` with that handle re-installed as the
|
|
505
|
+
current owner: effects and computeds created directly in `fn` are adopted
|
|
506
|
+
by that owner and cascade-dispose when it re-runs or is disposed. Nulls
|
|
507
|
+
the tracking observer for the duration of `fn` (Solid semantics, matching
|
|
508
|
+
`createRoot`'s pairing) so accidental cross-async edges cannot form.
|
|
509
|
+
|
|
510
|
+
The handles use the same `describeNode` / `liveNode` ABA-guard machinery
|
|
511
|
+
that `describe` / `nodeId` / `forEachOwned` / `ownerOf` have used since
|
|
512
|
+
1.2.1: a returned descriptor carries an internal `NODE_GEN` stamp, and
|
|
513
|
+
`runWithOwner` resolves via `liveNode()` which checks that the stamp
|
|
514
|
+
still matches the pool slot's current gen. Stale, null, undefined, or
|
|
515
|
+
non-tracker handles all **degrade to rooted execution** -- `currentOwner`
|
|
516
|
+
set to `null`, `fn` runs, created children survive without adoption, and
|
|
517
|
+
the caller is responsible for their disposal (the same contract as
|
|
518
|
+
`createRoot`).
|
|
519
|
+
|
|
520
|
+
### Fixed -- the two hazards the gen guard exists to prevent
|
|
521
|
+
|
|
522
|
+
The design was originally sketched with raw node pointers -- `getOwner()
|
|
523
|
+
{ return currentOwner; }` and `runWithOwner(node, fn) { const p =
|
|
524
|
+
currentOwner; currentOwner = node; ... }`. That shape is broken in this
|
|
525
|
+
engine because nodes are pooled and the LIFO free list recycles a
|
|
526
|
+
disposed owner's slot into whatever effect/computed is allocated next.
|
|
527
|
+
Two failure modes were empirically reproduced against a 1.5.0-beta
|
|
528
|
+
engine patched with the raw-pointer alternative
|
|
529
|
+
(`harness/owner-hazard-repro.mjs`):
|
|
530
|
+
|
|
531
|
+
- **Recycled-slot cascade death.** Owner A captured; A disposed; effect B
|
|
532
|
+
allocated (LIFO -> same slot); `runWithOwner(captured)` silently
|
|
533
|
+
adopts the continuation into B; B's re-run cascade-disposes it.
|
|
534
|
+
Measured on the unsafe engine: continuation ran 1 time before
|
|
535
|
+
stranger disposal, 1 time after (should have been 2, then 3).
|
|
536
|
+
- **Corpse adoption = engine crash.** Same capture, slot NOT yet
|
|
537
|
+
recycled; `runWithOwner(captured, () => effect(...))` splices a child
|
|
538
|
+
into a disposed owner's `firstOwned` list; the next disposal walk
|
|
539
|
+
recurses without termination. Measured: `RangeError: Maximum call
|
|
540
|
+
stack size exceeded` at `runCleanup` / `disposeNode`. Not a leak, a
|
|
541
|
+
crash.
|
|
542
|
+
|
|
543
|
+
Both hazards are pinned in `test/28-run-with-owner.test.mjs` and both
|
|
544
|
+
fail on the raw-pointer sketch; both pass on the shipped
|
|
545
|
+
`describeNode` / `liveNode` implementation. The safe implementation
|
|
546
|
+
degrades both hazards to rooted execution (the continuation runs and
|
|
547
|
+
survives independently of any stranger's lifecycle -- the only honest
|
|
548
|
+
semantics for "the scope you captured no longer exists").
|
|
549
|
+
|
|
550
|
+
### Added -- `test/28-run-with-owner.test.mjs`
|
|
551
|
+
|
|
552
|
+
**16 tests**, structured to catch the failure modes above rather than
|
|
553
|
+
just the microtask happy path:
|
|
554
|
+
|
|
555
|
+
- Basic shape (7 tests): `getOwner()` returns undefined outside any
|
|
556
|
+
effect/computed and a descriptor inside; `runWithOwner` adopts a
|
|
557
|
+
nested effect into the captured owner, nulls the tracking observer
|
|
558
|
+
for reads directly in `fn`, returns whatever `fn` returns, restores
|
|
559
|
+
previous owner/observer/tracking on return AND on throw, and nests
|
|
560
|
+
correctly (inner switches, outer unwinds).
|
|
561
|
+
- Degradation (3 tests): `null` / `undefined` / a signal handle all
|
|
562
|
+
degrade to rooted execution and the created effect works normally
|
|
563
|
+
(fires on updates, disposable).
|
|
564
|
+
- Hazard pins (3 tests, plus a composed test): the recycled-slot cascade
|
|
565
|
+
and the corpse-adoption case, each with allocation pressure applied
|
|
566
|
+
BEFORE `runWithOwner` (a stranger effect is created to force slot
|
|
567
|
+
recycling), so the ABA guard is genuinely exercised. A follow-up
|
|
568
|
+
composed test asserts the continuation survives both the stranger's
|
|
569
|
+
re-runs and its disposal.
|
|
570
|
+
|
|
571
|
+
Full test suite on 1.5.0-beta.2: **455 total** (439 pre-existing +
|
|
572
|
+
16 new), 444 pass, 0 fail, 1 skip (SSR N/A), 10 cancelled (the
|
|
573
|
+
`25-devtools-real-boot` cases that need `@zakkster/lite-devtools`
|
|
574
|
+
installed as a peer -- pre-existing, unrelated).
|
|
575
|
+
|
|
576
|
+
### Added -- `harness/owner-hazard-repro.mjs`
|
|
577
|
+
|
|
578
|
+
A standalone reproducer for the two hazards, callable against any engine
|
|
579
|
+
(`node owner-hazard-repro.mjs <path-to-Signal.js>`). Prints
|
|
580
|
+
`VERDICT: SAFE` on the shipping implementation, `VERDICT: CORRUPTED` +
|
|
581
|
+
a stack overflow on the raw-pointer sketch. Kept in `harness/`
|
|
582
|
+
alongside the other run-on-demand probes rather than under `test/` so it can
|
|
583
|
+
travel to other engines (a candidate 1.6, or a rejected candidate you
|
|
584
|
+
want to confirm) without dragging the whole test tree along.
|
|
585
|
+
|
|
586
|
+
### Verified -- no hot-path change vs 1.5.0-beta.1
|
|
587
|
+
|
|
588
|
+
sha256 over the extracted function bodies of `pullComputed`,
|
|
589
|
+
`markDownstream`, `executeEffect`, `flushEffects`, `allocateLink`,
|
|
590
|
+
`severTail`, `createNode`, `runCleanup`, and `disposeNode` matches
|
|
591
|
+
1.5.0-beta.1 byte-for-byte. `currentOwner` is written by exactly the
|
|
592
|
+
sites that wrote it before (creation adoption, effect-body save/restore,
|
|
593
|
+
cleanup), plus the two new user-API primitives. Propagation
|
|
594
|
+
(`markDownstream`) remains owner-free per its documented invariant.
|
|
595
|
+
|
|
596
|
+
### Not shipped
|
|
597
|
+
|
|
598
|
+
- Watch.js needs no changes -- `watch` / `when` / `whenAsync` create
|
|
599
|
+
effects through the normal path and inherit correct adoption under
|
|
600
|
+
`runWithOwner` automatically. Verified against the safe engine.
|
|
601
|
+
- `runWithOwner` deliberately does NOT accept a callable `signal`
|
|
602
|
+
handle as an "owner" (signals cannot own). It falls through to
|
|
603
|
+
rooted execution instead, matching the shape of every other
|
|
604
|
+
handle-taking introspection API.
|
|
605
|
+
|
|
606
|
+
## [1.5.0-beta.1] -- 2026-06-XX
|
|
475
607
|
|
|
476
608
|
The API-surface minor: two new **non-callable, allocation-light** reactive
|
|
477
609
|
primitives, `signalBox` and `computedBox`, land alongside the existing callable
|
|
@@ -623,43 +755,69 @@ tolerances (`frame.avg` 5% rolling / 10% floor, `frame.p99` and `phase.write.p99
|
|
|
623
755
|
18% / 30%), four workloads mapping to public bench claims -- carries forward
|
|
624
756
|
from 1.4.0. Details in `harness/VersionMatrix/README.md`.
|
|
625
757
|
|
|
626
|
-
### Verified -- fresh 1.5.0-beta bench sweep
|
|
627
|
-
|
|
628
|
-
Both
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
758
|
+
### Verified -- fresh 1.5.0-beta bench sweep (Apple M4 Pro / Node 26)
|
|
759
|
+
|
|
760
|
+
Both v3 instruments were re-run in full on the 1.5.0-beta engine on **Apple
|
|
761
|
+
M4 Pro darwin/arm64, Node 26.3.1** (a step up from the 1.4.0 sweep's 2016
|
|
762
|
+
Intel MacBook / Node 22 host), with `#STAMP`-verified outputs committed to
|
|
763
|
+
`bench/rb.txt` (microscope aggregate, 4 engines across the six first-party
|
|
764
|
+
shapes) and `bench/r.txt` (mirror sweep, Andrii's canonical adapter verbatim,
|
|
765
|
+
lite vs alien across 47 rows, isolated-per-row, 10 reps). The M4 Pro host has
|
|
766
|
+
a lower run-to-run noise floor than the old Intel host, so the sub-percent
|
|
767
|
+
parity band tightens and the honest wins/losses stand out cleanly.
|
|
768
|
+
|
|
769
|
+
- **Microscope aggregate (rb.txt):** on the six v3 microscope shapes, lite
|
|
770
|
+
wins vs alien on **MUX +34.6%** (fan-in), **SELECTIVE DAG +20.0%**, and
|
|
771
|
+
**DYNAMIC DAG +18.4%** -- the allocation-heavy dynamic shapes stay lite's
|
|
772
|
+
home turf; the wins narrow versus the older Intel sweep (fast machine has
|
|
773
|
+
less GC pause to hide behind, so alien's raw propagation surfaces more) but
|
|
774
|
+
the ordering is intact. **BROADCAST is a true tie** (-1.2%, both under the
|
|
775
|
+
GC delta floor). Alien ahead on **KAIROS -15.7%** (1000 shared-source
|
|
776
|
+
computeds -- alien's flatter representation prices in the walk cheaper on
|
|
777
|
+
M4-class silicon) and **DEEP CHAIN -76.9%** (256-deep chain -- the same
|
|
778
|
+
architectural weak spot the honest framing has always named; recursive
|
|
779
|
+
JS-stack computed resolution loses to alien's flatter chain on hot new
|
|
780
|
+
cores by a wider margin than on old Intel). Speed wins vs alien: **3/6**;
|
|
781
|
+
heap wins: **5/6** with the sixth being a shared-zero on BROADCAST.
|
|
782
|
+
- **Microscope heap (the actual story):** on every shape where GC pressure
|
|
783
|
+
exists at all, lite allocates **one to four orders of magnitude less
|
|
784
|
+
transient heap than alien** -- DEEP CHAIN 0.5 KB vs 1062 KB (>2000x, on
|
|
785
|
+
the shape lite loses on time), MUX 0 KB vs 781 KB, KAIROS 23 KB vs 802 KB
|
|
786
|
+
(34.8x), DYNAMIC DAG 3.1 MB vs 60.7 MB (19.5x), SELECTIVE DAG 7.7 MB vs
|
|
787
|
+
78.0 MB (10.2x). Against preact-signals and solid-signals the heap gap is
|
|
788
|
+
even wider on the fan-in / fan-out family; solid allocates ~17 MB on MUX
|
|
789
|
+
and ~15 MB on SELECTIVE DAG where lite allocates 0 KB and 7.7 MB on the
|
|
790
|
+
same shapes. The differentiated position is ALLOCATION, not raw
|
|
791
|
+
propagation speed -- competitive-to-winning throughput with dramatically
|
|
792
|
+
lower GC pressure, and that is the headline that reproduces across hosts.
|
|
793
|
+
- **Mirror sweep (r.txt):** Andrii's canonical 47-shape suite re-run
|
|
794
|
+
isolated-per-row lite vs alien on M4 Pro reproduces the same honest
|
|
795
|
+
framing: lite runs **parity-to-behind alien on throughput** across the
|
|
796
|
+
suite (wins outright on 4/47 -- `1000x5 - 25 sources (wide dense)` +12%,
|
|
797
|
+
`manySourcesIntoOneComputedEffectWithDirect` +32.5%,
|
|
798
|
+
`manySourcesIntoOneComputedEffect` +31.7%, and `createComputations4to1`
|
|
799
|
+
+19.3%), weak on the deep/layered-burst family. Every row carries a
|
|
800
|
+
`#STAMP` and the counters (`nodesRecomputed` / `edgesTraversed` /
|
|
801
|
+
`sinkReads`) match Andrii's published suite exactly (`mirror.mjs
|
|
802
|
+
--self-verify`), so a lite-vs-alien delta here is identical work, not DCE.
|
|
803
|
+
- **Andrii Volynets js-reactivity-benchmark position holds at 4th of 15**
|
|
804
|
+
with geomean **79.3ms** (raw log `bench/AndriiVolynetsReactiveBench.log`,
|
|
805
|
+
Andrii's own host); lite is ahead of 5th-place Preact Signals (99.8) by
|
|
806
|
+
~21%. Top-3 count: **25/47** (up from 23 on 1.4.0);
|
|
807
|
+
outright-fastest-of-15 wins fluctuate at the top of a very tight
|
|
808
|
+
leaderboard where alien-signals / reflex / lite trade sub-percent margins
|
|
809
|
+
per shape (5 on 1.4.0, **2 on 1.5.0-beta** -- `createComputations4to1`
|
|
810
|
+
and `1000x5 - 25 sources (wide dense)`), plus 9 second-place finishes.
|
|
811
|
+
The stable metric across every published sweep is the geomean rank at #4
|
|
812
|
+
of 15.
|
|
813
|
+
- **Third-party version bumps** used in the local head-to-head vs 1.4.0:
|
|
814
|
+
alien-signals 3.1.2 -> 3.2.1, @preact/signals-core 1.14.1 -> 1.14.2,
|
|
815
|
+
@vue/reactivity 3.5.13 -> 3.5.35, solid-js 1.9.12 -> 1.9.13. Any
|
|
816
|
+
within-lib delta between the two sweeps reflects those bumps + the
|
|
817
|
+
Intel -> M4 Pro host change, not lite-signal changes: 1.4.0 -> 1.5.0
|
|
818
|
+
hot-path bytes are byte-identical (1.5.0 adds only the non-callable box
|
|
819
|
+
handle shape, which affects construction cost and handle ergonomics but
|
|
820
|
+
not the pooled-node read/write path).
|
|
663
821
|
|
|
664
822
|
## [1.4.0] -- 2026-06-XX
|
|
665
823
|
|