94779 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
d17ce4bd05
[Bug #21652] [DOC] Update unmarshalable object list
The `Data` mentioned here was the old `T_DATA` class, not the current
extended `Struct`.
2025-10-29 10:07:32 +09:00
Nobuyoshi Nakada
c4e090def1
test_commit_email.rb: Clean up temporary files 2025-10-29 10:06:02 +09:00
Max Bernstein
f8a333ae19
ZJIT: Add type checker to HIR (#14978)
Allow instructions to constrain their operands' input types to avoid
accidentally creating invalid HIR.
2025-10-29 00:11:27 +00:00
André Luiz Tiago Soares
80be97e4a2
ZJIT: Fill cfp->pc with trap value for C methods in debug builds 2025-10-28 23:48:38 +00:00
Peter Zhu
9f4a76ff51 Add a custom error class to TestString#test_encode_fallback_raise_memory_leak
This prevents a generic RuntimeError from being raised so we can ensure
that the correct error is being rescued.
2025-10-28 19:40:25 -04:00
Peter Zhu
4925bec65d Fix TestString#test_encode_fallback_raise_memory_leak
The method and aref cases need to accept a parameter.
2025-10-28 19:40:25 -04:00
Takashi Kokubun
7428dc7348 ZJIT: Migrate an arm64 register from emit to split 2025-10-28 16:35:47 -07:00
Takashi Kokubun
d6d095e2fc ZJIT: Rename SCRATCH_OPND to SCRATCH0_OPND for x86_64 2025-10-28 16:35:47 -07:00
dependabot[bot]
8dc276f3e1 Bump github.com/microsoft/vcpkg from master to 2025.10.17
Bumps [github.com/microsoft/vcpkg](https://github.com/microsoft/vcpkg) from master to 2025.10.17. This release includes the previously tagged commit.
- [Release notes](https://github.com/microsoft/vcpkg/releases)
- [Commits](4334d8b4c8...74e6536215)

---
updated-dependencies:
- dependency-name: github.com/microsoft/vcpkg
  dependency-version: 2025.10.17
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-29 07:25:02 +09:00
dependabot[bot]
5a14999d0d Bump actions/upload-artifact from 4 to 5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-29 07:24:49 +09:00
Takashi Kokubun
afb0d43181
ZJIT: Drop --seed from test-all on CI (#14976) 2025-10-28 13:47:15 -07:00
Takashi Kokubun
d0c7234bc7
ZJIT: Support ParallelMov into memory (#14975) 2025-10-28 13:18:05 -07:00
Takashi Kokubun
599de290a0 YJIT, ZJIT: Fix unnecessary use of macros
https://github.com/ruby/ruby/actions/runs/18887695798/job/53907237061?pr=14975
2025-10-28 13:14:48 -07:00
Andrew Konchin
882e167768 Update to ruby/spec@3bc45ba 2025-10-28 20:49:51 +01:00
Aiden Fox Ivey
8a76597535
ZJIT: Split HIR tests (#14967)
`hir.rs` was getting rather large, so I've opted to move the inline tests into their own files. This should also help when looking for where to put your tests, as the optimization tests have a dedicated file.

Future follow up work could make the layout of test modules more idiomatic to Rust.
2025-10-28 14:36:04 -04:00
Max Bernstein
a9d42f7c4b ZJIT: Print percentage of GuardType failure 2025-10-28 13:37:20 -04:00
Max Bernstein
2c90da465a ZJIT: Count GuardType instructions
We can measure how many we can remove by adding type information to C
functions, etc.
2025-10-28 13:37:20 -04:00
Takashi Kokubun
f6cd20c61e ZJIT: Split frame_setup_teardown tests 2025-10-28 09:25:30 -07:00
Takashi Kokubun
0e1d99ce69 ZJIT: Move c_stack_slots to Assembler 2025-10-28 09:25:30 -07:00
Takashi Kokubun
cc051ef0e5 ZJIT: Simplify Assembler constructors 2025-10-28 09:25:30 -07:00
Takashi Kokubun
b463c1a904 ZJIT: Stop computing offset on gen_push_opnds
Once we add register spill, the C stack will have not only spilled basic
block params but also spilled VRegs.

We won't know how many stack slots are used for spilled VRegs until
alloc_regs, so you can't compute an offset as of writing LIR.
2025-10-28 09:25:30 -07:00
Takashi Kokubun
9b3df50d90 ZJIT: Allow ALLOC_REGS to have an odd number of regs 2025-10-28 09:25:30 -07:00
Takashi Kokubun
b66c57be18 ZJIT: Print unexpected operands on x86_64 2025-10-28 09:25:30 -07:00
Takashi Kokubun
ec1b9bbd58 ZJIT: Call test again after profiling it
It's a call_threshold: 2 test

https://github.com/ruby/ruby/pull/14933#discussion_r2469731499
2025-10-28 09:24:07 -07:00
Aiden Fox Ivey
7a736545e9
ZJIT: Specialize Array#pop for no argument case (#14933)
Fixes https://github.com/Shopify/ruby/issues/814

This change specializes the case of calling `Array#pop` on a non frozen array with no arguments. `Array#pop` exists in the non-inlined C function list in the ZJIT SFR performance burndown list.

If in the future it is helpful, this patch could be extended to support the case where an argument is provided, but this initial work seeks to elide the ruby frame normally pushed in the case of `Array#pop` without an argument.
2025-10-28 11:44:25 -04:00
Max Bernstein
2e2f31c836 ZJIT: Add IsBitNotEqual and inline BasicObject#!= 2025-10-28 10:49:30 -04:00
Max Bernstein
c2bef01b66 ZJIT: Optimize Kernel#=== 2025-10-28 10:49:30 -04:00
Max Bernstein
e973baa837 ZJIT: Add BoxBool and remove CCall from BasicObject#== 2025-10-28 10:49:30 -04:00
Max Bernstein
a4f8afcec8 ZJIT: Use FnProperties::default() 2025-10-28 10:49:30 -04:00
Max Bernstein
2a6e5d7d94 ZJIT: Allow both inlining and annotating properties 2025-10-28 10:49:30 -04:00
Max Bernstein
7425520415 ZJIT: Remove redundant annotation 2025-10-28 10:49:30 -04:00
Max Bernstein
3624031bb5 ZJIT: Inline Kernel#nil? and NilClass#nil?
We can fully remove the CCall now.
2025-10-28 10:49:30 -04:00
Hiroshi SHIBATA
b0825d78f3 Restore old version of Gem::Installer#install for default gems installation 2025-10-28 21:02:29 +09:00
Hiroshi SHIBATA
52451798d2 [ruby/rubygems] Simulate default gems manually
https://github.com/ruby/rubygems/commit/c3cc38c72c
2025-10-28 11:06:18 +00:00
Hiroshi SHIBATA
3afe8ed46f [ruby/rubygems] Introduce default_spec_dir when it's not provided
https://github.com/ruby/rubygems/commit/e9bd59699c
2025-10-28 11:06:17 +00:00
Hiroshi SHIBATA
7bd7bcbf3e [ruby/rubygems] Removed default bundler spec from specification directory
https://github.com/ruby/rubygems/commit/6fbbde48e2
2025-10-28 11:06:17 +00:00
Hiroshi SHIBATA
ceb2b569af [ruby/rubygems] Added install_default_gem method for testing
https://github.com/ruby/rubygems/commit/81dbd42abf
2025-10-28 11:06:16 +00:00
Hiroshi SHIBATA
d67aba8a5d [ruby/rubygems] Completely removed install_as_default feature
https://github.com/ruby/rubygems/commit/15e46a3a68
2025-10-28 11:06:16 +00:00
Hiroshi SHIBATA
523474bdfc [ruby/rubygems] Deprecate --default option
https://github.com/ruby/rubygems/commit/55745ee0f8
2025-10-28 11:06:16 +00:00
Hiroshi SHIBATA
a27f430de7 [ruby/rubygems] Make more shortly with https://rubyonrails.org/conduct
https://github.com/ruby/rubygems/commit/62ba34d6c9
2025-10-28 08:28:38 +00:00
dysonreturns
7550f7e453 [ruby/rubygems] Update new gem CoC and prompt
Prompt wording "prefer safe, respectful, productive, and collaborative spaces" is copied verbatim from Ruby Community Conduct Guideline.

https://github.com/ruby/rubygems/commit/6cdf5f6d8a
2025-10-28 08:28:38 +00:00
Scott Myron
aab390aa5a [ruby/json] Use Vector API in the Java Extension
Overview

This PR uses the [jdk.incubator.vector module](https://docs.oracle.com/en/java/javase/20/docs/api/jdk.incubator.vector/jdk/incubator/vector/package-summary.html) as mentioned in [issue #739](https://github.com/ruby/json/issues/739) to accelerate generating JSON with the same algorithm as the C extension.

The PR as it exists right now, it will attempt to build the `json.ext.VectorizedEscapeScanner` class with a target release of `16`. This is the first version of Java with support for the `jdk.incubator.vector` module. The remaining code is built for Java 1.8. The code will attempt to load the `json.ext.VectorizedEscapeScanner` only if the `json.enableVectorizedEscapeScanner` system property is set to `true` (or `1`).

I'm not entirely sure how this is packaged / included with JRuby so I'd love @byroot and @headius's (and others?) thought about how to potential package and/or structure the JARs. I did consider adding the `json.ext.VectorizedEscapeScanner` to a separate `generator-vectorized.jar` but I thought I'd solicit feedback before spending any more time on the build / package process.

Benchmarks

Machine M1 Macbook Air

Note: I've had trouble modifying the `compare.rb` I was using for the C extension to work reliability with the Java extension. I'll probably spend more time trying to get it to work, but as of right now these are pretty raw benchmarks.

Below are two sample runs of the real-world benchmarks. The benchmarks are much more variable then the C extension for some reason. I'm not sure if HotSpot is doing something slightly different per execution.

Vector API Enabled

```
scott@Scotts-MacBook-Air json % ONLY=json JAVA_OPTS='--add-modules jdk.incubator.vector -Djson.enableVectorizedEscapeScanner=true' ruby -I"lib" benchmark/encoder-realworld.rb
WARNING: Using incubator modules: jdk.incubator.vector
== Encoding activitypub.json (52595 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json     1.384k i/100ms
Calculating -------------------------------------
                json     15.289k (± 0.8%) i/s   (65.41 μs/i) -    153.624k in  10.048481s

== Encoding citm_catalog.json (500298 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json    76.000 i/100ms
Calculating -------------------------------------
                json    753.787 (± 3.6%) i/s    (1.33 ms/i) -      7.524k in   9.997059s

== Encoding twitter.json (466906 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json   173.000 i/100ms
Calculating -------------------------------------
                json      1.751k (± 1.1%) i/s  (571.24 μs/i) -     17.646k in  10.081260s

== Encoding ohai.json (20147 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json     2.390k i/100ms
Calculating -------------------------------------
                json     23.829k (± 0.8%) i/s   (41.97 μs/i) -    239.000k in  10.030503s
```

Vector API Disabled

```
scott@Scotts-MacBook-Air json % ONLY=json JAVA_OPTS='--add-modules jdk.incubator.vector -Djson.enableVectorizedEscapeScanner=false' ruby -I"lib" benchmark/encoder-realworld.rb
WARNING: Using incubator modules: jdk.incubator.vector
VectorizedEscapeScanner disabled.
== Encoding activitypub.json (52595 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json     1.204k i/100ms
Calculating -------------------------------------
                json     12.937k (± 1.1%) i/s   (77.30 μs/i) -    130.032k in  10.052234s

== Encoding citm_catalog.json (500298 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json    80.000 i/100ms
Calculating -------------------------------------
                json    817.378 (± 1.0%) i/s    (1.22 ms/i) -      8.240k in  10.082058s

== Encoding twitter.json (466906 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json   147.000 i/100ms
Calculating -------------------------------------
                json      1.499k (± 1.3%) i/s  (667.08 μs/i) -     14.994k in  10.004181s

== Encoding ohai.json (20147 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json     2.269k i/100ms
Calculating -------------------------------------
                json     22.366k (± 5.7%) i/s   (44.71 μs/i) -    224.631k in  10.097069s
```

`master` as of commit `https://github.com/ruby/json/commit/c5af1b68c582`

```
scott@Scotts-MacBook-Air json % ONLY=json ruby -I"lib" benchmark/encoder-realworld.rb
== Encoding activitypub.json (52595 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json   886.000 i/100ms
Calculating -------------------------------------
                json^C%
scott@Scotts-MacBook-Air json % ONLY=json ruby -I"lib" benchmark/encoder-realworld.rb
== Encoding activitypub.json (52595 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json     1.031k i/100ms
Calculating -------------------------------------
                json     10.812k (± 1.3%) i/s   (92.49 μs/i) -    108.255k in  10.014260s

== Encoding citm_catalog.json (500298 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json    82.000 i/100ms
Calculating -------------------------------------
                json    824.921 (± 1.0%) i/s    (1.21 ms/i) -      8.282k in  10.040787s

== Encoding twitter.json (466906 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json   141.000 i/100ms
Calculating -------------------------------------
                json      1.421k (± 0.7%) i/s  (703.85 μs/i) -     14.241k in  10.023979s

== Encoding ohai.json (20147 bytes)
jruby 9.4.12.0 (3.1.4) 2025-02-11 https://github.com/ruby/json/commit/f4ab75096a Java HotSpot(TM) 64-Bit Server VM 21.0.7+8-LTS-245 on 21.0.7+8-LTS-245 +jit [arm64-darwin]
Warming up --------------------------------------
                json     2.274k i/100ms
Calculating -------------------------------------
                json     22.612k (± 0.9%) i/s   (44.22 μs/i) -    227.400k in  10.057516s
```

Observations

`activitypub.json` and `twitter.json` seem to be consistently faster with the Vector API enabled. `citm_catalog.json` seems consistently a bit slower and `ohai.json` is fairly close to even.

https://github.com/ruby/json/commit/d40b2703a8
2025-10-28 07:50:42 +00:00
Takashi Kokubun
d82a590a58 sync_default_gems.rb: Show git diff on failed sync 2025-10-28 00:28:35 -07:00
Nobuyoshi Nakada
0f5c69b317 [DOC] Moved non ASCII documents to separated files
C99 does not declare ways to designate the charset encoding of the
source file.  We can assume just US-ASCII characters will be safe.
2025-10-28 13:07:59 +09:00
Burdette Lamar
02d53bab56 [ruby/stringio] [DOC] Doc for StringIO#each_byte
(https://github.com/ruby/stringio/pull/157)

https://github.com/ruby/stringio/commit/624ce56b4e

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
2025-10-28 13:07:59 +09:00
git
d864bd1a58 Update default gems list at b3191d204b8b4fe4b29cf73cd09a1b [ci skip] 2025-10-28 03:58:48 +00:00
Takashi Kokubun
b3191d204b [ruby/erb] Version 5.1.3
https://github.com/ruby/erb/commit/e8d382a83e
2025-10-28 03:57:57 +00:00
git
4511e9621a Update default gems list at f7eee3427dcc8b644b9fd6c854f3e1 [ci skip] 2025-10-28 03:50:50 +00:00
Takashi Kokubun
f7eee3427d [ruby/erb] Version 5.1.2
https://github.com/ruby/erb/commit/daa0e8712f
2025-10-28 03:49:15 +00:00
Burdette Lamar
218c2805f9 [ruby/stringio] [DOC] Doc for StringIO#each_codepoint
(https://github.com/ruby/stringio/pull/159)

https://github.com/ruby/stringio/commit/6628d4837b

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
2025-10-28 03:09:50 +00:00