Skip to content

Marshal: BINARY result, and the 'C' (subclass) and 'e' (extended) codes - #464

Merged
tannevaled merged 1 commit into
mainfrom
feat/cluster34
Aug 26, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/cluster34

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Advances Marshal toward MRI 4.0.6 byte fidelity, clearing the largest cluster
of remaining core failures (dump +53, load +22 in ruby/spec):

  • Marshal.dump returns an ASCII-8BIT (BINARY) string — the single most common
    dump-spec expectation (the result's encoding), previously UTF-8.
  • C container for instances of a user subclass of a built-in value type
    (Array/Hash/String/Range/…): the class name followed by the wrapped
    built-in value, with instance variables carried by an outer I wrapper. Dump-
    and load-side object-link ids stay aligned so shared references round-trip.
  • e container for a singleton-extended object: one e per extending module
    (last-extended first, matching MRI's ancestry order). Extending with an
    anonymous module raises TypeError, as MRI does.

Verified byte-for-byte against ruby 4.0.6 (C/e/BINARY dumps and their
round-trips). Whole-package coverage stays at 100%; the ruby/spec ratchet floor
rises 15600 → 15680 (language+core now 15735 passing, +75, zero regressions in a
deterministic per-file sweep).

🤖 Generated with Claude Code

…ded) codes

Bring Marshal to MRI byte fidelity on three fronts:

- Marshal.dump now returns an ASCII-8BIT (BINARY) string, as MRI does.
- Instances of a user subclass of a built-in value type (Array/Hash/String/
  Range/...) dump and load as the 'C' container: the class name followed by the
  wrapped built-in value, with any instance variables carried by an outer 'I'
  wrapper. The dump- and load-side link ids stay aligned so shared references
  round-trip.
- A singleton-extended object dumps and loads as the 'e' container, one per
  extending module (last-extended first, matching MRI's ancestry order);
  extending with an anonymous module raises TypeError, as MRI does.

Verified byte-for-byte against ruby 4.0.6. Whole-package coverage stays at 100%;
the ruby/spec floor rises 15600 -> 15680 (language+core now 15735 passing, +75).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 78e8d0d into main Aug 26, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/cluster34 branch August 26, 2026 15:42
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