perf(arm64): reduce loop scans, spill loads, and state copy overhead - #783
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ef53d2489
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "$runner" --project "$HELIODOR_DIR" --test test_soc_linux_boot \ | ||
| --backend native --opt-level o2 "${args[@]}" > "$log" 2>&1 |
There was a problem hiding this comment.
Apply a timeout to each comparison run
When either the downloaded baseline or candidate runner hangs, this direct invocation bypasses the timeout protection in scripts/run-heliodor-bench.sh:1356-1395, so the comparison stalls until the entire 120-minute job timeout and the remaining rounds/profile never run. GNU timeout --help confirms that timeout DURATION COMMAND terminates a command after the specified duration; invoke the runners through the existing run_in_heliodor helper or wrap each invocation with an equivalent per-run timeout.
Useful? React with 👍 / 👎.
Summary
Heliodor's native ARM64 kernel repeatedly scans inactive entries, reloads spilled values, and copies small state arrays. Reduce this work in MIR optimization, register allocation, and machine-code emission:
Loop rewrites check bounds, escaped values, and effects on skipped paths. Memory rewrites preserve aliasing, overlap, partial chunks, and both value planes.
Native ARM64 comparison: release runners compiled on the same Neoverse-N2 host; Celox native/O2; Heliodor
a78d04730cf2b37c616e039b4a5bd437c1cfd355. Three alternating rounds compare master1ff7f81ewith this source tree and synchronous Veryl-CC. Timed executions exclude IR dumps and sampling.Celox execution time falls by 38.1%, bringing the gap to Veryl-CC to 2.9%. Heliodor compilation falls from 13.263 s to 12.413 s (medians; 6.4% lower). Veryl-CC's AOT compilation was cold in the first round (163.864 s) and cached in the later rounds (8.636–8.779 s).
All nine boots matched
cy=87cda0 x3=aa pass=1. The benchmarked commit26c1b8c1and the PR head have identical Git trees (698273195684401200cad34a2fa1ab2052e9cbbd). An independent image comparison also measured 20.481 s for the selected code versus 19.955 s for synchronous Veryl-CC, with all fifteen boots matching.The profiling workflow now supports same-host baseline/candidate/Veryl-CC comparisons. Each comparison and profile invocation has its own 1,200-second timeout, addressing the P2 review.
Validation