Skip to content

Instantly share code, notes, and snippets.

1..7
ok 1 - no lastcall, so we defer up the inheritance tree
ok 2 - sanity test for clearing
ok 3 - lastcall means nextsame causes Nil return of method
ok 4 - lastcall meant nextsame failed, no deferal happened
00000 checkarity 1, 1
00001 param_rp_o loc_0_obj, 0
00002 paramnamesused
annotation: gen/moar/BOOTSTRAP/v6c.nqp:5248
00003 const_s loc_5_str, 'dispatcher-get-resume-state'
@dogbert17
dogbert17 / gist:d3fee0f081bb30be355108854faa2f71
Last active October 24, 2021 20:34
Flapper in t/spec/S12-methods/lastcall.t
Notes: nursery is set to 20k. It seems as if adding MVM_SPESH_OSR_DISABLE=1 makes the problem go away.
dogbert@dogbert-VirtualBox:~/repos/rakudo$ MVM_SPESH_NODELAY=1 MVM_SPESH_BLOCKING=1 ./rakudo-gdb-m -Ilib --ll-exception t/spec/S12-methods/lastcall.t
================================================================================================
This is Rakudo running in the debugger, which often allows the user to generate useful back-
traces to debug or report issues in Rakudo, the MoarVM backend or the currently running code.
This Rakudo version is 2021.09.282.g.6.d.45.da.84.c built on MoarVM version 2021.09.676.g.8.c.7.b.734.d.8,
running on linuxmint (20.Ulyana) / linux
@dogbert17
dogbert17 / white-noise.raku
Created October 8, 2021 14:58
Thundergnat
use NativeCall;
use SDL2::Raw;
my int ($w, $h) = 320, 240;
SDL_Init(VIDEO);
my SDL_Window $window = SDL_CreateWindow(
"White Noise - Raku",
SDL_WINDOWPOS_CENTERED_MASK, SDL_WINDOWPOS_CENTERED_MASK,
@dogbert17
dogbert17 / euler-12.raku
Created October 7, 2021 12:57
Runs faster with expr-jit turned off
# What is the value of the first triangle number to have over five hundred divisors?
use v6;
my $numFactors = 500;
my $sum = 0;
for (1...*) -> $term {
$sum += $term;
my $factors = (1..floor(sqrt($sum))).grep( -> $x { $sum % $x == 0} ).elems * 2;
$factors-- if floor(sqrt($sum)) == sqrt($sum);
if $factors > $numFactors {
@dogbert17
dogbert17 / test.raku
Created October 5, 2021 15:52
Test for bug
my %objects;
my Lock $ol .= new;
class Bar {
submethod TWEAK (|) {
$ol.protect: {
my $obj-id = self.WHICH;
die "DUPLICATE FOUND: ", $obj-id if %objects{$obj-id};
%objects{$obj-id} = True;
say $obj-id;
@dogbert17
dogbert17 / gist:a07d0bb2340e37e250106866c9d6dc8c
Last active October 3, 2021 16:54
t/02-rakudo/15-gh_1202.t SEGV version
dogbert@dogbert-VirtualBox:~/repos/rakudo$ gdb install/bin/moar core.moar.1000.76f4e7648b41411e930b2edf5cc63bb4.2709599.1633277864000000000000
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
@dogbert17
dogbert17 / euler-3.raku
Created September 23, 2021 18:04
JIT error
# What is the largest prime factor of the number 600851475143 ?
use v6;
my $num = 600_851_475_143;
my $val = $num;
my @factors = ();
while ([*] @factors) != $num {
push @factors, (2...*).first(-> $x { $val %% $x && $x.is-prime });
$val = $val div @factors[*-1];
}
say @factors.max; # remove max to see all prime factors
@dogbert17
dogbert17 / callframe.raku
Created September 18, 2021 12:09
callframe
use Test;
# R#1781
{
my $seen;
multi sub a() { ++$seen if callframe(1).my.EXISTS-KEY(<$seen>) };
# call a 300 times
a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;
a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;
dogbert@dogbert-VirtualBox:~/repos/rakudo$ MVM_SPESH_NODELAY=1 ./rakudo-m --ll-exception -Ilib t/spec/S09-typed-arrays/native-shape1-num.rakudo.moar
1..333
# Testing num array
ok 1 - num array is Positional
...
ok 206 - does re-initializing a num32 array work
ok 207 - List-assigning num32 array to untyped works (1)
ok 208 - List-assigning num32 array to untyped works (2)
ok 209 - List-assigning num32 array to untyped works (3)
const_iX NYI
dogbert@dogbert-VirtualBox:~/repos/p6-concurrent-stack$ while perl6 -Ilib --ll-exception t/stress.t; do :; done
ok 1 - Pushed/popped correct values
1..1
ok 1 - Pushed/popped correct values
1..1
ok 1 - Pushed/popped correct values
1..1
ok 1 - Pushed/popped correct values
1..1
ok 1 - Pushed/popped correct values