Skip to content

feat: tools to compare two builds fairly, with their spread - #48

Open
psiha wants to merge 1 commit into
mainfrom
tools/ab-compare
Open

psiha wants to merge 1 commit into
mainfrom
tools/ab-compare

Conversation

@psiha

@psiha psiha commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

What

Two tools to compare two builds of an entry fairly, in a new tools/ folder (nothing else changes):

  • tools/ab.sh runs the arms in turns on one machine:
    • every arm has its own work folder and one untimed load of its own, so no build times a snapshot another build made
    • the legs run A B, B A, A B, so neither arm is always first or last
    • each leg tries SCHED_FIFO 50 and trusts it only when ps reports class FF and a non-zero priority for a process it started. If it cannot get it, the leg runs normally and says not realtime, in the output and in leg.txt
    • it stops if the host, boot id or machine id changes between legs, and every leg has a timeout
  • tools/summarize-ab.mjs prints, per test and arm, the median over the legs and the spread ((max - min) / median). Two arms are "beyond spread" only when the legs' ranges do not overlap, with at least 3 legs each. It refuses results from different machines, datasets or tests versions. --csv for a spreadsheet.

Usage is in tools/README.md.

Noise it removes

Order bias (the second run profits from a warm cache or suffers from heat), a shared snapshot between builds, scheduler jitter, a machine that changed in between, and having no spread to judge a difference against.

Schema

None. It reads the existing result files and does not touch runner/run.mjs.

How it was checked

On a Linux box, 10m, --quick, the in-process RAMA entry, tests R1 and W3, 3 legs, the same build as both arms:

  • scheduling verified as FF 50 in all legs, leg order AB BA AB, exit codes 0, and the summary table printed. The box was busy, so W3 showed a wide spread and, correctly, no difference beyond it.
  • with the real-time limit lowered to 0, a warning is printed, the legs are marked not realtime, and the summary shows it. With 2 legs it says "fewer than 3 legs" instead of a verdict.
  • the summary on fabricated result folders: a clear difference is "beyond spread", an overlapping one "within spread", and a folder from a different CPU is refused.

Not checked: the stop on a changed machine (the summary's refusal was), a timed run on a quiet machine, the sudo path, --cpus, a run with a failing leg, macOS.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request due to rate limiting. Please try again later. See Usage limits for GitHub Copilot for details.

Adds tools/ab.sh, which runs two or more builds of an entry in turns on one machine: a work folder and an untimed load per arm, ABBA order, SCHED_FIFO verified instead of assumed, and a stop when the machine changes. tools/summarize-ab.mjs prints the median and spread of the legs per test, and says when two arms differ by more than that spread. No change to the runner or the result files.

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

This branch has not been deployed

No deployments
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