Skip to content

[pull] master from ruby:master - #1392

Merged
pull[bot] merged 8 commits into
turkdevops:masterfrom
ruby:master
Sep 9, 2026
Merged

[pull] master from ruby:master#1392
pull[bot] merged 8 commits into
turkdevops:masterfrom
ruby:master

Conversation

@pull

@pull pull Bot commented Sep 9, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

tekknolagi and others added 8 commits September 9, 2026 14:41
Much like `opt_getconstant_path`, check the cache and see if the
interpreter has done the hard work for us already. If it has, just
re-use the result.

For example, support regexp modifier `o` , which runs the code to
create the regular expression... once:

```ruby
def test = /#{'a'.upcase}/o
```
ISEQ_TRANSLATED is defined through a chain of macros that ends in an
enum value (IMEMO_FL_USER3 -> FL_USER8 -> RUBY_FL_USER8), which bindgen
cannot evaluate, so YJIT and ZJIT had been defining the constant
manually in cruby.rs. ZJIT doesn't even use the constant, so drop it
there, and re-expose it for YJIT through enum yjit_bindgen_constants
in yjit.c so that the Rust side can no longer go out of sync with
iseq.h.

#18597 (comment)
gc_clock_start/end read CLOCK_PROCESS_CPUTIME_ID, which is the sum of
every thread's cpu time. A local GC runs while the other Ractors keep
going, so their work is counted as collection: the same ten collections
of the same objects in one Ractor are reported as 3ms alone and 146ms
with eight unrelated busy Ractors -- 96% of the wall clock that Ractor
ran in, and in another run more than the wall clock.

Read the collecting thread's own cpu instead. A local GC runs to its end
on one thread, and a global one stops the others, so this is what the
number was always meant to be. With the fix the same measurement reads
3 / 4 / 6 / 18ms, the remaining growth being collections that genuinely
cost more on a busy machine.

The read also gets cheaper. GC.measure_total_time is on by default, so
every program pays for four of these reads per collection, and neither
cpu clock is served by the vDSO: both are real syscalls. Reading
CLOCK_PROCESS_CPUTIME_ID makes the kernel walk every thread in the
process, so it costs 477ns with one thread and 3.6us with 256, while
CLOCK_THREAD_CPUTIME_ID is 454ns whatever the count (idle Ryzen 9
8945HS; the threads were asleep, they only have to exist, not run).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
OpenBSD CI now runs inside a qemu virtual machine inside a Ubuntu
virtual machine, without hardware virtualization support. It is
limited to 2.5GB of RAM and only 2 vCPUs. There is a bootstrap test
that fails on it due to resource issues.

```
bootstraptest.test_ractor.rb_1536_1361.rb:8:in 'Thread#initialize':
can't create Thread: Cannot allocate memory (ThreadError)
```

Fix this by using 100 threads instead of 1000.
@pull pull Bot locked and limited conversation to collaborators Sep 9, 2026
@pull pull Bot added the ⤵️ pull label Sep 9, 2026
@pull
pull Bot merged commit 1b75fb2 into turkdevops:master Sep 9, 2026
1 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants