Re: [racket-users] 6.2 regression in running tests?

2015-07-20 Thread Gustavo Massaccesi
Sorry for the delay. It has been a very interesting week in the low
level implementation of Racket. A few days ago, Matthew fixed the bug
and enabled the new expander, and then he fixed most of the problems
that appear with the changes. So now looks like a good time to retry
all the tests and see if the test are working with the snapshot
version of Racket.

Following this idea, I remembered that the rackjure project (
https://github.com/greghendershott/rackjure ) has a .travis.yml file,
to get continuous integration tests in Travis. It uses a trick to run
the project with the latest 10 versions of Racket. You can configure
it to run less versions, for example only 6.0.1, 6.1.1 and HEAD (but
allow errors in HEAD). You should look at the file in the repository
because it's very clear, and if you have a problem you may ask the
author because he usually reads the list.

This will give you a report of the errors that the next version of
Racket would create, and you can send an early warning to the list.
This will be helpfull to fix the errors before shipping.

Gustavo


On Wed, Jul 15, 2015 at 4:14 AM, Ryan Davis zenspi...@gmail.com wrote:

 On Jul 14, 2015, at 20:19, Gustavo Massaccesi gust...@oma.org.ar wrote:

 Replacing the line 1758 of optimize.c

 -  if ((info-inline_fuel  0)  info-has_nonleaf  !noapp)
 +  if ((info-inline_fuel = 0)  info-has_nonleaf  !noapp)

 make the problem disappear, but I still don't understand why (dup
 rep) is the only combination that creates a problem.

 I also want to think about the (info-inline_fuel = 0) in line 1872
 and how that interacts with the if (noapp) in line 1876 ...

 Thanks! I can test against my whole suite in tomorrow's daily if you'd like.


-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] 6.2 regression in running tests?

2015-07-16 Thread Matthew Flatt
At Wed, 15 Jul 2015 22:48:26 -0300, Gustavo Massaccesi wrote:
 But perhaps the problem is in the code that tracks the single_use
 value. After 'dup' is applied, 'rep' is not long a singled used
 function.

Yes, I think that's the problem. I thunk I have a repair to update
single-use tracking appropriately, but I need to test more.

If I remember correctly, we recently changed the optimizer to always
inline single-use functions, where it had skipped them before (under
some condition that I don't recall). If that's right, it would explain
the v6.1.1-to-v6.2 regression.

Thanks for tracking down the problem!

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] 6.2 regression in running tests?

2015-07-15 Thread Gustavo Massaccesi
Update: No so good news, my idea of yesterday was slightly wrong. I
think it causes no errors, but it makes the compiler pessimistic and
it avoid some optimizations. I found another fix, but I want to test
it more before submitting the patch.

More details:

In some cases, the optimizer reoptimize an expression with fuel=0, to
get the correct values of some internal flags. So some code in
optimize_for_inline must run even when fuel=0.

The idea is that when fuel=0 there should be no inlining, but the
compiler tries to inline the functions that are used only once even
when there is not enough fuel, so the original copy disappear and only
the inlined code survives. (When the function is used more than one
time this may increase the size of the bytecode. But this is a good
idea for single used functions.)

So this modified version hangs:
#lang racket
(define dup (lambda (f) (f f)))
(lambda ()
  (let ([rep (lambda (f) (f f))])
(list
 (dup rep)
 dup))) ; -- look here

But this modified version is ok
#lang racket
(define dup (lambda (f) (f f)))
(lambda ()
  (let ([rep (lambda (f) (f f))])
(list
 (dup rep)
 rep))) ; -- look here

This also explains why only '(dup rep)' caused problems.

Todays fix is in line 1900 of optimize.c
-  if ((sz = 0)  (single_use || (sz = threshold))) {
+  if ((sz = 0)  (single_use || (sz = threshold)) 
(info-inline_fuel  0)) {

But perhaps the problem is in the code that tracks the single_use
value. After 'dup' is applied, 'rep' is not long a singled used
function.  ... I must test this a little more ...

Gustavo



On Wed, Jul 15, 2015 at 4:14 AM, Ryan Davis zenspi...@gmail.com wrote:

 On Jul 14, 2015, at 20:19, Gustavo Massaccesi gust...@oma.org.ar wrote:

 Replacing the line 1758 of optimize.c

 -  if ((info-inline_fuel  0)  info-has_nonleaf  !noapp)
 +  if ((info-inline_fuel = 0)  info-has_nonleaf  !noapp)

 make the problem disappear, but I still don't understand why (dup
 rep) is the only combination that creates a problem.

 I also want to think about the (info-inline_fuel = 0) in line 1872
 and how that interacts with the if (noapp) in line 1876 ...

 Thanks! I can test against my whole suite in tomorrow's daily if you'd like.


-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] 6.2 regression in running tests?

2015-07-15 Thread Ryan Davis

 On Jul 14, 2015, at 20:19, Gustavo Massaccesi gust...@oma.org.ar wrote:
 
 Replacing the line 1758 of optimize.c
 
 -  if ((info-inline_fuel  0)  info-has_nonleaf  !noapp)
 +  if ((info-inline_fuel = 0)  info-has_nonleaf  !noapp)
 
 make the problem disappear, but I still don't understand why (dup
 rep) is the only combination that creates a problem.
 
 I also want to think about the (info-inline_fuel = 0) in line 1872
 and how that interacts with the if (noapp) in line 1876 ...

Thanks! I can test against my whole suite in tomorrow's daily if you'd like.

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] 6.2 regression in running tests?

2015-07-14 Thread Ryan Davis
I'm tired and not thinking straight, but we just finished running the schemer 
gauntlet and I decided to dip my toes into the 6.2 release. I can't get it to 
run my tests and I need external validation that it's not me doing something 
stupid.

  git clone https://github.com/searbsg/little-schemer
  cd little-schemer/zenspider
  raco test --direct ch*.rkt

For me, it hangs hard on ch09.rkt, ch10.rkt, and some combo of ch11.rkt and 
beyond. I can run all of ch2*.rkt just fine.

Additionally, it appears that `raco test --timeout` wasn't fixed after I 
reported it last time. I thought commits went it to address it. --heartbeat 
also appears to do nothing when run against these tests.

Under the previous racket release:

10028 % rake test
time raco test --direct ch*.rkt
raco test: ch00.rkt
raco test: (submod ch01.rkt test)
raco test: (submod ch02.rkt test)
raco test: (submod ch03.rkt test)
raco test: (submod ch04.rkt test)
raco test: (submod ch05.rkt test)
raco test: (submod ch06.rkt test)
raco test: (submod ch07.rkt test)
raco test: (submod ch08.rkt test)
raco test: (submod ch09.rkt test)
raco test: (submod ch10.rkt test)
raco test: (submod ch11.rkt test)
raco test: (submod ch12.rkt test)
raco test: (submod ch13.rkt test)
raco test: (submod ch14.rkt test)
raco test: (submod ch15.rkt test)
raco test: (submod ch16.rkt test)
raco test: (submod ch17.rkt test)
raco test: (submod ch18.rkt test)
raco test: (submod ch19.rkt test)
raco test: (submod ch20.rkt test)
raco test: (submod ch21.rkt test)
raco test: (submod ch22.rkt test)
raco test: (submod ch23.rkt test)
raco test: (submod ch24.rkt test)
raco test: (submod ch25.rkt test)
raco test: (submod ch26.rkt test)
raco test: (submod ch27.rkt test)
raco test: (submod ch29.rkt test)
raco test: (submod ch30.rkt test)
'done
909 tests passed

real0m3.482s
user0m3.091s
sys 0m0.354s

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] 6.2 regression in running tests?

2015-07-14 Thread Sam Tobin-Hochstadt
This appears to be a bug in the inliner, which appears in HEAD as well.

This program is sufficient to reproduce:

#lang racket

(define (Y3 outer)
  (define ((call f) x)
((f f) x))
  ((lambda (f) (f f)) call))

I wasn't able to make this any smaller -- in particular, the `outer`
parameter is needed. If you try to compile this with `raco make`, it will
hang, but `raco make --disable-inline` will succeed.

That's also why `--timeout` didn't help, because it seems to wait for
compilation to have any effect.

Sam

On Tue, Jul 14, 2015 at 6:31 AM Ryan Davis zenspi...@gmail.com wrote:

 I'm tired and not thinking straight, but we just finished running the
 schemer gauntlet and I decided to dip my toes into the 6.2 release. I can't
 get it to run my tests and I need external validation that it's not me
 doing something stupid.

   git clone https://github.com/searbsg/little-schemer
   cd little-schemer/zenspider
   raco test --direct ch*.rkt

 For me, it hangs hard on ch09.rkt, ch10.rkt, and some combo of ch11.rkt
 and beyond. I can run all of ch2*.rkt just fine.

 Additionally, it appears that `raco test --timeout` wasn't fixed after I
 reported it last time. I thought commits went it to address it. --heartbeat
 also appears to do nothing when run against these tests.

 Under the previous racket release:

 10028 % rake test
 time raco test --direct ch*.rkt
 raco test: ch00.rkt
 raco test: (submod ch01.rkt test)
 raco test: (submod ch02.rkt test)
 raco test: (submod ch03.rkt test)
 raco test: (submod ch04.rkt test)
 raco test: (submod ch05.rkt test)
 raco test: (submod ch06.rkt test)
 raco test: (submod ch07.rkt test)
 raco test: (submod ch08.rkt test)
 raco test: (submod ch09.rkt test)
 raco test: (submod ch10.rkt test)
 raco test: (submod ch11.rkt test)
 raco test: (submod ch12.rkt test)
 raco test: (submod ch13.rkt test)
 raco test: (submod ch14.rkt test)
 raco test: (submod ch15.rkt test)
 raco test: (submod ch16.rkt test)
 raco test: (submod ch17.rkt test)
 raco test: (submod ch18.rkt test)
 raco test: (submod ch19.rkt test)
 raco test: (submod ch20.rkt test)
 raco test: (submod ch21.rkt test)
 raco test: (submod ch22.rkt test)
 raco test: (submod ch23.rkt test)
 raco test: (submod ch24.rkt test)
 raco test: (submod ch25.rkt test)
 raco test: (submod ch26.rkt test)
 raco test: (submod ch27.rkt test)
 raco test: (submod ch29.rkt test)
 raco test: (submod ch30.rkt test)
 'done
 909 tests passed

 real0m3.482s
 user0m3.091s
 sys 0m0.354s

 --
 You received this message because you are subscribed to the Google Groups
 Racket Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to racket-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] 6.2 regression in running tests?

2015-07-14 Thread Gustavo Massaccesi
I reduced it a little, it's a variation of the old
  ((lambda (x) (x x)) (lambda (x) (x x)))
but there must be a problem in the inlining fuel.

In my example, the ´dup´ definition is not necessary, but it makes it
more clear. It can be copied by hand to the application point.

I wrapped the example in a 'lambda', to be sure that it should not be
executed even once. This lambda is not necessary and can be removed.

#lang racket
(define dup (lambda (f) (f f)))
(lambda ()
  (let ([rep (lambda (f) (f f))])
(dup rep)))

It's strange that only (dup rep) causes a problem, (dup dup), (rep
rep) and (rep dup) are ok.

Gustavo


On Tue, Jul 14, 2015 at 6:23 PM, Sam Tobin-Hochstadt
sa...@cs.indiana.edu wrote:
 This appears to be a bug in the inliner, which appears in HEAD as well.

 This program is sufficient to reproduce:

 #lang racket

 (define (Y3 outer)
   (define ((call f) x)
 ((f f) x))
   ((lambda (f) (f f)) call))

 I wasn't able to make this any smaller -- in particular, the `outer`
 parameter is needed. If you try to compile this with `raco make`, it will
 hang, but `raco make --disable-inline` will succeed.

 That's also why `--timeout` didn't help, because it seems to wait for
 compilation to have any effect.

 Sam

 On Tue, Jul 14, 2015 at 6:31 AM Ryan Davis zenspi...@gmail.com wrote:

 I'm tired and not thinking straight, but we just finished running the
 schemer gauntlet and I decided to dip my toes into the 6.2 release. I can't
 get it to run my tests and I need external validation that it's not me doing
 something stupid.

   git clone https://github.com/searbsg/little-schemer
   cd little-schemer/zenspider
   raco test --direct ch*.rkt

 For me, it hangs hard on ch09.rkt, ch10.rkt, and some combo of ch11.rkt
 and beyond. I can run all of ch2*.rkt just fine.

 Additionally, it appears that `raco test --timeout` wasn't fixed after I
 reported it last time. I thought commits went it to address it. --heartbeat
 also appears to do nothing when run against these tests.

 Under the previous racket release:

 10028 % rake test
 time raco test --direct ch*.rkt
 raco test: ch00.rkt
 raco test: (submod ch01.rkt test)
 raco test: (submod ch02.rkt test)
 raco test: (submod ch03.rkt test)
 raco test: (submod ch04.rkt test)
 raco test: (submod ch05.rkt test)
 raco test: (submod ch06.rkt test)
 raco test: (submod ch07.rkt test)
 raco test: (submod ch08.rkt test)
 raco test: (submod ch09.rkt test)
 raco test: (submod ch10.rkt test)
 raco test: (submod ch11.rkt test)
 raco test: (submod ch12.rkt test)
 raco test: (submod ch13.rkt test)
 raco test: (submod ch14.rkt test)
 raco test: (submod ch15.rkt test)
 raco test: (submod ch16.rkt test)
 raco test: (submod ch17.rkt test)
 raco test: (submod ch18.rkt test)
 raco test: (submod ch19.rkt test)
 raco test: (submod ch20.rkt test)
 raco test: (submod ch21.rkt test)
 raco test: (submod ch22.rkt test)
 raco test: (submod ch23.rkt test)
 raco test: (submod ch24.rkt test)
 raco test: (submod ch25.rkt test)
 raco test: (submod ch26.rkt test)
 raco test: (submod ch27.rkt test)
 raco test: (submod ch29.rkt test)
 raco test: (submod ch30.rkt test)
 'done
 909 tests passed

 real0m3.482s
 user0m3.091s
 sys 0m0.354s

 --
 You received this message because you are subscribed to the Google Groups
 Racket Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to racket-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

 --
 You received this message because you are subscribed to the Google Groups
 Racket Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to racket-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] 6.2 regression in running tests?

2015-07-14 Thread Gustavo Massaccesi
Replacing the line 1758 of optimize.c

-  if ((info-inline_fuel  0)  info-has_nonleaf  !noapp)
+  if ((info-inline_fuel = 0)  info-has_nonleaf  !noapp)

make the problem disappear, but I still don't understand why (dup
rep) is the only combination that creates a problem.

I also want to think about the (info-inline_fuel = 0) in line 1872
and how that interacts with the if (noapp) in line 1876 ...

Gustavo

On Tue, Jul 14, 2015 at 8:38 PM, Gustavo Massaccesi gust...@oma.org.ar wrote:
 I reduced it a little, it's a variation of the old
   ((lambda (x) (x x)) (lambda (x) (x x)))
 but there must be a problem in the inlining fuel.

 In my example, the ´dup´ definition is not necessary, but it makes it
 more clear. It can be copied by hand to the application point.

 I wrapped the example in a 'lambda', to be sure that it should not be
 executed even once. This lambda is not necessary and can be removed.

 #lang racket
 (define dup (lambda (f) (f f)))
 (lambda ()
   (let ([rep (lambda (f) (f f))])
 (dup rep)))

 It's strange that only (dup rep) causes a problem, (dup dup), (rep
 rep) and (rep dup) are ok.

 Gustavo


 On Tue, Jul 14, 2015 at 6:23 PM, Sam Tobin-Hochstadt
 sa...@cs.indiana.edu wrote:
 This appears to be a bug in the inliner, which appears in HEAD as well.

 This program is sufficient to reproduce:

 #lang racket

 (define (Y3 outer)
   (define ((call f) x)
 ((f f) x))
   ((lambda (f) (f f)) call))

 I wasn't able to make this any smaller -- in particular, the `outer`
 parameter is needed. If you try to compile this with `raco make`, it will
 hang, but `raco make --disable-inline` will succeed.

 That's also why `--timeout` didn't help, because it seems to wait for
 compilation to have any effect.

 Sam

 On Tue, Jul 14, 2015 at 6:31 AM Ryan Davis zenspi...@gmail.com wrote:

 I'm tired and not thinking straight, but we just finished running the
 schemer gauntlet and I decided to dip my toes into the 6.2 release. I can't
 get it to run my tests and I need external validation that it's not me doing
 something stupid.

   git clone https://github.com/searbsg/little-schemer
   cd little-schemer/zenspider
   raco test --direct ch*.rkt

 For me, it hangs hard on ch09.rkt, ch10.rkt, and some combo of ch11.rkt
 and beyond. I can run all of ch2*.rkt just fine.

 Additionally, it appears that `raco test --timeout` wasn't fixed after I
 reported it last time. I thought commits went it to address it. --heartbeat
 also appears to do nothing when run against these tests.

 Under the previous racket release:

 10028 % rake test
 time raco test --direct ch*.rkt
 raco test: ch00.rkt
 raco test: (submod ch01.rkt test)
 raco test: (submod ch02.rkt test)
 raco test: (submod ch03.rkt test)
 raco test: (submod ch04.rkt test)
 raco test: (submod ch05.rkt test)
 raco test: (submod ch06.rkt test)
 raco test: (submod ch07.rkt test)
 raco test: (submod ch08.rkt test)
 raco test: (submod ch09.rkt test)
 raco test: (submod ch10.rkt test)
 raco test: (submod ch11.rkt test)
 raco test: (submod ch12.rkt test)
 raco test: (submod ch13.rkt test)
 raco test: (submod ch14.rkt test)
 raco test: (submod ch15.rkt test)
 raco test: (submod ch16.rkt test)
 raco test: (submod ch17.rkt test)
 raco test: (submod ch18.rkt test)
 raco test: (submod ch19.rkt test)
 raco test: (submod ch20.rkt test)
 raco test: (submod ch21.rkt test)
 raco test: (submod ch22.rkt test)
 raco test: (submod ch23.rkt test)
 raco test: (submod ch24.rkt test)
 raco test: (submod ch25.rkt test)
 raco test: (submod ch26.rkt test)
 raco test: (submod ch27.rkt test)
 raco test: (submod ch29.rkt test)
 raco test: (submod ch30.rkt test)
 'done
 909 tests passed

 real0m3.482s
 user0m3.091s
 sys 0m0.354s

 --
 You received this message because you are subscribed to the Google Groups
 Racket Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to racket-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

 --
 You received this message because you are subscribed to the Google Groups
 Racket Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to racket-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.