Repository navigation
CI checks of the ISeq VM: the fallbacks held to a list, the forced VM, the compilers' chain - #261
Merged
Merged
Conversation
…, the compilers' chain #232's first three proposals, as the owner decided. vm_corpus.sh holds each program that falls back to tools/iseq/vm_fallbacks.txt (empty): one not listed fails, and so does one listed that runs on the VM. The corpus job runs vm_check.sh, and the compilers' comparisons over the whole corpus: compare_with_ruby.rb and compare_files.rb (the Ruby compiler against ruby), native/check.sh (the native compiler against the Ruby one). And it checks that m_pathname_lib.mere, the embedded copy of the Ruby compiler, is as generated. compare_with_ruby.rb exits 1 when a snippet differs.
284km
commented
Nov 25, 2026
284km
left a comment
Owner
Author
There was a problem hiding this comment.
Reviewed f6cb33e. No Critical / Major / Minor findings. This PR edits .github/workflows/ci.yml, so the owner reviews and merges it. The base is still stage10-r65 (#257, now merged); retarget it to main first.
vm_corpus.shagainst a list of fallbacks (tools/iseq/vm_fallbacks.txt, empty since #233):- an unlisted fallback fails the run, and so does a listed program that now runs on the VM;
- only the programs of the run are checked, so a subset run behaves as before;
VM_FALLBACKS=noneopts out;- the description's table shows both failure directions and the listed-and-passing case.
- New CI steps in the corpus job:
vm_check.sh(VM forced);compare_with_ruby.rbover the 460 snippets (it now exits 1 on a difference, and writes its diff inputs to a privateDir.mktmpdirinstead of fixed/tmp/ma.txt/ra.txt);compare_files.rbandnative/check.shover the whole corpus;- a
cmpofm_pathname_lib.mereagainsttools/gen_pathname_lib.rb's fresh output, which would have caught round 63's stale embedded compiler.
- Local times (load 25–35): vm_check about 2 min, native/check about 1 min, the rest seconds. Please add the CI times when the run finishes.
- Cosmetic only:
${nlist:+…}always expands, becausenlistis always set (to 0), so the summary line always ends with ", 0 against the list of fallbacks". Harmless. - No mere-pr-review-watch inline comments.
This was referenced Nov 25, 2026
284km
added a commit
that referenced
this pull request
Nov 25, 2026
vm_check.sh: the ruby on PATH when the rbenv build is not there (fixes #261's CI step)
Owner
Author
|
Step times of the four ISeq VM steps, from the first run after #296 where vm_check and the two steps after it ran to the end (run 45665012046, branch rails-ar-ivar-walks, corpus job):
Together about 4 min 32 s of the corpus job. |
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.
#232's first three checks for CI, as the owner decided, and a fourth found on the way. This changes
.github/workflows/ci.yml: the owner reviews it before it is merged.Built on #257 (round 65), which regenerates the embedded copy of the Ruby compiler that one of the new steps checks. The PR's base is #257's branch, so the diff here is this change alone; it is retargeted to main when #257 is merged.
The record is
loop/2026-11-25-stage10-vm-ci-gates.md; what follows is it.#232 proposed four checks CI did not make of the VM; the owner decided to take the first three now. This is those three, and a fourth found while writing them.
1. A list of fallbacks
tools/iseq/vm_corpus.shalready ran in CI, on macOS and Linux, and failed on a program whose output under MERE_RUBY_VM differs from ruby's. A program the VM declined ran on the evaluator, matched, and passed as a "fallback".It is now held to
tools/iseq/vm_fallbacks.txt, a list in the repository: one program a line and why. The script failsOnly the programs of the run are held to the list, so a run over a few files works as before.
VM_FALLBACKS=<file>names another list andVM_FALLBACKS=nonenone.The list is empty: since round 63 (#233) every corpus program runs on the VM. Adding a line is a change a PR has to make, and say why.
How it was checked, on this branch:
VM_FALLBACKS=noneThe files a program requires are not held to a list yet (
MERE_RUBY_VM=reportnames those): the owner put that later.2. The forced VM
A step runs
tools/iseq/vm_check.sh: 245 snippets throughRubyVM::InstructionSequence#evalwith the VM forced, each compared with ruby, stdout and stderr. A snippet the VM declines fails here.3. The compilers' chain
What runs on the VM is the native compiler's sequence. That it is ruby's rests on two comparisons, made by hand until now:
lib/iseq_compiler_ext.rb) against ruby's own#to_a:compare_with_ruby.rbover the 460 snippets andcompare_files.rbover the whole corpus;tools/iseq/native/check.shover the whole corpus.One step runs the three. A file that differs fails it; a file one of them declines is counted and passes, being the list of fallbacks' business when the VM declines it.
compare_with_ruby.rbexited 0 whatever it found; it exits 1 when a snippet differs now, and writes its two files in a directory of its own.4. The embedded copy of the Ruby compiler
Writing these, it showed that mere-ruby's copy of the Ruby compiler was stale. mere-ruby carries it as a string in
m_pathname_lib.mere, made from the lib bytools/gen_pathname_lib.rb. Round 63 (#233) changed the lib and not the copy, and the comparisons above, which read the lib, could not see it.A step generates the file again and compares it, as the job does for the Psych and network libraries. It fails on main as it was: the regeneration is in round 65's PR (#257), which this one is built on.
Times
Here, each step run alone at a load of 25 to 35 (other sessions' work), on main 323706a with #257:
vm_corpus.sh -j 3with the list (it ran before; the list costs nothing)vm_check.shcompare_with_ruby.rb(460 snippets)compare_files.rb(893 files)native/check.sh(893 files)gen_pathname_lib.rbandcmpCI's own times are added below when this PR's run is through.
Checked
Against ruby 4.0.10 (tools/ref_ruby.sh), built with Mere 9dec2ff6, on main 323706a with #257:
nilpushed withputobjectinstead ofputnil),compare_with_ruby.rbexits 1 (400 snippets the same, 60 different), and so doescompare_files.rbover the first nine corpus programs (2 different).🤖 Generated with Claude Code