Skip to content

Instantly share code, notes, and snippets.

@skids
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skids/2b069b02b2a9b6e0ee45 to your computer and use it in GitHub Desktop.
Save skids/2b069b02b2a9b6e0ee45 to your computer and use it in GitHub Desktop.
All the following was done in the star-04-14 tree on 64-bit Debian.
Before running Configure.pl I replaced the bitop guts functions in
the files nqp/src/vm/parrot/ops/nqp_bigint.ops
with the versions found in my original fix here:
https://gist.github.com/skids/4187527
I verified the changes were still there after the build so
there was no re-checkout.
These are the tests that rakudo-p fails:
Test Summary Report
-------------------
t/spec/S02-literals/char-by-name.rakudo.parrot (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/spec/S05-mass/charsets.rakudo.parrot (Wstat: 0 Tests: 16 Failed: 0)
TODO passed: 10
t/spec/S05-mass/named-chars.rakudo.parrot (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/spec/S05-mass/properties-block.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/spec/S05-mass/properties-derived.rakudo.parrot (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/spec/S05-mass/properties-general.rakudo.parrot (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/spec/S32-temporal/local.t (Wstat: 0 Tests: 25 Failed: 9)
Failed tests: 7-8, 10, 14-15, 17-18, 20, 25
Files=798, Tests=28787, 4615 wallclock secs (11.36 usr 3.19 sys + 3961.12 cusr 493.37 csys = 4469.04 CPU)
Result: FAIL
Most of these seem to be related to not having unicode names defined,
and none seem like they would be related to this change.
I also tested rakudo-m with no alterations to moarvm. The results:
Test Summary Report
-------------------
t/spec/S04-phasers/first.t (Wstat: 11 Tests: 3 Failed: 0)
Non-zero wait status: 11
Parse errors: Bad plan. You planned 4 tests but ran 3.
t/spec/S29-os/system.rakudo.moar (Wstat: 0 Tests: 5 Failed: 0)
TODO passed: 1
t/spec/S32-temporal/local.t (Wstat: 0 Tests: 25 Failed: 9)
Failed tests: 7-8, 10, 14-15, 17-18, 20, 25
Files=808, Tests=31197, 2070 wallclock secs (10.44 usr 3.08 sys + 1840.06 cusr 150.40 csys = 2003.98 CPU)
Result: FAIL
Then I altered the same functions in MoarVM/src/math/bigintops.c. Then I spent
WAYYY too much time trying to trick the build system into rebuilding
moarvm/nqp-m/perl6-m because it doesn't happen naturally based on modstamps.
Turned out the magic incantation was to make clean in nqp, then make m-install
in nqp then in rakudo, and probably also to delete some binaries from the path
but I lost track of that.
Then I checked that rakudo-p and rakudo-m passed the following tests:
# Check all bits; implementations use clever representations.
for 1..129 -> $n {
my $i;
my $e;
my $r;
# Generate values in a way that avoids high level integer ops.
# $i = Int("0b1" ~ ("0" x $n));
# $e = Int("0b" ~ ("1" x $n));
$i = 2 ** $n;
$e = $i - 1;
$r = -$i +^ -1;
is $r, $e, "XOR two negatives ({-$i}) lhs (bit $n)";
$r = -1 +^ -$i;
is $r, $e, "XOR two negatives rhs (bit $n)";
$e = Int("-0b1" ~ ("0" x $n - 1) ~ "1");
$r = $i +^ -1;
is $r, $e, "XOR positive with -1 lhs (bit $n - 1)";
$r = -1 +^ $i;
is $r, $e, "XOR positive with -1 rhs (bit $n - 1)";
}
...and they now did using the substituted functions, where
they had not passed all these tests before.
I also tested the 0x0123456789abcdef rakudo-m bug and I
was wrong, we should have kept that as a separate bug,
because it was not fixed by the new code.
Then I ran the spectest for rakudo-m to verify that the
failed tests were the same as before. They were.
Went back to a fresh install and get the
p-spectest results on my system and verified that,
indeed, the same tests fail without the change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment