Backport #3073 to 4.1: Avoid eagerly inspecting call traces in type assertions - #3076
Merged
Merged
Conversation
(cherry picked from commit f1bcff3)
Merged
soutaro
pushed a commit
that referenced
this pull request
Aug 12, 2026
The Backports section explains what `-x` buys — that the changelog reaches the pull request the change was written and reviewed in — but not what the entry ends up looking like, so the annotation naming the backport was rediscovered while preparing 4.1.3, and got it wrong first. `gem:changelog` now prints the form rather than leaving it to be remembered. It already had both halves: `changelog_origins` resolves the `-x` trailer to where the change was written, and the `fallbacks` path already looked the cherry-pick's own pull request up, calling it in passing "at least the backport that brought it here". Both ends are now asked for together — one query rather than two, since the second was only ever a retry — and the cherry-pick's becomes the entry's second link instead of being discarded. A backport also stops appearing beside the entries it carried. Its merge commit is in the history too and has no `-x` trailer to resolve, so it read as an ordinary commit of its own pull request: dispatching this on the 4.1.3 cycle listed #3076 as a change of its own, above the entry it annotates. A backport is how a change arrived rather than a change, so the ones that annotate something are dropped from the list. On the development line there are no origins, so entries keep the single link they have today. A backport carrying several changes at once falls out of the same handling: each entry names its own origin and shares the one backport link, which is what 4.0.3 should have looked like. docs/release.md loses the procedure it carried for assembling the changelog by hand, which existed because the task could not run from a Claude Code on the web session. `changelog.yml` runs it on a runner now, so the section says to dispatch that instead — and the traps it documented, all of them about hand-rolling the match, go with it. What replaces them is the one thing the workflow adds: the ref picks the copy of the task as well as the history, so a release branch needs the file on it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QAgPhpLrU9Z4bENCR9RUub
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.
Backports #3073 to the
aaa-4.1.xbranch, cherry-picked with-x.RBS::UnitTest::TypeAssertionseagerly interpolatestrace.inspectinto assertion messages, so the complete argument and return values are inspected even when the assertion succeeds.This is problematic for
ObjectSpace.reachable_objects_from_root: after the per-Ractor GC roots change in Ruby, the returned roots hash can be very large. Building its inspection string causes excessive peak memory usage and can raiseNoMemoryErrorin the Windowstest-bundled-gemsjob in ruby/ruby.Assertion messages are passed as procs, so call traces and method definitions are formatted only when an assertion fails. The same lazy formatting is applied to
assert_send_type,assert_send_type_error, andrefute_send_type.lib/rbs/unit_test/ships in the gem and is what CRuby's bundled-gem tests run against, so the fix reaches CRuby only through the 4.1 line — the same reason #3074 was backported in #3075.The cherry-pick applied cleanly with no conflicts.
Verification
test/stdlib/Integer_test.rbpasses on this branch (67 tests, 648 assertions), so the succeeding path still type-checks calls as before.assert_send_typestill renders the full diagnostic — the call trace and theReturnTypeErrordetail — confirming the procs are called on failure.steep checkreports no type error with the widened_BaseAssertions#assert/#assert_emptysignatures.rake testwas run with this commit applied toaaa-4.1.xand its failure set is identical to the unmodified branch's, with no new failures.Generated by Claude Code