Repository navigation
Conversation
Envelope validation and load-bearing checks (duplicate ids, record existence, attach-state transitions, cloneProps ownership) stay unconditional; the per-command, per-handle-delta, and per-snapshot-node structural walks plus the whole-tree prepare check pass become development-only. Production keeps fail-stop: a corrupt commit rejects loudly through the staging guards and the apply-time fault path, pinned by a new production-module dual-thread suite. The profile hook gains prepareCheckMs, the dev-only check share of prepareMs. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013br9KPN1riTSP683xEvUuU
This was referenced Aug 11, 2026
Owner
Author
|
Conclusion: close as not currently justified. The historical validation-diet optimization no longer has a material live-main owner and should be reconsidered only with a new profile. |
This was referenced Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
The accepted command batch already enforces the invariants needed to construct a transaction. Production then paid again for diagnostic structural walks and a final scan over every retained host, even when a commit touched only two rows. Those checks are valuable when developing a broken renderer, but their cost scales with retained state instead of changed state.
This layer keeps the load-bearing checks that own behavior and failure containment, while limiting deep diagnostics to development. It is the independently mergeable P4 replacement for #13, frozen at
dcb334afa415fda63e94c09a77a31d107dea6128over source parentb4b0ab92df2f4b4ec0cf3b1a203158f8aa6943ec. The historical PR remains untouched.The old #13 body reported a 3.8x aggregate prepare win from a now-retired in-process whole-run profile. That headline is not carried forward: the current durable fresh-page runner separates create and storms and does not reproduce a large create@10k wall-clock gain. The defensible product claim is the prepare-stage reduction for small commits over retained state, not a 3.8x create speedup.
Changes
packages/lynx/src/core/protocol.ts: retain exact envelope/identity checks in all builds; gate deep command, handle-delta, and first-tree node walks behind the existingLYNX_DEVELOPMENTconstant.packages/lynx/src/core/host-driver.ts: gate diagnostic structural assertions and the final whole-tree consistency pass in production; keep staging/ownership/transition checks unconditional; collect native-list updates from accepted records; avoid allocating empty destroyed/final-id sets on the production steady path.packages/lynx/src/core/profiling.ts: exposeprepareCheckMs, the development-only whole-tree check share of prepare.packages/lynx/tests/validation-diet.test.ts: run the real dual-thread graph with freshNODE_ENV=productionmodules and prove render/update/replace/unmount, native-list membership, corrupt-command rejection, duplicate-id rejection, and malformed-envelope rejection.benchmarks/lynx-table/attribution/run.mjs: collect main-realm wire stages in CPU/cold/storm captures and fail profiled CPU capture if that attribution is absent.@octanejs/lynx.Stack
4a444b1b9665d8b4020d774a220bd0e21933cdb2)fd2ea96d5fe7fc4d39d0d24fe5e9aee8f196b111)b41944e6effd65d3d967af9233e8cf6569ed8301)The fork review stack is GitHub Stack octanejs#36 and is managed with the official
gh stackextension. Upstream delivery remains bottom-to-top.Simplification
cloneProps, duplicate/record/attachment checks, protocol envelopes, and apply-time rejection unconditional rather than turning the production path into unchecked input handling.Setallocations for destroyed/final ids in production steady state.Performance audit
Exact comparison:
4a444b1b9665d8b4020d774a220bd0e21933cdb2fd2ea96d5fe7fc4d39d0d24fe5e9aee8f196b1116d989b92a0f107f5cd7d71ba443f23a912397997f691cb9fa4825b0e51fb585c, P4a6cd897fc81277782bbf06c27f4d82a47b4b7fdfaa74a665dff5ddeb475ac916d7dae63ae1522b79898f6de98787ea75467a40a6df292c3c5d3a80e3ac0f6c74, P427e52fe5d1a1424c50e8653b3ddd6b490d01f4744ea323eb319017a4c96f3875p4-final-candidate-wire.json,p4-final-control-{cpu,heap,cold,cold-reverse}.json,p4-final-profile-{cpu,cpu-reverse,cold,storm}.jsonunderbenchmarks/lynx-table/attribution/results/Reportable attribution captures use five fresh pages/workers per target. CPU wraps create@10k; cold operations use five fresh realms with one cold plus four steady samples per realm; storms use the runner's fixed retained 1k setup. Every raw capture passed quiet-host preflight and records sample order, load, bundle hash, semantic state, and worker lifecycle.
Deterministic behavior and production fail-stop
Three final-candidate iterations are identical to P3 at 1k/10k: create 1 command/row; update10th 100/1,000 commands and Row renders; select 2 commands, 237 bytes, and 2 Row renders; swap 997 commands and 0 Row renders; update storm 50 commits and 5,000/50,000 commands; select storm 30 commits and 60 commands. Paced 1k remains 50 commits / 300 commands with three framed commits over three frames. The final ratio run passes all 25 applicable guards.
The production-module integration suite also proves the diet does not convert corruption into undefined behavior: null create props, duplicate ids, and malformed envelopes each produce one rejection and leave the DOM unchanged; ordinary lifecycle and native-list membership still complete.
The owner signal: small commits over retained state
Profile medians and full observed wall/prepare ranges:
Validate also falls 0.6 → 0.2ms for update and 0.1 → 0.0ms for select. Apply and acknowledgement remain within 0.6ms and 0.1ms respectively. The removed whole-tree scan is therefore visible at its named owner without skipped commits, rows, commands, or presentation states. End-to-end update is a wash because RAF/presentation dominates the saved 18ms; select improves modestly.
Create@10k CPU and order controls
In the forward profile, main validate is 30.9 → 0.0ms and prepare is 495.1 → 483.8ms. In reverse order they are 31.5 → 0.1ms and 583.9 → 476.0ms. A single create already touches/materializes the full tree, so removing a final diagnostic scan is a modest share of its total work; it is not the old 3.8x headline.
Profiled apply measures about +10% in both orders although P4 does not change apply behavior. Observer-free total MTS is +1.5%, reverse-profile total MTS is +1.8%, and whole wall is -1.9%/+0.2%; this is disclosed as instrumentation/bundle-layout sensitivity rather than claimed as either a gain or a product regression.
Cold paths, heap, and bundle
The profiled cold first medians are non-adverse across all six cells: swap -0.1%, replace -8.9%, create -4.0%, clear -10.3%, select -8.9%, update10th -5.8%. Control-forward select was +11.0%, so the entire matrix was repeated P4→P3; select became -1.3%. Reverse update10th then landed in the next roughly 13ms RAF bucket (+37.4%) while profile and control-forward measured -5.8% and -1.7%. The direction flips and the exact semantic/wire counts remain constant, so these isolated first samples are classified as frame-phase quantization, not a stable regression.
Explicit-GC retained slopes are 13,842.49 → 13,842.58 bytes/row (+0.0007%). P4 retained medians are slightly lower at 1k, 10k, and 30k (14,285,496; 142,708,824; 416,582,308 bytes), and every clear/view-destroy/page-close worker-release check passes. The control bundle adds 221 raw bytes / 82 gzip bytes, well below the 5% budget.
FCP is not reused from the historical PR because it predates this final candidate and harness. This layer does not make a startup claim; the cumulative P6/P7 checkpoints will remeasure FCP on exact SHAs.
Validation
@octanejs/lynxsource/testing/typetest typechecksspawnSync nodeEPERMs; the same command outside that process restriction passes 301/301)pnpm sync;git diff --check; final worktree cleanRisk / follow-ups
Provenance
agent-authored)dcb334afa415fda63e94c09a77a31d107dea6128(source parentb4b0ab92df2f4b4ec0cf3b1a203158f8aa6943ec)