From 7f52b79960ea0c2217f6a6ec2ae163b164baadcd Mon Sep 17 00:00:00 2001 From: tannevaled Date: Tue, 25 Aug 2026 15:33:45 +0200 Subject: [PATCH] conformance: fix the mspec shim's bignum_value (2**63 -> 2**64) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The vendored MSpec shim defined `bignum_value` as 0x8000_0000_0000_0000 (2**63), but ruby/spec is written against the real mspec, whose `bignum_value` is 2**64. Every spec that pins a bignum arithmetic result off `bignum_value` therefore compared against a value half the size the corpus author intended. Proof this is a shim bug, not an rbgo one: running core/integer/left_shift_spec through *MRI* under this shim passes 29/34, but with `bignum_value` set to 2**64 MRI passes 34/34 — the corpus's hard-coded expectations require 2**64. Correcting the shim raises rbgo's measured language + core total from 15461 to 15521 (+60) with zero per-file regressions — the wins are spread across integer/{left_shift,right_shift,bit_and,bit_or,bit_xor,plus,minus,multiply, chr,to_s,divide,…}, float, rational and array/pack specs whose bignum expectations were simply being compared against the wrong magnitude. The ratchet floor is bumped 15400 -> 15450 to lock the gain in (margin left for the random/bytes and require flakes). Co-Authored-By: Claude Opus 4.8 --- scripts/conformance/rubyspec/FLOOR | 2 +- scripts/conformance/rubyspec/spec_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/conformance/rubyspec/FLOOR b/scripts/conformance/rubyspec/FLOOR index 65817310..48cad9c8 100644 --- a/scripts/conformance/rubyspec/FLOOR +++ b/scripts/conformance/rubyspec/FLOOR @@ -1 +1 @@ -15400 +15450 diff --git a/scripts/conformance/rubyspec/spec_helper.rb b/scripts/conformance/rubyspec/spec_helper.rb index a6d14860..7e54cddd 100644 --- a/scripts/conformance/rubyspec/spec_helper.rb +++ b/scripts/conformance/rubyspec/spec_helper.rb @@ -194,7 +194,7 @@ def new_fd(name, mode = "w:utf-8") end def infinity_value; 1.0/0.0; end def nan_value; 0.0/0.0; end -def bignum_value(plus = 0); 0x8000_0000_0000_0000 + plus; end +def bignum_value(plus = 0); (2**64) + plus; end def fixnum_max; 0x3fff_ffff_ffff_ffff; end def fixnum_min; -0x4000_0000_0000_0000; end def max_long; 0x7fff_ffff_ffff_ffff; end