90749 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
49d49d5985 [ruby/psych] Format Date in ISO-8601 explicitly
Fix https://github.com/ruby/psych/pull/644

https://github.com/ruby/psych/commit/b1ade765ba
2025-03-27 14:56:49 +00:00
Naoto Ono
5adb2591da
Skip TestThreadInstrumentation#test_sleeping_inside_ractor on ModGC workflow (#12996)
TestThreadInstrumentation#test_sleeping_inside_ractor is a flaky and failing intermittently. Additionally, Launchable reported this test as a top flaky test. (Link: https://app.launchableinc.com/organizations/ruby/workspaces/ruby/insights/unhealthy-tests)

It failed only failed intermittently on ModGC workflow, so I'm gonna skip this test on ModGC workflow.
2025-03-27 21:22:38 +09:00
Andrew Konchin
c577416b27 Do not run ruby/spec on CI on Ruby 3.0 2025-03-27 11:09:24 +01:00
Andrew Konchin
bac22c985e Update to ruby/spec@5e579e2 2025-03-27 11:09:24 +01:00
Andrew Konchin
53a930f157 Update to ruby/mspec@484310d 2025-03-27 11:09:24 +01:00
Hiroshi SHIBATA
df08cc629e
[rubygems/rubygems] Bump up connection_pool-2.5.0 with rake vendor:install
https://github.com/rubygems/rubygems/commit/33c3caa63f
2025-03-27 16:57:10 +09:00
Hiroshi SHIBATA
62a026a425
[rubygems/rubygems] Fix Style/RedundantParentheses by bin/rubocop -a
https://github.com/rubygems/rubygems/commit/4bbf02493e
2025-03-27 16:57:10 +09:00
Hiroshi SHIBATA
c9e07da51d
[rubygems/rubygems] Resolved Lint/ShadowingOuterLocalVariable warning
https://github.com/rubygems/rubygems/commit/01a14a7073
2025-03-27 16:57:10 +09:00
Hiroshi SHIBATA
d4a97ea313
Update the all of gemfile deps 2025-03-27 16:56:59 +09:00
Hartley McGuire
752a1d7854 [rubygems/rubygems] Implement pub_grub strategy interface
My application spends more than 30% of time during `bundle update`
comparing versions due to versions being sorted inside
next_package_to_try. This has been addressed in pub_grub by defining a
strategy interface (a `#next_package_and_version` method) which allows
consumers to have finer control over the heuristic to select the next
package to try.

This commit implements the new strategy interface to remove extraneous
version sorting (previously in next_package_to_try) since only the final
count of versions is used.

Combined with a previous change to pub_grub (already applied to
Bundler), this commit results in `bundle update` taking only half the
time it did on 2.6.5.

https://github.com/rubygems/rubygems/commit/62f69e27f0
2025-03-27 13:57:26 +09:00
Ellen Marie Dash
af594f5166 [rubygems/rubygems] Have "gem exec" sort executable names in error message.
This decouples `gem exec` behavior (and tests) from the sort order of
the gemspec.

https://github.com/rubygems/rubygems/commit/911cd29159
2025-03-27 13:57:25 +09:00
Jean Boussier
9f17a0c7cb Get rid of SAFE_STATE_PROTOTYPE
It was only used by JRuby and TruffleRuby to call `SAFE_STATE_PROTOTYPE.dup`
instead of `State.new` which isn't an worthy optimization.
2025-03-27 13:54:12 +09:00
Jean Boussier
4dde7101c7 Refactor jeaiii-ltoa.h
Some relatively minor change to make the library more in line
with the gem. Some renaming, etc.
2025-03-27 13:54:12 +09:00
Yusuke Endoh
1b8e6568e4 Pend a test for ractor in etc
... because it is flaky
2025-03-27 12:28:28 +09:00
Hiroshi SHIBATA
c6f89e263e Skip failing rbs tests for removing deprecated methods 2025-03-27 11:37:27 +09:00
Hiroshi SHIBATA
6d82ea7db8 Update ext/json/generator/depend 2025-03-27 11:37:27 +09:00
Hiroshi SHIBATA
ee85745c61 Removed trailing spaces 2025-03-27 11:37:27 +09:00
eno
d1f3c81258 Faster integer formatting
This commit provides an alternative implementation for a
long → decimal conversion.

The main difference is that it uses an algorithm pulled from
https://github.com/jeaiii/itoa.
The source there is C++, it was converted by hand to C for
inclusion with this gem.
jeaiii's algorithm is covered by the MIT License, see source code.

On addition this version now also generates the string directly into
the fbuffer, foregoing the need to run a separate memory copy.

As a result, I see a speedup of 32% on Apple Silicon M1 for an
integer set of benchmarks.
2025-03-27 11:37:27 +09:00
Jean Boussier
dc6ffbbe9e [ruby/json] Remove unused FAST_STATE_PROTOTYPE and PRETTY_STATE_PROTOTYPE
https://github.com/ruby/json/commit/18e5c3c67c
2025-03-27 11:37:27 +09:00
Jean Boussier
b71ec1196e [ruby/json] Remove unparse and restore aliases.
These were deprecated 16 years ago.

https://github.com/ruby/json/commit/a88d825a91
2025-03-27 11:37:27 +09:00
Jean Boussier
f4529ecbe7 [ruby/json] Deprecate all *_default_options
Globally changing the behavior of the library is a bad idea, as
many different libraries may rely on `json` and may not expect it
and likely never tested that a different default config works for them.

If you need to change the behavior of JSON, it's best to do it only
locally, and not globally.

In addition the new `JSON::Coder` interface is much more suited for
that.

Another reason for the deprecation is that it's impossible to
make `JSON.load` and `JSON.dump` Ractor-safe with such API.

https://github.com/ruby/json/commit/172762c6e4
2025-03-27 11:37:27 +09:00
John Hawthorn
46ee73f4f6 Add additional Ractor.make_shareable tests 2025-03-26 16:05:02 -07:00
lukeg
d80f3a287c Ractor.make_shareable(proc_obj) makes inner structure shareable
Proc objects are now traversed like other objects when making them
shareable.

Fixes [Bug #19372]
Fixes [Bug #19374]
2025-03-26 16:05:02 -07:00
Peter Zhu
2183899fd1 Re-use objspace variable instead of calling rb_gc_get_objspace() 2025-03-26 09:35:51 -04:00
Hiroshi SHIBATA
88f0c04174 Use release version of turbo_tests 2025-03-26 19:37:22 +09:00
John Hawthorn
310c00a137 Reset thread interrupt lock on fork
If a thread was holding this lock before fork, it will not exist in the
child process. We should re-initialize these locks as we do with the VM
locks when forking.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2025-03-25 19:14:26 -07:00
John Hawthorn
be6954f5d4 Fail test if child process exists non-zero 2025-03-25 19:14:26 -07:00
John Hawthorn
8f952a1178 Clear VM_CHECK lock info on fork
We are resetting the actual lock so we should reset this information at
the same time. Previously this caused an assertion to fail in debug
mode.
2025-03-25 19:14:26 -07:00
Alan Wu
c576e83a24
Prefer FL_TEST_RAW() in GC on known on-heap objects
Was reading some assembly and noticed the dead branches generated for
FL_TEST(). Just a quick basic pass to change the obvious places; there
may be other opportunities.
2025-03-25 18:16:31 -04:00
Benoit Daloze
bfc5b8305d [ruby/etc] Etc.sysconfdir does not work in a Ractor
* Because it uses RbConfig::CONFIG.
* See https://github.com/ruby/ruby/actions/runs/14069312270/job/39399502142#step:12:947

https://github.com/ruby/etc/commit/12dbe03b6a
2025-03-25 21:27:16 +00:00
Peter Zhu
6bb35a1de4 Make ruby_autocompact_compare_func static
It's not used outside of default.c.
2025-03-25 16:19:32 -04:00
Peter Zhu
e4c7eb1152 Make ruby_enable_autocompact static
It's not used outside of defaut.c
2025-03-25 16:19:32 -04:00
Benoit Daloze
b9e9a1034a [ruby/etc] Most Etc methods are not Ractor-safe currently
* See https://bugs.ruby-lang.org/issues/21115

https://github.com/ruby/etc/commit/ae62b7619c
2025-03-25 20:17:01 +00:00
Burdette Lamar
0b186ed413
[DOC] Doc for Hash#transform_keys! (#12942) 2025-03-25 15:26:51 -04:00
Peter Zhu
eb3f73ae9c [DOC] Use install-modular-gc in gc/README.md 2025-03-25 08:49:31 -04:00
David Rodríguez
1427629a5f [rubygems/rubygems] Remove specs with bad sources when converging dependencies
https://github.com/rubygems/rubygems/commit/a0f7851451
2025-03-25 10:36:33 +09:00
David Rodríguez
fd43aca13b [rubygems/rubygems] Tweak to check specs size just once
https://github.com/rubygems/rubygems/commit/4497555023
2025-03-25 10:36:33 +09:00
Randy Stauner
2eb5690ab6 [rubygems/rubygems] Add test for fixing mismatched versions in lockfile
This test confirms that a bug that existed in 2.6.3
was fixed by https://github.com/rubygems/rubygems/commit/b8e55087f026

https://github.com/rubygems/rubygems/commit/9e4ca5c5b2
2025-03-25 10:36:32 +09:00
Peter Zhu
319fcca656 Move rb_gc_impl_ractor_cache_free to shutdown section 2025-03-24 08:49:30 -04:00
Peter Zhu
a572ec1ba0 Move rb_gc_impl_objspace_free to shutdown section 2025-03-24 08:49:30 -04:00
Naoto Ono
56b89d31c7
Launchable: Fix CI scripts by adding backslashes (#12974)
The following command doesn't work correctly since a backslash doesn't exist after `exec`. This PR fixes it.

```
if [ -n "${LAUNCHABLE_ORGANIZATION}" ]; then
  exec
  > >(tee launchable_stdout.log) \
  2> >(tee launchable_stderr.log)
fi
```
2025-03-24 11:45:24 +00:00
Nobuyoshi Nakada
42daa6c2a2
[Bug #21141] [DOC] Fix indentation 2025-03-24 15:49:41 +09:00
Nobuyoshi Nakada
51bc992822
[Bug #21141] [DOC] Refine description of Time#utc? 2025-03-24 15:43:40 +09:00
Hiroshi SHIBATA
c5f30e9567
Update ext/json/generator/depend 2025-03-24 15:24:47 +09:00
Hiroshi SHIBATA
6b15857e25
Removed trailing space 2025-03-24 15:20:59 +09:00
Jean Boussier
f3f4524d19
Reorganize fpconv vendoring
Make it a single file and declare the dependency.
2025-03-24 14:49:44 +09:00
eno
c98e6a9b89 [ruby/json] Extends license description
https://github.com/ruby/json/commit/cce3d1f6c1
2025-03-24 14:35:05 +09:00
eno
528c08cc5f [ruby/json] Adjust fpconv to add ".0" to integers
Adds a test case

fix

https://github.com/ruby/json/commit/fa5bdf87cb
2025-03-24 14:35:04 +09:00
eno
a59333c58b [ruby/json] Faster float formatting
This commit provides an alternative implementation for a float → decimal conversion.

It integrates a C implementation of Fabian Loitsch's Grisu-algorithm [[pdf]](http://florian.loitsch.com/publications/dtoa-pldi2010.pdf), extracted from https://github.com/night-shift/fpconv. The relevant files are added in this PR, they are, as is all of https://github.com/night-shift/fpconv, available under a MIT License.

As a result, I see a speedup of 900% on Apple Silicon M1 for a float set of benchmarks.

floats don't have a single correct  string representation: a float like `1000.0` can be represented as "1000", "1e3", "1000.0" (and more).

The Grisu algorithm converts floating point numbers to an optimal decimal string representation without loss of precision. As a result, a float that is exactly an integer (like `Float(10)`) will be converted by that algorithm into `"10"`. While technically correct – the JSON format treats floats and integers identically –, this differs from the current behaviour of the `"json"` gem. To address this, the integration checks for that case, and explicitely adds a ".0" suffix in those cases.

This is sufficient to meet all existing tests; there is, however, a chance that the current implementation and this implementation occasionally encode floats differently.

```
== Encoding floats (4179311 bytes)
ruby 3.4.1 (2024-12-25 revision https://github.com/ruby/json/commit/48d4efcb85) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
        json (local)     4.000 i/100ms
Calculating -------------------------------------
        json (local)     46.046 (± 2.2%) i/s   (21.72 ms/i) -    232.000 in   5.039611s

Normalize to 2090234 byte
== Encoding floats (4179242 bytes)
ruby 3.4.1 (2024-12-25 revision https://github.com/ruby/json/commit/48d4efcb85) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
       json (2.10.2)     1.000 i/100ms
Calculating -------------------------------------
       json (2.10.2)      4.614 (± 0.0%) i/s  (216.74 ms/i) -     24.000 in   5.201871s
```

These benchmarks are run via a script ([link](https://gist.github.com/radiospiel/04019402726a28b31616df3d0c17bd1c)) which is based on the gem's `benchmark/encoder.rb` file. There are probably better ways to run benchmarks :) My version allows to combine multiple test cases into a single one.

The `dumps` benchmark, which covers the JSON files in `benchmark/data/*.json` – with the exception of `canada.json` – , reported a minor speedup within statistical uncertainty.

https://github.com/ruby/json/commit/7d77415108
2025-03-24 14:35:04 +09:00
Hiroshi SHIBATA
ef7c7f9e77 Revert "Fix broken CI. (#12963)"
This reverts commit eb91c664dc0b4d69db09ae913f2d7a5ef3490d74.
2025-03-24 13:25:07 +09:00