General

Profile

shugo (Shugo Maeda)

  • Login: shugo
  • Registered on: 05/08/2008
  • Last sign in: 10/01/2026

Issues

open closed Total
Assigned issues 3 159 162
Reported issues 4 94 98

Projects

Project Roles Registered on
Ruby Committer, Infrastructure team 05/28/2008

Activity

Today

12:35 PM Ruby Feature #22392: Allow refinements to define && and ||
alanwu (Alan Wu) wrote in #note-6:
> BTW, the cost analysis to non-users is incomplete in the PoC.
You're right that the analysis is incomplete.
As you say, a parse-time switch would be ideal, but I cannot think of a way to do that ...
shugo (Shugo Maeda)
02:28 AM Ruby Misc #22394: DevMeeting-2026-10-07
* [Feature #22392] Allow refinements to define && and || (shugo)
* I propose to allow `&&` and `||` to be defined in refinements, so that DSLs can write `where { name == "x" && age > 20 }` instead of `where { (name == "x") & (age > 20...
shugo (Shugo Maeda)

10/01/2026

07:53 AM Ruby Feature #22392: Allow refinements to define && and ||
alanwu (Alan Wu) wrote in #note-1:
> Please no. Changing non-method call operations to be method calls has disastrous time and space cost for everyone involved, JIT or not. If accepted, this would be yet another case of refinement makin...
shugo (Shugo Maeda)

09/30/2026

03:18 PM Ruby Revision ce37be7c (git): Keep a managed id table pinned while inserting into it
rb_managed_id_table_insert() took the interior pointer of the embedded
table and passed it to rb_id_table_insert(), whose buffer growth can run
a compacting GC. A shape's edge table is referenced only from the shape
tree, so nothing kep...
shugo (Shugo Maeda)
03:18 PM Ruby Revision 3aca4224 (git): Keep a lazy enumerator's proc entry pinned while its block runs
lazy_grep_iter_proc() and lazy_grep_v_iter_proc() read entry->proc
after calling pattern === value, which can run any Ruby code. The proc
entry is embedded in an object that only the procs array references, so
a compacting GC could move...
shugo (Shugo Maeda)
03:18 PM Ruby Revision 891973a9 (git): Keep a Ractor::Port pinned while Ractor#monitor copies it
ractor_monitor() copied *rp after an allocation that can run a
compacting GC, and used rp again after taking the ractor lock. The port
is embedded and the argument is dead once the pointer is taken, so
nothing kept the port in place.
S...
shugo (Shugo Maeda)
03:18 PM Ruby Revision 4c28391b (git): Keep a Monitor pinned while Monitor#enter blocks on its mutex
monitor_enter0() writes the owner and count after do_mutex_lock(),
which may block with the GVL released. The monitor was stored only in
a stack struct field that nothing read, which the compiler may drop, so
nothing was guaranteed to k...
shugo (Shugo Maeda)
02:31 PM Ruby Revision e45f082e (git): Keep the refinement call cache set pinned while inserting into it
dd7be7ce69 re-read the embedded data pointer of vm->cc_refinement_set
after the realloc that may move the set. Keep the set on the stack
with RB_GC_GUARD instead, as id_table.c does for managed id tables, so
that the pointer stays valid...
shugo (Shugo Maeda)
11:54 AM Ruby Bug #22397 (Closed): Memory corruption in rb_vm_insert_cc_refinement under compacting GC
Applied in changeset commit:git|dd7be7ce695a118104c132c5aec917884fc1974b.
----------
Re-read the refinement call cache set after growing it
rb_vm_insert_cc_refinement() kept a pointer into the embedded data of
vm->cc_refinement_set acr...
shugo (Shugo Maeda)
11:53 AM Ruby Revision dd7be7ce (git): Re-read the refinement call cache set after growing it
rb_vm_insert_cc_refinement() kept a pointer into the embedded data of
vm->cc_refinement_set across the realloc of its entries. Under
GC.stress, ruby_xrealloc2_sized() runs a GC first, and when that GC
compacts and moves the set, the new...
shugo (Shugo Maeda)

Also available in: Atom