perf(vm): reuse publication guarantees in execution - #18
Open
Eric-Song-Nop wants to merge 33 commits into
Open
Conversation
Eric-Song-Nop
marked this pull request as ready for review
September 11, 2026 00:25
This was referenced Sep 11, 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.
VM 在绑定访问、闭包创建和 direct eval 准备中重复读取发布时已经验证的数据。本 PR 将不可变发布数据与对应执行帧连接起来,让这些路径复用发布保证,并减少常用字节码的重复分派、静态跳转验界和局部栈检查。
Stacked on #17;base 保持
perf/indexed-data-structures,继续跟踪 #16。全部变更继续提交到原 PR #18。VerifiedFunction拥有验证过的准确草稿;snapshot 将代码、布局与 root 放在同一拥有者中,建帧和恢复使用对应 host。reuse_frame_capture验证实际视图并复用,不再查询父定义或重复进入完整捕获分派。首次捕获仍使用 canonical metadata。PublishedEvalEnvironment共享环境数组与字节码 root,以身份核对代替深拷贝和结构比较;编译成功后才建立实际捕获。pop_pair合并两次长度判断,clone_at_depth使用一次安全查询;保留失败消费顺序和 root 生命周期。没有引入 unsafe、第二份指令表、复制常量池或通用策略框架。实施计划和执行契约记录拥有者、证明链、动态边界和验证入口。常量的安全 enum match 与 PC checked_add 明确保留,不计作已消除的工作。切片占位值、drain 和强制内联实验已撤回。
每个实际优化提交后完成定向交错 A/B;最终重新比较 PR #17、本轮起点和最终实现的 50+8 固定控制矩阵及 8 个诊断负载,并对疑似退化项追加十轮复核。累计优化减少工作并改善整体固定工作量耗时;本轮补齐的综合耗时基本持平,部分负载仍有小幅代价;静态分支的最终隔离对照也显示算术耗时上升,保留依据是目标循环收益与更少指令工作,不能宣称所有负载提速或已消除与 QuickJS 的差距。原始测量数据只保存在忽略的 target,不提交 benchmark 报告。
验证:Rust 1.88.0 的 workspace/all-targets(引擎 1,969 项)、profiling、doc、test262-host 组合及五组严格 Clippy 通过。完整 701 个架构变异全部被拒绝;14 个架构规则测试、16 个 benchmark 工具测试、源码/registry/布局/rust-only 门禁和 runner provenance 通过。额外 65K 参数边界测试、Node/WASM 的 15 个示例、direct eval 和可捕获的深层 yield-star 溢出通过。
完整 Test262 的 102,037 个结果与冻结行为向量一致:79,982 pass,原有 50 fail 不变。仅规范化唯一源码指纹字段后,完整 TSV/JSONL 哈希均匹配;本次 full 中的 6,844 个 focused 条目逐列一致。原 full 门禁因源码指纹变化返回 receipt checksum drift;没有改写冻结记录。GitHub CI 状态见本 PR checks。
独立评审仍待完成;实施者自查不算独立评审。重点检查发布构造能力、代码与帧配对、捕获视图、eval root 生命周期、静态目标证明及栈错误路径的释放顺序。