Skip to content

HF-150: advisory instruction-count workflow (prototype) - #1814

Merged
marcin-kordas-hoc merged 12 commits into
feat/hf-150-perf-gatefrom
feat/hf-150-instruction-count
Nov 25, 2026
Merged

marcin-kordas-hoc merged 12 commits into
feat/hf-150-perf-gatefrom
feat/hf-150-instruction-count

Conversation

@marcin-kordas-hoc

@marcin-kordas-hoc marcin-kordas-hoc commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Context

The PR adds an advisory workflow that compares base and head by the CPU instructions each performance scenario executes, instead of by time.

  • Why: on shared runners, wall-clock noise lets the timing comparison (HF-150: alternate base and head runs in the performance workflow #1805) show only regressions of about 5% or more per scenario, and it still reports false regressions. Instruction counts do not depend on the load of the runner.
  • What changed:
    • .github/workflows/performance-instructions.yml: installs valgrind, counts the instructions of every scenario for base and head (one after the other, from the same build directory), writes the comparison to the job summary and prints the raw counts into the log. Paths follow the monorepo layout.
    • The job never fails the pull request (continue-on-error) and posts no comment. performance.yml is unchanged.
    • When the paired tests branch has no performance/run-instructions.ts, the job skips the counts and the comparison with a notice instead of failing with module-not-found.
    • hyperformula/dev-docs/PERFORMANCE.md: one sentence about this workflow.
  • Result: every PR gets a per-scenario instruction-count comparison that can see changes well under 1%.
  • Role: the intended direction for the performance check, done in-house with valgrind on standard runners and without a vendor service. The wall-clock comparison stays as a temporary advisory layer, because instruction counts do not see GC pauses, memory or cache effects.

How did you test your changes?

  • Paired tests branch: feat/hf-150-instruction-count in hyperformula-tests.
  • This PR changes no engine code, so every scenario should come out at about 0%. CI runs:
Run Largest change over 13 scenarios Job time
before the monorepo merge 0.0075% 7m39s
after the monorepo merge (63b4b92) 0.00022% 10m37s
with the runner check and the scenario table (7ded1cc, tests dae23a2) 0.0056% 11m58s
with the action pins of performance.yml and the zero-count check (ff3019a, tests f9f0e41) 0.00147% 6m52s
  • A throwaway control PR that added a fixed loop to setCellContents moved every scenario that calls it by +0.06% to +3.97%, and every other scenario by at most 0.013%.
  • Locally, in the monorepo layout: one scenario counted end to end under valgrind.
  • The runner check, run as a script against three tests refs: develop and feat/hf-150-perf-gate (no runner) print the notice and set no output, so the three guarded steps skip; feat/hf-150-instruction-count sets present=true.

AI assistance

Claude Code co-authored 5 of the 7 non-merge commits on this branch (the workflow) and 7 of the 8 on the paired hyperformula-tests branch (the instruction-count runner), as the Co-Authored-By: Claude trailers record. The other 2 and 1 commits carry no such trailer.

Compatibility with Excel and Google Sheets

Not applicable.

Public API changes

None.

Out of scope and follow-ups

Types of changes

  • Breaking change (existing functionality no longer works as before) – agreed with the maintainers
  • New feature or improvement (a non-breaking change that adds functionality)
  • Bug fix (a non-breaking change that fixes an issue)
  • Additional language file, or a change to an existing language file (translations)
  • Change to the documentation

CI tooling only, plus one sentence in dev-docs/.

Related issues

  1. HF-150 (internal task)

Checklist

🤖 Generated with Claude Code


Note

Low Risk
CI-only addition with read permissions and no PR gating; engine code and public APIs are unchanged.

Overview
Adds a prototype GitHub Actions workflow (Performance (instruction count)) that runs on pull requests alongside the existing wall-clock Performance job, without changing that workflow.

The new job checks out base and head, shares the paired hyperformula-tests suite (including valgrind-based runners when present), runs run-instructions.ts sequentially for each side, compares results with compare-instructions.ts, and appends the report to the job summary. It uses continue-on-error, does not comment on the PR, and skips counting with a notice if performance/run-instructions.ts is missing on the tests branch.

hyperformula/dev-docs/PERFORMANCE.md gains one sentence describing this advisory instruction-count check.

Reviewed by Cursor Bugbot for commit ff3019a. Bugbot is set up for automated code reviews on this repo. Configure here.

marcin-kordas-hoc and others added 3 commits October 13, 2026 07:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… script

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
hyperformula-docs ff3019a Commit Preview URL

Branch Preview URL
Nov 10 2026, 07:58 AM

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Performance comparison of head (ff3019a) vs base (b3f2f68) with the tests at f9f0e41

Scenario base median (ms) head median (ms) change threshold noise (CV base/head) verdict
Sheet A 502.2 506.1 +0.78% ±5.0% † 2.9% / 1.1% ok
Sheet B 213.9 214.6 +0.34% ±7.4% † 3.9% / 3.4% ok
Sheet T 173.9 173.4 -0.30% ±8.0% † 2.4% / 2.3% ok
Column ranges 610.8 603.7 -1.16% ±5.3% † 1.8% / 1.7% ok
Sorted lookup 14205.1 14389.7 +1.30% ±50.0% ‡ 2.6% / 1.5% ok
Sheet A: change value, add/remove row/column 93.1 92.8 -0.32% ±5.0% 1.8% / 1.7% ok
Sheet B: change value, add/remove row/column 162.0 167.0 +3.08% ±13.3% † 4.9% / 3.5% ok
Column ranges - add column 163.8 168.1 +2.60% ±6.4% † 1.2% / 2.1% ok
Column ranges - without batch 444.1 448.4 +0.96% ±6.3% † 1.6% / 2.5% ok
Column ranges - batch 137.3 137.8 +0.36% ±5.1% † 2.1% / 3.2% ok
Recalculation fan-out - one edit, 10k dependents 47.4 46.6 -1.82% ±6.4% † 12.6% / 15.8% ok
Recalculation fan-out - 5 edits without batch 124.0 123.7 -0.24% ±9.0% † 3.6% / 4.9% ok
Recalculation fan-out - 5 edits in batch 50.6 50.6 +0.05% ±6.8% † 4.8% / 8.0% ok

Threshold of an unmarked scenario = max(5%, 3 x the standard error of the difference of the two medians). † = the band of changes observed on identical code in earlier runs, instead of that rule. ‡ = a fixed threshold for a scenario that guards against a change of complexity class. This check is advisory: it reports regressions but does not fail the build.

A paired hyperformula-tests branch without performance/run-instructions.ts
made the count steps stop with a module-not-found error. The job now checks
for the runner and, when it is missing, skips the counts and the comparison
with a notice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Tobiadefami Tobiadefami left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description has no AI assistance section, though it says the PR was generated with Claude Code

blocking: The description doesn't have the template's "AI assistance" section, though it ends with "Generated with Claude Code". Could you add it, naming the tool and the parts it wrote here and in the paired tests PR?

@Tobiadefami Tobiadefami left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocking: The description still needs the template's "AI assistance" section, which the Definition of Done requires (see my earlier comment, now labelled blocking).

….yml uses

setup-node v7.1.0 and checkout v7.0.1, each with its version comment, for all four steps,
including the hyperformula-tests checkout, which had a pin without a comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@marcin-kordas-hoc

Copy link
Copy Markdown
Collaborator Author

The AI assistance section is in this description, after "How did you test your changes?", and hyperformula-tests#91 now has one as well.

@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (feat/hf-150-perf-gate@b3f2f68). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                    @@
##             feat/hf-150-perf-gate    #1814   +/-   ##
========================================================
  Coverage                         ?   97.36%           
========================================================
  Files                            ?      209           
  Lines                            ?    16524           
  Branches                         ?     3670           
========================================================
  Hits                             ?    16089           
  Misses                           ?      435           
  Partials                         ?        0           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Tobiadefami Tobiadefami left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the earlier points are fixed.

@marcin-kordas-hoc
marcin-kordas-hoc merged commit f58df37 into feat/hf-150-perf-gate Nov 25, 2026
34 checks passed
@marcin-kordas-hoc
marcin-kordas-hoc deleted the feat/hf-150-instruction-count branch November 25, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants