<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/zjit/src/lib.rs, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>ZJIT: Add standalone JSON implementation (#15162)</title>
<updated>2025-11-13T00:06:52+00:00</updated>
<author>
<name>Aiden Fox Ivey</name>
<email>aiden@aidenfoxivey.com</email>
</author>
<published>2025-11-13T00:06:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8f9b038df30d1ba8310de642a5884d34fbf60e1a'/>
<id>8f9b038df30d1ba8310de642a5884d34fbf60e1a</id>
<content type='text'>
I split this off from https://github.com/ruby/ruby/pull/14999 to land the JSON component earlier.

Iongraph's viewer is (as mentioned in the article above) a few notches above graphviz for viewing large CFGs. It also allows easily inspecting different compiler optimization passes and multiple functions in the same browser window. Since Spidermonkey is using this format, it may be beneficial to use it for our own JIT development.

The requirement for JSON is downstream from that of the Iongraph format. As for writing the implementation myself, ZJIT leans towards having fewer dependencies, so this is the preferred approach.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I split this off from https://github.com/ruby/ruby/pull/14999 to land the JSON component earlier.

Iongraph's viewer is (as mentioned in the article above) a few notches above graphviz for viewing large CFGs. It also allows easily inspecting different compiler optimization passes and multiple functions in the same browser window. Since Spidermonkey is using this format, it may be beneficial to use it for our own JIT development.

The requirement for JSON is downstream from that of the Iongraph format. As for writing the implementation myself, ZJIT leans towards having fewer dependencies, so this is the preferred approach.</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Carve out IseqPayload into a separate module (#15098)</title>
<updated>2025-11-07T16:54:21+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashi.kokubun@shopify.com</email>
</author>
<published>2025-11-07T16:54:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9bbe4b600b2bc2866561d095c3409589a214a358'/>
<id>9bbe4b600b2bc2866561d095c3409589a214a358</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Test disasm with insta (#14602)</title>
<updated>2025-09-19T14:08:13+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashi.kokubun@shopify.com</email>
</author>
<published>2025-09-19T14:08:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a54351f98ce68999ed798a68c8ea58c5abb71467'/>
<id>a54351f98ce68999ed798a68c8ea58c5abb71467</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Ensure `clippy` passes and silence unnecessary warnings (#14439)</title>
<updated>2025-09-03T21:45:54+00:00</updated>
<author>
<name>Aiden Fox Ivey</name>
<email>aiden.foxivey@shopify.com</email>
</author>
<published>2025-09-03T21:45:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a6d397e29c61030f130f8d83e6bfe6d99ebbae91'/>
<id>a6d397e29c61030f130f8d83e6bfe6d99ebbae91</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Profile type+shape distributions (#13901)</title>
<updated>2025-08-05T20:56:04+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>rubybugs@bernsteinbear.com</email>
</author>
<published>2025-08-05T20:56:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ef95e5ba3de65d42fe0e1d41519dcf05db11a4e8'/>
<id>ef95e5ba3de65d42fe0e1d41519dcf05db11a4e8</id>
<content type='text'>
ZJIT uses the interpreter to take type profiles of what objects pass through
the code. It stores a compressed record of the history per opcode for the
opcodes we select.

Before this change, we re-used the HIR Type data-structure, a shallow type
lattice, to store historical type information. This was quick for bringup but
is quite lossy as profiles go: we get one bit per built-in type seen, and if we
see a non-built-in type in addition, we end up with BasicObject. Not very
helpful. Additionally, it does not give us any notion of cardinality: how many
of each type did we see?

This change brings with it a much more interesting slice of type history: a
histogram. A Distribution holds a record of the top-N (where N is fixed at Ruby
compile-time) `(Class, ShapeId)` pairs and their counts. It also holds an
*other* count in case we see more than N pairs.

Using this distribution, we can make more informed decisions about when we
should use type information. We can determine if we are strictly monomorphic,
very nearly monomorphic, or something else. Maybe the call-site is polymorphic,
so we should have a polymorphic inline cache. Exciting stuff.

I also plumb this new distribution into the HIR part of the compilation
pipeline.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ZJIT uses the interpreter to take type profiles of what objects pass through
the code. It stores a compressed record of the history per opcode for the
opcodes we select.

Before this change, we re-used the HIR Type data-structure, a shallow type
lattice, to store historical type information. This was quick for bringup but
is quite lossy as profiles go: we get one bit per built-in type seen, and if we
see a non-built-in type in addition, we end up with BasicObject. Not very
helpful. Additionally, it does not give us any notion of cardinality: how many
of each type did we see?

This change brings with it a much more interesting slice of type history: a
histogram. A Distribution holds a record of the top-N (where N is fixed at Ruby
compile-time) `(Class, ShapeId)` pairs and their counts. It also holds an
*other* count in case we see more than N pairs.

Using this distribution, we can make more informed decisions about when we
should use type information. We can determine if we are strictly monomorphic,
very nearly monomorphic, or something else. Maybe the call-site is polymorphic,
so we should have a polymorphic inline cache. Exciting stuff.

I also plumb this new distribution into the HIR part of the compilation
pipeline.</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Mark profiled objects when marking ISEQ (#13784)</title>
<updated>2025-07-09T23:03:23+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashi.kokubun@shopify.com</email>
</author>
<published>2025-07-09T23:03:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f5085c70f25fb1b435ac7d6604fc95492fe9537d'/>
<id>f5085c70f25fb1b435ac7d6604fc95492fe9537d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Add a BitSet type</title>
<updated>2025-07-08T19:57:31+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>max@bernsteinbear.com</email>
</author>
<published>2025-07-08T14:55:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e59f404bea4cacadb8cb786a79ec57b3e44eb67b'/>
<id>e59f404bea4cacadb8cb786a79ec57b3e44eb67b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Restore most x64 backend tests</title>
<updated>2025-06-11T10:49:49+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2025-06-10T12:52:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0bc24353d31ff14661b74c57297795b8fa1e6439'/>
<id>0bc24353d31ff14661b74c57297795b8fa1e6439</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Strength reduce to `CCall` for sends landing in simple C methods</title>
<updated>2025-04-18T12:53:01+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2025-04-07T17:34:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3e57c4dceba54b23e0c186591da98d045a8d4be1'/>
<id>3e57c4dceba54b23e0c186591da98d045a8d4be1</id>
<content type='text'>
A new optimization pass. Also:
- Printing for `Insn::CCall`
- Wrap `ID` and add convenience method for printing, replacing calls to rb_id2name()
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A new optimization pass. Also:
- Printing for `Insn::CCall`
- Wrap `ID` and add convenience method for printing, replacing calls to rb_id2name()
</pre>
</div>
</content>
</entry>
<entry>
<title>Move lib.rs functions to appropriate modules (https://github.com/Shopify/zjit/pull/43)</title>
<updated>2025-04-18T12:52:59+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-03-08T03:59:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c01568e070a205ab5a7bad42ead9b2dba1f74eff'/>
<id>c01568e070a205ab5a7bad42ead9b2dba1f74eff</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
