Skip to content

feat(lynx): prove typed delta shadow over real commits (issue-66 A4) - #78

Merged
Huxpro merged 1 commit into
new-lynxfrom
feat/lynx-delta-shadow
Aug 19, 2026
Merged

Huxpro merged 1 commit into
new-lynxfrom
feat/lynx-delta-shadow

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

Stacked on #75; first Phase A4 background-delta vertical slice of #66.

  • adds a transactional, profiling-only bridge from current accepted command commits to typed RUN/SET/MOVE/REMOVE deltas
  • maps mount-template-run using compiler program stride and IDs; maps binding-only updates directly from compiler slot metadata without planLynxHostPropPatch
  • declines any unsupported command, non-binding prop mutation, non-root move/remove, portal parent, or malformed stride without mutating accepted shadow state
  • publishes shadow state only after host acknowledgement callbacks succeed; reject/fault/abort leave it unchanged
  • differential command-reference vs encode/decode/delta-applier suite; production fold proves byte-equal output when profiling is disabled
  • living-spec §8 projection and patch changeset

The production transport and main-thread applier still consume the command batch in this slice. This is the dual-path proof required before authoritative wire cutover.

Red-green / differential evidence

  • Focused delta protocol + shadow: 2 files / 18 tests (including malformed/opaque protocol coverage and 3 shadow cases).
  • Deliberate break: offsetting each emitted SET slot by +1 made class/label values land in the wrong cells; the per-commit differential failed immediately. Restoring the slot index returned it to green.
  • Full Lynx owning project: 28 files / 362 tests green.
  • Stage/fold: 8 tests green; the profiled entry importing the delta shadow bundles byte-identically to the control with __OCTANE_LYNX_PROFILE__=false.
  • Runtime inventory now treats universal-core.ts + extracted universal-kernel.ts as the native universal runtime graph for the pinned Symbol.description compatibility contract.

Real workload coverage / projected wire

LYNX_TABLE_SCALES=1000,10000 node benchmarks/lynx-table/run.mjs 2 preserved every existing command/render/identity/event control. Across both scales, all 166 measured commits were delta-expressible with 0 misses.

10k encoded delta payload estimate vs current command commit bytes:

operation delta current
create 349,778 B 350,619 B
update10th 36,755 B 69,874 B
select 40 B 225 B
swap 27 B 368 B
update storm (50 commits) 1,133,250 B 2,789,296 B
select storm (30 commits) 1,346 B 6,956 B

These are cutover projections, not shipped performance gains: the command wire remains authoritative here.

Validation

  • pnpm sync
  • scoped format + tsgo for changed Lynx source/test files
  • Lynx project — 28 files / 362 tests
  • stage/fold — 8 tests
  • deterministic real workload at 1k + 10k, two iterations, 0 shadow misses
  • octane + octane-prod full projects not rerun; A2 broad run was environment-failed by SG1 inotify EMFILE, while relevant universal guards remain green
  • pnpm test (full repository)

Risk / follow-ups

  • Profiling builds clone the shadow state per commit; normal production pays zero bytes/branches after define folding.
  • Template IDs are shadow-session-local and become authoritative only after capability/ABI negotiation in the next slice.
  • Event/lifecycle/public-instance changes intentionally miss today; the table workload's stable program event sites require none after initial RUN. The authoritative cutover must preserve those cold semantics or retain a dual-path fallback.
  • Next: transport the delta envelope, apply it through slot tables on main, then remove full-prop update bags and background updates.classify only after that path is green.

Provenance

  • An agent produced this diff (agent-authored)

Add a profiling-only transactional bridge from mount-template-run/update/move/remove command batches to RUN/SET/MOVE/REMOVE deltas. Differentially apply encoded deltas against command semantics, publish shadow state only after acknowledgement callbacks, compile the whole bridge out of normal production, and record 0 misses across the 1k/10k table workload.

Agent-Authored-By: TraeCode <[email protected]>

Trae-Session: 01a015c8-dc52-71b3-b929-2b5d818926bf
@Huxpro
Huxpro changed the base branch from refactor/universal-kernel-owner-claiming to new-lynx August 19, 2026 18:29
@Huxpro
Huxpro marked this pull request as ready for review August 19, 2026 18:29
@Huxpro
Huxpro merged commit 793ec3d into new-lynx Aug 19, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant