[00:00] but the fail will still be created [00:02] it will? [00:02] you're talking about return value of val? [00:03] i think s? [00:05] or is this more about "val is too many-purpose"? [00:07] so we can't just use it for when we smartmatch against a number [00:08] well, as i understand it, we're calling Str.Numeric -> val(:val-or-fail) -> fail [00:08] https://github.com/rakudo/rakudo/blob/master/src/core.c/allomorphs.pm6#L219-L220 [00:09] so by the time val has returned the fail+backtrace have already been created [00:09] ok so we would steal Str::Numeric and change nothing except for the use of val-or-fail [00:10] or add an argument to Str.Numeric that it passes to val [00:10] btw we could perhaps maybe numify only a single time when there's multiple whens that try to match against numbers [00:10] possibly [00:11] yeah, i was wondering about maybe creating QAST::Blocks and creating some variables to reuse [00:12] blocks you have to be careful with, because they have a scoping meaning [00:12] m: given "0x1" { when 16 { say "yes" } } [00:12] rakudo-moar 85847d2f1: ( no output ) [00:12] m: given "0x1" { when 16 { say "yes" }; when Int { .say } } [00:12] rakudo-moar 85847d2f1: ( no output ) [00:13] m: say 0x1.Numeric [00:13] rakudo-moar 85847d2f1: OUTPUT: «1␤» [00:13] ahahaha [00:13] m: given "0x10" { when 16 { say "yes" } } [00:13] rakudo-moar 85847d2f1: OUTPUT: «yes␤» [00:13] well, statement_control:sym doesn't really know about the other whens, so that optimization would have to happen elsewhere, right? [00:13] yeah [00:13] and you can put "when" in many different things [00:14] we'll want to do some pretty defensive checks at the beginning [00:14] that might best belong in Optimize.pm6 [00:14] true [00:18] looks like we probably also need a new Failure.new. all the existing ones call nqp::create(self)!SET-SELF, and !SET-SELF is where the backtrace is created [00:18] or more arguments to set [00:19] ugh, i also don't see a restart button for travis https://travis-ci.org/github/rakudo/rakudo/builds/743501497 [00:20] why do we want a failure without backtraces? [00:20] because creating the backtrace is what's slow. and we don't use it in this case [00:21] https://github.com/rakudo/rakudo/blob/master/src/core.c/Backtrace.pm6#L98 is what's 44% in the profile [00:22] i'd rather say skip failure entirely for cases like this [00:22] we'd have to pass something to decide between failure with and without backtrace anyway [00:22] sure, no strong feelings either way here [00:24] but if it doesn't fail/throw/something, whatever the return value is will get passed to nqp::iseq_s [00:24] oops, iseq_i [00:25] well, we'd have to check that first [00:25] immediately after the return [00:25] typecheck could be enough, since it's either something numeric, or the string again [00:25] (but it could be a string with a role applied, or something derived from Str) [00:31] i gotta get to bed. but i'll backlog if there are any more idea/suggestions [00:38] good night! [02:34] *** leont left [02:58] *** lucasb left [03:49] *** b2gills left [04:12] ¦ rakudo: Kaiepi++ created pull request #4028: Throw an exception if &make is called w/o a valid match in $/ [04:12] ¦ rakudo: review: https://github.com/rakudo/rakudo/pull/4028 [06:04] *** sena_kun joined [08:09] *** Altai-man joined [08:12] *** sena_kun left [09:00] vrurg: (exceptions on jvm backend) I'm afraid I'm not of much help there. I've tweaked some code to throw a typed (Raku) exception in the past -- but maybe that's not what you want. I took this old commit as a blueprint for throwing typed exceptions: https://github.com/rakudo/rakudo/commit/1b01e7aff7 [09:01] vrurg: do you have a link to a specific nqp::die you want to change? [09:40] *** linkable6 left [09:40] *** evalable6 left [09:40] *** evalable6 joined [09:42] *** linkable6 joined [10:39] *** ufobat joined [11:14] ¦ rakudo: adeff7de83 | (Elizabeth Mattijsen)++ | 2 files [11:14] ¦ rakudo: Streamline handling of bind/delete on native arrays [11:14] ¦ rakudo: [11:14] ¦ rakudo: - Introduce X::Delete typed error message and use that [11:14] ¦ rakudo: - Throw an X::Bind on trying to bind: please note that this is [11:14] ¦ rakudo: runtime and at that point it is impossible to get the name of [11:14] ¦ rakudo: the native array being accessed, so X::Bind::NativeType can [11:14] ¦ rakudo: not be used for that. [11:14] ¦ rakudo: review: https://github.com/rakudo/rakudo/commit/adeff7de83 [11:19] *** leont joined [12:10] *** sena_kun joined [12:12] *** Altai-man left [12:18] vrurg: I poked around with your branch and I think the internal java error happens because origArg is not decontainerized in https://github.com/vrurg/rakudo/blob/raku_1285/src/vm/jvm/runtime/org/raku/rakudo/Binder.java#L519 [12:26] vrurg: I tested with Ops.decont(arg_o, tc) instead and in both cases the following error from nqp::die appeared: Impossible coercion from 'BOOTStr' into 'Str': no acceptable coercion method found [12:29] *** frost-lab joined [12:30] ¦ rakudo: 3e6e15e620 | (Elizabeth Mattijsen)++ | 2 files [12:30] ¦ rakudo: Make simple native shaped array access about 5x as fast [12:30] ¦ rakudo: [12:30] ¦ rakudo: By supplying postcircumfix candidates that directly map to the [12:30] ¦ rakudo: underlying nqp:: ops. This does *not* fix the issue with a [12:30] ¦ rakudo: typecheck on the native shaped array that for some reason is [12:30] ¦ rakudo: *always* taking the slow path. [12:30] ¦ rakudo: review: https://github.com/rakudo/rakudo/commit/3e6e15e620 [12:34] vrurg: but please note, from what it looks this error pops up for a different object (not the one that caused the other explosion) [12:37] *** ufobat left [12:47] (and the string it doesn't like is the current version (2020.10-90-g3923f18c3)) [12:49] *** lucasb joined [12:57] m: my int @a[10]; say @a[0].WHAT [12:57] rakudo-moar 85847d2f1: OUTPUT: «(Int)␤» [13:08] lizmat: are native int arrays automatically initialized to zero? [13:09] ¦ rakudo: f6a33b8b35 | (Elizabeth Mattijsen)++ | 3 files [13:09] ¦ rakudo: Make @a[int $i] about 2x as fast [13:09] ¦ rakudo: [13:09] ¦ rakudo: Turns out that having explicit int $pos candidates for [13:09] ¦ rakudo: postcircumfix:<[ ]> is actually detrimental to performance when [13:09] ¦ rakudo: indexing using a native int. So remove all of the specific int [13:09] ¦ rakudo: $pos candidates. [13:09] ¦ rakudo: [13:09] ¦ rakudo: However, using an int to index into an array, is still about 5x [13:09] dogbert17: yes [13:09] ¦ rakudo: as slow as using an Int:D :-( So effectively it's gone down from [13:09] ¦ rakudo: 10x as slow to 5x as slow. [13:09] ¦ rakudo: review: https://github.com/rakudo/rakudo/commit/f6a33b8b35 [13:09] lizmat++ optimizing [13:09] m: my int @a; @a[9] = 42; dd @a [13:09] rakudo-moar 85847d2f1: OUTPUT: «array[int].new(0, 0, 0, 0, 0, 0, 0, 0, 0, 42)␤» [13:09] m: my int @a[10]; dd @a [13:09] rakudo-moar 85847d2f1: OUTPUT: «array[int].new(:shape(10,), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0])␤» [13:10] *** ugexe left [13:10] thx, just wanted to be certain. I guess it's in the docs somewhere. [13:11] well, if you think about it: a native int array is basically just a blob of memort [13:11] *memory [13:11] we don't want garbage in there, so setting it to 0 seems like a sensible thing to do :-) [13:11] excellent, now I know [13:23] lizmat: I think I see a slowdown in one of my test scripts after the latest fixes [13:23] ah> [13:23] ? [13:24] which one, the last one ? [13:24] or the one adding native shaped array postcircumfix candidates ? [13:25] dunno, I can investigate [13:26] * dogbert17 investigates [13:26] please :-) with a golfed example, hopefully :-) [13:27] will try [13:28] seems to be the last one [13:29] intriguing, are you using native indices in your code ? [13:31] m: my int $max = 2_000_000; my int @a = (0..$max); for (2..($max div 2)) -> int $i { my int $j = 2; @a[$i * $j++] = 1 while $i * $j <= $max; } # the worst golf ever :-) [13:32] rakudo-moar 85847d2f1: ( no output ) [13:33] dogbert17: am about to go afk for a few hours, will look at it when back [13:33] ++lizmat [13:33] committable6: HEAD~3,HEAD my int $max = 2_000_000; my int @a = (0..$max); my $s = now; for (2..($max div 2)) -> int $i { my int $j = 2; @a[$i * $j++] = 1 while $i * $j <= $max; }; say now - $s [13:33] MasterDuke, ¦HEAD~3: «1.1405576␤» ¦HEAD(f6a33b8): «1.909452␤» [13:34] MasterDuke++ [13:34] wow, that's quite a difference [13:34] a mystery [13:34] well, a --profile will say a lot [13:34] but when I get back :-) [13:36] vrurg: and with Ops.hllize(Ops.decont(arg_o, tc), tc) there seems to be no error at all. I'll start a spectest run ... [13:37] *** tailgate left [13:39] *** b2gills joined [13:40] lizmat: can you get the shit together, please? Or at least let me know what I should and should not have access to, so that I can demand privileges that you forgot to grant. For example, if I shouldn't have access to whateverable repo (including not being able to even leave comments on my own issues), then I guess you're ready to run them on your own server? If not, then please fix it. [13:41] *** tailgate joined [13:43] how do i pass a named parameter to a `QAST::Op.new( :op('call'), ...)`? [13:44] *** unclechu left [13:44] *** MitarashiDango[m left [13:44] *** AlexDaniel` left [13:47] *** JJAtria[m] left [13:48] oh, QAST::SpecialArg [14:05] *** wildtrees joined [14:11] *** unclechu joined [14:19] *** wildtrees left [14:19] *** wildtrees joined [14:22] *** MitarashiDango[m joined [14:23] *** AlexDaniel` joined [14:25] *** JJAtria[m] joined [14:26] *** b2gills left [14:34] *** b2gills joined [14:49] it used to be any QAST node with :name attached, IIRC [14:55] turns out i had to `my $a := QAST::Op.new( :op('hllbool')QAST::IVal.new( :value(1) ) ); $a.named('name-i-chose');` [14:55] and then push that onto the `call` [14:57] ah, .named, not :name [15:06] lizmat: let me know when it's fixed [15:07] or whatever the decision is [15:07] more complicated than i expected [15:08] m: my $a; my $s = now; $a = do given "hi" { when 3 { "three" }; when 5 { "five" }; when "hi" { "hello" }; when * > 40 { "> 40" }; default { "default" } } for ^40_000; say now - $s; say $a [15:08] rakudo-moar 85847d2f1: OUTPUT: «7.7764281␤hello␤» [15:08] timotimo: locally ^^^ went from ~4.5s to ~0.5s [15:08] passes spectest [15:09] and to make it even more actionable: click Settings, Manage access, add AlexDaniel, set role as Admin [15:10] in the long run, please, do take over the project. But meanwhile do not interfere. [15:11] https://gist.github.com/MasterDuke17/a731e2dc7a8b2f5c82ff581f535ad0f9 [15:13] MasterDuke: very nice [15:14] not sure how pretty/clean/whatever the change is though... [15:18] think i should add it to the existing PR? [15:45] added as a new/separate commit [16:08] ¦ problem-solving: lizmat assigned to codesections Issue How should modules/distributions be handled when severe security issues are discovered? https://github.com/Raku/problem-solving/issues/245 [16:09] *** Altai-man joined [16:12] *** sena_kun left [16:19] *** Kaeipi left [16:19] *** Kaeipi joined [16:20] very glad to see you succeeded with this optimization [16:21] *** ufobat joined [16:22] *** Merfont joined [16:22] *** Kaeipi left [16:52] *** domidumont joined [16:53] *** domidumont left [17:12] *** MasterDuke left [17:15] *** MasterDuke joined [17:22] *** ufobat left [18:12] ¦ rakudo: mienaikage++ created pull request #4029: Improve output of Attribute with Pod::To::Text [18:12] ¦ rakudo: review: https://github.com/rakudo/rakudo/pull/4029 [18:15] *** jmerelo joined [18:15] p6steve has posted this in StackOverflow https://stackoverflow.com/questions/64837072/should-i-get-a-raku-segfault-depending-on-order-of-use-statements [18:15] Can anyone help? [19:13] ¦ nqp: usev6++ created pull request #682: Add add_native_assign_op to keywords [19:13] ¦ nqp: review: https://github.com/Raku/nqp/pull/682 [19:34] *** jmerelo left [19:47] <[Coke]> "should... segfault" answer is always no [19:48] <[Coke]> (except for NativeCall maybe) [19:52] and for doing multithreading in an unsafe way, the answer is currently "possible to segfault, but not going to stay that way forever" [20:07] backtraces of the segv from the SO question https://gist.github.com/MasterDuke17/1ca3751839081a8ffb1126e4113a65e5 [20:10] *** sena_kun joined [20:12] *** Altai-man left [20:16] ¦ rakudo: dumarchie++ created pull request #4030: Add Windows specific build instructions [20:16] ¦ rakudo: review: https://github.com/rakudo/rakudo/pull/4030 [22:01] .tell bartolin I have partially fixed that exception. It was due to where X::Parameter::InvalidConcreteness exception is prepared two arguments are passed as longs instead of boxed values. It's now different exception it produces. Looks like another case of missing boxing. [22:01] vrurg, I'll pass your message to bartolin [22:03] lizmat: i can repro the segv asked about in the SO question. https://gist.github.com/MasterDuke17/1ca3751839081a8ffb1126e4113a65e5 [22:21] *** sena_kun left [22:28] *** sena_kun joined [22:35] *** sena_kun left [22:51] *** sena_kun joined [23:06] *** sena_kun left