masak (>):
> <masak> Tux says something recent caused the above failure. I'd really
> appreciate it if someone wanted bisect (maybe a month back or so).

I did a bisect, which revealed a number of things. All of the findings below 
can be reproduced by the following commands:

    $ git clone g...@github.com:rakudo/rakudo
    $ cd rakudo
    $ git checkout <SHA-1 to check out>
    $ perl Configure.pl --gen-moar --gen-nqp --backends=moar
    $ make
    $ make install
    $ install/bin/perl6 -e 'my $dots = 0; class C is Exception { method message 
{ "$dots" } }; for ^20_000 { { die C.new; CATCH { default {} } }; print "."; 
$dots++ }'

First off, here's the offending commit. Its parent runs all the way 
undisturbed, but this commit dies after 28 iterations:

commit a398910b4a6a1bdd42cd5a3cc33d8dfad0e3501f
Author: jnthn <jn...@jnthn.net>
Date:   Thu Jul 31 00:32:56 2014 +0200

    Better handling of sink.
    
    On MoarVM, this leads to a smaller QAST trees and much better code
    generation. On JVM and Parrot, we get the first advantage, and we
    could improve their code-gen in the future too. Note the Parrot bit
    of this is untested due to being unable to build NQP Parrot on Win32
    at present; the JVM patch worked right off, though, and there's very
    little reason fro the Parrot one not to. Testing welcome.

 src/Perl6/Actions.nqp       | 29 ++---------------------------
 src/vm/jvm/Perl6/Ops.nqp    | 27 +++++++++++++++++++++++++++
 src/vm/moar/Perl6/Ops.nqp   | 38 ++++++++++++++++++++++++++++++++++++++
 src/vm/parrot/Perl6/Ops.nqp | 27 +++++++++++++++++++++++++++
 4 files changed, 94 insertions(+), 27 deletions(-)

What's interesting is that the commit is not an NQP/Moar bump, it's just the 
addition of a new op. So chances are the commit uncovered an error that was 
already present.

I tried reverting this commit on Rakudo HEAD (c86f75), and the resulting commit 
doesn't have the bug. I pushed the result to the branch 'revert-bho-sink' on 
Github, in case someone wants to merge this into 'nom'. (Which is my 
recommendation.) I haven't spectested the new commit.

Next up, the following commit changes the number of iterations from 28 to 32:

commit a1a236067b805961e742e1b51fa2ffbc274f90c4
Author: jnthn <jn...@jnthn.net>
Date:   Sat Aug 2 01:29:16 2014 +0200

    Get latest NQP and MoarVM improvements.

 tools/build/NQP_REVISION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This commit pulls in the following NQP commits (reverse chronological order):

183e611 Use new MoarVM static block lexicals support.
9268ba7 Bump to latest MoarVM, with many improvements.
c3f29b6 Bring test in line with behavior change.
aa8a615 Small optimizations to .symbol.

And that 9267ba7 bump commit pulls in the following Moar commits:

f25affb MAST nodes can be identified by exact type.
e64c5eb Read in static lexicals.
c0984eb Write static lex values; read but don't apply them
ac33547 Update MAST::Frame to hold static lex values.
9ba5d15 No longer need to support Parrot cross-compiler.
c65b2a6 Spec static lexical values table in bytecode.
cdda218 Switch on lazy frame deserialization.
0098c0c Preparations for lazy frame deserialization.
0043778 Split out part of frame deserialization.
985cd8b Bump minimum bytecode version to 2.
49f19ca Tweak spesh log run count.
8df127a Merge remote-tracking branch 'origin/split_get_use_facts'
b57061e Ensure OSR-triggered optimize is used next invoke.
f55e682 De-virtualize serialization write functions.
6da5b90 De-virtualize read_var_int.
9a3a96d Bump minimum serialization format version.
e92aa36 De-virtualize most reader functions.
b6a9cad Fix an uninitialized variable bug.
be8cfdf fix teh build
9d377a3 split get_facts and use_facts from get_and_use_facts.

Beyond noting that there are several spesh-related changes in there, I don't 
find anything particular in that list that stands out as a suspect.

Later on, another bump commit changes the number of iterations from 32 to 207:

commit dd131050268bc63044868689df487fcc47e841de
Author: jnthn <jn...@jnthn.net>
Date:   Thu Mar 26 22:59:35 2015 +0100

    Bump NQP_REVISION to get latest MoarVM.
    
    This brings both lazy deserialization and tuning of the spesh/JIT
    thresholds, both improving startup time.

The commit pulls in only one NQP commit, which in turn pulls in these Moar 
commits:

a752064 Bump OSR theshold also.
e2e908b Tweak dynamic optimization thresholds.
b5d57ae mark existspos as pure
5ef6456 Merge pull request #192 from fperrad/ar
bba0d8c Configure: add an option --ar
375f647 Merge pull request #191 from fperrad/patch-2
7955cee fix for ARMv5
01be8e3 First steps to handling bit-packed arrays.
74c1982 Fix a possible buffer-overrun in existspos.
0c95c4b Add type codes for bit-packed array sizes.
aa450df Re-enable lazy deserialization.
b26111b fix thinko
a938e5d Add a README explaining how to macport
cc1dc8b more macport updates;
226db54 Whoops. use checksums from correct version!
6d8f3f1 updates for new release.

This one is easier to explain. One of the optimization thresholds is changed 
from 25 to 200 in e2e908b. 25+7 == 32 and 200+7 == 207. So a decent guess is 
that an optimization kicks in after 207 iterations, and creates code that fails 
to catch the exception.

There, that's a bunch of grunt work done. :) Hopefully minds sharper that mine 
can look at the a39891 commit and go "ah! that's what's wrong!".

Reply via email to