Repository navigation
Marshal: BINARY result, and the 'C' (subclass) and 'e' (extended) codes - #464
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Advances
Marshaltoward MRI 4.0.6 byte fidelity, clearing the largest clusterof remaining core failures (dump +53, load +22 in ruby/spec):
Marshal.dumpreturns an ASCII-8BIT (BINARY) string — the single most commondump-spec expectation (the result's encoding), previously UTF-8.
Ccontainer for instances of a user subclass of a built-in value type(
Array/Hash/String/Range/…): the class name followed by the wrappedbuilt-in value, with instance variables carried by an outer
Iwrapper. Dump-and load-side object-link ids stay aligned so shared references round-trip.
econtainer for a singleton-extended object: oneeper 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 theirround-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