Skip to content

Retire 2016-era code and bring the core closer to CRuby 4.0 - #119

Merged
Largo merged 334 commits into
masterfrom
claude/sleepy-cori-qrvpl9
Nov 7, 2026
Merged

Largo merged 334 commits into
masterfrom
claude/sleepy-cori-qrvpl9

Conversation

@Largo

@Largo Largo commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

This retires the code still unchanged since the 2016 import commit (5252433c) and brings IronRuby closer to CRuby 4.0, in five rounds. Today's master (91bb9ecb) is merged in.

2016-era lines (git blame -w, which ignores whitespace changes): 408,361 → 137,549 (−66%). The diff against master is 7,207 files, +24.5k / −280k lines.

Most of the remaining 2016 lines are working code. About 21k are upstream stdlib files identical to CRuby 4.0's, and about 7k are license headers.

Round 1: dead code

  • Unused test trees: deleted the vendored 2016 rubyspec/mspec (Tests/mspec), Tests/Legacy, Tests/Experiments, Tests/Interop and Tests/Scripts. Their tests that still check something were ported to Src/IronRuby.Tests first.
  • Old build system: deleted Build.proj, make.cmd and the nuspecs; the Makefile and Ruby.sln now drive dotnet build.
  • Dead libraries and docs: deleted ParseTree, the 2016 rb-readline (CRuby's readline gem over Reline replaces it), the Tutorial sample, and the 2007 TiddlyWiki docs.
  • Dead code paths: removed always-true FEATURE_* #ifs, dead AST nodes, and Ruby 1.8 methods.
  • Version info: assemblies carry the release version, and RUBY_REVISION is the git commit.

Round 2: 1.8/1.9-era machinery

  • Removed: taint/untrust, $SAFE, RubyCompatibility, the Thread.Abort leftovers and -save/-load.
  • Compiler fixes: rescue list evaluation order, a bare rescue calling ===, eval('super') arguments, break from forwarded blocks.
  • Library fixes: IO.popen "r+" with binary data, String#chars with U+FFFF, String#succ, const_get, Process.clock_gettime, and the Integer⊕Float out-of-range warnings.
  • RbConfig::CONFIG["ruby_version"] is now "4.0.0".

Round 3: CRuby 4.0 conformance

  • Stdlib: synced to CRuby 4.0.9 (RubyGems/Bundler 4.0.20), using Util/sync-stdlib.rb.
  • Core:
    • CRuby's encoding table;
    • a BigDecimal engine on BigInteger;
    • the platform's errno numbers and texts;
    • object-model fixes (Class.new(Class), 16-digit object ids, method lists hiding CLR members and helpers);
    • Comparable/Enumerable → IComparable/IEnumerable.
  • Error messages: CRuby 4.0 wording.
  • Prelude: about 725 dead lines removed.

Round 4: follow-ups

  • System::Int64/BigInteger name their CLR types again.
  • Library methods:
    • keyword-parameter arity errors match CRuby ([Keywords]);
    • called names through aliases ([CalledName], [SameRubyMethod]);
    • no sticky keyword-hash mark ([ReceivesKeywords]).
  • Encodings: regexp character offsets on Shift_JIS/EUC-JP, UTF-16/32 padding, converters.
  • New API: IO#timeout, Thread#set_trace_func, ObjectSpace.count_objects, GC.stat_heap, did_you_mean (lazy), Enumerator::Producer, Process::Waiter.
  • Ractor: the Ruby 4.0 API on CLR threads.
  • Startup: the precompiled startup library builds again (ir -e 1: 0.65 s → 0.49 s on the R2R host). A new DLR patch, 0103, keeps backtraces when rethrowing.
  • Platform: open/fcntl flags, File.lchmod, UDP after ICMP errors, connect timeouts per CRuby Bug #22223, regenerated AOT subclasses.
  • Regressions from rounds 1–3, found by a full ruby/spec run, are fixed.

Round 5: conformance and performance

  • Performance:
    • the keyword-mark checks cost nothing measurable;
    • const_get/const_defined? are back to their pre-round-1 speed;
    • the Util/bench geomean over 63 benchmarks is 0.984× the start of round 5, where pre-round-1 is 1.038×.
  • Backtraces:
    • correct lines in compiled (hot) code;
    • re-raise frames;
    • library frames and labels follow CRuby's rule (a probe of ~210 raising snippets went from 104 differences to 39).
  • Error reports: did_you_mean suggests locals (NameError#local_variables); error_highlight is on by default; SyntaxError reports read "syntax errors found" with prism's annotated snippet, and syntax_suggest is on. All byte-identical to CRuby on the cases checked.
  • Ractor isolation: globals, class variables, class-level ivars, constants with unshareable values, ractor-local $stdout/$VERBOSE, isolated procs, require in main. 146 of 153 checks in CRuby's bootstraptest/test_ractor.rb pass; the checks cost nothing until a Ractor starts.
  • Method#arity/#parameters: match CRuby for all but 46 of 2,111 core methods (41 of them Set), via an InternalMethods.Generated.cs signature table.
  • Fiber: resume/transfer keywords, CRuby's Fiber errors and storage, IO#write_nonblock with non-Strings, and a RubyBufferedStream offset bug.
  • .NET interop: overloads are chosen by a Ruby Array's items (String.Join(",", [1, 2]), LINQ Sum), bignums prefer double, Nullable[T].new works, BigInteger-only members and snake_case CLR names work on Integers.
  • Hidden state: about 55 prelude constants hidden (Module#__hide_constant__), internal ivars of Set, Random, Enumerator and others hidden (Marshal stays byte-compatible), autoloads for core classes answer nil, and Enumerator names are fixed.
  • ruby/spec fixes: mspec's fixnum_max helper now covers IronRuby (default.mspec), a Net::HTTP hang (IO#read after gets on a socket) is fixed, and Thread#status at thread start is fixed.

Merge with master (91bb9ecb)

  • master's C# Rational/Complex are kept, with this branch's conventions on top: hidden helpers, the Numeric owner for dup/clone, "to" wording, and [Keywords] for exception:.
  • Integer()/Float() stay this branch's C# methods.
  • BasicObject#equal? keeps master's identity method while staying one method with #== to Ruby.
  • 1.step(by:, to:) keywords and the Range#first arity were fixed after the merge.
  • ruby/spec slices show no regressions against either parent (core/rational, complex, integer, range, numeric, kernel conversions, basicobject, language).

Testing (final tree d15f678b)

  • IronRuby.Tests on net10.0: PASSED, 0 failures. net8.0 and net10.0 build with no compiler warnings.
  • Prism sweeps: 847/847, 491/491, 314/314, 0 failed. The generated files come out unchanged when regenerated.
  • CRuby-diff scripts (encodings, BigDecimal, Zlib, error messages, keyword hashes, hot-code backtraces, did_you_mean/error_highlight/SyntaxError, Rational/Complex): byte-identical output.
  • ruby/spec at dda28d04/b79c65ed, LANG=C.UTF-8 (README Status):
suite examples failing
language 2935 1 (wording, below)
command_line 175 0
security 34 0
library 6011 0
core 23130 44: 20 ObjectSpace.each_object (needs -X:ObjectSpace), 24 wording

Decision for the reviewer

"can't convert X to Y (X#m gives Z)" matches CRuby 4.0 exactly, which the README names as the reference. The pinned ruby/spec expects the 4.1 wording "into" from engines other than CRuby < 4.1; CRuby 4.0.9 fails the same examples. CI doesn't gate on the spec run. Reverting means changing one format string in RubyExceptions.CreateReturnTypeError, one prelude line, and the test expectations that pinned the old wording.

Not verified here

  • Windows and macOS: the errno tables and the macOS/FreeBSD/arm/powerpc open/fcntl values come from the platform headers, untested on those systems.

Known follow-ups

  • Line tracking: correct lines in compiled code add 4–10% on pure call microbenchmarks (super_call, lambda_call, yield). Cheaper variants would lose other threads' Thread#backtrace frames or the fiber-reclamation guarantees.
  • Ractor: moved Strings/Arrays/Hashes passed to built-ins aren't rejected.
  • Thread#raise and fibers: a Thread#raise arriving just as a thread resumes a fiber can land in the wrong one (intermittent).
  • Identity on large numbers: (2**64).equal?(2**64) is true (from master's value-type identity rule); CRuby says false.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM

claude added 30 commits November 6, 2026 02:34
…rror

A method's keywords (or **nil) are lowered onto a trailing optional
parameter, so the binder's arity check reported the lowered bounds:
`def f(a, k:); f` said "given 0, expected 1..2" where MRI says
"given 0, expected 1; required keyword: k". ArgsBuilder now takes the
declared signature for such a method, words the error from it, and does
not count a trailing keyword hash as given. The wording moves to
RubyParameterSignature.DescribeExpectedArguments, which the lambda arity
check in RubyOps shares.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…esolver fills in

The context, scope, call-site storage and constructor-class builders were
four copies of one class differing only in the expression they return;
they are now one builder given that expression. Also: the argument
assumptions are value tuples rather than an allocated Key per entry, a
splatted item reads through the cached IList indexer MethodInfo instead of
looking it up by name each time, and an else-if that could only be true
is an else.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…er call

When a hosted scope has no variable of the name, main's method_missing
calls the next method_missing with the name inserted. InsertMethodName
already adds it to the call signature, and the signature then added it
again, so the callee saw one argument more than it got: a define_method
method_missing raised "wrong number of arguments (given 3, expected 2)"
for `foo 2`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…ingletons

Static field initializers run in textual order, and the singletons' constructors
call AsciiIdentity, which encodes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…ncoding

DuplexStream.Write turned the bytes into a string with the StreamWriter's
encoding, so a write of bytes not valid UTF-8 ("\xff".b) raised
System.Text.DecoderFallbackException and others were silently altered, and
ReadByte returned a decoded char instead of a byte. Both now go to the pipe
streams under the reader and writer. Seek/Length/Position throw
NotSupportedException (the Stream contract) instead of NotImplementedException.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
Splat, SplatAppend, SplatPair (1.8 multiple-assignment), Create*IntegerRange,
ConvertRubySymbolToClrString (1.8 Integer-as-Symbol), ConvertSymbolToMutableString,
GetEmptyScope, MakeAbstractMethodCalledError and MakeInvalidArgumentTypesError
had no caller left: nothing emits them since the prism front end replaced the
old AST transformations. ReflectionCache.Generated.cs regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…Exception

RecursionTracker used a Dictionary<object, bool> as a set; it is now a
HashSet with the BCL's ReferenceEqualityComparer, and TrackObject is a single
Add. HasPendingAsyncException had no caller.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…dead paths

- -save never saved anything on .NET Core (AssemblyGen.SaveAssembly is a no-op
  without FEATURE_ASSEMBLYBUILDER_SAVE) yet kept every compiled file alive and
  recompiled them all for saving at shutdown; -load looked for an assembly
  named after the main script that could not exist. The loader keeps only the
  precompiled-file table the startup library and Util/aot register. SavePath
  stays as the hosting option Util/aot sets to compile without runtime-bound
  sites.
- $LOAD_PATH no longer gets ".": MRI dropped it in 1.9.2 and ruby4.rb already
  deleted it again for the console host, but a hosted runtime kept it.
- load_assembly's Assembly.LoadWithPartialName retry: on .NET Core that API is
  Assembly.Load again, so it only replaced the real load error.
- GetPathsToTestLoaded added the path twice for a fullPath nobody passed;
  InsertLoadPaths (unused) inserted in reverse and ignored its index;
  GetLoadPaths locked $" instead of $:; CAS-era SecurityException handlers;
  WeakReference<Loader> for the AssemblyResolve holder.
- RubyContext: library data on a ConcurrentDictionary instead of a hand-locked
  Dictionary (TryAddLibraryData had no other caller); EqualityComparer is set
  in the constructor, so its lazy getter was dead; unused
  DropClrInstanceSingleton; StringifyIdentifier(s) go through EncodeIdentifier.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
CRuby 4.0 says "to" in the message for a conversion method that returned the
wrong type ("into" is only for the explicit Integer()/Float() failure). Also
drop the DecoderFallbackException overload of CreateTranscodingError, which
had no callers and threw instead of returning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
CompileDebug only called lambda.Compile() since the PDB-emit path went.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
Thread#raise no longer wraps the raised exception in a ThreadAbortException
(.NET Core has no Thread.Abort; the exception is parked and thrown as itself),
so the "visible" and the real exception are always the same object, and the
DEBUG-only _throwingThread was never read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
No "python" language can ever be configured for the suite: IronPython is
not referenced or deployed, the test host ships no app.config, and the
snippets are Python 2 (print statements) that IronPython 3 would reject.
RequireInterop1/2, Backtrace5 and the Python halves of the delegate
conversion tests could only ever return early. Drop them with
Driver.RunPython and /py[-].

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
….ProcessId

MRI dropped $defout in 1.9 and never had $-O (the -0 switch sets $/ and $-0):
neither is in its global_variables until assigned, and both read as nil.
$$ is read from Environment.ProcessId, without a Process object and the
CAS-era SecurityException guard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
- ClrExtensionMethods5 (#if TODO): LINQ extension methods on a Ruby class
  that includes IEnumerable[T] are by design not offered (see
  RubyModule.IsScopedExtensionPlace: a Ruby class has no extension-method
  place of its own); its expected output was not even what LINQ gives.
- Dlr_Languages and OverloadResolution_ParamArrays1 had empty bodies, and
  the SuperParameterlessEval1/2 registrations named tests that do not exist.
- EqualityComparer1 was never registered; CRuby 4.0 agrees with it.
- ClrMethods2 expected empty output, so it passed whatever new.m did. It
  now pins the hide/show/hide sequence ClrOverloadInheritance4 relies on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…nd(half:), quo(x, n), new/allocate, frozen

- #** and #power are now the gem's own Ruby (lib/bigdecimal.rb, verbatim), so they
  take a BigDecimal/Float/Rational exponent and a precision; the C# Power (int only)
  is gone. BigMath.log/exp are the gem's as well, replacing the 1.9 series.
- A Rational operand of ==/<=>/</<=/>/>=, #coerce, #add/#sub/#mult/#div/#divmod/
  #remainder is expanded as + already did. BigDecimal("0.5") == Rational(1, 2)
  overflowed the stack (BigDecimal#== and Rational#== handed it back and forth).
- round(n, half: :even), quo(value, digits); the defunct #precs is removed.
- BigDecimal.new is undefined and allocate raises as in MRI; Kernel#BigDecimal (in
  bigdecimal.rb) was already the real constructor, so the C# Kernel#BigDecimal it
  shadowed is deleted. A BigDecimal reports frozen? true.
- Messages: sqrt of negative value/NaN, Negative precision for sqrt, Computation
  results in 'Infinity', X can't be coerced into BigDecimal. BASE is an Integer, and
  _dump writes MRI's word-aligned digit count ("18:0.15e1").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
- Manual.cs/RunManualTest: an edit-the-source hook for running one
  snippet, which ir and running one test by name already cover.
- MutableTuple bookkeeping -> record structs; options are instance state;
  option parsing is one Take() per switch; /help prints and exits instead
  of then running the whole suite; [Serializable] (AppDomain marshalling)
  dropped; temp files get a GUID name instead of a ticks/retry loop.
- LoggingErrorSink never printed (every caller suppressed output): it now
  just records; ErrorLogRecord is a record; GroupWithCount is a GroupBy;
  the unused AreEqualBug/AssertExceptionThrownBug helpers are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…at would

An Integer too large for a double met a Float silently in +, -, *, /, **, %,
modulo, remainder, divmod, div, coerce and Kernel#Float, where MRI (which
coerces the Integer with rb_big2dbl) warns under -w - Float-op-Integer already
did, via Protocols.ConvertToDouble. divmod, div and % with such an Integer
also threw a CLR OverflowException ("BigInteger cannot represent infinity")
instead of answering NaN or raising FloatDomainError: they now go through
Float#divmod / Float#% on the converted value, which is what MRI's coercion
amounts to. Float#divmod named every non-finite quotient "NaN"
(Float::INFINITY.divmod(1.0) is "Infinity" in MRI); the CreateFloatDomainError
helpers that ignored their message argument are gone.

Also drops Float::ROUNDS, removed from MRI in Ruby 3.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…haracter

rb_str_succ stops carrying at a non-alphanumeric when the characters on
either side of it are a letter and a digit: "a-9".succ is "a-10" (IronRuby
gave "b-0"), while "1.9".succ is still "2.0" and "a.z".succ "b.a". The
recursive carry is now a loop, with the three copies of the wrap logic folded
into one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…mes as MRI does

- A segment after the first of "A::B" is looked up with rb_const_get_from,
  which stops at Object: Object.const_get("C::String") is
  "uninitialized constant C::String", not String, and const_defined? and
  const_source_location agree.
- Errors come in MRI's order and wording: a malformed path ("C::", "C:::D",
  "") names the whole path, a segment that is not a constant name names only
  that segment ("wrong constant name b" for "C::b"), and both are raised only
  once the segments before resolve ("Zz::C:D" is "uninitialized constant Zz").
  "does not refer to class/module" quotes the name as given.
- private_constant, public_constant and deprecate_constant raise FrozenError on
  a frozen module before anything else, warn (-W) when given no names, and say
  "constant C::q not defined" for a lower-case name, as MRI does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…does

RubyUtils.InspectObject answered a bare "..." for an object met again inside
its own inspect, so o.instance_variable_set(:@A, o) inspected as
#<Object:0x... @A=...>; MRI's rb_obj_inspect gives the class and id first.
Tests for that and for the $defout/$-O/$$ change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
claude and others added 7 commits November 7, 2026 04:05
…g in

The Windows test-suite step of PR 119 ran for 90 minutes until a newer push
cancelled it; its results.txt only held progress dots, so nothing said which
test hung. The run now has a 25-minute timeout (the suite takes 2-4 minutes)
and prints each test's name as it starts (/verbose), so the "did not finish"
branch's tail of results.txt names the test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…ests

The previous commit passed "/verbose" to IronRuby.Tests; Git Bash on Windows
rewrites an argument starting with "/" into a path, the driver read that as a
test-name filter, matched nothing, ran 0 tests and printed PASSED, so the
Windows jobs went green in 5 seconds. MSYS2_ARG_CONV_EXCL keeps the argument
as written, and the step now fails when fewer than 500 tests ran.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPwZf4gAJD4kdk9eEzGgYM
…not there

Io_Timeout2 hung the Windows test run under both .NET versions. IO.pipe's
write end there is a CreatePipe handle in a plain FileStream. IO.select and
IO#timeout's wait called it writable whenever its mode allowed, and a
blocking WriteFile into a full pipe waits until the reader takes the bytes,
so the timeout never fired.

- IoReadiness.GetWindowsPipeRoom asks the pipe how much room it has
  (NtQueryInformationFile, WriteQuotaAvailable, as libuv does); the write
  readiness of a Windows pipe is now "has room, or the reader is gone".
- The write end is a WindowsPipeWriteStream, a FileStream that can time
  out: with IO#timeout set it writes no more than the room the pipe has,
  waits for more in between, and raises TimeoutException at the deadline,
  which RubyBufferedStream already turns into IO::TimeoutError. Without a
  timeout it writes as before.

Prelude_HiddenHelpers1 failed only on Windows: Process.getrlimit is
NotImplementedError there, as in CRuby (rb_f_notimplement), so the
expected line depends on the platform.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013PQjtzppEMdiC1GEqqiRth
…locking

Io_Timeout2 hung on Windows at `r.read_nonblock(1)`, not at the write loops: an
IO.pipe end has no DescriptorStream there, so read_nonblock fell through to a
plain ReadFile, which waits for the writer. PeekNamedPipe (as IO.select already
asks) now decides first.

Prelude_HiddenHelpers1: on Windows Process.getrlimit raises NotImplementedError,
a ScriptError, which the test's rescue modifier did not catch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- IO#write_nonblock into a full Windows pipe raised nothing and blocked
  (WeakMap_NoBlock1 hung): WindowsPipeWriteStream is an INonBlockingWriteStream
  now, writing what WriteQuotaAvailable says fits and -1 (EAGAIN) when full.
- A warning handed to Warning.warn ended in "\r\n" on Windows (AppendLine);
  it ends in "\n", as MRI's does.
- Tests whose expectations were Linux's: E2BIG's CRT text ("Arg list too
  long"), WSAECONNRESET for an ICMP port unreachable and a refused connect
  that Windows retries past timeout: 0 (Errno_SocketCalls3), maxgroups and
  initgroups not implemented, a fixture written in text mode
  (ErrorHighlight_Spots1), /tmp (Ractor_RequireInMain1), and a 2000-level
  Ractor copy that a 1 MB Windows stack cannot hold (now 1000).

net8.0 and net10.0 on Windows 11: 1067 tests, 0 failures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ObjectSpace::WeakMap holds its values weakly as well as its keys; 'b' had no
other reference, and when a collection took it (ubuntu net8.0 CI), each_key
and each_value found an empty map and answered it instead of raising
LocalJumpError.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…i-qrvpl9

Conflicts: ThreadOps.cs and RubyUtils.cs take master's (PR 125 extends the
same ActiveFiberThread with FiberSwitchLock); BlockDefinition.cs keeps this
branch's removal of the trace calls and master's rescue safe point;
ruby4.rb keeps ruby2_keywords and the storage= warning around master's
Fiber.__switched__; the test lists and FiberTests.cs keep both sides' tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Largo
Largo merged commit c7f70cf into master Nov 7, 2026
8 checks passed
Largo added a commit that referenced this pull request Nov 8, 2026
Master (#119) bounded a write into a full IO.pipe with IO#timeout through
WindowsPipeWriteStream, a FileStream for the write end only. This branch's
WindowsPipeStream now carries both ends, so it gets the same behaviour:
CanTimeout, and with a WriteTimeout a write goes in no more than the pipe has
room for at a time, waits for room in between and throws TimeoutException
at the deadline (IO::TimeoutError). WindowsPipeWriteStream is gone; nothing
creates it any more. Closes #131.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

2 participants