Skip to content

conformance: fix the mspec shim's bignum_value (2**63 -> 2**64) - #454

Merged
tannevaled merged 1 commit into
mainfrom
feat/shim-bignum-value
Aug 25, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/shim-bignum-value

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

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 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 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).

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit a836c22 into main Aug 25, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/shim-bignum-value branch August 25, 2026 14:10
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