Skip to content

[Lynx M1] 削减 BTS 批量 mount 的解释与分配,消除框架超线性 #286

Closed

Description

@Huxpro

总路线:#282(承接 #281)。所属 milestone:Lynx ceiling M1 — 消除 bulk create 的架构残差。

目的

#281 所引旧原生 cohort 的 bulk collapse 不能仅由“无 JIT”解释。#278 必须先分辨 BTS render/build、bridge、MTS apply 与 GC 的贡献;本 issue 拿其中 BTS bulk owner,不承诺无数据重写整个 reconciler。

工作

依赖 #283、#278;与 #284 的布局契约协作。

  1. 给 create/replace/append/recreate 的循环建立 operations/allocations 随 N 的计数,追踪 growing-array drain、重复 sort/find、每行复制前缀、重复 props/record 派生及共享结构 JSON 展开。先消除被确认的 O(N²),再压线性常数。
  2. 若剩余主要成本是模板解释/重复构造,把已证明的同形 @for 行变为 BTS shape-level mount entry 与紧凑 values/events 表;对动态退出形状保留一般 Block 路径。复用已有 Block core、hook/effect 内核与 compiled run,不重新实现一套公共语义。
  3. codegen 依据实际 loop-body/调用帧计数与设备 whole-cell A/B。Research: a cost model for LepusNG — what the interpreter charges for, so emission strategy becomes calculable #196 的绝对成本模型 M2 已被证伪;不能用 ns/op 相加直接承诺收益,也不做全树无限 unroll。

归属

block-background、block-component、block-core、编译器对应 lowering。初始 first-screen adoption 留给 #287。

验收

  • 同一语义下 1k/2k/3k/5k 的 BTS 工作计数近线性,不随每新增行重扫前缀;框架阶段 timing exponent 目标 ≤1.15,拟合置信区间和设备 floor 一并报告。端到端平台本身的非线性单独归因。
  • rows/keys/events、render-phase updates、删除 cleanup、错误/abort、异步 in-flight commit 的结果不变;range 不符合条件时显式回退。
  • allocations/峰值堆与 create/replace/append 均给结果;冷启动/编译时间/生成代码和 bundle 税不得隐去。若无 BTS owner,允许证据化不实施。

通用合并与证据契约

  • 保持 Octane 的 hooks、refs/effects、原生事件、Suspense/Activity/portal、reject/abort 与 cleanup 语义;适用模式必须覆盖。共享两条路径时使用同一语义实现,并加独立的用户可观察断言,不能只做 differential 对比。
  • 每个优化 PR 带 baseline/candidate 的精确 SHA、生产 bundle hash、机制命中/回退原因、同窗口 AB/BA 原始样本及成本归属;profile 负责解释,未插桩生产产物负责 headline。未测到的收益标为 hypothesis。
  • 先拿到相关 owner 数据,再实现一个机制一条 PR;正确性与 current-head CI 通过才算交付。记录对冷启动、另一线程、GC、内存和 bundle 的成本转移。

由 agent 根据 #281 的后续规划请求创建。

Activity

  1. Huxpro commented on Sep 7, 2026

    @Huxpro
    OwnerAuthor

    #294 closes this layer with an evidence-backed no-change decision. BTS preparation, encoding, and wire transfer are near-linear across the completed device sweep (exponents 0.954, 1.011, and 1.004), while paired 1k MTS apply owns 96.4% of control wall and scales at exponent 1.952.

    There is no measured BTS bulk owner to justify a reconciler/codegen rewrite, shape cache, or allocation trade. The next M1 work remains the resident-layout/scalar eligibility correction in #284, where eligible real rows can remove repeated descriptor application on MTS without weakening range semantics. Evidence/report: #294; merged head dc42bdd513d58b026c576f76a013231cdbff8e09.

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-authoredenhancementlynx

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions