96283 Commits

Author SHA1 Message Date
Soutaro Matsumoto
2ed9a7bde2
Bundle RBS 3.10.0 (#15701)
* Bundle RBS 3.10.0
* Unskip BigDecimal tests
2025-12-23 08:51:32 +00:00
Jeremy Evans
d879f9f696 [DOC] Fix example in Ruby::Box documentation 2025-12-23 09:02:25 +01:00
Hiroshi SHIBATA
b04e61c390
Added release note for RubyGems 4.0.3 2025-12-23 16:30:58 +09:00
git
3a92e07a51 Update default gems list at 1c3ef2719155b56f14bf734c82b26e [ci skip] 2025-12-23 07:11:02 +00:00
Hiroshi SHIBATA
1c3ef27191 Merge RubyGems 4.0.3 and Bundler 4.0.3 2025-12-23 16:10:04 +09:00
git
ed1aac5486 Update default gems list at 8eaf6739fda591233b07f3ada7ed4e [ci skip] 2025-12-23 04:04:07 +00:00
Yusuke Endoh
8eaf6739fd [ruby/error_highlight] Bump version
https://github.com/ruby/error_highlight/commit/dc2dad6632
2025-12-23 13:03:02 +09:00
Peter Zhu
0b3199a653 [DOC] Fix backticks in docs for Set#add 2025-12-22 19:12:38 -05:00
Burdette Lamar
e69f41a0a8
[DOC] Languages in Examples (#15697)
* [DOC] Languages in Examples

* Update doc/contributing/documentation_guide.md

Co-authored-by: Jeremy Evans <code@jeremyevans.net>

* Update doc/contributing/documentation_guide.md

Co-authored-by: Jeremy Evans <code@jeremyevans.net>

---------

Co-authored-by: Jeremy Evans <code@jeremyevans.net>
2025-12-22 16:52:52 -06:00
Peter Zhu
af30e4714c [ruby/mmtk] Implement Ruby heap
This heap emulates the growth characteristics of the Ruby default GC's
heap. By default, the heap grows by 40%, requires at least 20% empty
after a GC, and allows at most 65% empty before it shrinks the heap. This
is all configurable via the same environment variables the default GC
uses (`RUBY_GC_HEAP_FREE_SLOTS_GOAL_RATIO`, `RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO`,
`RUBY_GC_HEAP_FREE_SLOTS_MAX_RATIO`, respectively).

The Ruby heap can be enabled via the `MMTK_HEAP_MODE=ruby` environment
variable.

Compared to the dynamic heap in MMTk (which uses the MemBalancer algorithm),
the Ruby heap allows the heap to grow more generously, which uses a bit
more memory but offers significant performance gains because it runs GC
much less frequently.

We can see in the benchmarks below that this Ruby heap heap gives faster
performance than the dynamic heap in every benchmark, with over 2x faster
in many of them. We see that memory is often around 10-20% higher with
certain outliers that use significantly more memory like hexapdf and
erubi-rails. We can also see that this brings MMTk's Ruby heap much
closer in performance to the default GC.

Ruby heap benchmark results:

    --------------  --------------  ----------  ---------
    bench           ruby heap (ms)  stddev (%)  RSS (MiB)
    activerecord    233.6           10.7        85.9
    chunky-png      457.1           1.1         79.3
    erubi-rails     1148.0          3.8         133.3
    hexapdf         1570.5          2.4         403.0
    liquid-c        42.8            5.3         43.4
    liquid-compile  41.3            7.6         52.6
    liquid-render   102.8           3.8         55.3
    lobsters        651.9           8.0         426.3
    mail            106.4           1.8         67.2
    psych-load      1552.1          0.8         43.4
    railsbench      1707.2          6.0         145.6
    rubocop         127.2           15.3        148.8
    ruby-lsp        136.6           11.7        113.7
    sequel          47.2            5.9         44.4
    shipit          1197.5          3.6         301.0
    --------------  --------------  ----------  ---------

Dynamic heap benchmark results:

    --------------  -----------------  ----------  ---------
    bench           dynamic heap (ms)  stddev (%)  RSS (MiB)
    activerecord    845.3              3.1         76.7
    chunky-png      525.9              0.4         38.9
    erubi-rails     2694.9             3.4         115.8
    hexapdf         2344.8             5.6         164.9
    liquid-c        73.7               5.0         40.5
    liquid-compile  107.1              6.8         40.3
    liquid-render   147.2              1.7         39.5
    lobsters        697.6              4.5         342.0
    mail            224.6              2.1         64.0
    psych-load      4326.7             0.6         37.4
    railsbench      3218.0             5.5         124.7
    rubocop         203.6              6.1         110.9
    ruby-lsp        350.7              3.2         79.0
    sequel          121.8              2.5         39.6
    shipit          1510.1             3.1         220.8
    --------------  -----------------  ----------  ---------

Default GC benchmark results:

    --------------  ---------------  ----------  ---------
    bench           default GC (ms)  stddev (%)  RSS (MiB)
    activerecord    148.4            0.6         67.9
    chunky-png      440.2            0.7         57.0
    erubi-rails     722.7            0.3         97.8
    hexapdf         1466.2           1.7         254.3
    liquid-c        32.5             3.6         42.3
    liquid-compile  31.2             1.9         35.4
    liquid-render   88.3             0.7         30.8
    lobsters        633.6            7.0         305.4
    mail            76.6             1.6         53.2
    psych-load      1166.2           1.3         29.1
    railsbench      1262.9           2.3         114.7
    rubocop         105.6            0.8         95.4
    ruby-lsp        101.6            1.4         75.4
    sequel          27.4             1.2         33.1
    shipit          1083.1           1.5         163.4
    --------------  ---------------  ----------  ---------

https://github.com/ruby/mmtk/commit/c0ca29922d
2025-12-22 16:54:27 -05:00
Luke Gruber
481f16f3f1
[DOC] Improve ractor class docs (grammar, code examples) (#15686) 2025-12-22 13:22:01 -05:00
Peter Zhu
6a2cd630d5 [DOC] Improve call-seq of Proc#call 2025-12-22 09:12:54 -05:00
Burdette Lamar
f98bbb7474
[DOC] Doc for Rational#<=> 2025-12-22 09:12:33 -05:00
Stan Lo
5272f2bc95
Bump RDoc to 7.0.2 (#15691) 2025-12-22 12:00:09 +00:00
Nobuyoshi Nakada
2191768980
[DOC] Refine packed_data.rdoc
* Escape unexpected links
* Remove unnecessary path name from in-file reference
2025-12-22 14:58:51 +09:00
Nobuyoshi Nakada
87e78e6f8a
[DOC] Add multiline condition code example that was already possible
To avoid the misconception that previously conditional code had to be
written on a single line.
2025-12-22 14:39:41 +09:00
Peter Zhu
cfb324e9d1 [DOC] Improve docs for Method#>> 2025-12-21 14:08:00 -05:00
Peter Zhu
9f8231b7f8 [DOC] Update call-seq for Method#>> 2025-12-21 14:08:00 -05:00
Peter Zhu
759187b560 [DOC] Improve docs for Method#<< 2025-12-21 14:08:00 -05:00
Peter Zhu
76441060f2 [DOC] Update call-seq for Method#<< 2025-12-21 14:08:00 -05:00
BurdetteLamar
ab4a0b4e0e [DOC] Doc for File::Stat<=> 2025-12-21 14:05:55 -05:00
Burdette Lamar
2d69facd20
[DOC] Tweaks for Object#<=> 2025-12-21 14:05:38 -05:00
Luke Gruber
d0ec60dc7b
More doc improvements to ractor.md (#15676)
[DOC] More doc improvements to ractor.md
2025-12-21 13:26:10 -05:00
Peter Zhu
37b98f0df7 [ruby/mmtk] Add a 32 byte heap for allocating smaller objects
https://github.com/ruby/mmtk/commit/c4cca6c1c3
2025-12-21 08:59:28 -05:00
Nobuyoshi Nakada
d8b33993e1
Box: Fix an unused variable warning 2025-12-21 20:31:30 +09:00
kitazawa
2ffd5ad05f
[DOC] Remove duplicate Pathname promotion entry at NEWS.md
The Pathname promotion to core class is already documented in the
"Core classes updates" section, making this duplicate entry
redundant.
2025-12-21 18:35:32 +09:00
Peter Zhu
038b158fa3 [ruby/mmtk] Implement fast path for bump pointer allocator
Adding a fast path for bump pointer allocator can improve allocation
performance.

For the following microbenchmark with MMTK_HEAP_MIN=100MiB:

    10_000_000.times { String.new }

Before:

    810.7 ms ±   8.3 ms    [User: 790.9 ms, System: 40.3 ms]

After:

    777.9 ms ±  10.4 ms    [User: 759.0 ms, System: 37.9 ms]

https://github.com/ruby/mmtk/commit/0ff5c9f579
2025-12-20 21:55:12 -05:00
Nobuyoshi Nakada
1bc2a91589
[DOC] Align tables in globals.md
* Align "Contains" column in "Streams" table
* Align some columns vertically
* Remove a duplicate `$-a` description
2025-12-21 11:31:36 +09:00
BurdetteLamar
e2243ed232 [DOC] Correct typo 2025-12-20 21:24:37 -05:00
Peter Zhu
483ef3a0d2 Test test_remove_instance_variable_re_embed separately
Shape tree pollution could cause this test to flake.
2025-12-20 18:14:48 -05:00
Peter Zhu
f42535fa38 Change test to define ivars in initialize method
Defining ivars in initialize method guarantees the object to be embedded.
2025-12-20 18:14:48 -05:00
BurdetteLamar
5808727851 [DOC] Fix indentation error in Complex#<=> 2025-12-20 18:13:17 -05:00
BurdetteLamar
addbeb6cf3 [DOC] Note for String#<=> about Comparable 2025-12-20 18:13:08 -05:00
BurdetteLamar
7c1e37cfe1 [DOC] Tweaks for Module#<=> 2025-12-20 18:12:56 -05:00
Peter Zhu
48842525a8 Exclude TestObjSpace#test_dump_objects_dumps_page_slot_sizes for MMTk [ci skip] 2025-12-20 17:19:58 -05:00
Luke Gruber
3fee7dd90d
Small improvements to doc/language/ractor.md (#15588)
[DOC] Improvements to doc/language/ractor.md
2025-12-20 15:28:04 -05:00
Peter Zhu
6d5605b28a [ruby/mmtk] Make rb_gc_impl_heap_id_for_size use MMTK_HEAP_COUNT
https://github.com/ruby/mmtk/commit/2185189df4
2025-12-20 11:41:11 -05:00
Peter Zhu
fe9a7448b1 Check slot_size before zeroing memory for GC hook
If the slot_size < RVALUE_SIZE then we would underflow in the memset.
2025-12-20 11:27:34 -05:00
Burdette Lamar
5cdda61d00
[DOC] Enhancements for globals.md (#15545)
* [DOC] Enhancements for globals.md
2025-12-20 09:26:02 -06:00
Peter Zhu
6bf921051c [ruby/mmtk] Call rb_bug when Ruby mutator thread panics
This will allow the Ruby backtrace, memory mapping, etc. to be outputted
when a Ruby mutator thread panics.

https://github.com/ruby/mmtk/commit/d10fd325dd
2025-12-20 08:40:00 -05:00
Mike Dalessio
e6520de344 [Bug #21792] Build rubyspec-capiext only when excuting test-spec
rubyspec-capiext is only needed for running specs, not for building or
installing Ruby.
2025-12-20 22:24:52 +09:00
Jean Boussier
e4bcb64be1 [Doc] prefer encoding objects over encoding names 2025-12-20 14:12:35 +01:00
Nobuyoshi Nakada
8f7c3603c1
Fix a fragile test
`Dir.mktmpdir` concatenates a random base-36 number separated by "-",
so may generate pathnames containing "-j4".
2025-12-20 21:37:45 +09:00
Victor Shepelev
a57039196f
Add clarifications about the Enumerator.size (#15615) 2025-12-20 13:26:12 +02:00
Victor Shepelev
ec4ca91319
Small documentation adjustments for new/updated features (#15634)
* Document Range#to_set

* Update Thread#raise and Fiber#raise signatures and docs

* Add reference to String#strip to character_selectors.rdoc

* Update *nil docs when calling methods

* Enhance Array#find and #rfind docs

* Add a notice to Kernel#raise about cause:
2025-12-20 13:07:38 +02:00
Nobuyoshi Nakada
77c3a9e447 Revert pack/unpack support for LEB128
https://bugs.ruby-lang.org/issues/21785#note-10
> It is too late to introduce it in Ruby 4.0, let's aim for 4.1.

This reverts commits:

* d0b72429a93e54f1f956b4aedfc25c57dc7001aa
  Add support for signed and unsigned LEB128 to pack/unpack.

* 68a900e30b4ca1537d7975c3a619fd94fca7b084
  add news for pack / unpack directives
2025-12-20 16:59:51 +09:00
Satoshi Tagomori
49f9c9bff2 Box: [DOC] Uodate the name from Namespace 2025-12-20 16:18:33 +09:00
YO4
0291123599 fix for a test case that depends on rbuf size 2025-12-20 14:54:45 +09:00
YO4
43b67356bc remove obsolete workaround
This appears to be a workaround for Windows XP behavior. It is unnecessary now.
2025-12-20 14:54:45 +09:00
Peter Zhu
df68535055 [DOC] Improve docs for Signal.trap 2025-12-19 21:38:12 -05:00