分析 hermesvm 在一段提交范围内的二进制体积变化与回归原因
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "binary-size-analysis" 技能: 1. 下载 https://raw.githubusercontent.com/facebook/hermes/static_h/.claude/skills/binary-size-analysis/SKILL.md 2. 保存为 ~/.claude/skills/binary-size-analysis/SKILL.md 3. 装好后重载技能,告诉我可以用了
请分析 hermesvm 在 commit abc123 到 def456 之间的 binary size 变化,找出体积明显增加的提交,并总结每次增长的可能原因。
一份按提交列出的体积变化分析,标出主要回归点及可能原因。
比较 hermesvm 在 release-v1.2 和 release-v1.3 的二进制大小差异,说明增加或减少了多少,并指出受影响最大的模块。
一份版本对比结果,包含总体差异、变化幅度和重点模块说明。
请测量这组功能提交对 hermesvm library size 的影响,给出每个提交的增减幅度,并判断是否存在 size regression 风险。
一份提交影响评估,包含每个提交的体积变化和整体风险判断。
Analyze per-commit binary size changes of the hermesvm shared library across a
git commit range. Produces a markdown report with per-commit sizes and summary
tables of significant increases and decreases.
Before starting, inform the user how size is measured and ask about verification:
Explain the measurement method: Tell the user that sizes are measured by
summing ALLOC section sizes (via readelf -SW on Linux or otool -l on
macOS), not by measuring the file size with stat. This excludes alignment
padding and non-shipping sections (symbol tables, string tables, code
signatures), matching what actually ships on-device after strip.
Ask about parent-commit verification: This verification is enabled by default. It builds each BUILD commit's parent to confirm no skipped commit changed the binary size. It catches miscategorized SKIP commits but roughly doubles the build time. If the user declines, skip all verification substeps in Step 2.
b48b6cc..HEAD or v0.290.0..v0.300.0cmake -B cmake-build-minsizerel -GNinja \
-DHERMESVM_GCKIND=HADES \
-DHERMESVM_HEAP_HV_MODE=HEAP_HV_PREFER32 \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DHERMESVM_ALLOW_JIT=2 \
-DHERMESVM_ALLOW_CONTIGUOUS_HEAP=ON \
-DHERMES_IS_MOBILE_BUILD=ON
If the user provides additional flags, append them to the cmake command. If the user provides a different value to flags in default build configuration above, replace it with the user-provided value (e.g., -DHERMESVM_ALLOW_JIT=0).
This skill requires a GitHub checkout of the static_h repo (commit hashes are git hashes). Before proceeding, verify the working directory is a valid git repo:
git rev-parse --is-inside-work-tree
If this fails (e.g., the repo is a Sapling/Mercurial checkout or not a repo at all), stop and inform the user that this skill only works in a git checkout of the Hermes repository.
Bloaty setup: This skill uses bloaty for detailed per-section diffs on large size increases. Download and build it:
git clone https://github.com/google/bloaty.git ~/bloaty
cd ~/bloaty && cmake -B build -GNinja && cmake --build build
If the download or build fails (e.g., no network access, missing dependencies),
ask the user to provide the path to a pre-built bloaty binary.
Generate the list of commits in the range and categorize each as BUILD or SKIP.
A commit is SKIP if it only touches files outside the directories that contribute to the hermesvm binary. The relevant source directories are:
lib/ (VM, Parser, Sema, IR, BCGen, Support, Regex, etc.)API/hermes/public/hermes/include/hermes/external/CMakeLists.txt (exact match, not filtered by .txt suffix), cmake/,
lib/config/Files that never affect the binary: test/, unittests/, .github/, docs
(.md, .txt, .rst), tools/, npm packages (hermes-parser,
prettier-plugin, etc.), utils/, benchmarks/, website/, blog/.
Use this Python script to categorize:
#!/usr/bin/env python3
import subprocess, sys
RELEVANT_PREFIXES = [
"lib/", "API/hermes/", "API/jsi/", "public/hermes/", "include/hermes/",
"external/", "cmake/", "lib/config/",
]
…
帮助开发者编写和审查符合 Hermes VM 垃圾回收安全规范的 C++ 代码
指导在 JSI Runtime 层新增方法与功能,并同步 Hermes 与 SynthTrace 支持。
无需交互式编辑器,程序化重排、拆分、删除或修订任意 Git 历史提交。
Guide for adding a new IR instruction to the Hermes compiler. Use when the user asks to add, create, or define a new IR instruction (Inst/Instruction) in the Hermes intermediate representation. Covers all required files and the patterns for each.
帮助排查常见故障、版本兼容与会话流诊断问题,提升开发调试效率
帮助开发者完成 Meta AI 应用注册与设备权限接入流程配置。