Skip to content

conformance shim: honour platform_is c_long_size - #425

Merged
tannevaled merged 1 commit into
mainfrom
fix/shim-honours-c-long-size
Aug 21, 2026
Merged

tannevaled merged 1 commit into
mainfrom
fix/shim-honours-c-long-size

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

The shim understood :wordsize and :pointer_size and ignored :c_long_size, so every example a spec had guarded for a platform with a narrower C long ran here anyway.

One of them cost 6 GB

shared/string/times.rb asks a 32-bit platform to refuse "abc" * ((2 ** 31) - 1) with ArgumentError. On a 64-bit one that is a legal six-gigabyte string — so rbgo built it, took 6.5 GB of a CI runner's sixteen, and then failed the example it had no reason to raise from.

core/string/multiply_spec.rb
before 6.08 GB, pass=8 fail=1
after 78 MB, pass=8 fail=0

(The 64-bit example is already correct: "abc" * ((2**63)-1) raises ArgumentError, "argument too big", exactly as ruby 3 does.)

The floor moves down, and that is not a regression

Honouring the guard stops counting 62 examples that were never this platform's to run — and stops 299 failures that were the same examples failing. The measured total goes 14963 → 14896.

before after
core/array/pack/l_spec.rb pass 256, fail 140 pass 236, fail 0
core/string/unpack/l_spec.rb pass 288, fail 158 pass 246, fail 0
core/integer/size_spec.rb pass 2, fail 1 pass 2, fail 0
core/marshal/{load,dump}_spec.rb — unchanged

FLOOR goes 14900 → 14850, which leaves the same cushion under 14896 that 14900 left under 14949.

A ratchet counting examples that do not apply to the platform is measuring the wrong thing, and 299 permanent failures in the log are noise a real one would hide in.

🤖 Generated with Claude Code

The shim understood :wordsize and :pointer_size and ignored
:c_long_size, so every example a spec had guarded for a platform with a
narrower C long ran here anyway.

One of them cost 6 GB. shared/string/times.rb asks a 32-bit platform to
refuse "abc" * ((2 ** 31) - 1) with ArgumentError; on a 64-bit one that
is a legal six-gigabyte string, and building it took 6.5 GB of a CI
runner's sixteen and then failed the example it could not raise from.

  core/string/multiply_spec.rb   6.08 GB, pass=8 fail=1
                                 78 MB,   pass=8 fail=0

The floor moves down with it, 14900 -> 14850, and that is not a
regression. Honouring the guard stops counting 62 examples that were
never this platform's to run — and stops 299 failures that were the same
examples failing. The measured total goes 14963 -> 14896; 14850 leaves
the same cushion under it that 14900 left under 14949.

Where those numbers land, before and after:

  core/array/pack/l_spec.rb     pass 256 fail 140  ->  pass 236 fail 0
  core/string/unpack/l_spec.rb  pass 288 fail 158  ->  pass 246 fail 0
  core/integer/size_spec.rb     pass   2 fail   1  ->  pass   2 fail 0
  core/marshal/{load,dump}      unchanged

A ratchet counting examples that do not apply to the platform is
measuring the wrong thing, and 299 permanent failures in the log are
noise a real one would hide in.
@tannevaled
tannevaled force-pushed the fix/shim-honours-c-long-size branch from 4725613 to 667b749 Compare August 21, 2026 18:02
@tannevaled
tannevaled merged commit 0e5a8fb into main Aug 21, 2026
7 checks passed
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