Save results as JSON and run YJIT and ZJIT variants - #241
Merged
Merged
Conversation
Results only existed as text in job logs and as ips.fastruby.io reports, which do not record the Ruby, OS or machine. When RESULTS_DIR is set, docker/collect_results.rb (loaded through RUBYOPT, so benchmark files stay untouched) writes each Benchmark.ips report to RESULTS_DIR/<label>/<benchmark>.json, with the Ruby, its flags, the run and the environment: arch, CPU, core count, OS, glibc, compiler and its flags. It records the PR's own commit and number (on a pull request, github.sha is a temporary merge commit). A field that cannot be read is null, the others are kept. CI sets RESULTS_DIR on every benchmark job and uploads the results as a results-<label> artifact. The results site will read these. Brought over from the parked prototype (988a455), without the site.
Every CRuby run was interpreter-only (YJIT is built into 3.2+ but off by default), while many production apps run YJIT. CI now also runs ruby_3.1 to ruby_head with --yjit, and ruby_4.0 and ruby_head with --zjit: 8 more jobs, labeled like ruby_3.4+yjit. RUBY_VARIANT_FLAGS goes through the variable each engine reads (RUBYOPT, JRUBY_OPTS, TRUFFLERUBYOPT), since the Rakefile starts one process per benchmark. The run then stops if the variant is not on, instead of quietly benchmarking the interpreter. Only plain Rubies share to ips.fastruby.io: shared reports do not record the Ruby or its flags, so variant reports would be indistinguishable.
JuanVqz
force-pushed
the
feature/jit-variants-and-comparable-results
branch
from
September 23, 2026 22:12
c80788f to
f4b5a55
Compare
JuanVqz
marked this pull request as ready for review
September 23, 2026 22:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Step 1: results as JSON
docker/collect_results.rb, loaded throughRUBYOPTwhenRESULTS_DIRis set, so benchmark files stay untouched. EachBenchmark.ipsreport goes toRESULTS_DIR/<label>/<benchmark>.jsonwith the Ruby, the variant and flags, the PR's own commit and number, and the environment: arch, CPU, core count, OS, glibc, compiler and optflags. A field that can't be read isnull, and the others are kept.RESULTS_DIRon every benchmark job and uploads aresults-<label>artifact.Step 2: YJIT and ZJIT variants
+yjiton ruby_3.1 to ruby_head, and+zjiton ruby_4.0 and ruby_head. Each is its own job (variant: ['']plusinclude, so the entries don't merge into the plain jobs).RUBYOPT,JRUBY_OPTSorTRUFFLERUBYOPT, so every benchmark process the Rakefile starts inherits them. The run stops if the variant isn't on, instead of quietly benchmarking the interpreter.Test plan
RUBY_DESCRIPTION), plus JRuby--devand TruffleRuby with compilation off, which are supported but not in the matrix.ruby:3.1image has YJIT (+YJIT [x86_64-linux]), soruby_3.1+yjitpasses its check on CI./etc/os-releaseorlddleaves only those fields null; an emptyRESULTS_LABELfalls back to the engine and version, plus the variant (ruby-3.4.10+yjit), so local plain and YJIT runs don't overwrite each other;RUBY_VARIANTwithout flags stops with "Variant yjit is not on"; a PR run records the PR's head commit and number instead of GitHub's temporary merge commit.includerules: 26 jobs, the 18 plain ones unchanged. actionlint is clean.docker/, so its CI runs the full suite on all 26 jobs. It is also the first real check of the artifacts and of how many CPU models one run gets.