Skip to content

[lynx-perf-s2 1] Compiler MT emission target: per-plan create() + slot setters, planId registry, fallback-safe (flagged) #17

Closed as not planned

Description

@Huxpro

Part of the [lynx-perf-s2] code-staged roadmap (sequel to #9). Depends on #16 for target-setting but can start in parallel: with the flag off this PR is behavior-neutral by construction.

Scope (one PR)

Give compile-universal an MT-layer emission mode: for each universalPlan, emit a module exporting

  • create(instance) — straight-line host-driver calls materializing the plan's static skeleton (no tree walk, no dispatch), returning the element/handle topology the interpretive path would have produced;
  • a per-slot setter table — set[slot](element, value) where the prop kind (class/attr/text/event-token) is resolved at compile time (consumed by s2-3, shipped here so codegen lands once).

Keyed by the content-derived planId from PR #12 — the negotiated plan identity is already the registry key. Off by default behind a build flag.

Design constraints (each is a lesson already paid for)

  • Fallback-safe: an unregistered/mismatched planId falls back to the interpretive path (vue +b:c precedent, including its fail-safe shape). The interpreter is not removed by this PR.
  • DCE-friendly registration (PR perf(lynx): receiver diet — lazy worklet bridge, per-slice gzip gates ([lynx-perf 7]) #15's sideEffects lesson): per-plan modules are imported from the compiled app's MT output — provide-by-usage, no central manifest that retains every plan. An app that compiles no plans ships no registry.
  • Dev cross-check (PR perf(lynx): protocol slimming — derived ack handles, merged completion, empty-commit elision ([lynx-perf 6]) #14's derivation pattern): dev builds run compiled and interpreted and fail-stop on any divergence in element/handle topology or initial props.
  • No AST mutation — codegen is copy-on-write over the parsed plan (repo rule; tests deep-freeze).
  • Plans remain in the bundle wherever the BG slice needs them; net slice arithmetic (+codegen, −interpreter later) belongs to s2-4, but per-plan codegen bytes are measured and recorded here.

Acceptance

  • Differential suite: compiled vs interpreted produce byte-identical element trees and identical handle/adoption topology across the fixture corpus + the rig app (both slices' consumers).
  • Flag off ⇒ default build output byte-identical (gate).
  • Codegen-size counters recorded per plan (deterministic, into the codegen/bundle benchmark family).
  • Red-checked both ways: break a setter's prop kind ⇒ differential suite fails; corrupt a planId ⇒ fallback path serves and dev cross-check reports.

Activity

  1. added
    enhancement
    on Aug 9, 2026
  2. Huxpro commented on Aug 10, 2026

    @Huxpro
    OwnerAuthor

    Closed by #16's measurement gate before starting: the downstream consumers (#18/#20) measured below the 10% direct-share threshold on the SG1 quiet host (plan interpretation 5.4% of FCP, mt_expand 2.5% of create, receiver eval 0.8%), so the emission target has nothing gate-clearing to feed. Full tables and stop rationale: #21 (comment) and the gate-outcome section of #21. Reopen only if a new measurement re-clears the gate.


    Generated by Claude Code

  3. Huxpro commented on Aug 11, 2026

    @Huxpro
    OwnerAuthor

    Live-main audit (2026-08-11): this remains correctly closed. The exact compiler MT-emission proposal is superseded by octanejs#693/octanejs#700 template programs/runs and direct dense host execution. No old patch should be revived.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-authoredenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions