Skip to content

v2.26.0

Choose a tag to compare

@sunnylqm sunnylqm released this 11 Sep 08:24
· 3 commits to master since this release

English

Highlights

  • Hermes base-bytecode equivalence check, reworked. With --verifyHermesBase, compareHermesBytecode now reads each disassembly as a structure: string ids are resolved through each side's own table, functions are compared one at a time (a desync no longer cascades), and a dump that exits non-zero or ends early is reported as dump-failed, distinct from different. Rejections now name the function, instruction and first differing entry.
  • Literals compared per instruction. For HBC v87–96, the Array/Object Key/Object Value buffers are decoded from the binary at each New*WithBuffer instruction's offset, so the builder's overlapping/deduplicated literals no longer cause false rejections of good delta builds. Other bytecode versions (e.g. HBC v98) fall back to whole-buffer comparison.
  • Outcome reported at version/create. New optional fields hermesBaseOutcome (used | rejected | dump-failed | none) and hermesBaseDetail (≤ 500 chars) let the server track rejection rates. Keys are omitted when unknown; older servers ignore them.

Fixes

  • When the verification's plain compile fails, the base is now dropped instead of shipping an unverified delta; the plain compile is re-run into the real output.

Tooling

  • bun run fuzz:hermes-base — seeded differential fuzzer for the equivalence check (planted one-literal changes must still be caught). Docs: docs/hermes-base-verification.md.

中文

主要更新

  • 重写 Hermes base 字节码等价性校验。 开启 --verifyHermesBase 时,compareHermesBytecode 按结构解析反汇编:字符串 id 通过各自的字符串表解析,函数逐个比较(不再因错位级联误判),dump 进程非零退出或提前结束会报告为 dump-failed,与 different 区分。拒绝时会给出函数、指令和第一处差异。
  • 字面量按指令逐条比较。 对 HBC v87–96,从二进制中按每条 New*WithBuffer 指令的偏移解码 Array/Object Key/Object Value 缓冲区,不再因 buffer 构建器的重叠/去重而误拒正常的增量构建。其他字节码版本(如 HBC v98)回退为整体 buffer 比较。
  • version/create 上报校验结果。 新增可选字段 hermesBaseOutcomeused | rejected | dump-failed | none)和 hermesBaseDetail(≤ 500 字符),便于服务端统计拒绝率。未知时不传;旧版服务端会忽略。

修复

  • 校验所需的普通编译失败时,现在会放弃 base,而不是发布未经校验的增量产物;普通编译会重新输出到正式产物。

工具

  • bun run fuzz:hermes-base:等价性校验的差分模糊测试(每十轮植入单个字面量改动,必须被检出)。文档见 docs/hermes-base-verification.md