Perl 6 language and compiler development 2.0 | Logs at irclog.perlgeek.de/perl6-dev/today | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
Set by moderator on 12 May 2018.
MasterDuke timotimo: any ideas for how to make this github.com/rakudo/rakudo/blob/mast...#L799-L823 smaller in bytecode? i've removed sigils and pulled the role outside the sub, but it's only down to 440 bytes 01:06
timotimo perhaps try to have just one EVAL and combine the string in there 01:07
maybe have the ifs construct just one string that'? either :i :m, :i, :m or the empty string 01:08
MasterDuke hm, i'll give that a try 01:09
01:58 ilbot3 joined
moderator Perl 6 language and compiler development 2.0 | Logs at irclog.perlgeek.de/perl6-dev/today | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
timotimo can you tell from spesh if the inner blocks are already counted for the 440? 02:05
MasterDuke how would i know? 02:06
if i turn on MVM_LOG_INLINES, the only debug output with MAKE_REGEX in it is `Can NOT inline MAKE_REGEX (9904) with bytecode size (440) into INTERPOLATE_ASSERTION (9892): bytecode is too large to inline` 02:08
adding the `with bytecode size (440)` to what's printed is a local modification 02:09
timotimo the spesh log prints out the bytecode for the whole frame normally 02:21
MasterDuke i don't see bytecode size in the spesh log? 02:25
i'm trying turning it into multis now
timotimo no, but you can see what kinds of things take up space in it
oh, you can just take the very last BB and see what its pc is 02:28
that's the original pc, i.e. it refers to the "before" state 02:29
but it gives you a rough idea of how big the frame is
MasterDuke line: 807 (pc 440) 02:30
both before and after specialization 02:31
timotimo right, that doesn't change between before and after
i'll make spesh print out the size 02:33
oh, it's not trivial, i'll have to go through the code and count
MasterDuke how would it be different than what i did? 02:34
timotimo well, spesh can make the bytecode shrink or grow, but you can't see that from what's in the speshlog unless you count it by hand 02:35
computers are better at that sort of thing
MasterDuke hm. and is the inlining being attempted before or after the specialization? 02:37
timotimo i think it takes spesh-optimized code for inlining 02:38
yeah, you can see it in the spesh log
"Inlining graph" gives you graphs that contain sp_ ops 02:39
which only spesh is allowed to emit
MasterDuke hm, with multis i now get `Can inline <anon> (835) into MAKE_REGEX (9903)`
but that's the only reference to MAKE_REGEX, there's nothing about trying to inline it
timotimo inlining something into MAKE_REGEX can be a big contributor to its size 02:41
can you find the corresponding frame in the spesh log that's being inlined into MAKE_REGEX?
MasterDuke Latest statistics for '<anon>' (cuid: 835, file: SETTING::src/core/Attribute.pm6:63) 02:42
that's deep into `method compose` in Attribute.pm6 02:43
timotimo grab my latest moarvm commit 02:49
MasterDuke k. btw, making it multis was a decent help 02:53
timotimo hm, i wonder if they should be made named arguments 02:54
MasterDuke `perl6 -e 'my @l = "sm.sql".IO.lines; my $s = "Perl6"; my $t = now; my @m = @l.grep(/ <$s> /); say @m.elems; say now - $t'` for a 10k line file went from 3.4s to 2.6s
timotimo but their presence or nonpresence is probably not going to be static in the code
so that might not actually help
wow
MasterDuke fyi, couple new warnings. e.g., `src/spesh/dump.c:552:37: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘MVMuint32 {aka unsigned int}’ [-Wformat=]` 02:56
timotimo why don't i get those :| 02:58
gcc is lying to me?
MasterDuke i have gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0
timotimo if you change the ld in there to lu instead, does that fix it? 02:59
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
MasterDuke but i didn't see them with gcc (GCC) 8.1.0
i.e., got warnings in kubuntu 17.10, not in arch linux
Frame size: 226 bytes 03:00
for the <anon> that got inlined into MAKE_REGEX
oh, that was before. Frame size: 128 bytes after
MAKE_REGEX is Frame size: 546 bytes before, and Frame size: 344 bytes (140 from inlined frames) after 03:02
hm. there was an 'inlining graph' before, of that <anon>. it had Frame size: 128 bytes 03:03
btw, making them '%u' silenced the warnings 03:05
timotimo without an l?
MasterDuke yeah
timotimo so with %lu it's still warning? 03:06
MasterDuke yeah, `warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘MVMuint32 {aka unsigned int}’ [-Wformat=]`
timotimo ok, thank you! 03:07
going to bed, seeya! 03:16
MasterDuke same here, later... 03:17
04:01 Ben_Goldberg joined 05:47 ufobat___ joined 05:55 entonian joined 08:24 ufobat___ joined
[Tux] Rakudo version 2018.04.1-71-g776ff354c - MoarVM version 2018.04.1-100-g99971b537
csv-ip5xs0.861 - 0.873
csv-ip5xs-208.698 - 8.760
csv-parser37.111 - 37.651
csv-test-xs-200.421 - 0.480
test8.974 - 9.008
test-t2.347 - 2.428
test-t --race0.998 - 1.000
test-t-2041.685 - 42.041
test-t-20 --race14.766 - 15.508
08:25
samcv good * 09:17
10:12 robertle joined
samcv releasable6: status 10:24
releasable6 samcv, Next release in ≈6 days and ≈8 hours. 2 blockers. 0 out of 71 commits logged
samcv, Details: gist.github.com/f63ca0be6ce1470dee...b606ee850e
10:55 ExtraCrispy joined
Geth rakudo: MasterDuke17++ created pull request #1823:
Turn MAKE_REGEX into multis
11:36
MasterDuke still not sure why MAKE_REGEX doesn't show up in the debug output for inlining other than something being inlined into it. why isn't spesh attempting to inline it into INTERPOLATE_ASSERTION? 11:46
timotimo MasterDuke: what does INTERPOLATE_ASSERTION's spesh log look like? 12:25
both the stats and the before/after 12:26
Geth roast/car-grant-midrat: e0c9483ff0 | (Zoffix Znet)++ | S32-num/midrat.t
[CaR Grant] Spec MidRat->Rat degradation
12:30
roast/car-grant-midrat: f98396df31 | (Zoffix Znet)++ | S32-num/midrat.t
Don't store dens in vars

We never use them in this subtest
12:32
MasterDuke timotimo: before has Frame size: 1748 bytes + (166 + 170 from inlining graph), after has Frame size: 1836 bytes (346 from inlined frames) 12:33
timotimo what code are you using? 12:34
MasterDuke `perl6 -e 'my @l = "sm.sql".IO.lines; my $s = "Perl6"; my $t = now; my @m = @l.grep(/ <$s> /); say @m.elems; say now - $t'`
timotimo sm.sql is like a profile sql file or something? 12:36
MasterDuke yeah, shortened to exactly 10k lines
this is all done on the branch from my PR of course 12:40
dogbert11 ZOFFLOP: t/06-telemetry/01-basic.t test #42 13:06
ZOFFLIP: t/spec/S10-packages/precompilation.rakudo.moar test #47 13:07
MasterDuke i think there was a segfault in t/09-moar/General_Category__UnicodeData__2.t in the failed travis run for github.com/rakudo/rakudo/pull/1823 13:08
Geth roast/car-grant-midrat: cd834c824c | (Zoffix Znet)++ | S32-num/midrat.t
[CaR Grant] Add more MidRat->Rat degradation specs

  - Test with two low-denominator MidRats
13:27
dogbert11 MasterDuke: yes, there's something fishy going on with that one 13:40
it shouldn't look like this: Illegal instruction (core dumped) 13:41
timotimo MasterDuke: got a clue what's ailing the jvm in your pull request? or does it also not run any of rakudo's tests in the master branch? 13:42
MasterDuke timotimo: not sure. but github.com/rakudo/rakudo/pull/1822 also has all failing jvm jobs 13:44
and that touches completely different code, so i don't think it's a problem with either of the PRs 13:46
timotimo OK
that's fair
i restarted the job with the flapper btw
MasterDuke thanks
13:47 bartolin joined 13:56 lucasb joined
MasterDuke oh, t/02-rakudo/08-inline-native-arith.t just flopped for me, that's a new one 13:56
Geth roast/car-grant-midrat: 7891f3d6e9 | (Zoffix Znet)++ | S32-num/midrat.t
[CaR Grant] MidRat no longer inherits from FatRat

Reasoning: irclog.perlgeek.de/perl6/2018-05-13#i_16160055
14:11
MasterDuke timotimo: travis is now clean. would you mind merging 1822 and 1823? 14:27
timotimo i wonder if the single space for "not m and not i" is necessary 14:30
or if it also comes out correct with an empty string there
we perhaps optimize concatenating empty strings
of course that'll be a drop in the ocean
if we pull the "anon regex { " together with the different flags, we'll spend a tiny more space in the string constant table, but we can get rid of a single concatenation in the bytecode 14:32
MasterDuke k. i'm gonna be afk for a bit, but can try that later 14:33
timotimo until then i can probably merge the pull request, it does look good 14:34
and the pay-off looks juicy
MasterDuke yeah, i was surprised but happy it was that much of a difference 14:35
Geth rakudo: 32a78996e6 | (Daniel Green)++ | src/core/Match.pm6
Turn MAKE_REGEX into multis

Also pull the role outside of the subs and re-write a nested ternary into nested nqp ops.
rakudo: 79af50f698 | timo++ (committed using GitHub Web editor) | src/core/Match.pm6
Merge pull request #1823 from MasterDuke17/speed_up_MAKE_REGEX

Turn MAKE_REGEX into multis
searching 10k lines for a constant string interpolated into a regex with `<$s>` syntax is about 30% faster.
rakudo: e0dca0ccbd | thundergnat++ | src/core/Rational.pm6
Rewrote Rat / FatRat stringification to be much faster.

Rats stringify on average twice as fast, FatRats, depending on the size of the denominator, range from about the same to 200+ times as fast. Also fixes a few bugs: FatRat strings very close to 1 no longer round off to 1. Rats and FatRats no longer ever stringify with trailing zeros in the fractional part. FatRats are now capable of stringifying to sixteen minimum significant digits or more if necessary to accurately express the value, but holding off for v6.c
  because it isn't spec.
14:36
rakudo: f72a6a4995 | timo++ (committed using GitHub Web editor) | src/core/Rational.pm6
Merge pull request #1822 from thundergnat/fast-fatrats

Rewrote Rat / FatRat stringification to be much faster.
timotimo thundergnat++ # very cool
14:43 AlexDaniel joined 15:05 ufobat joined 15:45 skids joined
skids wonders if there is an nqp op to create a shallow clone of a mixin's base type 16:21
timotimo clone of a type? you mean an instance of that type with the attributes copied over shallowly? 16:23
skids Yes, of an instance. Basically strip the mixin.
timotimo i don't think there is an op for that 16:24
skids I've found a spot where it is necessary to shed SpecialArg off a node.
timotimo ah, interesting
i suppose storing a value in there that means "nope" is not helpful, right? 16:25
if places do istype everywhere
skids Well usually they check whether .named is true, but there are a few spots that check for SPecialArg specifically. 16:26
(this is the spot. It was assuming it would get a Want and stripping it, but it could actually be a WVal or an Op, too) github.com/skids/rakudo/commit/8c1...ca7103556e 16:27
(Oh i guess that's two commits in) 16:28
Geth rakudo: zoffixznet self-assigned TWEAK cannot set array dimension dynamically when it uses variable declared with has keyword github.com/rakudo/rakudo/issues/1793
9b915f09de | (Zoffix Znet)++ | src/Perl6/Grammar.nqp

Fixes R#1793 github.com/rakudo/rakudo/issues/1793
When we set up a fresh $*HAS_SELF for throwage of X::Syntax::NoSelf in post contraints, it's not actually scoped to for just the post constraint. It's technically declared at the start of ... (6 more lines)
16:47
16:54 cog_ joined
synopsebot R#1793 [open]: github.com/rakudo/rakudo/issues/1793 TWEAK cannot set array dimension dynamically when it uses variable declared with has keyword
roast: 3993892a3f | (Zoffix Znet)++ | S12-construction/construction.t
Remove trailing whitespace
18:33
roast: 65f0dd0cff | (Zoffix Znet)++ | S12-construction/construction.t
Test attributes can be used in variable shape declarations

Closes github.com/rakudo/rakudo/issues/1793 R#1793 Rakudo fix: github.com/rakudo/rakudo/commit/9b915f09de
releasable6 Next release in ≈5 days and ≈23 hours. 2 blockers. Please log your changes in the ChangeLog 19:00
MasterDuke hasn't nine++ already fixed the .precomp blocker? 19:01
19:11 commavir joined
MasterDuke timotimo: thanks for merging. btw, did you try my code? if so, did you see anything useful in the spesh log? 20:15
timotimo i only looked a tiny bit, but i also didn't see why it didn't come up 20:29
20:33 cog_ joined
timotimo like, in the stats it records more and more hits for that, i.e. it's running code that is actually still logging the executions 20:39
which speshed code wouldn't do 20:40
hey, maybe i'm onto something here
MasterDuke oh?
timotimo hm, no, there's no deopts 20:41
and interpolate_assertion and make_regex are both jitted fully
AlexDaniel MasterDuke: I think he did some improvements 20:43
they're not referenced in the issue unfortunately
IIRC there was still something left, although maybe that's not blocker-worthy 20:44
.tell nine Please update the status of R#1783 (is it fully resolved? If not, what is left?) 20:45
yoleaux AlexDaniel: I'll pass your message to nine.
synopsebot R#1783 [open]: github.com/rakudo/rakudo/issues/1783 [⚠ blocker ⚠] New sporadic explosions likely related to precomp
dogbert11 stupid question of the day: if MoarVM is built with the --no-optimize flag everything should still work albeit at a slower pace right? 21:17
21:21 cog_ joined
timotimo yeah 21:36
dogbert11 timotimo: thx, one spectest file behaves badly with --no-optimize, i.e. t/spec/integration/eval-and-threads.t 22:03
it tends to fail with 'moar: src/gc/collect.c:218: process_worklist: Assertion `*item_ptr != item->sc_forward_u.forwarder' failed.'
22:31 lizmat joined 23:32 MasterDuke joined