Skip to content

conformance: one source for what platform this is, and sizes in bits - #961

Merged
tannevaled merged 5 commits into
mainfrom
shim-platform-single-source
Nov 20, 2026
Merged

tannevaled merged 5 commits into
mainfrom
shim-platform-single-source

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

The shim had two sources for what platform this is

PLATFORMS = [:darwin, :bsd, :unix]   # a literal
class PlatformGuard
  PLATFORM = RUBY_PLATFORM           # derived

…under a comment saying the literal was the single source of truth. On darwin
the two agree, so the split is invisible from the machine the work is done
on
. On the ubuntu lane that enforces the gate, platform_is :linux was false
while PlatformGuard.os?(:linux) was true.

The fix is not to derive the list. mspec has no list — read at the tip of
ruby/mspec, lib/mspec/guards/platform.rb:26-38: every name but :windows
and :wsl is a plain substring of RUBY_PLATFORM. So platform_is and
platform_is_not now call PlatformGuard, PLATFORMS is gone, and nothing is
typed twice.

Three defects the issue did not name

Found by reading the reference rather than the issue.

:pointer_size compared against WORDSIZE / 8 bytes against a value the corpus writes in bits (platform.rb:61-66 is SIZEOF * 8). Both the 64 and the 32 branch of every such guard were false, on every machine. Nothing looked wrong, because a shut guard is what a guard does.
platform_is_not rebuilt its own negation by OR-ing the parts mspec is run_unless over the same match? (:116-122). The two differ as soon as a site carries a name AND an option.
the os: option was not read at all

Measured, not argued

Same binary, same corpus, only the shim changed — cmd/shimdelta on darwin:

  +188   core/array/pack/j_spec.rb     (0 -> 188)
  +216   core/string/unpack/j_spec.rb  (0 -> 216)

Both were recorded as 0 in BASELINE, which is what a file contributing
nothing looks like from the outside. Their entire contents sit behind
platform_is pointer_size: 64.

And in the other direction, which is why the two are never summed:
core/file/sticky_spec.rb went pass=4 fail=1 → pass=4 fail=0. The literal's
:bsd matched no RUBY_PLATFORM this project runs on, so a BSD-only
expectation was being asserted on a mac.

Static census over the pinned corpus — 2206 files, which is the gate's own
count, and 420 guard sites, 3 of which the reader refuses rather than
guesses at because they do not close on their line:

machine skipped but should run ran but should not
x86_64-linux 20 guards, ≥29 examples, 19 files 11 guards, ≥11 examples, 10 files
arm64-darwin 2 guards, 2 files 1 guard, ≥1 example, 1 file

Two instruments, because neither axis existed

  • cmd/platguard reads the corpus and says which guards the two answers
    disagree about, for a named machine. It has to be named: the defect is
    invisible on darwin, so a tool that could only answer about its own host would
    have reported a clean corpus from here.
  • cmd/shimdelta runs one interpreter over the same files under two
    spec_helper.rb. cmd/specdelta compares two engines through one shim,
    which is the wrong axis when the engine is fixed and the shim decides which
    examples exist. It refuses two byte-identical shims, counts a missing tally as
    DIDNOTRUN and never as zero, and prints the two directions on separate lines.

The gate

conformance_platform_guard_test.go, and every assertion in it is
platform-independent
: it asserts that the two sources agree, not what they
answer, plus three facts true of every machine. This test runs on ubuntu, macos
and windows; one that spelled out an expected answer would be asserting which
runner it is on.

Verified the way a gate has to be — run against main's shim, where it goes red
six times on darwin alone: :bsd, :unix, the pointer_size pair, the
shut-both-ways absolute, the negation, and the full triple. A second test
refuses a PLATFORMS literal in code at all, because a list that happened to
agree with RUBY_PLATFORM on the runner would satisfy every runtime assertion
while putting the second source back for every other machine.

The census table was checked the same way: reintroducing the bits/bytes
comparison in Go turns two rows red.

Issues

Not done here, on purpose

BASELINE is not regenerated in this commit. It is recorded where it is
enforced — the rubyspec-baseline dispatch on ubuntu-24.04 — and this change
moves the population on that machine in both directions. The ratchet lane on
this PR is the measurement, and the re-record follows it.

⛔ cmd/shimdelta measures passing examples and nothing else. A guard change
that removes a failure is invisible to it — sticky_spec.rb above is the
witness, and the limitation is stated in the command's own doc comment rather
than left to be discovered.

Refs #837, #960, #799, #843 — all four stay open: #837 until BASELINE is
re-recorded on the lane that enforces it, #960 until the citation gate is
widened to all six, and #799 and #843 are named here for context only.

🤖 Generated with Claude Code

The shim had TWO platform sources under a comment saying it had one:

    PLATFORMS = [:darwin, :bsd, :unix]   # a literal
    class PlatformGuard
      PLATFORM = RUBY_PLATFORM           # derived

On darwin they agree, so the split is invisible from the machine the work
is done on. On the ubuntu lane that enforces the gate, `platform_is
:linux` was false while `PlatformGuard.os?(:linux)` was true.

mspec has no list either (ruby/mspec lib/mspec/guards/platform.rb:26-38,
read at the tip): every name but :windows and :wsl is a plain substring
of RUBY_PLATFORM. So platform_is / platform_is_not now call
PlatformGuard, PLATFORMS is gone, and nothing is typed twice.

Three defects the issue did not name, found by reading the reference
rather than the issue:

1. :pointer_size was compared against WORDSIZE / 8 — BYTES against a
   value the corpus writes in BITS (platform.rb:61-66 is SIZEOF * 8).
   So `pointer_size: 64` AND `pointer_size: 32` were both false, on
   every machine, and every guard written that way was shut. Nothing
   looked wrong, because a shut guard is what a guard does.

2. platform_is_not rebuilt its own negation by OR-ing the parts. mspec
   is run_unless over the SAME match? platform_is runs on (:116-122),
   and the two differ as soon as a site carries a name AND an option.

3. The `os:` option was not read at all.

MEASURED, same binary, same corpus, only the shim changed (cmd/shimdelta
on darwin):

    +188   core/array/pack/j_spec.rb     (0 -> 188)
    +216   core/string/unpack/j_spec.rb  (0 -> 216)

Both were recorded as 0 in BASELINE — what a file contributing nothing
looks like from the outside. Their whole contents sit behind
`platform_is pointer_size: 64`.

And in the other direction, which is why the two are never summed:
core/file/sticky_spec.rb went pass=4 fail=1 -> pass=4 fail=0. The
literal's :bsd matched no RUBY_PLATFORM this project runs on, so a
BSD-only expectation was being asserted on a mac.

The static census, over the pinned corpus (2206 files — the gate's own
count — and 420 guard sites, 3 of which the reader REFUSES rather than
guesses at, because they do not close on their line):

    x86_64-linux   skipped but should run  20 guards >=29 ex  19 files
                   ran but should not      11 guards >=11 ex  10 files
    arm64-darwin   skipped but should run   2 guards           2 files
                   ran but should not       1 guard  >=1 ex    1 file

Two instruments, because neither axis existed:

  cmd/platguard   reads the corpus and says which guards the two answers
                  disagree about, for a NAMED machine. It has to be
                  named: the defect is invisible on darwin, so a tool
                  that could only answer about its own host would have
                  reported a clean corpus from here.

  cmd/shimdelta   runs ONE interpreter over the same files under two
                  spec_helper.rb. cmd/specdelta compares two engines
                  through one shim, which is the wrong axis when the
                  engine is fixed and the shim decides which examples
                  exist. It refuses two byte-identical shims, counts a
                  missing tally as DIDNOTRUN and never as zero, and
                  prints the two directions on separate lines.

THE GATE is conformance_platform_guard_test.go, and every assertion in
it is platform-independent: it asserts that the two sources AGREE, not
what they answer, plus three facts true of every machine. Verified by
running it against main's shim, where it goes red six times on darwin
alone — :bsd, :unix, the pointer_size pair, the shut-both-ways
absolute, the negation, and the full triple.

A second test refuses a PLATFORMS literal in code at all, because a list
that happened to agree with RUBY_PLATFORM on the runner would satisfy
every runtime assertion while putting the second source back for every
other machine.

Also corrected: the four README citations my own insertion moved, with
MEASURED values, not computed ones. Three of them are outside the gate
that checks such citations (#960).

NOT DONE HERE: BASELINE. It is recorded where it is enforced, through
the rubyspec-baseline dispatch on ubuntu, and this change moves the
population on that machine in both directions. The ratchet lane on this
PR is the measurement.

Refs #837, #960

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Recorded by the rubyspec-baseline dispatch on ubuntu-24.04 at this
branch's head 7ea7cbb (run 44763141137, green), with -absorb. Not on
this laptop: #838 is why that lane exists.

25 rows move. EVERY ONE of them is accounted for, and the control that
makes that claim checkable is main's own ratchet run on 5d0c805 at
10:23, twenty minutes before this branch's at 10:44.

17 of the 25 are already in MAIN's report, same labels, same values.
They are main drifting ahead of a stale baseline, not this change:

    to_set +1, cause +1, gc/config +1, kernel/inspect +2,
    marshal/dump +3, _id2ref +1, range/max +5, range/to_set +1,
    set/divide +1, language/{array,block,def,lambda,variables} +1,
    language/predefined +4, language/send +4

Four of those are the files absorbed as regressions on 2026-11-03; they
have recovered, so that header line is gone.

The other 8 are this change, and the two directions are listed apart:

    +188  core/array/pack/j_spec.rb        pointer_size: 64
    +216  core/string/unpack/j_spec.rb     pointer_size: 64
      +1  core/io/buffer/map_spec.rb       platform_is :linux
      +1  core/file/stat/inspect_spec.rb   a guard INSIDE an it, which
                                           appended a birthtime= field
                                           to the expected string on a
                                           machine that does not produce
                                           one
      +1  core/string/byteslice_spec.rb        \ through shared/slice.rb:122
      +1  core/string/element_reference_spec.rb/ pointer_size: 64

      -1  core/io/buffer/resize_spec.rb    platform_is_not :linux, on linux
      -1  core/io/seek_spec.rb             platform_is :darwin, on linux
      -1  core/file/stat/birthtime_spec.rb see #962

The three losses are absorbed on purpose and the header names them. Two
of them are examples that were never this machine's to run: the old
literal matched :darwin everywhere, so darwin-only expectations were
being asserted on ubuntu and counted as linux passes. Removing them is
the point of #837, not a cost of it.

The third is #962, filed today: `_guard_run` returns nil where mspec
returns the block's value, so `*ruby_version_is("4.0") { :linux }` in
core/file/stat/birthtime_spec.rb:3-5 splats to nothing and the file is
guarded for a list that never contains :linux. It ran on ubuntu only
because the literal's :darwin matched -- two defects cancelling, and
removing one made the other measurable. Fixed separately, so each
population move stays attributable.

⛔ AND A CORRECTION TO MY OWN READING. byteslice, element_reference and
kernel/require carry no platform guard in their own source, and on that
evidence I called their moves flakes. That is evidence about the wrong
file: ruby/spec is built on it_behaves_like, so the guard lives in the
shared-examples file and is counted against every spec that includes it.
One grep of core/string/shared/ and core/kernel/shared/ turned three
"flakes" into three attributions. cmd/platguard's doc comment now says
so, next to the lower-bound caveat it already carried -- the census
bounds the GUARDS, never the FILES.

Refs #837, #962, #838

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

Copy link
Copy Markdown
Contributor Author

The ubuntu measurement arrived, and every moved row is attributed

The ratchet lane failing on this branch was the measurement — it is the
only way to read the population move on the machine that enforces it. Run
44721466507 on 7ea7cbb:

files: 2206 measured, 2206 in baseline
passing examples: 24106 (baseline 23672, +434)
-- REGRESSED (3) --
-- improved (22) --

⛔ That +434 is exactly the single number this PR says never to read. The
control that makes the 25 rows legible is main's own ratchet run on 5d0c805
twenty-one minutes earlier (44717998241): 17 of the 25 are already in it,
same labels, same values.
They are main drifting ahead of a stale baseline,
not this change. Four of them are files absorbed as regressions on 2026-11-03
that have since recovered, so that header line is gone.

The 8 that are this change, in two directions:

+188 core/array/pack/j_spec.rb — pointer_size: 64
+216 core/string/unpack/j_spec.rb — pointer_size: 64
+1 core/io/buffer/map_spec.rb — platform_is :linux
+1 core/file/stat/inspect_spec.rb — a guard inside an it, appending a birthtime= field to the expected string on a machine that does not produce one
+1 core/string/byteslice_spec.rb — via core/string/shared/slice.rb:122
+1 core/string/element_reference_spec.rb — same shared file
−1 core/io/buffer/resize_spec.rb — platform_is_not :linux, on linux
−1 core/io/seek_spec.rb — platform_is :darwin, on linux
−1 core/file/stat/birthtime_spec.rb — see #962

The three losses are absorbed on purpose and BASELINE's header names them.
Two are examples that were never this machine's to run: the old literal matched
:darwin everywhere, so darwin-only expectations were asserted on ubuntu and
counted as linux passes. Removing them is the point of #837, not a cost of it.

⛔ A correction to my own reading, and the cheap check that caught it

byteslice_spec.rb, element_reference_spec.rb and kernel/require_spec.rb
contain no platform guard in their own source, and on that evidence I wrote
them off as flakes — three ±1 moves in both directions, which is what noise
looks like.

That is evidence about the wrong file. ruby/spec is built on it_behaves_like,
so the guard lives in the shared-examples file and is counted against every
spec that includes it:

  • core/string/shared/slice.rb:122 — platform_is pointer_size: 64, included
    by both string files, +1 each.
  • core/kernel/shared/require.rb:230 and :837 — platform_is :darwin, which
    is why require_spec.rb reads 69 here and 70 on main.

One grep of two shared/ directories turned three "flakes" into three
attributions. Nothing in this diff is noise. cmd/platguard's doc comment
now says so next to the lower-bound caveat it already carried: the census bounds
the guards, never the files.

The re-record

BASELINE is regenerated by the rubyspec-baseline dispatch on
ubuntu-24.04
(run 44763141137, green, absorb=true) and committed from the
artefact — not from this laptop, which is what #838 made that lane for.

Still to follow, after this merges

The conformance figure is published in three places and only the repo README is
gated. The landing (go-embedded-ruby.github.io, 5 sites, each dated
2026-11-03) and the docs site (content/en/_index.md, refreshed by
tools/conformancefigure) still read 23,672. One PR each, once main carries
the new number — a landing that quotes a branch would be the same drift in a new
place.

Refs #837, #838, #962

🤖 Generated with Claude Code

tannevaled and others added 3 commits November 20, 2026 16:52
…op one that holds nothing

A mutation sweep of the two new commands found 11 refusals that no test
failed without. This holds the ones that mean something, deletes one
that turned out to mean nothing, and disposes of three in writing.

⛔ FIRST, THE SWEEP ITSELF WAS WRONG AND HAD TO BE RE-RUN. I started two
mutsweeps in parallel on one module. Each mutates a file in place while
the other compiles the same subtree, so each measured the other's
mutants. The serial re-run disagreed -- and in the dangerous direction:
the contaminated run reported FEWER survivors (5 against 7 for
shimdelta, and two lines it called "not a mutant" were really a PANIC
and a survivor). A contaminated sweep reassures.

⭐ THE ONE THAT MATTERED. shimdelta's tally read -- the command's whole
thesis, that a missing tally is not a tally of zero -- was inline in
runOne, where the only way to exercise it was to build an interpreter
and run a corpus. Nothing held any arm of it. It is now readTally(path),
with a seven-row table whose load-bearing pair is:

    a file that is not there        -> Ran:false
    a spec that really passed none  -> Ran:true, Pass:0

Both produce the number 0 to a careless reader and they mean opposite
things.

⛔ AND THE SWEEP DELETED A LINE RATHER THAN EARNING ONE. readTally
opened with `if err != nil || text == ""`, which reads like the line
carrying all of that and holds nothing: on a read error the bytes are
nil, so the text is already empty, and the Atoi below refuses all four
unreadable cases on its own. Removing it left the seven rows passing --
which is what says the coverage was never in that line. A guard that
cannot fail is a guard nobody can keep honest.

The discarded error that remains is not the one that bit us on Windows
this morning. There, "the binary never started" and "it ran and printed
nothing" needed OPPOSITE answers. Here the caller asks one question --
is there a usable number -- and an unreadable file and a file full of
junk are both "no". That distinction is now written where the `_` is.

Also held, with a witness on each side:

  both walks' filter   a DIRECTORY named x_spec.rb, and a suite the
                       caller did not name, must both be passed over
  both walks' errors   an unreadable directory and an unreadable spec
                       file must come back as an ERROR, because a
                       swallowed one yields a SHORTER census that is
                       not wrong-looking anywhere downstream -- just a
                       smaller number carrying the same confidence
  three refused shapes a bare `platform_is` mention, an argument the
                       reader cannot resolve, an option it does not
                       know. Falling through any of them yields "no
                       names", which means EVERY platform -- the most
                       permissive answer there is, invented out of a
                       line that could not be read

The permission tests skip on Windows and under root, and say which:
those hosts cannot ARRANGE the condition. Each also asserts the
arrangement worked before asserting the behaviour, so a filesystem that
ignored the mode skips rather than passing on a walk that simply
succeeded.

NOT HELD, and why, rather than contorting the code:

  platform.go:230, :256   nil guards before a dereference. Deleting
                          either panics before any assertion can run,
                          so "caught by PANIC" is the only verdict
                          available. mutsweep's warning that a later
                          test turns such a line into a silent survivor
                          does not apply to a nil dereference.
  platform.go:399         filepath.Rel(root, p) where p is built FROM
                          root by WalkDir. The error cannot occur. The
                          arm is defensive and mirrors the Walk beside
                          it in census.go; diverging from the neighbour
                          to satisfy a gate would be the worse trade.

One of my own expectations was wrong and the code was right: an
unclassified site still records Block, because the reader established
that the line opens one before failing on the arguments. Corrected in
the test.

Refs #837

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A mutation sweep found the `-list` comparator held by nothing: platguard
had no test at all, so the order its census is READ in was never checked.
That order is not presentation. This listing is diffed one run against
another -- it is how the 17 rows main had already moved were told apart
from the 8 #837 moved -- and rows arriving in walk order move about
whenever the filesystem does.

A comparator inside a sort.Slice call in main() cannot be exercised by
anything, so it is inCorpusOrder() now, with three rows that each fail a
different half: without the file comparison the rows stay in input order,
without the line comparison two sites in one file do, and a comparator
keyed on the line alone would interleave files. A fourth test holds that
the caller's slice is left alone, since the totals are printed from it
after this runs.

Control: the census prints the same numbers before and after, which is
what says this moved code rather than a measurement.

Refs #837

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… fail

filepath.Rel(root, p) inside WalkPlatform's callback had a refusal arm no
input could reach: WalkDir is rooted at filepath.Join(root, suite), so
every p it yields already starts with root, which is the one condition
Rel needs. A mutation sweep deleted the arm and nothing failed, because
nothing could.

A refusal no input reaches is a line no test can ever hold. This file
argues exactly that two functions down, about a guard in shimdelta that
was removed for the same reason, so keeping this one to match the Walk
beside it in census.go would be a divergence from its own stated rule
rather than agreement with a neighbour. The divergence from Walk is
noted where it is made.

The suite name and the walked remainder give the same answer with no
error to invent.

⭐ CONTROL: platguard -list over the pinned corpus prints BYTE-IDENTICAL
rows before and after -- 420 sites, 3 refused, the same 31 linux and 3
darwin disagreements, the same paths. The only line that differs is the
RUBY_PLATFORM triple I corrected earlier on purpose. That is what says
this moved code rather than a measurement.

platform.go now sweeps 0 survived. The three that remain are caught by
PANIC: two nil guards before a dereference and one slice bound, which
the gate names as the ceiling for an indexing guard -- deleting any of
them crashes before an assertion can run.

Refs #837

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit d89e418 into main Nov 20, 2026
26 checks passed
@tannevaled
tannevaled deleted the shim-platform-single-source branch November 20, 2026 17:55
tannevaled added a commit to go-embedded-ruby/go-embedded-ruby.github.io that referenced this pull request Nov 20, 2026
…e measurement (#45)

go-embedded-ruby/ruby#961 re-recorded BASELINE on the pinned ubuntu
runner, and it now sums to 24,106. This page's own gate
(conformancefigure@v0.8.0, the step in deploy-pages.yml) was RED against
ruby's main from that merge on: 6 claims, all reading 23,672. Every push
and pull request here would have failed it for a reason that had nothing
to do with the change being proposed.

Six figures and two dates move:

  hugo.toml:74            23,672 -> 24,106, re-recorded 2026-11-03 -> 11-20
  list.html:73            the same, in the "what CI guarantees" item
  list.html:79            the climb from 6,000
  index.html:25, :60, :69 the trust bar, the card, the stat

⭐ AND ONE SENTENCE THE PAGE OWED ITSELF. This page carefully separates
jumps that were fixes to the MEASUREMENT from jumps in what the VM can
do. This one is mostly the first kind: the shim's platform guards
compared `pointer_size: 64` against a size in bytes, so every such guard
was shut on every machine and two whole files had been counted at zero.
Fixing that is +404 of the day's +434 -- main alone would have read
23,702, and 24,106 - 23,702 = 404. Without saying so, the page would have
presented a better instrument as a better interpreter, which is the
exact confusion the sentence it extends was written to prevent. Both
places that list the measurement fixes now count three.

Still true and left alone, checked against the new BASELINE rather than
assumed: 2,202 of 2,206 spec files produce a result with 4 FILEFAIL, and
core/random/bytes_spec.rb's row is still 8, its floor.

CONTROL: the pinned gate, run on this tree against ruby's main, checks
6 claims and passes. The COUNT is the evidence, not the exit status: a
rewording that took a claim out of the tool's vocabulary would have
checked 5 and passed just the same.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
tannevaled added a commit to go-embedded-ruby/docs that referenced this pull request Nov 20, 2026
…measurement (#54)

go-embedded-ruby/ruby#961 re-recorded BASELINE on the pinned runner; it
now sums to 24,106. This site's own check (tools/conformancefigure,
docs.yml) reads that file from ruby's main and was RED from the merge
on: 5 claims, all reading 23,672.

  _index.md:13            the front page
  conformance.md:165      the callout title
  conformance.md:217      "The sum is ..."
  conformance.md:354      the end of the climb from 6 000
  roadmap.md:22           "its sum is ..."

⭐ "NOT EVERY GAIN IS VM CONFORMANCE" NOW LISTS THREE. That section
exists to keep fixes to the measurement apart from fixes to the
interpreter, and it ended "The rest of the climb is the VM" -- which
stopped being true today. The shim's platform guards compared
`pointer_size: 64` against a size in bytes, so every such guard was shut
on every machine; two files counted at 0 measured 188 and 216 with only
the shim changed, and on the pinned runner the fix is +404 of the day's
+434 (main alone read 23 702). A third bullet says so, with the files,
and also that the fix REMOVED darwin expectations the old list had been
counting as linux passes -- a gain in what is seen is not always a gain
in the count.

⛔ AND A TRANSCRIPT NO GATE READS. conformance.md:182-185 shows

    $ awk ... scripts/conformance/rubyspec/BASELINE
    23673

as the figure "read straight out of the gate's own file". The tool does
not match it -- it is a command's output, not a sentence -- and it was
ALREADY wrong by one: 23673 is the sum from before 2026-11-04, when
core/random/bytes_spec.rb's row was pinned from 9 to its floor of 8.
Nothing has refreshed it since, which is the proof that nothing reads
it. Updated to 24106 here; a transcript of that command is a claim in
everything but grammar, and the vocabulary should learn it.

CONTROL: the lane's own command, `go run ./tools/conformancefigure
--root content/en`, run on this tree against ruby's main: 5 claims
before, 5 after, passing. The count is the evidence -- a rewording that
took a claim out of the vocabulary would have checked 4 and passed just
the same.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
tannevaled added a commit that referenced this pull request Nov 20, 2026
…962)

mspec's SpecGuard#run_if is `yield if yield?(false)` (guard.rb:80), so
with a block the guard's value is the block's value when it holds and nil
when it does not. The shim's `_guard_run` ended in a hardcoded `nil`, so
the open case returned nothing too.

It is the same defect the comment above `_guard_run` already records
fixing for the NO-block form, one form over: a guard used as an
expression contributed nothing.

Where it cost: core/file/stat/birthtime_spec.rb:3-5 splats exactly that
value into a platform list,

    platform_is(:windows, :darwin, :freebsd, :netbsd,
                *ruby_version_is("4.0") { :linux },
               ) do

so `*nil` added nothing and the file was guarded for a list that never
contained :linux -- skipped on the gate's own ubuntu runner, at a version
where upstream runs it. It ran there only because the old literal
PLATFORMS matched :darwin on every machine (#837): two defects
cancelling, and #961 removing one is what made this one measurable.

THE GATE, conformance_guard_value_test.go, has a witness on each side,
because one side alone is a weaker rule that also passes:

  against the old helper     the 4 OPEN rows go red (block value lost)
  against `yield` with no    the 4 SHUT rows go red (block value returned
    `if match`                  where mspec returns nil)

A helper returning the block's value unconditionally would ALSO turn
birthtime_spec green, and would add :linux on a Ruby where the corpus
says not to; only the shut rows tell the two fixes apart. Every row is
platform-independent ("0.0" / "999" / RUBY_PLATFORM), and the no-block
form is asserted unchanged.

MEASURED. The corpus uses a guard with a block as a value in exactly two
places in language/ + core/:

  core/file/stat/birthtime_spec.rb:4    value splatted -- THIS defect
  core/tracepoint/inspect_spec.rb:70    statement form, value discarded

cmd/shimdelta on darwin over both, same binary, only the shim changed:
0 gained, 0 lost, 0 unmeasured -- as predicted, since :darwin is in that
list either way. The ubuntu effect is the ratchet lane's to report.

Citations moved by the 19-line comment, with measured values: two in the
conformance README (gated) and one in the root README (not gated, #960).
Nine more citations into this file live in cmd/specdelta's Go source,
and on main they are ALREADY wrong by a uniform +48 -- pre-existing,
written 2026-11-02 and never touched since. Recorded on #960 rather than
hand-fixed here: they would be right until the next insertion, and the
remedy is the gate that issue asks for.

Refs #962, #837, #960

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tannevaled added a commit that referenced this pull request Nov 21, 2026
…962) (#965)

mspec's SpecGuard#run_if is `yield if yield?(false)` (guard.rb:80), so
with a block the guard's value is the block's value when it holds and nil
when it does not. The shim's `_guard_run` ended in a hardcoded `nil`, so
the open case returned nothing too.

It is the same defect the comment above `_guard_run` already records
fixing for the NO-block form, one form over: a guard used as an
expression contributed nothing.

Where it cost: core/file/stat/birthtime_spec.rb:3-5 splats exactly that
value into a platform list,

    platform_is(:windows, :darwin, :freebsd, :netbsd,
                *ruby_version_is("4.0") { :linux },
               ) do

so `*nil` added nothing and the file was guarded for a list that never
contained :linux -- skipped on the gate's own ubuntu runner, at a version
where upstream runs it. It ran there only because the old literal
PLATFORMS matched :darwin on every machine (#837): two defects
cancelling, and #961 removing one is what made this one measurable.

THE GATE, conformance_guard_value_test.go, has a witness on each side,
because one side alone is a weaker rule that also passes:

  against the old helper     the 4 OPEN rows go red (block value lost)
  against `yield` with no    the 4 SHUT rows go red (block value returned
    `if match`                  where mspec returns nil)

A helper returning the block's value unconditionally would ALSO turn
birthtime_spec green, and would add :linux on a Ruby where the corpus
says not to; only the shut rows tell the two fixes apart. Every row is
platform-independent ("0.0" / "999" / RUBY_PLATFORM), and the no-block
form is asserted unchanged.

MEASURED. The corpus uses a guard with a block as a value in exactly two
places in language/ + core/:

  core/file/stat/birthtime_spec.rb:4    value splatted -- THIS defect
  core/tracepoint/inspect_spec.rb:70    statement form, value discarded

cmd/shimdelta on darwin over both, same binary, only the shim changed:
0 gained, 0 lost, 0 unmeasured -- as predicted, since :darwin is in that
list either way. The ubuntu effect is the ratchet lane's to report.

Citations moved by the 19-line comment, with measured values: two in the
conformance README (gated) and one in the root README (not gated, #960).
Nine more citations into this file live in cmd/specdelta's Go source,
and on main they are ALREADY wrong by a uniform +48 -- pre-existing,
written 2026-11-02 and never touched since. Recorded on #960 rather than
hand-fixed here: they would be right until the next insertion, and the
remedy is the gate that issue asks for.

Refs #962, #837, #960

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
tannevaled added a commit that referenced this pull request Nov 21, 2026
…); sum unchanged (#967)

core/kernel/require_spec.rb read 68 in 2 of 4 ratchet attempts since
BASELINE recorded 69, at code that cannot affect it:

  #965  868e42e  attempt 1  68  red
  #965  868e42e  attempt 2  69  green     <- same SHA, both values
  #966  d66943c  attempt 1  69  green
  #966  6f88f65  attempt 1  68  red       <- a test-only change

Pinned to its floor, as #885 pinned core/random/bytes_spec.rb -- the
remedy #887 describes for a file with no honest single row. Which example
flips is not measured: the ratchet keeps a count per file (#887).

core/file/stat/birthtime_spec.rb 0 -> 1: what #965 made it on the gate's
runner, read 1 in all 3 attempts whose logs were read. The 0 was
absorbed for #961; leaving it unbanked meant a regression to 0 would pass.

The two moves cancel: the sum stays 24106, so the figure gates of the
README, docs and landing are untouched. The header records both edits.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant