Skip to content

Kernel: advance MRI 4.0.6 conformance (core/kernel residuals) - #553

Merged
tannevaled merged 2 commits into
mainfrom
feat/agent-kernel
Sep 4, 2026
Merged

tannevaled merged 2 commits into
mainfrom
feat/agent-kernel

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Advances core/kernel residuals against MRI 4.0.6 (edit-in-place, no shadowed definitions). Suite + wasm + gofmt verified locally before push; FLOOR untouched — consolidated ratchet bump follows once the wave lands.

🤖 Generated with Claude Code

tannevaled and others added 2 commits September 4, 2026 08:28
…merics, singleton freeze

Kernel#Array now follows MRI's rb_Array: #to_ary then #to_a (each may decline
with nil), a non-Array result is a TypeError, and only an unconvertible value is
wrapped as [v]. Kernel#Hash is newly defined (nil/empty-Array to {}, #to_hash
otherwise, TypeError on failure) and registered as a module_function. Kernel#String
returns a String/String-subclass untouched (no #to_s), honours an overridden
#respond_to?(:to_s) that hides an existing #to_s, and turns a NoMethodError from a
missing #to_s into a TypeError while still allowing a #method_missing answer.

isFrozen now reports Bignum, Complex and Rational as frozen (immutable value
objects), and Object#freeze also freezes an already-materialised singleton class.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…gleton copy

dup now runs #initialize_dup (which delegates to #initialize_copy) on the shallow
copy; clone runs #initialize_clone, copies the frozen state (a freeze: true/false/nil
keyword overrides it and is forwarded to #initialize_clone, an invalid value or
unknown keyword raising ArgumentError), and clones the singleton class so per-object
methods, singleton-included modules and singleton constants carry over — for both
an *RObject inline singleton and the side-table singleton of an Array/Hash/String.

Adds the default private Kernel copy hooks #initialize_copy (same-object no-op,
FrozenError on a frozen receiver, TypeError across classes), #initialize_dup and
#initialize_clone, and preserves instance-variable order across dupValue.

Fixes core/kernel dup, clone, initialize_copy/dup/clone specs to full MRI parity
(clone 18->30) and core/array clone singleton copy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 37ad5f4 into main Sep 4, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/agent-kernel branch September 4, 2026 07:51
tannevaled added a commit that referenced this pull request Sep 4, 2026
Locks in #553 (Kernel), #554 (Module/Class) and #555 (Exception). Measured
18354 passing on the pinned corpus, up from 18245.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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