Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3023 commits
Select commit Hold shift + click to select a range
d809920
Merge perf/resume1: -X:JITResume, stage 1 of Docs/jit-resume-deopt.md
claude Nov 16, 2026
d4a9724
JIT: a subclass's `private :x' applies to a compiled attribute access
claude Nov 16, 2026
c062810
perf ledger: round eleven (-X:JITResume stage 1), and the gate's new …
claude Nov 16, 2026
6197f6a
bench: shapes for stage 2 of the resume design (calls from a compiled…
claude Nov 16, 2026
fa69240
perf ledger: round twelve, stage 2 of the resume design tried as "tai…
claude Nov 16, 2026
aaba463
JIT: direct calls between compiled methods on by default (-X:NoJITCalls)
claude Nov 16, 2026
fd13114
Merge perf/calls: direct calls between compiled methods on by default
claude Nov 16, 2026
4570876
perf ledger: round thirteen, direct calls between compiled methods on…
claude Nov 16, 2026
48499b1
perf: awfy.rb --whole runs Havlak too, the fourteenth AWFY benchmark
claude Nov 16, 2026
122581c
JIT: String#length and #size in typed bodies
claude Nov 16, 2026
079d660
JIT: Integer#abs and Float#abs in typed bodies
claude Nov 16, 2026
04c9d48
JIT: `v == nil' and `v != nil' on an Array or a Hash in typed bodies
claude Nov 16, 2026
c2747ab
perf ledger: logged instance-variable and attribute stores tried and …
claude Nov 16, 2026
4ce34fe
IronRuby.Tests: JitCore tests without the prelude's String#b and Floa…
claude Nov 16, 2026
7503ea0
Run a core iterator's nested literal block in place inside an outline…
claude Nov 16, 2026
7a0a194
JIT: read `!=' visibility through the lookup; leave `v.abs' on an obj…
claude Nov 17, 2026
47d030b
Nested iterator copy: no global stores beside it, and recheck the ite…
claude Nov 17, 2026
c256bd7
Merge perf/nest: a core iterator's nested literal block runs in place…
claude Nov 17, 2026
8081395
Merge perf/core: String#length/size, abs and `== nil` on a collection…
claude Nov 17, 2026
87bb0b5
perf ledger: round fourteen, nested block loops and core operations i…
claude Nov 17, 2026
d03fe1e
Compile a constant whose value is nil in the method JIT
claude Nov 17, 2026
3e8a7bc
Check the method version at every compiled loop iteration, not only o…
claude Nov 17, 2026
3a52d16
Matrix rows and a test for a loop that meets a redefinition while it …
claude Nov 17, 2026
59828ec
Bump the code epoch once per method table update, not once per class
claude Nov 17, 2026
826c652
Keep the code epoch in the low half of the safe-point word
claude Nov 17, 2026
2b7faaf
Move the code epoch only when a compiled loop can be stale
claude Nov 17, 2026
d338750
Merge perf/core2 into perf/safept: the JIT matrix's two new sections
claude Nov 17, 2026
a8d443c
An autoload's file assigning its constant does not move the code epoch
claude Nov 17, 2026
29aed06
Merge perf/core2: a constant whose value is nil in the method JIT
claude Nov 17, 2026
ea86fa3
Merge perf/safept: a compiled loop that is running sees a method rede…
claude Nov 17, 2026
cd0d906
perf ledger: round fifteen, nil constants and loops that see a redefi…
claude Nov 17, 2026
f4b3865
Make a module's dependent-class lookup constant time (extend no longe…
claude Nov 17, 2026
31612b1
Lessons from Benoit Daloze's papers, blog and talks, and two gaps the…
claude Nov 17, 2026
1d918af
Shapes for Float, Integer and object instance variables
claude Nov 17, 2026
272826f
Notes on the ZJIT status post, its shapes measured here, and three gaps
claude Nov 17, 2026
eab962d
perf ledger: where Havlak's time goes, and Kernel#loop in C# not kept
claude Nov 17, 2026
d5685f4
WeakList: nothing is removed while the list is being enumerated
claude Nov 17, 2026
183f22b
Instance variable slots can hold a Float raw (FloatLocation)
claude Nov 17, 2026
75b4dc9
Typed code stores and reads Float instance variables raw
claude Nov 17, 2026
af94c4a
ivar-stress: Floats stored raw, flipped and moved between threads
claude Nov 17, 2026
91f0a03
Keep the boxing of a raw Float out of the inlined ivar read
claude Nov 17, 2026
8e84423
Merge perf/extend: extending an object no longer searches every objec…
claude Nov 17, 2026
c791ce6
perf ledger: round sixteen, extend in constant time
claude Nov 17, 2026
768a7c9
Merge branch 'claude/vibrant-fermi-vot97g' into perf/unboxed
claude Nov 17, 2026
e4d40b7
ivar-stress: the Float section starts its variables at their owners' …
claude Nov 17, 2026
3302b91
A Float's object_id is CRuby's flonum id where CRuby has a flonum
claude Nov 17, 2026
07c4c28
Float locations only in raw shapes; promotion by a Move
claude Nov 17, 2026
91c93e0
Promoted classes' new instances are born raw; second-shape typed paths
claude Nov 17, 2026
40cf009
Born raw only by its own class; promotion part of ivar-stress
claude Nov 17, 2026
ad2f022
ivar-stress: the promotion count only where the build has one
claude Nov 17, 2026
bb52e71
perf tools: all fourteen Are-We-Fast-Yet benchmarks by default, on CR…
claude Nov 17, 2026
56c082e
Generic cached ivar reads compare with the entry's plain shape only
claude Nov 17, 2026
913e9fa
Typed Float reads: small inlined part, Speculate reads, raw second sh…
claude Nov 17, 2026
6441c61
Typed Float reads inline without an out parameter
claude Nov 17, 2026
676de2d
Cached ivar reads of a raw object stay inline, after the plain compare
claude Nov 17, 2026
6304f81
The raw object's cached read goes back out of line
claude Nov 17, 2026
128306e
Float ivars: the typed read tests the box first, the site entry keeps…
claude Nov 17, 2026
b0bbefe
Array#dig steps into the next level without two helpers that make a s…
Largo Nov 17, 2026
991add2
perf-core: what keeps a method out of light frames that why does not …
Largo Nov 17, 2026
59e8c3f
Merge perf/dig: Array#dig without two helpers that make a scope
Largo Nov 17, 2026
9345cd7
perf ledger: Array#dig landed (perf/dig)
Largo Nov 17, 2026
36c5856
Float ivars: a raw object's generic read is taken where it lands
claude Nov 17, 2026
ccc3608
Array#sum with a block adds its values itself, as MRI's ary_sum does
Largo Nov 17, 2026
2adc61c
Merge perf/sum: Array#sum with a block adds its values itself
Largo Nov 17, 2026
ba51846
Array#sum keeps the call without a block as small as it was
Largo Nov 17, 2026
40dd77e
perf ledger: Array#sum with a block landed (perf/sum)
Largo Nov 17, 2026
d5161d0
perf-core: count with succ, keep rare paths out of the common method
Largo Nov 17, 2026
a52c750
Kernel#String answers a String without the scope its other paths need
Largo Nov 17, 2026
b92f3b0
Merge perf/string: Kernel#String answers a String without a scope
Largo Nov 17, 2026
077348f
perf ledger and perf-core: Kernel#String landed; a scope is paid for …
Largo Nov 17, 2026
02d9beb
Array#to_h walks its indices and checks each pair as MRI's rb_ary_to_…
Largo Nov 18, 2026
a86cd81
Merge perf/toh: Array#to_h as MRI's rb_ary_to_h
Largo Nov 18, 2026
db95ade
perf ledger: Array#to_h landed; {} keeps a method out of light frames
Largo Nov 18, 2026
63f19fc
Float ivars: the inlined cached read takes a raw object too
claude Nov 18, 2026
e7f1bfa
min_by and max_by take their count without a rest Array, and walk an …
Largo Nov 18, 2026
1a43507
perf-core: walk the receiver the way CRuby's method does
Largo Nov 18, 2026
2ac8375
Merge perf/minby: min_by and max_by without a rest Array or a splat b…
Largo Nov 18, 2026
d3ce481
perf ledger: min_by and max_by landed (perf/minby)
Largo Nov 18, 2026
0a8c380
Float ivars: the inlined read stays as it was; a raw object's is one …
claude Nov 18, 2026
92fd4bd
min_by(n) and max_by(n) of an Array sort through the C# sort_by
Largo Nov 18, 2026
6cf7489
Merge perf/minbyn: min_by(n) and max_by(n) of an Array through the C#…
Largo Nov 18, 2026
b61d318
perf ledger and perf-core: min_by(n) landed; reuse a C# method under …
Largo Nov 18, 2026
22ea351
Array#take_while and #drop_while are Array's own, as in MRI
Largo Nov 18, 2026
b24149b
Merge perf/tw: Array#take_while and #drop_while as in MRI
Largo Nov 18, 2026
a963ca3
perf ledger: take_while/drop_while landed; send with a String name sh…
Largo Nov 18, 2026
8f080a6
flat_map of an Array takes one value per element and checks it as MRI…
Largo Nov 18, 2026
3ed23ba
Merge perf/fm: flat_map of an Array as MRI's flat_map_i
Largo Nov 18, 2026
c59b573
perf ledger: flat_map landed (perf/fm)
Largo Nov 18, 2026
e449118
Array#uniq with a block is MRI's rb_ary_uniq: no block call for one e…
Largo Nov 18, 2026
a5f2846
Merge perf/uniq: Array#uniq with a block as MRI's rb_ary_uniq
Largo Nov 18, 2026
3b134e6
perf ledger: Array#uniq with a block (perf/uniq)
Largo Nov 18, 2026
a7060a2
Merge perf/unboxed: Float instance variables updated by typed code ar…
claude Nov 18, 2026
1bb9364
filter_map of an Array takes one value per element
Largo Nov 18, 2026
37d941d
Merge perf/fmap: filter_map of an Array with a one-value block
Largo Nov 18, 2026
82c7b11
perf ledger: filter_map landed (perf/fmap)
Largo Nov 18, 2026
1dc7041
perf ledger: Enumerable#sum's block_given? hoist rejected; /perf-core…
Largo Nov 18, 2026
67313c8
perf ledger: round sixteen's raw Float ivars landed, numbers at a7060a27
claude Nov 18, 2026
d4f4446
Prelude index loops read Array's storage; min_by(n) keeps #each
Largo Nov 18, 2026
d4fc067
Merge pull request #228 from Largo/perf-core-loop
Largo Nov 18, 2026
fd765a2
perf ledger: round seventeen's experiment on gap 1 is in progress
claude Nov 18, 2026
53cb7e5
perf-gate: start-up is timed on gem and irb too, not only on -e 1
claude Nov 18, 2026
321043e
perf ledger: start-up is a gap of its own; the gate times it on the h…
claude Nov 18, 2026
67d633b
Method JIT: hold self's instance variable writes back to the end of a…
claude Nov 18, 2026
770ce19
IronRuby.Tests: JitCore_SunkStores1, Json's read with its writes held…
claude Nov 18, 2026
9cffd6a
Method JIT: a body whose value is its last held-back write answers th…
claude Nov 18, 2026
77dc13e
Method JIT: the store of held-back writes is the first write's deopt,…
claude Nov 18, 2026
42882e0
Method JIT: held-back writes add new variables in the order they ran
claude Nov 18, 2026
ee2d5cd
Method JIT: no held-back writes tried in a body with a loop; the revi…
claude Nov 18, 2026
f1ef1ac
Method JIT: no order bookkeeping where the writes cannot run out of o…
claude Nov 18, 2026
556e4ae
sum from a Float initial value follows CRuby 4.0's init_is_float
Largo Nov 18, 2026
e321b21
Method JIT: no held-back writes with keyword or optional parameters; …
claude Nov 18, 2026
e25dea5
ab.rb -i: instructions per call, which a busy machine does not move
Largo Nov 18, 2026
99ad3bf
perf skills: count instructions first, and one gate per branch after …
Largo Nov 18, 2026
d064caf
Merge perf/jread: a typed body holds its writes to self's instance va…
claude Nov 18, 2026
bcbb535
Merge pull request #229 from Largo/sum-float-init
Largo Nov 18, 2026
6f148e6
The instruction counter is pinned, and a lost counter gives no count …
Largo Nov 18, 2026
3db6f16
perf skills: an equal instruction count rejects only a change meant t…
Largo Nov 18, 2026
80d46b8
Merge pull request #230 from Largo/perf-instructions
Largo Nov 18, 2026
ef5f019
perf ledger: round seventeen's held-back writes landed, numbers at d0…
claude Nov 18, 2026
b81424a
perf ledger: round eighteen's experiment on gap 1 is in progress
claude Nov 18, 2026
8d092e7
Method JIT: hold back writes of one instance variable written as an I…
claude Nov 18, 2026
011e476
Shapes and a test for held-back writes of a variable in two integer t…
claude Nov 18, 2026
dabd54d
Light frames take a call that passes the method's block on
Largo Nov 18, 2026
3da83b6
perf ledger: a passed block no longer keeps a method out of light frames
Largo Nov 18, 2026
c3cb833
Held-back writes: the widening rounds are one per variable, and the c…
claude Nov 18, 2026
981d270
Merge perf/bounce: a held-back instance variable may be written as an…
claude Nov 18, 2026
b1c8be2
A copy of a method's block Proc is not a literal block either
Largo Nov 18, 2026
80699c2
Merge pull request #231 from Largo/perf-blockpass
Largo Nov 18, 2026
7e72e9d
perf ledger: round eighteen's Int-and-Long held writes landed, number…
claude Nov 18, 2026
d9fd281
perf ledger: where the three benchmarks slower than CRuby spend their…
claude Nov 18, 2026
0f4f0cf
Method JIT: a raise in a typed body is a deopt
claude Nov 18, 2026
5164689
Method JIT: time generic calls that raise, so a body that always deop…
claude Nov 18, 2026
6eb8fa6
Light frames take a call that passes a splatted value on
Largo Nov 18, 2026
27740d5
A census of what the JIT and the light frames make of every method, w…
Largo Nov 18, 2026
ed6ca82
perf-step judges a change by the census and leaves the tests to the gate
Largo Nov 18, 2026
32698c1
core-small: strip, lstrip and rstrip shapes
Largo Nov 18, 2026
060b63e
Merge pull request #232 from Largo/jit-census
Largo Nov 18, 2026
6fb3e3d
Merge branch 'master' into perf/splat
Largo Nov 19, 2026
3081699
Merge perf/raise: a raise in a typed body is a deopt
claude Nov 19, 2026
273d629
Merge branch 'perf/splat': light frames take a call that passes a spl…
Largo Nov 19, 2026
e1e4a1d
perf ledger: a splat passed on no longer keeps a method out of light …
Largo Nov 19, 2026
3825776
perf ledger: round nineteen's raise-as-deopt landed, numbers at 3081699d
claude Nov 19, 2026
ed4122b
perf ledger: round twenty measured the garbage collector's settings a…
claude Nov 19, 2026
fd9a8c2
perf ledger: round twenty-one's experiment on gap 13 is in progress
claude Nov 19, 2026
271c373
Park the scope of a method whose literal blocks reuse their Procs
claude Nov 19, 2026
ac8a79c
Parked scopes: hold nothing of the last call, cost nothing where they…
claude Nov 19, 2026
55485f9
Parked scopes: no slot for a literal given to an iterator that never …
claude Nov 19, 2026
c2f4608
Light frames take a method that interpolates
Largo Nov 19, 2026
9e47cfc
Merge branch 'perf/interp': light frames take a method that interpolates
Largo Nov 19, 2026
2bbdde5
perf ledger: an interpolation no longer keeps a method out of light f…
Largo Nov 19, 2026
0e78b9f
Merge pull request #233 from Largo/perf-splat
Largo Nov 19, 2026
302be1f
Merge master (perf-splat, #233) into the session branch
Largo Nov 19, 2026
434e3dc
perf ledger: name the commit of perf/splat's merged-build numbers
Largo Nov 19, 2026
74c188e
Merge master into claude/vibrant-fermi-vot97g
claude Nov 19, 2026
8eb61cd
Merge claude/vibrant-fermi-vot97g (with master) into perf/park
claude Nov 19, 2026
2baa009
Merge perf/park: a method keeps its scope and the Procs of its litera…
claude Nov 19, 2026
c79a3ed
perf ledger: rounds twenty and twenty-one, numbers at 2baa0099
claude Nov 19, 2026
ebe601b
perf ledger: perf/interp gated and measured; numbers at 434e3dcc
Largo Nov 19, 2026
a169b27
census: answer the screen's question about a call on self as -X:JITCa…
claude Nov 19, 2026
1d4b770
jit-construct-matrix: probes for Array.new mid-body
claude Nov 19, 2026
15bab30
JIT: take Array.new(n, v) anywhere in a method body
claude Nov 19, 2026
23fe949
JIT matrices: probes for Array.new sizes, SizeOf with held writes, gu…
claude Nov 19, 2026
441d1da
JIT: Array.new of Int64 and object sizes, SizeOf under held writes, g…
claude Nov 19, 2026
e2b2896
Merge pull request #234 from Largo/perf-interp
Largo Nov 19, 2026
a6ea753
perf ledger: gap 1 cites the ratios of the current micro table
Largo Nov 19, 2026
c5b5b96
Merge perf/arrnew: Array.new anywhere in a body the method JIT compiles
claude Nov 19, 2026
b188758
perf ledger: round twenty-two (Array.new in typed bodies) and the cen…
claude Nov 19, 2026
da4a82f
Release 4.0.6
Largo Nov 19, 2026
cb14302
build-capi.sh: sort and compare in the C locale
Largo Nov 19, 2026
5a24660
Release archives ship the C API's libironruby-capi
Largo Nov 19, 2026
fb881a8
README: mkmf compiles where the C API is; ledger: gap 1 in order (rev…
Largo Nov 19, 2026
46db830
perf ledger: round twenty-three rejected (is_a? in typed bodies); its…
claude Nov 19, 2026
22f2f73
Merge pull request #236 from Largo/release-capi
Largo Nov 19, 2026
0ba3d65
Merge pull request #235 from Largo/release/v4.0.6
Largo Nov 19, 2026
497da68
4.0.6 notes and README: the Linux and Windows downloads carry the C API
Largo Nov 19, 2026
6bac932
census: name every refusal of the screen in a method, and count what …
claude Nov 19, 2026
666cf06
jit-scan-matrix: probes for @x ||= v, @x &&= v and the same on a local
claude Nov 19, 2026
f5601af
perf ledger: Kernel.raise as a deopt rejected (round twenty-four); it…
claude Nov 19, 2026
7fb0cbc
Merge pull request #237 from Largo/release-notes-capi
Largo Nov 19, 2026
dfe1eb5
JIT: compile @x ||= v, @x &&= v and the same on a local of the method
claude Nov 19, 2026
92bb385
Merge perf/orasgn: @x ||= v and @x &&= v in a body the method JIT com…
claude Nov 19, 2026
356c08a
perf ledger: round twenty-four (||= in typed bodies landed), and gap 29
claude Nov 19, 2026
3bbe4fd
perf ledger: correct a count in gap 29
claude Nov 19, 2026
87f4e9b
jit-const-matrix: probes for typed bodies that folded constants
claude Nov 19, 2026
0354b60
Method JIT: look folded constants up again when only the constant ver…
claude Nov 19, 2026
093c7e1
Merge perf/constrev: a typed body looks its constants up again when t…
claude Nov 19, 2026
d1a738c
perf ledger: round twenty-five (constants looked up again), gap 29 mo…
claude Nov 19, 2026
c99c2ef
perf ledger: the gate's correctness half for rounds twenty-two to twe…
claude Nov 19, 2026
401d5bc
perf ledger: numbers at c99c2ef6, the timing half for rounds twenty-t…
claude Nov 19, 2026
1b46b1d
perf ledger: mark rounds twenty-two to twenty-five as gated and measured
claude Nov 19, 2026
91728c2
Util/bench/app-shapes.rb and census.rb -u: ordinary Ruby to measure, …
claude Nov 19, 2026
550d838
Merge perf/apps: a benchmark of ordinary Ruby, and the census of the …
claude Nov 19, 2026
28e753a
perf ledger: the first table of ordinary Ruby, and gaps 30 to 32
claude Nov 19, 2026
5310f5f
Util/binding-lvar-matrix.rb: probes for Binding's local variable methods
claude Nov 19, 2026
3820abf
Binding#local_variable_get/_set/_defined? and #local_variables withou…
claude Nov 19, 2026
54a62c4
release.yml: a cancelled macOS package no longer keeps the release fr…
Largo Nov 19, 2026
dc147d3
Merge master (Release 4.0.6, perf/interp, the C API in the release ar…
claude Nov 19, 2026
987f853
release.yml: check the required archives by their exact names
Largo Nov 19, 2026
084b09c
Merge pull request #238 from Largo/release-publish-without-macos
Largo Nov 19, 2026
0624caf
RUBY_VERSION 4.0.10: IronRuby matches CRuby 4.0.10
Largo Nov 19, 2026
809d195
C API: ruby.h compiles as C++ (rb_ir_abi_version has external linkage)
Largo Nov 19, 2026
508f543
Merge perf/bindlv: Binding#local_variable_get/_set/_defined? and #loc…
claude Nov 19, 2026
2172d69
C API: $~ and $_ are the calling frame's; rb_Hash, rb_Rational, rb_Co…
Largo Nov 19, 2026
17c6cf9
perf ledger: round twenty-eight (Binding's local variable methods wit…
claude Nov 19, 2026
3176e59
C API: rb_io_t for GetOpenFile, IO waits, fd sets and cloexec helpers
Largo Nov 19, 2026
0313657
Park only a literal block of the method's own scope, not one in a cla…
claude Nov 19, 2026
9a6d34c
Method JIT: no ||= or &&= on a local the compiler has no binding for
claude Nov 19, 2026
ae4a7eb
`using` in an eval through a binding's own scope activates at the bin…
claude Nov 19, 2026
268fe84
true's object_id is MRI's 20, no longer the flonum 2.0's
claude Nov 19, 2026
64420a9
osr-array-matrix: a failed redefinition ends the loop instead of hang…
claude Nov 19, 2026
35fd70f
binding-lvar-matrix: `using` through a binding and its copies
claude Nov 19, 2026
e4ed67d
C API: keyword calls, $! in rb_rescue/rb_ensure, rb_get_kwargs, small…
Largo Nov 19, 2026
9de7160
binding-lvar-matrix: `using` through a Binding#dup itself
claude Nov 19, 2026
be6309f
Keep the cause of a C#-raised error in a rescue clause once the metho…
Largo Nov 19, 2026
052c323
C API: C globals follow $stdout/$/, constants, errinfo, symbols, Data
Largo Nov 19, 2026
c72df4a
C API: encodings beyond ASCII and UTF-8
Largo Nov 19, 2026
105f991
C API: st tables
Largo Nov 19, 2026
ecce37b
C API: methods of rb_f_notimplement are denied by respond_to?
Largo Nov 19, 2026
82ecf3f
C API: enumerator sizes, rb_check_type on typed data, autoloads, Froz…
Largo Nov 19, 2026
5b5eaf0
Merge pull request #239 from Largo/claude/vibrant-fermi-vot97g
Largo Nov 20, 2026
665f04c
Merge pull request #241 from Largo/capi-cxx
Largo Nov 20, 2026
41b6b0b
Merge pull request #242 from Largo/capi-batch1
Largo Nov 20, 2026
a5485a3
Merge pull request #243 from Largo/capi-batch2
Largo Nov 20, 2026
15b6183
Merge pull request #244 from Largo/capi-batch3
Largo Nov 20, 2026
775ea4d
Merge pull request #246 from Largo/capi-batch4
Largo Nov 20, 2026
42e4fa2
Merge pull request #247 from Largo/capi-batch5
Largo Nov 20, 2026
22896e2
Merge pull request #248 from Largo/capi-batch6
Largo Nov 20, 2026
e79b81c
wasm browser test: accept any RUBY_VERSION in the puts check
Largo Nov 20, 2026
8aa52a5
Merge pull request #240 from Largo/ruby-4.0.10
Largo Nov 20, 2026
d069ea2
C API: TracePoint, debug inspector and the last loose ends
Largo Nov 20, 2026
e028316
C API: digest plugins (ruby/digest.h)
Largo Nov 20, 2026
3bb6757
Merge remote-tracking branch 'origin/master' into capi-batch7
Largo Nov 20, 2026
ac4bf3e
Merge pull request #249 from Largo/capi-batch7
Largo Nov 20, 2026
08e0165
Merge pull request #245 from Largo/fix/clause-cause-compiled
Largo Nov 20, 2026
c992624
C API: ractor.h and the functions real gems reach for first
Largo Nov 20, 2026
8480b29
Allow undefining initialize, as CRuby does
Largo Nov 20, 2026
d7ee79b
RubyGems: native gems' extensions win over IronRuby's own
Largo Nov 20, 2026
1938e51
Merge pull request #250 from Largo/capi-gems
Largo Nov 20, 2026
df2bb0b
undef reports its own line
Largo Nov 20, 2026
4c50e8f
Undefining, removing and redefining core methods warn as in CRuby
Largo Nov 20, 2026
3d5c0fd
C API: Ractor-local storage across threads, a per-process hash seed
Largo Nov 20, 2026
e03c42a
One helper for the shims that defer to a native gem
Largo Nov 20, 2026
2fdcf31
Util/capi/selftest: the C API functions real gems use, checked agains…
Largo Nov 20, 2026
1ac98ca
RbConfig: system triplets, binutils and install directories, as CRuby's
Largo Nov 20, 2026
53bb8f7
No "redefining" warning for a visibility change of an own method
Largo Nov 20, 2026
c731085
C API: release and acquire on every Ractor-local store, not only the …
Largo Nov 20, 2026
8df261b
Merge pull request #251 from Largo/capi-gems-review
Largo Nov 20, 2026
0570d33
Merge remote-tracking branch 'origin/master' into rbconfig-triplets
Largo Nov 20, 2026
81a68d0
C API README: the second batch of gems tried, nokogiri among them
Largo Nov 20, 2026
1522386
Merge pull request #252 from Largo/rbconfig-triplets
Largo Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
96 changes: 96 additions & 0 deletions .claude/hooks/session-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/bin/bash
# SessionStart hook for Claude Code cloud sessions (claude.ai/code).
#
# Prepares what building IronRuby needs next to the checkout, as .github/workflows/ci.yml
# does: ../dlr at DLR_REF with Build/dlr-patches applied, ../prism at PRISM_REF with
# libprism built, and the native libraries for markly and rbs. The system toolchain
# (.NET 11 SDK + .NET 10 runtime, Ruby 4) comes from the environment's setup script.
#
# Each step leaves a stamp in the directory it fills and runs again only when the stamp no
# longer matches (a new ref or patch in ci.yml, a changed build script, a new container).
set -euo pipefail

if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
exit 0
fi

SELF=$(readlink -f "$0")
IR="${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "$0")/../.." && pwd)}"
PARENT=$(dirname "$IR")
DLR="$PARENT/dlr"
PRISM="$PARENT/prism"
cd "$IR"

ci_env() { sed -n "s/^ *$1: *//p" .github/workflows/ci.yml | head -n 1; }
DLR_REF=$(ci_env DLR_REF)
PRISM_REF=$(ci_env PRISM_REF)
[ -n "$DLR_REF" ] && [ -n "$PRISM_REF" ] || { echo "session-start: no DLR_REF/PRISM_REF in ci.yml" >&2; exit 1; }

# fresh <file> <inputs...>: succeeds when <file> holds the hash of the inputs and this script;
# stamp <file> <inputs...> writes it.
digest() { { printf '%s\n' "$@"; cat "$SELF"; } | sha256sum | cut -d' ' -f1; }
fresh() { local f=$1; shift; [ -f "$f" ] && [ "$(cat "$f")" = "$(digest "$@")" ]; }
stamp() { local f=$1; shift; digest "$@" > "$f"; }

# Check out <dir> at <ref> of <url>, fetching just that commit.
checkout() {
local dir=$1 url=$2 ref=$3
[ -d "$dir/.git" ] || git init -q "$dir"
if ! git -C "$dir" cat-file -e "$ref^{commit}" 2>/dev/null; then
git -C "$dir" fetch -q --depth 1 "$url" "$ref"
fi
git -C "$dir" checkout -q -f --detach "$ref"
git -C "$dir" clean -q -fdx
}

# --- Ruby 4 as `ruby` (fallback if the setup script did not relink /usr/local/bin) -------
if [ -x /opt/ruby-4/bin/ruby ] && ! ruby -e 'exit RUBY_VERSION.start_with?("4.")' 2>/dev/null; then
for exe in /opt/ruby-4/bin/*; do ln -sfn "$exe" "/usr/local/bin/$(basename "$exe")"; done
hash -r
fi

# --- DLR -----------------------------------------------------------------------------------
dlr_inputs=("$DLR_REF" "$(cat Build/dlr-patches/*.patch | sha256sum)")
if ! fresh "$DLR/.session-start.sha256" "${dlr_inputs[@]}"; then
echo "session-start: DLR at $DLR_REF"
checkout "$DLR" https://github.com/IronLanguages/dlr "$DLR_REF"
for p in Build/dlr-patches/*.patch; do git -C "$DLR" apply "$IR/$p"; done
stamp "$DLR/.session-start.sha256" "${dlr_inputs[@]}"
# the stamp is inside the checkout: keep it out of the DLR's git status
echo ".session-start.sha256" >> "$DLR/.git/info/exclude"
fi

# --- prism / libprism ------------------------------------------------------------------------
if ! fresh "$PRISM/build/.session-start.sha256" "$PRISM_REF" || [ ! -f "$PRISM/build/libprism.so" ]; then
echo "session-start: prism at $PRISM_REF"
checkout "$PRISM" https://github.com/ruby/prism "$PRISM_REF"
(cd "$PRISM" && ruby templates/template.rb && make shared -j"$(nproc)")
stamp "$PRISM/build/.session-start.sha256" "$PRISM_REF"
fi

# --- markly (cmark-gfm) and librbs -----------------------------------------------------------
markly_out=Src/Libraries/Markly/native/build
markly_inputs=("$(cat Util/build-markly.sh $(find Src/Libraries/Markly/native -maxdepth 1 -type f | sort) | sha256sum)")
if ! fresh "$markly_out/.session-start.sha256" "${markly_inputs[@]}"; then
echo "session-start: building libmarkly_cmark"
bash Util/build-markly.sh
stamp "$markly_out/.session-start.sha256" "${markly_inputs[@]}"
fi

rbs_out=Src/Libraries/Rbs/native/build
rbs_inputs=("$(cat Util/build-librbs.sh $(find Src/Libraries/Rbs/native -maxdepth 1 -type f | sort) | sha256sum)")
if ! fresh "$rbs_out/.session-start.sha256" "${rbs_inputs[@]}"; then
echo "session-start: building librbs"
bash Util/build-librbs.sh
stamp "$rbs_out/.session-start.sha256" "${rbs_inputs[@]}"
fi

# --- Session environment ---------------------------------------------------------------------
if [ -n "${CLAUDE_ENV_FILE:-}" ]; then
# Apphosts (ironruby, ir) find the runtime through DOTNET_ROOT; point it at the real install.
dotnet_root=$(dirname "$(readlink -f "$(command -v dotnet)")")
{
echo "export DOTNET_ROOT=\"$dotnet_root\""
echo "export DLR_SOURCE_DIR=\"$DLR/src/core\""
} >> "$CLAUDE_ENV_FILE"
fi
14 changes: 14 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh"
}
]
}
]
}
}
193 changes: 193 additions & 0 deletions .claude/skills/perf-ab/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
---
name: perf-ab
description: Tell whether one IronRuby build is faster than another on small shapes (a core method call, a kind of method entry, a guard) where the difference is 10-30% and the machine is shared - alternating runs, pinned to idle CPUs, on-CPU time, a checksum per shape, and a spread that says when a difference is only noise; and, for the first look and for a machine that is busy with a sweep or a build, instructions per call (`ab.rb -i`), which are steady to parts in a thousand where time is not. Use whenever a perf change needs a before/after number, when a benchmark line "looks slower" or "looks faster" and you are about to believe it, when asked "is this actually faster than master?", and from /perf-core and /perf-frame for their measurements. Not for the AWFY table or the ledger's numbers (/perf-measure) or for whether a change is safe (/perf-gate).
---

# Is it faster? A/B on small shapes

A change to how a method is entered moves a call by 50-100 ns out of 300. On this kind of
machine the same binary measures 10-15% apart from one process to the next, so a single
before/after pair proves nothing either way. `Util/perf/ab.rb` is the tool; this skill is how
to use it and how to read it.

Count instructions first (step 7, `ab.rb -i`): it takes two rounds, needs no quiet machine,
and says whether the change did anything to the shape at all. Time (steps 2 to 4) is for
the number that is reported, once, when the count has moved.

Arguments: the two trees and the shapes. In `/perf-step`, `/perf-core` and `/perf-frame`
the baseline is this checkout and the candidate `../wt-NAME`. For "is my branch faster
than master?" it is the other way round: this checkout is the candidate, and master is a
worktree you make for the purpose (`../wt-base`, below).

## 1. Two builds whose sources you know

Both Release, both built from a clean tree just now (`git status --short` prints nothing;
`set -o pipefail` if the build's output is piped). The binaries do not say which commit
they are. A Debug build is 1.8x slower and inlines nothing: never measure one.

A baseline other than this checkout is a worktree at the commit to compare with:

```sh
git worktree add --detach ../wt-base <commit> # then build it like any tree
ln -s "$PWD/spec" ../wt-base/spec; ln -s "$PWD/mspec" ../wt-base/mspec # only if specs will run there
```

Build the two one after the other, not at once, unless each has its own DLR copy
(`Util/perf/worktree.sh` makes one): trees sharing a DLR checkout share its `obj/`. Do not
run `dotnet build-server shutdown`: it ends other sessions' builds.

## 2. Run

```sh
ruby Util/perf/ab.rb -r 4 Util/bench/prelude-cost.rb cruby=ruby \
"base=env IR_CONFIG=Release ./ir.sh" "new=env IR_CONFIG=Release ../wt-NAME/ir.sh" -- g_bg n_splat
```

- The shape files: `Util/bench/prelude-cost.rb` (a core method in C# against the same in
Ruby, the parts of a Ruby iterator, openings, wrappers) and `Util/bench/core-small.rb`
(67 core methods on four elements). `ruby FILE --list` prints a file's shape names.
`Util/perf/micro.rb` (calls, ivars, yields, loops) is read too, but it times wall
clock, prints no checksum and has no `N`: use it for a hint, not a decision.
- Name the shapes after `--`; the rows come in that order. A shape costs about 5 s per
interpreter per round at the default count, so three shapes, three interpreters and
four rounds are about three minutes. A whole file (67-96 shapes) is about 6-8 minutes
per interpreter per round: for finding what moved that nobody expected, once, at the
end, with `-r 2`.
- Rounds: `-r 1` is a survey (no spread is shown, because there is none to show), `-r 4`
for a decision, `-r 6` for a shape whose cells overlap.
- CRuby first: it is the scale, and its checksum is the right answer.
- Put the candidate last and the build to compare it with just before it: the last
column is last over the one before.

## 3. Read it

Master against the change that made `block_given?` and rest parameters cheaper, four
rounds (`-- g_bg n_splat e0`, 2026-11-15):

```
ns (spread %) cruby base new new/base
g_bg 76.0 (4) 272.0 (14) 207.6 (15) 0.76
n_splat 133.6 (3) 259.2 (12) 182.2 (11) 0.70
e0 56.7 (6) 171.3 (22) 169.9 (9) 0.99 overlap
```

- A cell is the least of its rounds; the number in brackets is how far the greatest was
above it. The last column is the two least values' ratio, and `overlap` when some round
of the slower build beat some round of the faster one.
- `g_bg`: the slowest round of `new` (207.6 x 1.15 = 239) was faster than the fastest of
`base` (272): shown. `e0`, which the change does not touch, overlaps, as it should: it
is the run's own noise, here up to 22% on one build. A row the change was meant to move
that says `overlap` has **not** shown it, whatever its ratio. Run it alone with `-r 6`,
and with the third arm (step 4).
- Some shapes are bimodal: a process lands on 300 ns or on 380, whichever build it is. It
looks like a regression in every table it appears in. The test is the same: alone, six
rounds, and see whether the two sets of numbers overlap.
- `VALUE DIFFERS` is a wrong answer. Stop measuring and find it.
- A shape that was not supposed to move and did, both ways, in the same table: that is the
size of the noise in this run. Quote it next to the result.

## 4. The third arm

When the change has a switch (`IR_LIGHT_REST=0`, `-X:NoJIT`), run the candidate with the
switch off as one more interpreter:

```sh
ruby Util/perf/ab.rb -r 6 FILE "base=..." "off=env IR_LIGHT_REST=0 IR_CONFIG=Release ../wt-NAME/ir.sh" \
"new=env IR_CONFIG=Release ../wt-NAME/ir.sh" -- shape
```

`off` and `new` are one binary, so code layout and everything else the change did not
intend are the same in both. `new` against `off` isolates the switched change. `off`
against `base` shows every other difference the candidate build has: noise, and anything
else the branch changed, intended or not. A regression that `off` shows too is not the
switched change's - but it is still the candidate's, and is reported as one until a rerun
shows it is noise.

## 5. A shape of your own

Add it to the file it belongs in, in the candidate's worktree, and commit it with the
change, so that the next run has it; the baseline checkout stays clean. A probe you will
not keep goes into a scratch file outside the repository, written the same way:

- a method on `H` that makes the call and returns something to sum, and a `t("name", N) {
|n| i = 0; s = 0; while i < n; s += h.name; i += 1; end; s }` line. The sum is the
checksum: make it depend on what the call returns.
- Write the methods out. A method defined with `eval` or `define_method` costs 100-240 ns
more per call than the same `def`, which is more than what is being measured.
- Each timed section should take 100 ms or more: on-CPU time
(`/proc/thread-self/schedstat`) has a grain of 4 ms, so a 50 ns shape needs a count of
two million (`-n` sets it for every shape of the file; count x ns >= 100,000,000). A
short count shows as cells that are multiples of `4 ms / count` (20 ns at 200,000).
- A pair is `x` and `rb_x` (C# and Ruby), or the same shape with and without the one thing
in question (`g0` and `g_bg`): a difference between two lines of one process is steadier
than either line.

## 6. Report

The rows, with CRuby's column, the rounds, and the noise seen in this run: "0.76 of master
on `g_bg`, four rounds, no overlap; `e0`, untouched, 0.99 with spreads up to 22%" - not
"24% faster". A result from `-i` is reported as instructions, not as a speed-up.

## 7. Instructions instead of time (`-i`)

```sh
ruby Util/perf/ab.rb -i Util/bench/core-small.rb \
"base=env IR_CONFIG=Release ./ir.sh" "new=env IR_CONFIG=Release ../wt-NAME/ir.sh" -- each tap inject min_by flat_map
```

The shape files count the instructions of each timed section on the benchmark's own
thread (`Util/perf/instructions.rb`: the CPU's counter, through `perf_event_open`) and
`-i` shows the least section's instructions per call. A count does not depend on what
else is running. The same two builds in the same ten minutes, at a load of 3 to 4 on
eight CPUs (2026-11-18), by time with three rounds and by instructions with two:

```
ns (spread %) base new new/base
each 320.0 (65) 316.0 (70) 0.99 overlap
tap 264.0 (55) 212.0 (219) 0.80 overlap
inject 632.0 (58) 616.0 (3) 0.97 overlap
min_by 1008.0 (73) 1172.0 (52) 1.16 overlap
flat_map 1491.8 (66) 1328.0 (82) 0.89 overlap

instr (spread %) base new new/base
each 2989.3 (0.1) 2993.7 (0.0) 1.001
tap 2072.4 (0.2) 1915.1 (8.4) 0.924 overlap
inject 4698.6 (0.0) 4694.6 (0.1) 0.999 overlap
min_by 8333.1 (0.6) 8442.2 (0.1) 1.013
flat_map 11553.2 (0.2) 11404.5 (0.0) 0.987
```

- **When:** first, for every attempt, and whenever a sweep, a build or another session's
measurement is running. It pins nothing (the idle CPUs are left to whoever is timing)
and two rounds are its default.
- **What is noise:** one build against itself, two rounds, six shapes, gave 0.999 to
1.008, and the 1.008 came without `overlap`. So a ratio within 2% of 1 is nothing until
four rounds (`-r 4`) agree, and beyond that it is a difference in instructions.
- **Two states show plainly.** `tap` counts 1,915 or 2,072 in either build, whichever the
process lands on (the row above: `base` got the higher one twice, `new` one of each). A
cell whose spread is several percent, when its neighbours' are tenths, is such a shape:
`overlap` marks it, and more rounds give both builds their lower state.
- **Keep the file's count.** The sections must be long enough for the code to reach its
optimized state, as for time: at `-n 100000` `inject` counted 7,500 instead of 4,700 and
one build differed from itself by 6%; at `-n 300000` the counts were still not the ones
of a million.
- **It is not time.** A cache miss, a mispredicted branch or a longer dependency chain cost
time and no instructions; an allocation saved shows only as the allocation's own
instructions, not as the collections it would have caused elsewhere. Read it as a
filter:
- the shape the change was meant to move counts the same: the change took no work off
that path. Stop, without timing it, if taking work off was the point (a scope not
made, a helper not called, an argument not boxed). If what it was meant to save is
not instructions - a cache miss, a mispredicted branch, a collection that happens
elsewhere - the count cannot judge it either way: time it;
- it counts fewer: time it (step 2, `-r 4`, the third arm) when the machine is quiet,
and report that number;
- a shape the change was not meant to move counts the same: it has not moved, and need
not be timed. One that counts more is looked at as a slower line is (`/perf-gate`,
step 4).
- CRuby's column is its checksum and nothing more: one engine's instructions are not
another's. `VALUE DIFFERS` means what it means for time.
- It needs the counter: Linux on x86-64 or arm64, as root or with
`kernel.perf_event_paranoid` at 2 or less, and not in most containers; `ab.rb` says so
when the shape file printed no counts. `Util/perf/micro.rb` and the AWFY harness do not
count.
Loading