Project

General

Profile

Activity

From 10/15/2020 to 10/21/2020

10/21/2020

11:37 PM Feature #17278: On-demand sharing of constants for Ractor
ko1 (Koichi Sasada) wrote in #note-1:
> If a non-main ractor is accessing `H` with immutable operation (such as `.each`), modifying `H` by main ractor will cause thread-safety issue.
If a non-main ractor is accessing `H`, it will cau...
Dan0042 (Daniel DeLorme)
10:56 PM Feature #17278: On-demand sharing of constants for Ractor
If a non-main ractor is accessing `H` with immutable operation (such as `.each`), modifying `H` by main ractor will cause thread-safety issue. ko1 (Koichi Sasada)
07:39 PM Feature #17278 (Feedback): On-demand sharing of constants for Ractor
### Description
This proposal aims to reduce (but not eliminate) the need for freezing/sharing boilerplate code needed by ractors.
```ruby
A = [1, [2, [3, 4]]]
H = {a: "a"}
Ractor.new do
p A #A is not actually modified anyw...
Dan0042 (Daniel DeLorme)
11:00 PM Feature #17274: Ractor.make_shareable(obj)
Eregon (Benoit Daloze) wrote in #note-3:
> @ko1 What's the difference with `Object#deep_freeze(skip_shareable: false)` from #17145 ?
Almost same.
* the ability is to focus `skip_shareable: true`.
* this ticket describes the detai...
ko1 (Koichi Sasada)
06:47 PM Feature #17274: Ractor.make_shareable(obj)
@ko1 What's the difference with `Object#deep_freeze(skip_shareable: false)` from #17145 ? Eregon (Benoit Daloze)
06:47 AM Feature #17274 (Closed): Ractor.make_shareable(obj)
This ticket describes the semantics of "shareable" and proposes a new method `Ractor.make_shareable(obj)`.
With this method, `obj` becomes a shareable object by freezing it and reachable objects if it is necessary and it is possible.
...
ko1 (Koichi Sasada)
09:02 PM Bug #17272 (Feedback): Ruby 2.7.2 crash report
The crash occurs when freeing an object, and you are using 10 external C extensions. A bug in a C extension can certainly cause a crash during free (as can a bug in a core class or the interpreter). Can you build a debug version of Rub... jeremyevans0 (Jeremy Evans)
07:03 PM Feature #17145: Ractor-aware `Object#deep_freeze`
@marcandre Thanks, I didn't get the use-case from the DeepCover above (I just missed the `freeze` definition).
I think the last variant of #20 works too if we call user `freeze` instead of internal freeze.
As long we call it before i...
Eregon (Benoit Daloze)
01:28 PM Feature #17145: Ractor-aware `Object#deep_freeze`
marcandre (Marc-Andre Lafortune) wrote in #note-22:
> I've been wanting for a long while to propose an API for caching methods, and that could be made Ractor compatible and would resolve most of these cases
+1
The `@var ||= expr` idiom ...
Dan0042 (Daniel DeLorme)
05:23 AM Feature #17145: Ractor-aware `Object#deep_freeze`
Looking at `def freeze` in the top ~400 gems, I found 64 in `sequel` gem alone, and 28 definitions in the rest 😅.
Excluding `sequel`, half do deep freeze. The other use cases:
Cache prebuilding:
https://github.com/rails/rails/blob...
marcandre (Marc-Andre Lafortune)
06:58 PM Feature #17273: shareable_constant_value pragma
Re naming, how about `# shareable_constants: true` instead of `# shareable_constant_value: true`?
(it's `# frozen_string_literal: true` but maybe it should have been `# frozen_string_literals: true` ...)
> However, if we have 100 c...
Eregon (Benoit Daloze)
05:56 AM Feature #17273 (Closed): shareable_constant_value pragma
This proposal is to introduce `# shareable_constant_value: true` pragma to make constant values shareable objects.
With this pragma, you don't need to add `freeze` to access from non-main ractors.
```ruby
# shareable_constant_value:...
ko1 (Koichi Sasada)
04:37 PM Misc #17200: DevelopersMeeting20201026Japan
* [Feature #17277] Make Enumerator#with_index yield row and col indices for Matrix
* Access Matrix indices in enumerable methods
greggzst (Grzegorz Jakubiak)
03:43 PM Revision 603fb940 (git): refactoring obj_traverse_i
ko1 (Koichi Sasada)
03:43 PM Revision 0c0d0752 (git): allow to access ivars of frozen shareable objects
Accessing a shareable object is prohibitted because it can cause
race condition, but if the shareable object is frozen, there is no
problem to access ivars.
ko1 (Koichi Sasada)
03:07 PM Revision 96293784 (git): * 2020-10-22 [ci skip]
git[bot]
02:57 PM Revision 3a97d361 (git): refactoring frozen_shareable_p
ko1 (Koichi Sasada)
02:52 PM Revision 89f6644d (git): refactoring rb_obj_traverse()
* create rec check hash lazily
* do not pass *data pointer for enter/leave function because
it is not used.
ko1 (Koichi Sasada)
02:52 PM Revision af247136 (git): refactoring rb_ractor_confirm_belonging()
rb_ractor_belonging() returns 0 only if it has sharable flag.
rb_ractor_confirm_belonging() checks rb_ractor_shareable_p()
if the belonging ractor id is different from current ractor id.
ko1 (Koichi Sasada)
02:52 PM Revision 631eaa85 (git): check main-ractor or not first
On non-multi-ractor-mode, the cost of rb_ractor_main_p() is low
so check it first.
ko1 (Koichi Sasada)
02:37 PM Revision 762be877 (git): test/json/json_parser_test.rb: suppress warnings
http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20201021T123003Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20201021T123003Z/ruby/test/json/json_parser_test.rb:227: warning: ambiguous first argument; put parentheses or a spa...
mame (Yusuke Endoh)
12:07 PM Feature #17277: Make Enumerator#with_index yield row and col indices for Matrix
~~I also noticed when combining `each_with_index` with `inject` it passes `element, row_index and col_index` as one argument to the block~~
```ruby
Matrix[[1,2,4,5],[7,8,9,2]].each_with_index.inject({}) { |acc, e, row, col| puts "#{acc}...
greggzst (Grzegorz Jakubiak)
11:26 AM Feature #17277: Make Enumerator#with_index yield row and col indices for Matrix
What about chained enumerators?
```ruby
matrix.each(:diagonal).each_const(2).with_index do |elem, ?|
```
It's not clear to me how that could be implemented efficiently, do you have an idea?
Finally, what is the use case?
I ...
marcandre (Marc-Andre Lafortune)
10:07 AM Feature #17277 (Closed): Make Enumerator#with_index yield row and col indices for Matrix
Given a matrix:
```ruby
matrix = Matrix[[0,2,3,4], [6,7,8,9], [1,4,5,8]]
```
You could get the row and col indices of a matrix using `Matrix#each_with_index`:
```ruby
matrix
.each_with_index { |e, row, col| p [row, col] }
[...
greggzst (Grzegorz Jakubiak)
10:00 AM Feature #17276 (Closed): Ripper stops tokenizing after keyword as a method parameter
Although these are obviously syntax errors at this time, the following
codes cannot be tokenized correctly by `Ripper.tokenize`.
```
$ cat src.rb
def req(true) end
def opt(true=0) end
def rest(*true) end
def keyrest(**true) end
...
no6v (Nobuhiro IMAI)
08:59 AM Revision 44140317 (git): extend timeout of rbs test on rbs tests
ko1 (Koichi Sasada)
07:50 AM Bug #17275: Please backport 8b0dc77a621ded75f72486c33f55404ce73f00d7
Thank you for your notice. I will fill the Backport field.
I think the situation is same on 2.5/2.6, though I didn't confirmed that this issue was reproducibility on them.
nagachika (Tomoyuki Chikanaga)
07:43 AM Bug #17275 (Closed): Please backport 8b0dc77a621ded75f72486c33f55404ce73f00d7
I've encountered the issue as same as https://github.com/ruby/ruby/pull/3307 with ruby-2.7.2.
I'm using a workaround for now, but it would be very nice if ruby_2_7 had a backport the commit https://git.ruby-lang.org/ruby.git/commit/?id=...
wanabe (_ wanabe)
07:15 AM Revision b59077ee (git): Ractor-safe rb_objspace_reachable_objects_from
rb_objspace_reachable_objects_from(obj) is used to traverse all
reachable objects from obj. This function modify objspace but it
is not ractor-safe (thread-safe). This patch fix the problem.
Strategy:
(1) call GC mark process during_gc
...
ko1 (Koichi Sasada)
05:26 AM Feature #17267: Remove Win32API at Ruby 3.0
+1 usa (Usaku NAKAMURA)
01:15 AM Feature #17267: Remove Win32API at Ruby 3.0
Eregon (Benoit Daloze) wrote in #note-4:
> I think it's fine as long as it's moved to a gem, so it can still be used when desired.
I agree with Benoit.
duerst (Martin Dürst)
04:08 AM Feature #17256: Freeze all Regexp objects
Dan0042 (Daniel DeLorme) wrote in #note-6:
> Given that string literals with interpolation were recently unfrozen, it would appear slightly inconsistent to freeze regexp literals with interpolation.
The difference is that there are m...
marcandre (Marc-Andre Lafortune)
02:57 AM Feature #17256: Freeze all Regexp objects
Given that string literals with interpolation were recently unfrozen, it would appear slightly inconsistent to freeze regexp literals with interpolation.
`/#{str}/` is equivalent to `Regexp.new(str)` so I would find it a bit weird if th...
Dan0042 (Daniel DeLorme)
04:04 AM Revision 4640c4ea (git): Removed more unnecessary ID caches
```
find . -name \*.o -exec nm {} + |&
grep -e 'InitVM_.*\.rbimpl_id' -e 'Init_.*\.rbimpl_id' |
sed 's/^.* b //;s/\.[1-9][0-9]*$//;s/\.rbimpl_id$//' |
uniq
```
should be empty.
nobu (Nobuyoshi Nakada)
03:46 AM Revision 5a77e90f (git): Use rb_intern_const instead of rb_intern in Init functions
```
find . -name \*.o -exec nm {} + |&
sed '/Init_.*\.rbimpl_id/!d;s/^.* b //;s/\.[1-9][0-9]*$//;s/\.rbimpl_id$//' |
uniq
```
should be empty.
nobu (Nobuyoshi Nakada)
03:45 AM Revision 8c2e5bbf (git): Don't redefine #rb_intern over and over again
Stefan Stüben
03:31 AM Revision d497436d (git): Update dependencies for macOS
nobu (Nobuyoshi Nakada)
03:31 AM Revision 640b3405 (git): Check dependencies on macOS too
nobu (Nobuyoshi Nakada)
02:44 AM Revision 73834b5f (git): Calculate transient heap block usable size at compile time
jacobmatthews (Jacob Matthews)
12:24 AM Revision da25affd (git): .github: reduce copy&paste
Found that we can set default working directory for github actions. shyouhei (Shyouhei Urabe)
12:24 AM Revision 1c5f44cd (git): .travis.yml: reduce redundant tests
These tests are (more or less) covered by github actions now. shyouhei (Shyouhei Urabe)

10/20/2020

10:59 PM Revision 2f50936c (git): Ractor.make_shareable(obj)
Introduce new method Ractor.make_shareable(obj) which tries to make
obj shareable object. Protocol is here.
(1) If obj is shareable, it is shareable.
(2) If obj is not a shareable object and if obj can be shareable
object if it is f...
ko1 (Koichi Sasada)
09:42 PM Feature #17145: Ractor-aware `Object#deep_freeze`
Eregon (Benoit Daloze) wrote in #note-19:
> Is there a concrete case where it is problematic to not call user's `freeze`?
I thought I [already answered that](https://bugs.ruby-lang.org/issues/17145#note-18), but here's a short exampl...
marcandre (Marc-Andre Lafortune)
08:42 PM Feature #17145: Ractor-aware `Object#deep_freeze`
A draft to make this in a single pass (but it's late, I might have missed something):
* if the object is already deeply-frozen/shareable, return, otherwise:
* mark an object as frozen if not already (so the reachable objects from i...
Eregon (Benoit Daloze)
08:23 PM Feature #17145: Ractor-aware `Object#deep_freeze`
ko1 (Koichi Sasada) wrote in #note-14:
> I implemented `Object#deep_freeze(skip_shareable: false)` for trial.
This sounds good to me.
IMHO if something fails in the middle, it's OK for part of it to be frozen.
The intention was to free...
Eregon (Benoit Daloze)
10:00 AM Feature #17145: Ractor-aware `Object#deep_freeze`
ko1 (Koichi Sasada) wrote in #note-17:
> I never realized that so many `freeze` redefinition are used. Checking the code, some of them freeze attribute objects, which they are frozen with `deep_freeze`. I can find some cases to calculat...
marcandre (Marc-Andre Lafortune)
12:43 AM Feature #17145: Ractor-aware `Object#deep_freeze`
marcandre (Marc-Andre Lafortune) wrote in #note-16:
> 1) This does not work for recursive structures, in the sense that they will not be marked as Ractor shareable. This is capital, particularly since it is the (only) part of this metho...
ko1 (Koichi Sasada)
09:35 PM Misc #17199: id outputed by inspect and to_s output does not allow to find actual object_id and vice-versa
> Another solution could be to provide a method to get access to the address, but I'm not sure you want that.
btw you can get the address of an object like this:
```
irb(main):001:0> require "fiddle"
=> true
irb(main):002:0> x =...
tenderlovemaking (Aaron Patterson)
09:32 PM Misc #17199: id outputed by inspect and to_s output does not allow to find actual object_id and vice-versa
I think adding the object id to `inspect` is a good idea, though I think it should just have the object id, not `object_id >> 1` (or any other permutation). I don't think adding the object id to heap dumps is a good idea though since we... tenderlovemaking (Aaron Patterson)
08:15 PM Misc #17199: id outputed by inspect and to_s output does not allow to find actual object_id and vice-versa
This looks like an oversight to me? I agree with Benoit - showing object_id everywhere we used to show address seems the best way forward. nateberkopec (Nate Berkopec)
08:06 PM Misc #17199: id outputed by inspect and to_s output does not allow to find actual object_id and vice-versa
Agreed on showing the `#object_id` in `#inspect` seems better (and more useful for identifying a specific object).
Annih (Baptiste Courtois) wrote:
> It makes harder:
> ...
A simple way is `"#{super[0...-1]} extra info>"`.
Trying t...
Eregon (Benoit Daloze)
06:31 PM Misc #17199: id outputed by inspect and to_s output does not allow to find actual object_id and vice-versa
Similarly, the `object_id` and object addresses are potentially problematic when making use of `ObjectSpace.trace_object_allocations_start` and dumping the json data periodically in trying to match up the object over time if `GC.compact`... jorel (Joel Johnson)
03:55 PM Misc #17199: id outputed by inspect and to_s output does not allow to find actual object_id and vice-versa
Additional context is that `#object_id` used to use the object's address, and is now a simple incrementing number, and `#inspect` still and has always used the object's address.
I believe the documentation is correct though?
https://ru...
chrisseaton (Chris Seaton)
09:00 PM Bug #17203 (Closed): Logger::Formatter won't work with non main Ractor
The PR was merged, and `$$` can be accessed from Ractors in #17268, I think we can close this. Eregon (Benoit Daloze)
08:52 PM Feature #17267: Remove Win32API at Ruby 3.0
I think it's fine as long as it's moved to a gem, so it can still be used when desired. Eregon (Benoit Daloze)
12:38 AM Feature #17267: Remove Win32API at Ruby 3.0
+1 for removal. shyouhei (Shyouhei Urabe)
12:19 AM Feature #17267: Remove Win32API at Ruby 3.0
The following gems still used win32api.rb.
```
hsbt@aluminium:~$ gem-codesearch "require \"win32api\""
/srv/gems/rinderon-0.0.0.1/lib/rinderon/window.rb:require "win32api"
hsbt@aluminium:~$ gem-codesearch "require 'win32api'"
/srv...
hsbt (Hiroshi SHIBATA)
08:47 PM Feature #17256: Freeze all Regexp objects
@ko1 Could you show the errors from the tests?
Some tests are there just for regression or corner cases, I think actual user code matters far more than tests when it comes to backward-incompatible changes.
It seems odd to store anythin...
Eregon (Benoit Daloze)
06:25 AM Feature #17256: Freeze all Regexp objects
I tried it and several errors are observed on tests.
It is possible that people want to tweak Regexp objects (unlike Range objects).
How about to freeze literals includes `/#{expr}/`?
https://github.com/ruby/ruby/pull/3676
It is ea...
ko1 (Koichi Sasada)
08:40 PM Bug #17263: Fiber context switch degrades with number of fibers, limit on number of fibers
Please forgive me if this is a stupid question, but are fiber stacks in Ruby resizable? Can they grow or do they have a fixed size? ciconia (Sharon Rosner)
07:39 PM Feature #17176: GC.auto_compact / GC.auto_compact=(flag)
I made another pull request that sets the default to "ON":
https://github.com/ruby/ruby/pull/3316
It looks like there is one optional ruby spec test that is failing, but all of the other tests pass. Since the test suites pass wi...
tenderlovemaking (Aaron Patterson)
05:40 PM Revision 587feb0b (git): * 2020-10-21 [ci skip]
git[bot]
05:40 PM Feature #16812 (Closed): Allow slicing arrays with ArithmeticSequence
Applied in changeset commit:git|a6a8576e877b02b83cabd0e712ecd377e7bc156b.
----------
Feature #16812: Allow slicing arrays with ArithmeticSequence (#3241)
* Support ArithmeticSequence in Array#slice
* Extract rb_range_component_beg_len...
Anonymous
05:40 PM Revision a6a8576e (git): Feature #16812: Allow slicing arrays with ArithmeticSequence (#3241)
* Support ArithmeticSequence in Array#slice
* Extract rb_range_component_beg_len
* Use rb_range_values to check Range object
* Fix ary_make_partial_step
* Fix for negative step cases
* range.c: Describe the role of err argument in r...
Kenta Murata
04:30 PM Bug #17272 (Third Party's Issue): Ruby 2.7.2 crash report
This was while running an app with Puma 5.0.2 and the worker process seemed to keep crashing, which Puma would restart, and it would crash again. Log below. Note: it would be great to have better instructions in the output for how to rep... swrobel (Stefan Wrobel)
03:22 PM Bug #17193: Endless method definition doesn't work with lambdas in IRB
This seems to be fixed in https://github.com/ruby/irb/pull/131. Please check it out. taiyoslime (Taiyo Mizuhashi)
02:52 PM Revision 081cc4eb (git): Dump FrozenCore specially
nobu (Nobuyoshi Nakada)
02:52 PM Revision d915e7ee (git): strip trailing spaces [ci skip]
nobu (Nobuyoshi Nakada)
02:48 PM Revision 512752ba (git): fix condition
ko1 (Koichi Sasada)
01:48 PM Revision a3ae90b8 (git): NEWS.md: mention TypeProf
mame (Yusuke Endoh)
12:46 PM Revision 451836f5 (git): Fix an issue with generate_pretty and empty objects in the Ruby and Java implementations
Chris Seaton
12:40 PM Revision 520e0916 (git): Implement a freeze: parser option
If set to true all parsed objects will be
immediately frozen, and strings will be
deduplicated if the Ruby implementation
allows it.
byroot (Jean Boussier)
12:33 PM Revision f6680c9a (git): Added rbs and typeprof to doc/*
hsbt (Hiroshi SHIBATA)
08:57 AM Revision 67c25a34 (git): skip `echo foo` on Solaris
On Solaris, it seems to access ENV in ``, so skip it now.
```
stderr output is not empty
Exception `NameError' at bootstraptest.tmp.rb:7 - can not access non-sharable objects in constant Object::ENV by non-main Ractor.
#<Thread:0x...
ko1 (Koichi Sasada)
07:02 AM Bug #17271 (Closed): Array#[]= puts -1 at the end-component of the endless range in its exception message
Applied in changeset commit:git|18cecda46e427362fa3447679e5d8a917b5d6cb6.
----------
range.c: Fix an exception message in rb_range_beg_len
[Bug #17271]
Anonymous
05:00 AM Bug #17271 (Closed): Array#[]= puts -1 at the end-component of the endless range in its exception message
```
irb(main):001:0> [*0..5][-7..] = 1
Traceback (most recent call last):
5: from /home/mrkn/.rbenv/versions/2.7/bin/irb:23:in `<main>'
4: from /home/mrkn/.rbenv/versions/2.7/bin/irb:23:in `load'
3: from /hom...
mrkn (Kenta Murata)
07:01 AM Revision 18cecda4 (git): range.c: Fix an exception message in rb_range_beg_len
[Bug #17271] Kenta Murata
06:39 AM Feature #17270 (Closed): ObjectSpace.each_object should be restricted on multi-Ractors
Applied in changeset commit:git|ade411465dc054af5ff025531649b69134d74b56.
----------
ObjectSpace.each_object with Ractors
Unshareable objects should not be touched from multiple ractors
so ObjectSpace.each_object should be restricted. ...
ko1 (Koichi Sasada)
02:28 AM Feature #17270 (Closed): ObjectSpace.each_object should be restricted on multi-Ractors
Unshareable objects should not be touched from multiple ractors
so ObjectSpace.each_object should be restricted. On multi-ractor
mode, ObjectSpace.each_object only iterates shareable objects
even if running on the main ractor.
http...
ko1 (Koichi Sasada)
06:39 AM Revision ade41146 (git): ObjectSpace.each_object with Ractors
Unshareable objects should not be touched from multiple ractors
so ObjectSpace.each_object should be restricted. On multi-ractor
mode, ObjectSpace.each_object only iterates shareable objects.
[Feature #17270]
ko1 (Koichi Sasada)
06:39 AM Revision 2bdbdc15 (git): add Ractor.shareable?(obj)
This method returns obj is shareable or not. ko1 (Koichi Sasada)
06:39 AM Bug #17268 (Closed): special global variables which can be accessed from ractors
Applied in changeset commit:git|99310e3eb56fbc85bb45119285812eb959448d0c.
----------
Some global variables can be accessed from ractors
Some global variables should be used from non-main Ractors.
[Bug #17268]
```ruby
# ractor-loc...
ko1 (Koichi Sasada)
01:47 AM Bug #17268 (Closed): special global variables which can be accessed from ractors
Ractors can't access global variables, but some special global variables should be accessed.
There are several types.
## Proposal
(1) Read-only global variables
```ruby
# process-local (readonly): other commandline parame...
ko1 (Koichi Sasada)
06:38 AM Revision 99310e3e (git): Some global variables can be accessed from ractors
Some global variables should be used from non-main Ractors.
[Bug #17268]
```ruby
# ractor-local (derived from created ractor): debug
'$DEBUG' => $DEBUG,
'$-d' => $-d,
# ractor-local (derived from created ractor): ve...
ko1 (Koichi Sasada)
06:36 AM Revision 9ced5fae (git): add a NEWS for Fiber#transfer
ko1 (Koichi Sasada)
04:03 AM Revision c05e4103 (git): Bundle typeprof gem as bundled gems
mame (Yusuke Endoh)
03:56 AM Revision 4a7dccf4 (git): Add a Ripper.lex test of :on_embexpr_end
This is a weird use case of Ripper.lex which I'm not sure is supposed to
be maintained, so I'm adding this test so that we can easily notice such
changes.
If we change the behavior, this will break the behavior of hamlit.gem v1
and code...
k0kubun (Takashi Kokubun)
02:07 AM Feature #17269 (Closed): Frozen Process::Status
It seems immutable information.
https://github.com/ruby/ruby/pull/3671
Someone can define singleton methods on that, so it is no strong feature request.
ko1 (Koichi Sasada)
12:04 AM Misc #17200: DevelopersMeeting20201026Japan
* [Feature #17267] Remove Win32API at Ruby 3.0
* Does anyone oppose it?
hsbt (Hiroshi SHIBATA)

10/19/2020

11:58 PM Feature #17267 (Closed): Remove Win32API at Ruby 3.0
https://github.com/ruby/ruby/blob/master/ext/win32/lib/Win32API.rb#L5 says "Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead".
We have enough time to deprecate for this module.
Can we remove it from our repo?
hsbt (Hiroshi SHIBATA)
11:52 PM Feature #17265: Add `Bool` module
Could you clarify the current proposal?
* bool / Bool / Boolean
* RBS side only / Ruby module as well
I am OK if RBS side only, no Ruby module.
Matz.
matz (Yukihiro Matsumoto)
01:20 PM Feature #17265: Add `Bool` module
So `Bool` would be the "strict" variant, only `true | false`, and `bool` is anything convertible to a boolean, so any object, right?
I don't like the name `Bool`. If anything, I think it should be properly named `Boolean`.
I think ...
Eregon (Benoit Daloze)
12:20 PM Feature #17265: Add `Bool` module
shyouhei (Shyouhei Urabe) wrote in #note-3:
> `Bool` and `bool` to have different semantics sounds problematic to me.
As I stated, `String` and `string` have different semantics. Is that also problematic?
> ...
That would defeat the wh...
marcandre (Marc-Andre Lafortune)
03:33 AM Feature #17265: Add `Bool` module
`Bool` and `bool` to have different semantics sounds problematic to me. Not against this proposed `Bool`, but we need to rename `bool` then.
BTW e.g. `class String; include Bool; end` shall be prohibited somehow. Maybe a parent clas...
shyouhei (Shyouhei Urabe)
02:34 AM Feature #17265: Add `Bool` module
Hi, I'd like to add the background.
Currently, RBS provides `bool` type as an alias to `top` type (a union type of all types). The rationale is because any type is actually accepted in the context of condition expression of `if` and `...
mame (Yusuke Endoh)
12:11 AM Feature #17265 (Feedback): Add `Bool` module
1-line Summary: `rbs` would benefit from the existence of common ancestor `Bool` for `TrueClass` and `FalseClass`.
Detail:
Matz: I am aware you rejected a similar request, but could we revisit this in light of RBS?
One use case wa...
marcandre (Marc-Andre Lafortune)
10:04 PM Feature #17266: Bundle TypeProf
Approved.
Matz.
matz (Yukihiro Matsumoto)
02:55 PM Feature #17266 (Closed): Bundle TypeProf
I'm working on bundling [TypeProf](https://github.com/ruby/typeprof), a type analyzer for non-annotated Ruby code, with Ruby 3.0. The following PR bundles TypeProf as a bundled gem.
https://github.com/ruby/ruby/pull/3668
Matz was ...
mame (Yusuke Endoh)
09:24 PM Feature #17145: Ractor-aware `Object#deep_freeze`
ko1 (Koichi Sasada) wrote in #note-14:
> I implemented `Object#deep_freeze(skip_shareable: false)` for trial.
> ...
This is great! 💪
Two major issues remain:
1) This does not work for recursive structures, in the sense that they wi...
marcandre (Marc-Andre Lafortune)
08:53 PM Feature #17145: Ractor-aware `Object#deep_freeze`
Maybe we need to introduce new protocol for `T_DATA`.
For example...:
* `Time` should be frozen.
* `Thread`, `Fiber` should not be frozen. At least they can't become shareable objects.
* `Proc` and `Binding` objects are also not frozen...
ko1 (Koichi Sasada)
08:48 PM Feature #17145: Ractor-aware `Object#deep_freeze`
I implemented `Object#deep_freeze(skip_shareable: false)` for trial.
https://github.com/ko1/ruby/pull/new/deep_freeze
* It doesn't call `#freeze`, but only set frozen flag.
* It set frozen bit for any objects such as Binding, Thread, Qu...
ko1 (Koichi Sasada)
04:34 PM Revision a76a3072 (git): Revert "reduce lock for encoding"
This reverts commit de17e2dea137bc5ba9f00e3acec32792d0dbb2eb.
This patch can introduce race condition because of conflicting
read/write access for enc_table::default_list. Maybe we need to
freeze default_list at the end of Init_encdb() ...
ko1 (Koichi Sasada)
04:05 PM Revision dac36774 (git): * 2020-10-20 [ci skip]
git[bot]
04:05 PM Revision 319afed2 (git): Use language TLS specifier if it is possible.
To access TLS, it is faster to use language TLS specifier instead
of using pthread_get/setspecific functions.
Original proposal is: Use native thread locals. #3665
ko1 (Koichi Sasada)
09:56 AM Revision 3f979402 (git): Followed up with 708413807ae958afb79257b18475424e0a8a4a56
* Added sync task for digest
* Update doc/* for default gems
* Update the latest version of gemspec
hsbt (Hiroshi SHIBATA)
09:38 AM Revision 70841380 (git): Revisit to promote digest to default gems.
This reverts commit f39021be7e0eac20ef7f06592769955ea482470f. hsbt (Hiroshi SHIBATA)
05:06 AM Revision de17e2de (git): reduce lock for encoding
To reduce the number of locking for encoding manipulation,
enc_table::list is splited to ::default_list and ::additional_list.
::default_list is pre-allocated and no need locking to access to
the ::default_list. If additional encoding sp...
ko1 (Koichi Sasada)
04:21 AM Revision f1f8f380 (git): * 2020-10-19 [ci skip]
git[bot]
04:20 AM Revision ce628503 (git): Fix typos [ci skip]
znz (Kazuhiro NISHIYAMA)
12:16 AM Misc #17200: DevelopersMeeting20201026Japan
* [Feature #17265] Have common ancestor `Bool` for `TrueClass` and `FalseClass` (marcandre)
* Useful for `RBS`
* Should have very limited incompatibility
marcandre (Marc-Andre Lafortune)

10/18/2020

12:36 AM Misc #17200: DevelopersMeeting20201026Japan
* [Feature #17176] GC.auto_compact / GC.auto_compact=(flag) (tenderlove)
* Currently compaction is a manual process, eventually I want to make it automatic
* This feature lets users "opt in" to automatic compaction so we can test ex...
tenderlovemaking (Aaron Patterson)

10/17/2020

05:43 PM Bug #15661: Disallow concurrent Dir.chdir with block
Although raising an error can be helpful for discovering buggy code, it prevents calling arbitrary third-party code from within a `Dir.chdir` block. This has a cascading effect. For example, a user's Rake task might use a blockless `Di... jonathanhefner (Jonathan Hefner)
10:02 AM Feature #17260: Promote pattern matching to official feature
Good catch.
For future optimization, I will document that the number of calls to `#deconstruct`/`#deconstruct_keys` is undefined and users should not rely on current behavior.
ktsj (Kazuki Tsujimoto)
06:32 AM Revision 09dd9d8e (git): Revert "test/rinda/test_rinda.rb: try debugging TestRingServer#test_do_reply"
This reverts commit de5e8d0e3bc3cc39487ffc9d9c15642b6881cd54.
Remove the debugging code that is no longer needed
mame (Yusuke Endoh)
06:32 AM Revision 6a9e0982 (git): Revert "test/rinda/test_rinda.rb: Add more debugging code"
This reverts commit ac803ab55db50ef891e3680680620d01f28a759b.
Remove debugging code that is no longer needed
mame (Yusuke Endoh)
06:17 AM Revision 5c003b4b (git): test/rinda/test_rinda.rb: Prevent a callback Proc from being GC'ed
According to the log of ac803ab55db50ef891e3680680620d01f28a759b, I
found that a thread terminates silently due to "recycled object" of
id2ref:
```
"/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/lib/drb/drb.rb:366:in `_id2ref'...
mame (Yusuke Endoh)

10/16/2020

11:39 PM Feature #17176: GC.auto_compact / GC.auto_compact=(flag)
I've updated the patches on the PR to reflect the new API. Now you can do `GC.auto_compact = true/false` and `GC.auto_compact`. tenderlovemaking (Aaron Patterson)
11:18 PM Revision f6661f50 (git): sync RClass::ext::iv_index_tbl
iv_index_tbl manages instance variable indexes (ID -> index).
This data structure should be synchronized with other ractors
so introduce some VM locks.
This patch also introduced atomic ivar cache used by
set/getinlinecache instructions...
ko1 (Koichi Sasada)
11:18 PM Revision 91ec5f9e (git): remove rb_obj_iv_index_tbl
(1) nobody uses it (gem-codesearch)
(2) the data strucuture will be changed.
ko1 (Koichi Sasada)
06:28 PM Revision ff9dc109 (git): keep proc on the stack so it does not move
tenderlovemaking (Aaron Patterson)
03:28 PM Feature #17171: Why is the visibility of constants not affected by `private`?
At the same time it would be worth reconsidering #16276, which would allow `private{ X = 42 }` right now without a deprecation warning or having to use `private_constant` Dan0042 (Daniel DeLorme)
02:49 PM Feature #17171: Why is the visibility of constants not affected by `private`?
If `private` affects constants, are constants private after `protected`?
```ruby
class Foo
protected
P1 = 1 # private constant or not?
private
protected
P2 = 2 # private constant or not?
end
```
znz (Kazuhiro NISHIYAMA)
05:26 AM Feature #17171: Why is the visibility of constants not affected by `private`?
Deprecating on access (first time only) would be less noisy and sounds easier to implement indeed 👍 marcandre (Marc-Andre Lafortune)
04:19 AM Feature #17171: Why is the visibility of constants not affected by `private`?
marcandre (Marc-Andre Lafortune) wrote in #note-7:
> So can we envision issuing a warning for two release cycles?
> ...
I think if we do this, we should only warn on access (i.e. `Foo::X`), not definition. This would require internal ...
jeremyevans0 (Jeremy Evans)
03:55 AM Feature #17171: Why is the visibility of constants not affected by `private`?
So can we envision issuing a warning for two release cycles?
Is it feasible to issue a warning for constants that are currently public that would be made private this way?
Difficult being that call to `private_constant` happens aft...
marcandre (Marc-Andre Lafortune)
03:22 PM Bug #17264 (Closed): BigDecimal exponentiation cannot be used with #** method
As stated in Bug #17214 (https://bugs.ruby-lang.org/issues/17214) when exponentiating a BigDdecimal number even when using small numbers, a precision argument must be passed to the operation or the operation will return wrong result, 222... karatedog (Földes László)
03:08 PM Revision 26e8db6b (git): * 2020-10-17 [ci skip]
git[bot]
03:07 PM Revision ac803ab5 (git): test/rinda/test_rinda.rb: Add more debugging code
in addition to de5e8d0e3bc3cc39487ffc9d9c15642b6881cd54 mame (Yusuke Endoh)
02:24 PM Revision 0d17cdd0 (git): Abort on system stack overflow during GC
Buggy native extensions could have mark functions that cause stack
overflow. When a stack overflow happens during GC, Ruby used to recover
by raising an exception, which runs the interpreter. It's not safe to
run the interpreter during G...
alanwu (Alan Wu)
10:49 AM Bug #17220 (Third Party's Issue): Rails Active Job integration test fails with Ruby 3.0.0 since 2038cc6cab6ceeffef3ec3a765c70ae684f829ed
`getaddrinfo_a` seems to create a thread, and it will be lost by `fork`.
I'm not sure if this is a glibc's spec or bug.
This code demonstrates the behavior without Ruby.
```C
#define _GNU_SOURCE
#include <netdb.h>
#include <std...
nobu (Nobuyoshi Nakada)
07:51 AM Revision de5e8d0e (git): test/rinda/test_rinda.rb: try debugging TestRingServer#test_do_reply
https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20201016T063003Z.fail.html.gz
```
1) Error:
Rinda::TestRingServer#test_do_reply:
Timeout::Error: timeout
/home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/...
mame (Yusuke Endoh)
06:19 AM Bug #17263: Fiber context switch degrades with number of fibers, limit on number of fibers
I've been meaning to revisit the x64 implementation to make it more memory friendly.
I played around with it today in my spare time. Here is updated implementation:
```
.globl PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer)
PRE...
ioquatix (Samuel Williams)
01:58 AM Bug #17263: Fiber context switch degrades with number of fibers, limit on number of fibers
On my computer, I found the following.
I changed your script to run with the given number of fibers as an argument.
```
> sudo perf stat -e page-faults,cpu-cycles:u,cpu-cycles:k ./ruby ../test.rb 10000
fibers: 10000 rss: 143252 count: ...
ioquatix (Samuel Williams)
05:39 AM Misc #17200: DevelopersMeeting20201026Japan
* [Feature #17171] Have `private` affect constants and singleton methods definitions too (marcandre)
* Privacy is important for gems in particular. `private_constant` is verbose to use.
* The constants and methods affected would ha...
marcandre (Marc-Andre Lafortune)
02:45 AM Bug #17254: ENV.replace may set nil instead of the proper value
Looking at the `ENV.replace` implementation, the reason it doesn't call `clear` is it isn't thread-safe. `ENV.replace` tries to set all ENV keys in the replacement hash (the argument), then remove keys for ENV that aren't in the replace... jeremyevans0 (Jeremy Evans)
02:10 AM Revision 1cbb1f17 (git): test/ruby/test_syntax.rb: avoid "warning: assigned but unused variable"
mame (Yusuke Endoh)
01:38 AM Bug #17255: Installation failed for ruby version 2.7.1: unknown encoding name: binary (ArgumentError)
Does this error also occur when building Ruby 2.7.2 in your environment? jeremyevans0 (Jeremy Evans)

10/15/2020

11:57 PM Bug #17220: Rails Active Job integration test fails with Ruby 3.0.0 since 2038cc6cab6ceeffef3ec3a765c70ae684f829ed
Here's a small script that reproduces the problem:
```ruby
require "socket"
Socket.getaddrinfo("localhost", nil)
pid = fork do
Socket.getaddrinfo("localhost", nil)
end
Process.wait pid
```
In Rails' test suite, the `...
eugeneius (Eugene Kenny)
11:37 PM Revision c34539d0 (git): * 2020-10-16 [ci skip]
git[bot]
11:37 PM Bug #16695 (Closed): Stack consistency error when using the return value
Applied in changeset commit:git|ce7a053475cbebfb2f3e5ed6614e0ba631541917.
----------
Adjust sp for `x = false; y = (return until x unless x)` [Bug #16695]
wanabe (_ wanabe)
11:37 PM Revision 65ae7f34 (git): Adjust sp for `if true or ...`/`if false and ...`
wanabe (_ wanabe)
11:37 PM Revision ce7a0534 (git): Adjust sp for `x = false; y = (return until x unless x)` [Bug #16695]
wanabe (_ wanabe)
07:10 PM Feature #16986: Anonymous Struct literal
I think a new syntax for this is way too heavy for such a small thing.
```ruby
s = Struct.new(:a, :b).new(0, 0)
```
is easy enough and already works.
And refactoring that to make it efficient for many instances is just giving it...
Eregon (Benoit Daloze)
05:43 PM Feature #16986: Anonymous Struct literal
From the aspect of "writing-well", `${a: 0, b: 0}` was happy with me (but I understand some (many?) people doesn't like `$`), but `%struct{a: 0, b: 0}` is longer. `Struct(a:0, b:0)` is shorter and clearer...
ko1 (Koichi Sasada)
05:40 PM Feature #16986: Anonymous Struct literal
marcandre (Marc-Andre Lafortune) wrote in #note-55:
> Seems to me that `s = {a: 0, b: 0}` is a good solution here. If you mistype `aa`, you *want* an error, so I don't see the issue.
In this case, yes. So IDE support in future? (clea...
ko1 (Koichi Sasada)
04:40 PM Feature #16986: Anonymous Struct literal
ko1 (Koichi Sasada) wrote in #note-54:
> Of course, sometimes I use `s = {a: 0, b: 0}`, but sometimes I mistype as `s[:aa] += val #=> error because of nil+val`
Seems to me that `s = {a: 0, b: 0}` is a good solution here. If you misty...
marcandre (Marc-Andre Lafortune)
03:27 PM Feature #16986: Anonymous Struct literal
Named tuple example:
On my scripting sometimes I use an array as a tuple like that:
```ruby
s = [0, 0] # s is "statistics" and [A's count, B's count]
# I want to prohibit extension of `s` (s[3] = 0), but there is no way.
dat...
ko1 (Koichi Sasada)
11:25 AM Bug #17263: Fiber context switch degrades with number of fibers, limit on number of fibers
I can confirm I can reproduce your problem. As an experiment, I did:
```
first.transfer
count = 0
```
as warmup to see if it was some kind of lazy allocation issue, but it didn't seem to help. I'll have to take a look at the i...
ioquatix (Samuel Williams)
11:13 AM Bug #17263: Fiber context switch degrades with number of fibers, limit on number of fibers
Regarding "can't set a guard page" it's because of your system is limiting the number of memory mapped segments. Each fiber stack requires a guard page and this is considered a separate memory map entry.
Try increasing it:
```
sysctl -...
ioquatix (Samuel Williams)
10:04 AM Bug #17263 (Closed): Fiber context switch degrades with number of fibers, limit on number of fibers
I'm working on developing [Polyphony](https://github.com/digital-fabric/polyphony), a Ruby gem for writing
highly-concurrent Ruby programs with fibers. In the course of my work I have
come up against two problems using Ruby fibers:
...
ciconia (Sharon Rosner)
08:19 AM Revision b68c22b3 (git): Partly reverted test failing with https://github.com/rubygems/rubygems/pull/3921
hsbt (Hiroshi SHIBATA)
08:19 AM Revision d386a58f (git): Merge bundler-2.2.0.rc.2
hsbt (Hiroshi SHIBATA)
08:13 AM Bug #17262 (Closed): Backport encoding fixes
Please backport following fixes for Encoding.
* commit:5f7be6243a5b support multi-run for test/ruby/test_encoding.rb
* commit:921916ff9e29 Isolate the test for Encoding#replicate
* commit:52cdf400efae Workaround of instance variable...
nobu (Nobuyoshi Nakada)
07:48 AM Revision 7ffd14a1 (git): Check encoding name to replicate
https://hackerone.com/reports/954433 nobu (Nobuyoshi Nakada)
05:12 AM Revision ab6c4f8b (git): Merge rubygems-3.2.0.rc.2
hsbt (Hiroshi SHIBATA)
 

Also available in: Atom