Patch mode default-on: channel hardening rounds 6–10.14, static manifests, node-driven delivery - #3091
Patch mode default-on: channel hardening rounds 6–10.14, static manifests, node-driven delivery#3091ryansolid wants to merge 45 commits into
Conversation
🦋 Changeset detectedLatest commit: 46930be The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
Coverage Report for CI Build 33487115013Coverage remained the same at 71.572%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Merging this PR will degrade performance by 5.63%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | reconcile: deep tree, 10 of ~12k paths subscribed |
3.4 ms | 3.6 ms | -5.63% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing patch-hardening-r6 (a4c439b) with next (a536e29)
Footnotes
-
132 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
|
Post-round-6 + default-flip dbmon (octane harness, alternating 30-iter rounds, midday machine — medians in ms):
Tick at 1.8 matches the recording+probe expectation measured when A1 landed (1.8 vs 1.7 with no demotion check vs 1.9 full-scan) — the round-6 hardening added no regression beyond the already-priced probe cost. Partial-tick diff-skip ratio 0.28–0.30 (better than octane's 0.32). Semantic gate green both rounds. |
|
Patch-mode worth-proof: same branch, same runtime, same fixture source — the ONLY difference is the compiler flag (three-way alternating, 30 iters, medians ms):
Patch mode is what puts this next to octane: classic sits 4.2x behind on the full tick; patch is within ~19%. The ~1.5–3.6 kB bundle cost in the size scenarios buys this column. (Incidentally the flip surfaced in the harness itself: the fixture's opt-out env passed empty compiler options, which now mean patch-ON — fixed to explicit |
|
Round 7 pushed — all nine audit findings fixed, harness-first. Three commits:
Also new: PINV-1..3 per-flush channel-ledger assertions in the Perf, quiet machine: dbmon tick 2.1 ms vs round-6's 1.9 — the +0.2 is the honest price of sound accessor demotion across branches and nested chains (first sound cut measured 2.5; manifest interning, prefix-tree probing, and leaf inlining recovered the rest — two profiler passes attached to the work, not guesses). Partial tick still beats octane (0.5 vs 0.7). Mount's intern misses were profiled to zero after array hoisting; final mount number needs one quiet-machine confirmation (a parallel build was loading the box during the last sweep). Gates: 32/32 monorepo tasks, size scenarios ratcheted with dated notes (net round-7 cost: ~+0.3 kB store apps, ~+0.6 kB patch-list apps), changesets included. |
|
Quiet-machine confirmation sweep (evening, 80% idle, both orders, 30 iters):
Mount fully recovered — the That closes round 7 end to end: 9/9 findings fixed harness-first, gates green, perf within noise of the pre-audit numbers with the soundness holes closed. |
|
Round 8 pushed — 8/8 findings fixed, harness-first again (the new invariant tests committed red where reproducible). Highlights beyond the straight fixes:
Everything else as reported: manifest deep-probe at admission, decimal-key ineligibility in both compilers (byte-parity fixtures regenerated), Gates: 32/32 tasks, 4,323 compiler + 153 Babel + 468 signals + 71 driver tests, size ratcheted (+~0.3 kB per tier with dated notes). dbmon identical to round-7 finals: mount 6.4 / tick 2.0 / partial 0.5, quiet machine, both orders. |
|
Round 9 pushed — 11/11 findings addressed, harness-first, with three findings materially refined during verification:
The rest as reported: per-queue forced-stamp clearing + merge repair, isWrappable bind guards, server-entry Gates: 32/32 tasks, 4,325 compiler tests, size gates ratcheted with dated notes. dbmon 6.3 / 2.1 / 0.6 — parity with rounds 7–8. Standing note for the next design pass (also in the brief): rounds 7–9's P1s are dominated by hand-replicated visibility rules at channel seams. I'm prototyping node-driven delivery (one hidden node per patched record, compiled bodies unchanged) as the by-construction answer before the next audit round — if per-record nodes hold dbmon, that eliminates the timing-divergence class entirely. |
|
Review note from #3161 (For + siblings hydration desync, fixed in 91e300a): the regression came from the list seam's lazy |
36d1d38 to
8527c6e
Compare
|
Heads-up for anyone continuing work on this branch: two review commits landed directly on
Full signals + web suites green on the new head, size inside budgets. The branch is also one commit behind |
|
Structural audit round landed on top of the review commits (no force-push — fetched and built on
Audit of 3e12ffd: sound — Hydration ask: Also merged |
|
Follow-up round landed (
Gates: 1,505 signals + 2 expected-fail pins, 719 web, size green — store-family app actually DOWN 50 B (the emission-time composition deleted), patch tiers +61/+111 B ratcheted with notes. |
ada689c to
4c7eedf
Compare
Prod-sound getter demotion (accessed-key recording + bounded adoption probes), transition-merge same-channel coalescing, unbind-safe structural queue dispatch, fixed dispatch windows, initial-construction severing on throw, and active failed-apply resync. Co-authored-by: Cursor <cursoragent@cursor.com>
Both compilers now emit patchDriver/rowProof templates by default (opt out: patchDriver: false). Regenerated fixture outputs and Oxc expectations; parity tier dom-nopatch fences the opt-out. Size scenarios renamed from flip-preview to default-on and ratcheted with round-6 notes. Includes AUDIT-BRIEF-R6.md for the pre-merge audit. Co-authored-by: Cursor <cursoragent@cursor.com>
Contract-derived tests, not instance reproductions: accessor-safety across admission/adoption axes, one-apply-per-batch under lane interleaving, consumer-list lifecycle at emission/drain/merge boundaries, throw-atomicity at every row-build entry point, hydration region surrender, Tier-2 read-set completeness, and compiled-imports ⊆ documented-runtime-surface contracts. 10 red / 8 green against the round-6 branch; each red is a confirmed audit-7 finding, each green documents an invariant that already holds. Co-authored-by: Cursor <cursoragent@cursor.com>
Each fix flips a red invariant-harness test green: stateless adoption probes against the incoming backing, prototype-plainness admission, split normal/optimistic stamps, emission-snapshot structural queues + drain-live value lists (with cross-release coalescing), build-before- destroy slot rebuilds, and full server-region surrender on hydration throw. Store+core suites 465 green; driver suites green. Co-authored-by: Cursor <cursoragent@cursor.com>
…1; renderer surface documents patchDriver (P1-4) Both compilers emit the body's full static read envelope (hoisted _mf$ arrays, deduped per module); the runtime interns manifests by identity, probes deep paths as a prefix tree at adoption gates and forced applies, bubbles ancestors on targeted reconciles, and resolves forced next through the proxy for deep-path channels. Eligibility: bare-subject reads and dotted string keys compile classic. Renderer type/README/contract tests pin patchDriver into the documented surface. PINV per-flush ledger checks wired into the __TEST__ invariant infra. dbmon: tick 2.1ms quiet-machine (was 1.9 unsound / 2.5 first sound cut), mount intern misses eliminated. Co-authored-by: Cursor <cursoragent@cursor.com>
Admission deep-probes manifests + committed-view reads, captured-record structural binds (patchProxyFor via createTarget-installed wrap hook — keeps the trap engine shakeable), lane-timed tentative ancestor bubbles with settle twins, generation-stamped drains, forced-bubble coalescing, decimal-key ineligibility (both compilers), rowProof on the createRenderer surface, untracked universal commit phase. dbmon unchanged (6.4/2.0/0.5). Co-authored-by: Cursor <cursoragent@cursor.com>
Committed-visible skip markers + held-view admission, optimistic-view mounts, manifest-read fallback compute (write-free), tentative self emission + immediate lane demotion, per-queue forced stamps + merge repair, isWrappable binds, server patch-tier exports, function-carrier probes, safe-int keys, unchanged-reconcile bubble gate. Attribution test warn-count flake fixed two-sided. dbmon 6.3/2.1/0.6 (parity with r7/r8). Co-authored-by: Cursor <cursoragent@cursor.com>
One bare version signal per record (pc.dn) bumped at emission seams; the driver's delivery effect applies compiled bodies with post-apply prev snapshots and scan-free committed reads. dbmon: tick/partial parity with the channel (2.1-2.2 / 0.6 both orders), mount +0.5-1ms (per-row root creation, optimizable). The queue/stamp/skip machinery is untouched but unused under the flag — candidacy evidence for deleting it. Co-authored-by: Cursor <cursoragent@cursor.com>
Value tier fully node-driven: per-channel render effect (createRoot-owned, disposed with last entry) dispatches applyEntries with manifest-shaped prev snapshots and a single visibleView() decision (optimistic view / held mask / committed). Value queues, stamps, cm/gen skip rules deleted; structural queue kept slim. Types clean, builds green. HARNESS TRIAGE PENDING (~24 red): known classes — (a) tests asserting queue-era mechanisms (force flags on ancestor re-applies — semantics hold, compares are exact now); (b) REAL defects to diagnose: structural tests red (row-ops path or reconcile gates), same-batch coalescing red, error routing through the detached delivery root (drain used haltReactivity; effect throw surfaces differently), optimistic in-flight timing. NOT MERGEABLE — checkpoint for fresh-eyes triage. Co-authored-by: Cursor <cursoragent@cursor.com>
… fixed Fixed tonight, each traced to first principles: - INV-2 violation: the delivery signal's override slot must be armed (NOT_PENDING) without CONFIG_OPTIMISTIC — plain bumps stay held-write, optimistic bumps ride the engine with correct revert registration. - Channel error contract restored: unhandled patch errors defer the halt one queue phase so sibling channels' deliveries complete first (the round-2 pin); flush still throws. - visibleView reads optimistic families THROUGH THE PROXY — tentative values live in node overrides at any depth; root-level view merges miss children. - The delivery signal + bump/dispatch bookkeeping PERSIST across consumer churn (only the effect root lives with consumers): held write-time emissions ride the signal's pending commit and died with disposal. - Value bumps moved to FOLD COMMIT (post-swap) — write-time bumps raced transition settles, delivering pre-fold state. REMAINING (11): the fold-commit move exposed the deepest discrimination — in-place folds are identity-invisible at drainFolds (t.v === old continue), which is WHY the queue design emitted at write time. Correct fix sketch: wk (written-keys) evidence at the identity-continue + ambient/transition bump gating at the setter site. Plus: force-flag test modernizations, optimistic in-flight set, projection refetch. NOT MERGEABLE. Co-authored-by: Cursor <cursoragent@cursor.com>
Session fixes, each traced: armed override slot without config reroute (INV-2), deferred halt preserves the round-2 sibling contract, proxy visibleView for optimistic families, persistent delivery signal across consumer churn, fold-commit bumps (write-time raced settles) + overlay- merge bumps (in-place folds are identity-invisible downstream — the undocumented reason the queue emitted at write time), write-override landing bumps, per-entry prev baselines (replaces gen/cm skip rules entirely — the compare IS the decision), untracked snapshots (tracked proxy spreads subscribed registrants' boundaries), owner-neutral delivery roots (boundary-queued effects missed lane runs), demote-at-delivery (effects created in setter write windows never subscribe), owned-write exemption on the delivery node. Full signals suite 1,415 green including PINV ledger. Web driver at 5 red (projection structure ×2, shallow retention, optimistic push visibility, nested-chain targeted reconcile) — diagnosis next. Test modernizations (asserting queue mechanisms → semantics): force flags ×2, mid-flush mount (compare-gated oracle), boundary isolation (restored to ORIGINAL queue expectations — owner-neutral effects deliver before teardown), tentative getter (effect-parity bounded: the queue EXCEEDED parity by delivering ambient writes in-flight). Co-authored-by: Cursor <cursoragent@cursor.com>
1,415 signals + 683 web + 150 hydrate + 32/32 monorepo tasks under node delivery: the entire nine-round invariant harness passes with the value queues deleted. Final session fixes: dp-channels read through the proxy (forcedNext's staleness call, reborn), null-baseline first deliveries force (projection materialization — one crash was halt-poisoning three equivalence tests), emission payload fast path (bc-tagged np), owned-write exemption on the delivery node, hook guards on revert-ancestor bumps. Sizes (vs channel): patchDriver tier 15,825 (-164), rowProof 18,358 (-112) — before deleting the now-dead stamp/merge machinery. PERF: NOT DONE. dbmon tick 8.3 / mount 12.0 (channel: 2.0 / 6.3). Profile: GC 1.6s (per-delivery manifestSnapshot allocation storm) + serveDataKey/get 1.1s (proxy reads leaking past the payload gate — double-bump suspected, uninstrumented). OPTIMIZATION DESIGN, verified against the profile: (1) pv = the swapped-out backing REFERENCE for adoption-style ticks (zero alloc — old backings are immutable after swap); clone only at the overlay (in-place) fold, exactly where the queue design ran clonePrev; (2) verify np payload engagement per tick (count np-hits vs proxy fallbacks); (3) registration-side pv laziness for mount. The flag-prototype measured 2.1/7.2 with flat spreads — the target is real. Co-authored-by: Cursor <cursoragent@cursor.com>
…tion Three fixes: the dispatch-side payload gate had silently failed to apply (every delivery took the proxy path — the whole 8.3ms tick); reference prev baselines (raw backings are immutable after adoption swaps; the overlay fold clones just-in-time via prepareInPlaceFold — the queue's clonePrev moment, now pay-per-in-place-fold); registration baselines by reference. Payload gate: 10,000 hits / 0 misses over 10 dbmon ticks. dbmon (PROVISIONAL — battery): tick 2.1 / partial 0.5 / mount 7.8 vs channel 2.0 / 0.5-0.6 / 6.3-7.5. Parity on updates; mount ~+0.5-1ms (per-row delivery root, documented). Dead machinery deleted: clearStamp, gen/cm skip fields, value-era merge dedup + stamp repair (scheduler merge is a plain structural move now), prototype exports (patchVersion/patchCommittedRaw). PINV-2 restated for node delivery (undispatched-bumps-at-quiescence). Sizes vs channel: core floor -157 B (the rounds-6/9 merge bumps reclaimed), createStore -112, patchDriver tier -169, rowProof -105 — net smaller WITH the delivery machinery added. All gates green: 1,415 signals + 683 web + 150 hydrate + 32/32 tasks. Authoritative dbmon pending wall power. Co-authored-by: Cursor <cursoragent@cursor.com>
…d, single-mode dispatch Manifest-less registrations poison the key union (akAll → full-scan probes) replacing the drain-side recording proxy; applyEntries drops its dead prev/force modes; deferHalt/routeEntryError shared across all four dispatch shapes; emitPatchLocal aliased. Value tier 16.22 → 16.05 kB, list 18.79 → 18.60 (ratchets tightened). Includes the auditor's round-10.8 lifecycle suite (8 tests, synthetic held-queue harness). Ticks unchanged in paired A/B (2.4/2.4 under load; mount delta within sd=1.07 noise — quiet-machine confirm noted). Co-authored-by: Cursor <cursoragent@cursor.com>
…diagnosable Patch consumers aren't graph subscribers (_subCount sees one delivery edge), so the channel witnesses its own shape: registration milestones fire HUGE_FAN_OUT, wide dispatches fire WIDE_WRITE with a doubling memo — same codes/thresholds as the graph twins, dev-only (sizes unchanged). Multi-subject/dynamic-key expressions stay patch-ineligible and keep classic graph attribution. Stale createSelector advice updated. Co-authored-by: Cursor <cursoragent@cursor.com>
patchEmit hook re-stamps the delivery signal after each bump with the record's store path (name-only on bubbles, value previews on self emissions), and delivery effects self-name patchDelivery(store.path) — rerun events for patch-applied updates now read as the causing record write. Dev-only via attrHooks (no engine coupling, no-try rule kept, sizes unchanged). Pinned by tests/attribution-patch.test.ts. Co-authored-by: Cursor <cursoragent@cursor.com>
…computes never commit Per-entry manifest envelopes for demoted bodies (the channel union would subscribe and fail every sibling on one sibling's keys); computeFailed latch skips the commit after a routed compute error (the auditor's lifecycle suite updated from the swallow-then-apply behavior it pinned); redrive roots transparent (hydration-ID depth parity); akAll ref-counted via entry.ml/pc.mlc, released on unbind and demotion. Three tier ratchets (+105/+23/+8 B — demotion lifecycle bytes). Co-authored-by: Cursor <cursoragent@cursor.com>
…ervability alignment readDeepChildren descends from the once-read root value (unstable getters track what they commit) and through functions; iterable manifests keep PropertyKey symbols (RED-verified: stringified envelopes tracked "Symbol(x)" and went stale); WIDE_WRITE twin engine-owned via patchDispatch (options.wideWrites, same memo/metadata); patchEmit origin threads the true write source through ancestor bubbles (chains report the child, not the ancestor); row-ops/slot registrations fire the HUGE_FAN_OUT milestones. Boundary-recovery thread closed by the auditor as a faulty probe. Co-authored-by: Cursor <cursoragent@cursor.com>
…velopes bumpAncestors moved INTO demoteToEffects (the already-empty demote on a previously-demoted child never bubbled — RED-verified after correcting the repro to put the accessor on a DECLARED key; off-envelope getters are correctly ignored by the manifest-scoped probe); ProcessedManifest gains a root-aligned deep index (dpr — envelope walk linear); coalesced bumps append origins via patchOrigin (chains report every feeding child); applyStructural dispatches through the engine's wide-write policy keyed on the consumer list. Runtime correctness otherwise closed per the auditor. Co-authored-by: Cursor <cursoragent@cursor.com>
…tics, combined budgets -X theirs clobbered upstream's contradicted-landing gate and retained- edit drop() in optimistic.ts (caught by upstream's own suites); the file is reset to next's version with only the branch's three emission-gate changes re-applied (diff verified minimal). Native compiler binary rebuilt (stale pre-rebase build re-minted the #3105 lone-spread merge — hydrate parity caught it). Four size tiers ratcheted for upstream drift stacking with branch bytes; treeshake core floor merged at 21.7k. Co-authored-by: Cursor <cursoragent@cursor.com>
…ents, cause hygiene QueuedApply.pc backref (never consulted by drains) keys wide-dispatch memos and anchors structural naming/causes; patchStructural records synthetic rerun events for commit-drain dispatches; appendPatchOrigin name-dedupes; patchDelivered marks consumed stamps so self-emissions carry forward only undelivered child causes; bumpAncestors uses path origins for demoted children (live-consumer gate). All five auditor P2s pinned in attribution-patch.test.ts. Co-authored-by: Cursor <cursoragent@cursor.com>
…ant resync Structural entries capture their owner queue; dispatch defers held consumers into it (deferHeldStructural, live RESYNC at release — row ops are baseline-relative and stale by then); the drain sweeps the LIVE consumer list for held-window registrants and resyncs them (round-7 "receive nothing" pin refined: never ops, always the identity rebuild). The equal-landing/contradicting-landing P1s are PAUSED per Ryan — both are patch-channel integration with #3123's in-flux landing semantics. Two tier ratchets (16.6/19.1). Co-authored-by: Cursor <cursoragent@cursor.com>
One queueIsHeld probe, one deferIntoQueue shape for held consumers, shared channelTarget registration prologue and structuralUnbind. Behavior-neutral: 514 signals store tests + 709 web tests green. Compressed size is a wash (brotli +11 B, raw -34 B) — the repeated shapes were already deduplicated by compression; kept for maintainability so future hold-routing changes land in one place. Co-authored-by: Cursor <cursoragent@cursor.com>
The rebase conflict policy kept the branch's evolving .size-limit.js at each replayed commit, dropping upstream's #3122/#3123 note blocks (the limits themselves were already above upstream's). Restores the six note blocks with post-rebase measured values; all scenarios pass unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
…o paused P1s) Equal-landing flash: emitPatch's raw payload fast path (pc.np) served committed backings directly to deliveries, bypassing visibleView's optimistic-family proxy rule — an equal landing (overrides held) flashed committed state through value patches while classic effects kept the override view. The stash is now gated on non-optimistic families; perf paths keep the payload. Contradicting-landing notification: consumeOverridesNext's wipe emitted through the optimistic lane for an authoritative change — timing divergence, duplicate delivery, and no structural resync (consumption removes the target from `overlaid` before the settle drain's resync loop reads it). The wipe's landing posture now emits a regular bump (coalesces with adoption's emission into one classic-schedule delivery) plus the row-ops resync form at the landing. The settle-drain site keeps the lane form — its own loop covers structure there. Both reproduced RED first in the invariant harness (classic-parity oracle). Full signals + web suites green; size inside existing budgets. Co-authored-by: Cursor <cursoragent@cursor.com>
…derived view The third landing posture was untested: a CONTINUATION landing echoing a replayed keyed add (d813a96's echo-mask semantics) against a driven list. RED first in the invariant harness — the channel delivered the bare landed base (the wipe's resync snapshot, taken mid-reckoning) and per-edit replay drafts, both states classic readers never render. Wipe + replay is ONE reckoning: notifyOptimisticWrites suppresses the write-site row-ops frame while replaying, and consumeOverridesNext emits the landing notification only after the replay half, carrying the optimisticView-composed snapshot (the target-resolved resync form reads pb ?? v — right for the settle-drain revert site it serves, a half-state here). Full signals + web suites green; size inside budgets. Co-authored-by: Cursor <cursoragent@cursor.com>
Entangled retainers (actions sharing one optimistic store) settle together — one completing early strips no mask — and the joint settle's wipe+replay lands the channel on committed truth with no half-state frames. Already green; the posture was the last one unpinned. Co-authored-by: Cursor <cursoragent@cursor.com>
…superseded work Six findings, three root causes, composed with review commit 3e12ffd (one-reckoning landing notification — audited: replaying latch is try/finally-safe with per-edit throw isolation): - Late-registrant sweep rebuilt on registration sequences: fixed window at both edges (in-snapshot entries and mid-drain registrants excluded), held owner queues defer via deferIntoQueue, and the scan is an O(#late) suffix walk (was indexOf-per-entry, quadratic). Contract refinement pinned: plain stores emit at the fold, so pre-flush registrants ride the snapshot with baseline-correct ops. - Drain-resolved structural next (resyncs, held releases, late sweeps) reads visibleStructRows — optimistic families through the composing proxy, never bare committed backing. - Deleted-slot gate: ticks coalesced past a shrink are skipped, snap and resync paths both. - Superseded-work generation: emitLandingConsumption bumps pc.sg; drains skip stale-generation items — transition-held ops can't replay over a landing's resync at settle. - Fifth-posture pin: aborted-retainer survivor kept at classic parity (oracle-anchored). 39/39 invariant harness, full signals (1,504) + web (709) suites green; two size ratchets with notes (+27 B store-family, +41 B list tier). Co-authored-by: Cursor <cursoragent@cursor.com>
Review ask from #3161's follow-through: post-flip, driver-ENGAGED hydration takes a different road than the classic seam (#3161's fix covered) — driveList claims rows positionally by _hk and mints its own listOwner child scope. The new scenario is the driven twin of the static one: store-backed rows whose template PROVES pure (attribute- only binding — text holes disqualify rowProof; emission verified against the compiler for this exact shape under the harness's flags). The update pushes a row THROUGH the engaged driver and bumps a sibling signal; the parity invariants pin no client-created DOM during hydration, no warns, textContent, and sibling node identity across the driven structural update. Both roads now covered: static rows decline at runtime (classic seam), store rows engage. Server harness 62/62, parity matrix 153/153. Co-authored-by: Cursor <cursoragent@cursor.com>
…on, drain dedup, slot-tick preservation Two P1s + two P2s from the follow-up audit, plus two OPEN upstream pins: - Slot-patch registrations stamp `sq` (the suffix scan read 0 and broke immediately — held-window shallow-list mounts stayed stale). The regression test is non-vacuous now: the surviving slot's resync must arrive, and emissions go through the reconcile walk. - emitRowOpsLanding hook: lane-timed (a reverting action's stash must not own the landing's notification) but DRAIN-RESOLVED — the emission-time composed snapshot read the mid-reckoning draft and could reach the DOM ahead of classic. visibleStructRows at drain reads what classic renders. Probed across five landing interleavings at parity. - Per-drain dedup for item-local late-row resyncs (was item-count × consumer-count repeats). - sg-stale SLOT items re-resolve live and keep their delivery (standalone value notifications the landing's row resync does not cover); sg-stale ROW items still drop. - OPEN upstream ×2, pinned it.fails: a second same-microtask continuation landing is swallowed (bare projection, no actions/consumers — committed truth loses the row); an until()-gated action wedges on the swallowed echo. #3123 reckoning seam — flagged, not unilaterally fixed. Full signals (1,505 + 2 expected-fail) + web (719) green; two size ratchets (16.7/19.3), store-family app DOWN 50 B (composition deleted). Co-authored-by: Cursor <cursoragent@cursor.com>
The re-ruled landing contract (truth folds into the retaining transaction, atomic reveal at settle) obsoletes the branch's landing integration wholesale: emitLandingConsumption/emitRowOpsLanding and the superseded-work generation (pc.sg + drain gate + item stamps) are DELETED with the contract they served — staged truth is transition-held (channel held-write semantics apply by construction) and the reveal rides the settle drain's existing resync loop. The registration- sequence sweep window, hold routing, visible-view resolution, and the deleted-slot gate are contract-independent and stay. Re-applies the round-10.5 primitive-owned emission gate the upstream rewrite reverted (settle-loop value emission gated on the local consumer list — silences ancestor channels, round-10 P1-3; two invariant tests caught it). Landing invariants re-pinned to fold semantics: interim landings invisible to both channels, atomic flip at settle, classic-parity oracles unchanged. The two upstream it.fails pins (same-microtask swallow, wedged until()) STILL FAIL under fold — they ride on. Full signals (1,507 + 2 expected-fail) + web (719) + hydration parity (153) green; two ratchets for upstream fold bytes (15.15/27.25). BASED ON UNPUSHED next (a536e29) — hold pushes until it lands. Co-authored-by: Cursor <cursoragent@cursor.com>
4c7eedf to
b31e992
Compare
The round-10.11 eager path-copying in adoptPB ran per eager child adoption with no channel gate. Ancestor committed raws are only ever served to PATCH consumers (patchableRaw / delivery payloads) — classic readers resolve through proxies and nodes — so in a patch-less app the repair bought nothing and cost plenty: privatizeCommitted re-cloned every freshly adopted interior backing per reconcile (an extra tree copy per iteration), and the clone's identity swap turned downstream equality gates into keyset/deep bump storms (insertSubs 7.8x on the listened-paths deep() bench; CodSpeed -11% on the sparse case). Profiled standalone against the merge-base prod dist: parity restored (interleaved min/median within noise), patch-mode tests unchanged (the deep-path invariants register channels and keep the repair covered). Co-authored-by: Cursor <cursoragent@cursor.com>
…l coverage Four P1s at b31e992, harness-first: - Held slot deliveries defer PER INDEX (entry.hqs): the shared hq flag collapsed multi-slot batches to the first index behind a hold. - Late-registrant sweep moved to DRAIN END with a per-channel highest- emission watermark: the per-item sweep resynced to live state and a later item's baseline ops re-applied on top, double-building rows. Audience unchanged: exactly the entries no snapshot reached, still a suffix tail scan. - stagedApply descends only through live draft proxies (stagedChild): recursing into a SHALLOW store's raw rows mutated committed truth in place — visible before the reveal, notified to no one. Raw children replace their slot wholesale. - Staged-truth folds emit at the reveal: t.sf marks optimistic-family drafts written under the authoritative posture (the staging bracket); both fold-site row-ops gates exempt it, and a slot-diff twin ticks changed slots. The old opt-family gates cover override materializations only — a root array retained through a DESCENDANT override is not overlaid, so the settle loop's resync never reached it. Full signals (1,511 + 2 expected-fail) + web (719) green; four size ratchets with notes (15.2/27.35/16.9/19.45). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Fold-audit round landed (
Also on the branch since your audit point: the rebase onto the pushed fold commit with the channel integration re-derived for fold semantics (landing-time machinery deleted — staged truth rides held-write semantics, the reveal rides the settle resync loop; the round-10.5 ancestor gate your rewrite reverted is re-applied), and the CodSpeed −11% root-caused and fixed ( Gates: 1,511 signals + 2 expected-fail pins (the same-microtask swallow and wedged |
…ng class Five findings at a4c439b, four in the accreted sweep machinery. Per the standing decision, redesigned rather than patched a fifth time: Emissions stamp svAt (per-kind: sv rows, svs slots); the channel tracks the VISIBLE version (svv/svvs — live-queue entry, releaseBatch for stashed items, emission for lane items); entries init av to it and apply an item only when av === svAt-1 (the item's baseline IS their last-seen state). Gaps take ONE flush-end resync after every queue. Deleted: emission-snapshot membership, PcSweep/noteSweep/sweepList/runLateSweeps, maxRq/winEnd watermarks, drainGen/dg, rq/sq stamps. Findings 1/2/4 are unaskable under the chain. Finding 3: settle loop skips staged-fold targets (single reveal notification, pinned). Finding 5: repairAncestorSlots at registration, gated to stale aliases of the SAME child resolved through the family map — the ungated first cut injected tentative rows into committed truth (all four optimistic equivalence failures, one root cause). Revert-form resyncs (cm items) resolve committed raw only — never a lingering draft, never the composing proxy. Held-window registrants improve: chain connects, real baseline-sound ops at release instead of a rebuild (pin updated). Signals 1,511 (+2 expected-fail) | web 719 | parity 153 — all green. Three ratchets (17.15/19.6/27.4): flat redesign cost, accretion stops. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Redesign landed ( The structural version chain: every emission stamps a per-kind version ( Against your findings: (1) and (2) and (4) have no mechanism left to be wrong in — no watermark, no per-queue sweep, no per-item repetition. (3): the settle loop skips staged-fold targets; the fold's own emission carries the reveal, pinned with a single-rebuild assertion. (5): Two contract notes: held-window registrants IMPROVE — their chain connects, so they receive real baseline-sound ops at release instead of an identity rebuild (10.13 pin updated to accept either sound form). Revert-form resyncs resolve COMMITTED raw only — never a lingering draft backing (row escape materializes one), never the composing proxy. Gates: signals 1,511 (+2 expected-fail upstream pins), web 719, parity 153, size green with three ratchets (17.15/19.6/27.4 — flat redesign cost; measured honestly, this is +230 B on the value tier, bought to stop the ~150 B/round accretion this class was generating). Your adversarial repros against the new head would be the confirmation that matters. |
Five findings at b296640 (3 P1 + 2 P2), all in the chain's edges: - av init is TRANSITION-AWARE: a consumer mounting inside the writing transition reads the SPECULATIVE view, so its baseline covers the stashed emissions (av = sv); the old svv init replayed stashed ops over DOM already built from them (store bac, DOM abc). Ambient mounts keep the visible-version init and receive stashed ops at release. - Staged reveals ride ONE channel: aligned windows (same length) are value replacements — slot ticks only; length changes are structure — row ops only. Both channels for one replacement rebuilt the row twice (lifecycle/focus divergence). - Staged-reveal identity diffs key rows through the FAMILY MAP: the fold re-seats retained rows' raws, and raw-keyed matching rebuilt rows whose proxies never changed. - Held structural releases fast-forward entry.av (a gap right after a release forced a redundant full resync). - Version arithmetic drops |0 coercions (2^31 wrap = permanent delivery suppression at scale). Signals 1,513 (+2 expected-fail) | web 719 green; two 20 B ratchets. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Fold audit 2 landed (
Gates: signals 1,513 (+2 expected-fail upstream pins), web 719, parity 153, size green (two 20 B ratchets). Standing merge position, per the thread with Ryan: correctness rounds keep closing, but the branch's PERFORMANCE case is currently unproven — the dbmon driver column can't be measured (the babel-preset fixture path never engages |
… version chain; harness ghosts documented Co-authored-by: Cursor <cursoragent@cursor.com>
|
Perf verification complete ( The sweep (30 iter, servers verified fresh):
With this, both merge blockers from the perf thread are resolved: the driver column demonstrates octane-class update throughput on the branch head, and classic carries no profile-visible tax. Remaining open: the two upstream |
…/multiplexing deferred to future RC Co-authored-by: Cursor <cursoragent@cursor.com>
|
Ship ruling ( Deferred to a future RC, recorded in the brief:
State for the final audit: head |
Patch channel: default-on flip + full hardening line
Scope:
next..patch-hardening-r6(33 commits). This PR carries the complete patch-mode line since round 6: the DEFAULT-ON compiler flip, ten audit-hardening rounds (all findings closed), static read manifests, the node-driven delivery architecture, two size passes, and the #3123 landing-consumption integration. The runtime audit backlog is EMPTY — nothing paused, nothing open except P3 diagnostics polish.What ships
Default flip (patch mode ON)
Both compilers (Babel + Oxc/Rust) emit
patchDriverbindings by default; opt out withpatchDriver: false. All fixture corpora regenerated; parity tierdom-nopatchfences the opt-out. Server entries carrypatchDriver/rowProofstubs so compiled DOM modules link under Node.Node-driven delivery (the architecture change)
Patch delivery moved from queue-driven to NODE-driven: each channel owns a detached
deliveryEffect(bare node, one static source, no root/owner bookkeeping) bumped by a channel signal. Emissions are signal writes — they inherit the engine's scheduling, transition stamping, and hold semantics instead of reimplementing them queue-side. Raw payload fast path (pc.np) serves fresh backings scan-free on the hot path. dbmon: mount 6.6 vs classic 15.1 ms, tick 2.1 vs 7.9, partial 0.6 vs 1.2 (2.3×/3.8×/2×).Static read manifests
Compilers emit each template's read set (
registerPatch(record, fn, keys)); manifests are interned per template (WeakMap, prefix trees for deep paths) and shared by reference across rows. Closes the prod-soundness hole (getter demotion probes exactly the declared envelope) and the round-7 mount regression (~0.1 ms/1000 rows).Hardening rounds 7–10.14 — the invariant harness
Every audit finding closed harness-first (RED test, then fix). The big structural rules now pinned:
Observability (dev-only, zero prod bytes — verified byte-identical)
Attribution cause chains flow through deliveries (
patchEmit/patchDispatch/patchDelivered/patchStructural), channel-sideHUGE_FAN_OUT/WIDE_WRITEtwins, synthetic structural rerun events.Size
Two dedicated size passes (recording-proxy deletion + single-mode dispatch; shape consolidation). Costs are tiered pay-for-use:
.size-limit.js.Verification
packages/signals/tests/store/patch-invariants.test.ts— the channel-contract harness (axis products: registration mode × backing shape × lane × timing × consumer lifecycle)packages/web/test/for.patchinvariants.spec.tsx— driver-level invariants (deep paths, holds, selections, cross-family)packages/signals/AUDIT-BRIEF-R6.md(per-round findings + fixes),packages/signals/DESIGN-PATCH-CHANNEL.md(architecture + decisions)