[FEAT] Add performance benchmarking and profiling infrastructure
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- github-actions, python
- 领域
- ci-cd, performance, testing, tooling
调研方向
首先检查 integration/data/prove-rs/ 下现有的程序、pyk/testing/_profiler.py、kmir.py、smir.py,以及 test.yml 中的 Docker 设置。在决定 benchmark 和 profiling 的入口点如何衔接之前,先梳理 pytest 集成测试和 Makefile 的组织方式。满足列出的验收标准即视为完成,包括 benchmark 产物、CI 摘要、profiling 输出以及 docs/dev/ 中的文档。
由索引模型根据 Issue 内容生成。
描述
Motivation
As the MIR semantics grows in complexity and test coverage expands (see #964), there is no systematic way to detect performance regressions or identify bottlenecks in symbolic execution. Issue #655 shows that performance problems have already surfaced (slow use functions), but we lack the tooling to investigate them systematically or to catch regressions automatically.
Proposed Feature
1. Benchmark Suite
Define a curated set of prove-rs test cases as a benchmark suite — a subset of the existing integration/data/prove-rs/ programs chosen to cover representative workloads (arithmetic, branching, enums, closures, iterators, etc.).
Each benchmark would record:
- Wall-clock time for
kmir prove-rs - Number of proof steps / rewrite rule applications (via K's
--statisticsoutput) - Peak memory usage
Results are stored as a JSON artifact (e.g., bench-results.json) committed or uploaded as a workflow artifact for comparison.
2. Python-level Profiling via pyk.testing.Profiler
pyk already ships a cProfile-based Profiler class (pyk/testing/_profiler.py). We can integrate it into the pytest integration-test runner to generate .prof files for selected tests, enabling:
- Identification of hot Python functions in the SMIR→K transformation pipeline (
kmir.py,smir.py) - Easy investigation of issues like #655 without manual instrumentation
A --profile pytest option (or a dedicated make profile-integration target) would enable this on demand.
3. GitHub Actions Workflow: benchmark.yml
A new workflow triggered on:
pushtomaster— baseline trackingworkflow_dispatch— on-demand profiling for PRs under investigation- Optionally:
pull_requestwith a label likeperfto gate on demand
Steps:
- Build
stable-mir-json+kmir(reuse Docker setup fromtest.yml) - Run the benchmark suite, capturing timing/step counts
- Upload
bench-results.jsonas a workflow artifact - On
masterpush: compare against the previous baseline stored in a GitHub Actions cache and post a summary to the job summary ($GITHUB_STEP_SUMMARY) - Optionally: use
benchmark-action/github-action-benchmarkto track trends over time and comment on PRs when a regression threshold is exceeded
4. make benchmark Target
A local Makefile target for developers to run the benchmark suite locally and view a summary, mirroring CI behaviour.
Acceptance Criteria
- Benchmark suite defined (list of representative test cases with expected step counts)
-
make benchmarktarget runs locally and outputs a timing/step-count table -
--profilemode generates.proffiles for pytest integration tests usingpyk.testing.Profiler -
benchmark.ymlGitHub Actions workflow uploads benchmark artifacts on everymasterpush - CI posts a step-summary table comparing current vs. baseline results
- Documentation added to
docs/dev/on how to run benchmarks and interpret results
Related
- #655 — slow
usefunctions investigation - #964 — external test suite integration (benchmark suite could overlap)
pyk/testing/_profiler.py— existing profiler infrastructure available in thepykdependency
- 主要语言
- Python
- 星标
- 55
- 派生
- 5
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
runtimeverification/mir-semantics 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 65/100
-
Inconsistent KMIR versions across project可能已有人在做 @dkcumming 于 112 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 52/100
runtimeverification/mir-semantics#1078 ·
-
难度 3/5 1-2 天 新手友好度 58/100
runtimeverification/mir-semantics#1070 · 2 条评论 ·
-
bug
难度 3/5 1-2 天 新手友好度 58/100
runtimeverification/mir-semantics#1067 ·
-
area:semantics kind:refactor priority:p1 status:triage type:task
难度 5/5 一周以上 新手友好度 35/100
runtimeverification/mir-semantics#1011 · 1 条评论 ·
查看 runtimeverification/mir-semantics 的全部 Issue
相似的 Issue
-
New Internship未关闭new_internship
难度 2/5 1-3 小时 新手友好度 68/100
-
get_graph warns that the oneway column is missing when no way has a oneway tag可能已有人在做 @HTenkanen 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
fix: security 🔐 style: article/section 📝 system: data-mgmt 🗃️ system: security 🔐 system: software 💻
难度 2/5 1-3 小时 新手友好度 65/100
uabrc/uabrc.github.io#1267 ·
-
Bot Type: Bug Type: Documentation
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复