Re: [racket-users] Racket 7.3 Plot Performance Regression

2019-06-05 Thread Alex Harsanyi
On Wednesday, June 5, 2019 at 9:23:26 PM UTC+8, Alex Harsanyi wrote: > > > > On Wednesday, June 5, 2019 at 8:51:48 PM UTC+8, evdubs wrote: >> >> I ran the program with your modifications, but counter to the >> documentation >>

Re: [racket-users] anyone using single-flonums?

2019-06-05 Thread Matthew Flatt
At Wed, 5 Jun 2019 19:41:19 -0400, Hendrik Boom wrote: > On Tue, Jun 04, 2019 at 07:09:52AM -0600, Matthew Flatt wrote: > > On a Racket variant that supports single-flonum values (like the > > > current version of Racket), the compiler will constant-fold that >

Re: [racket-users] anyone using single-flonums?

2019-06-05 Thread Hendrik Boom
On Tue, Jun 04, 2019 at 07:09:52AM -0600, Matthew Flatt wrote: > Thanks for all the replies about single-flonum uses! > > I've pushed the change to try out disabling single-flonum literals as > of v7.3.0.5. > > Note that this change doesn't remove the concept of single-flonum > values from the

Re: [racket-users] What is the difference between foo/c and foo? when creating contracts?

2019-06-05 Thread Philip McGrath
To add a bit to what Alexis said about flat contracts: On Wed, May 22, 2019 at 1:23 PM Alexis King wrote: > Your intuition is right, but let me make it more precise: foo? is used > when something is a flat contract, and foo/c is used otherwise. Flat > contracts only check *first order

Re: [racket-users] Typed Racket segmentation fault

2019-06-05 Thread Philip McGrath
On Wed, Jun 5, 2019 at 12:26 PM James Geddes wrote: > Annoyingly, my colleague had got the same speedup by using Numpy, but that > does require a change to the way one arranges the calculation (and the > change is unnatural, to my eye). > Also, that's cheating! Numpy is mostly written in C,

Re: [racket-users] Typed Racket segmentation fault

2019-06-05 Thread James Geddes
This is very helpful, thank you. In fact, my "naive" version (in untyped Racket) was about the same speed as my colleague's naive Python version. Switching to fl+, fl-, etc bought me a 10x improvement (I presume from the JIT compiler avoiding boxing and unboxing?). Annoyingly, my colleague had

Re: [racket-users] Unexpected error in output of :print-type

2019-06-05 Thread Sam Tobin-Hochstadt
This is definitely a bug. I'm looking into it. On Wed, Jun 5, 2019 at 5:11 AM James Geddes wrote: > > Dear All, > > The following output from Typed Racket is unexpected -- to me! -- can someone > confirm whether I should have expected it or that it's (perhaps) a bug or > known limitation? > >

Re: [racket-users] Typed Racket segmentation fault

2019-06-05 Thread Matthew Flatt
Repair pushed. At Wed, 5 Jun 2019 09:45:58 -0600, Matthew Flatt wrote: > I had just reached the same conclusion. Specifically, it looks like a > missing runstack sync in the JIT-inlined `unsafe-make-flrectangular`. > > Thanks! > > At Wed, 5 Jun 2019 11:40:41 -0400, Sam Tobin-Hochstadt wrote: >

Re: [racket-users] Typed Racket segmentation fault

2019-06-05 Thread Philip McGrath
In case it's helpful as a workaround, changing the #lang line to: #lang typed/racket #:no-optimize will disable the type-based optimizations, so the problematic `unsafe-make-flrectangular` isn't introduced and the segfault is avoided. You presumably loose some performance, though, and "use this

Re: [racket-users] Typed Racket segmentation fault

2019-06-05 Thread Matthew Flatt
I had just reached the same conclusion. Specifically, it looks like a missing runstack sync in the JIT-inlined `unsafe-make-flrectangular`. Thanks! At Wed, 5 Jun 2019 11:40:41 -0400, Sam Tobin-Hochstadt wrote: > I think this is a miscompilation of `unsafe-make-flrectangular` by the > underlying

Re: [racket-users] Typed Racket segmentation fault

2019-06-05 Thread Sam Tobin-Hochstadt
I think this is a miscompilation of `unsafe-make-flrectangular` by the underlying Racket compiler. The below program is a plain racket version of the code, with just one use of unsafe, a call to `unsafe-make-flrectangular`. If that's replaced with `make-flrectangular`, then the program works

Re: [racket-users] Typed Racket segmentation fault

2019-06-05 Thread 'Paulo Matos' via Racket Users
On 05/06/2019 16:47, Philip McGrath wrote: > What version of Racket are you using? I get a segfault in 7.2, but 7.3 > works for me. I see the segfault in 7.1 but not in 7.2 or 7.3. Then I run it under valgrind and I see it in all the versions. :) It's there, but sometimes hiding. Will take a

Re: [racket-users] Typed Racket segmentation fault

2019-06-05 Thread James Geddes
I'm using version 7.3, amusingly. James > On 5 Jun 2019, at 15:47, Philip McGrath wrote: > > What version of Racket are you using? I get a segfault in 7.2, but 7.3 works > for me. > -Philip > > > On Wed, Jun 5, 2019 at 10:42 AM James Geddes wrote: > Dear All, > > The following Typed

Re: [racket-users] Typed Racket segmentation fault

2019-06-05 Thread Philip McGrath
What version of Racket are you using? I get a segfault in 7.2, but 7.3 works for me. -Philip On Wed, Jun 5, 2019 at 10:42 AM James Geddes wrote: > Dear All, > > The following Typed Racket program is intended to produce an image of the > Mandelbrot set (but it doesn't bother actually displaying

[racket-users] Typed Racket segmentation fault

2019-06-05 Thread James Geddes
Dear All, The following Typed Racket program is intended to produce an image of the Mandelbrot set (but it doesn't bother actually displaying the image). Running the program using command-line Racket causes a crash. Specifically, Racket terminates with the error message: Segmentation

Re: [racket-users] Racket 7.3 Plot Performance Regression

2019-06-05 Thread Alex Harsanyi
On Wednesday, June 5, 2019 at 8:51:48 PM UTC+8, evdubs wrote: > > I ran the program with your modifications, but counter to the > documentation > , > >

Re: [racket-users] Racket 7.3 Plot Performance Regression

2019-06-05 Thread evdubs
I ran the program with your modifications, but counter to the documentation , the values I get from get-time-stamp don't seem at all similar to

Re: [racket-users] Racket 7.3 Plot Performance Regression

2019-06-05 Thread Alex Harsanyi
I had a look at the code and it is not exactly what I had in mind for the measurements. The problem with your measurements is that the canvas is re-drawn only when needed, so the time between two calls to on-paint is not relevant for performance measurements. For the on-paint, the time of the

Re: [racket-users] Racket 7.3 Plot Performance Regression

2019-06-05 Thread evdubs
Thanks for responding, Alex. Here's what I came up with that I think satisfies your recommendations. It shows the sin() plot, expects interaction for 10 seconds, then prints min/max/mean/std dev for both the mouse-event-callback for the snip and on-paint for

[racket-users] Unexpected error in output of :print-type

2019-06-05 Thread James Geddes
Dear All, The following output from Typed Racket is unexpected -- to me! -- can someone confirm whether I should have expected it or that it's (perhaps) a bug or known limitation? > % racket -I typed/racket > > Welcome to Racket v7.3. > > > (for/vector ([i (in-range 5)]) i) > - : (Vectorof