[racket-dev] extflonum unboxing, f80vector ffi

2013-02-15 Thread Michael Filonenko
Hi all.

This time I use the github pull requesting tool, which is more
comfortable for annotation, I think.

The following merge request https://github.com/plt/racket/pull/245 contains:

  * small fixes for extflonum arithmetic: two functions were not jitted.
  * experimental extflonum unboxing
  * f80vector type for ffi (sorry, not documented yet)

I used the extfl flag and therefore did much less copypaste than previous time.

Unfortunately the extflonum unboxing is not stable and is disabled by default.
You can uncomment USE_EXTFLONUM_UNBOXING definition in jit.h to turn
on extfl unboxing.

The following test case fails all the time:

  (require racket/unsafe/ops)

  (let ()
(define f (lambda (x)
(collect-garbage)
(let loop ([a 0.0t0][v 0.0t0][n 1000])
  (if (zero? n)
  v
  (if (odd? n)
  (let ([b (unsafe-extfl+ a a)])
(loop b v (sub1 n)))
  ;; First arg is un place, but may need re-boxing
  (loop a
(unsafe-extfl+ v x)
(- n 1)))
(let ((res (f 1.0t0)))
  (when (not (equal? res 500.0t0))
(printf error extfl ~a~% res

If the (collect-garbage) call is removed, then the test can pass (or not).
My hypothesis is that the gc collects unboxed extflonums as garbage,
which pollutes the memory and breaks further calculations.

Other than that, I ran out of ideas. I continue exploring the gc,
but an advice would be of great help. How do you think, what other
reason could it be?


--
With best regards, Michael Filonenko
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Compilation of 5.3.2 fails on some compilers

2013-02-15 Thread Tobias Hammer

Thanks for the patch. I've changed more AC_TRY_RUN()s to
AC_COMPILE_IFELSE()s and AC_LINK_IFELSE()s to work better for
cross-compilation, and I'll push that soon.


Great! They all look good except one.
The test for GNU preprocessor never fails because whether the macro  
exists or not does not influence anything. Before the change the value  
returned from main was the indication if the macro was set or not. I think  
the test can be fixed by letting the compilation fail when __GNUC__ is  
undefined:


diff --git a/src/racket/configure.ac b/src/racket/configure.ac
index 92af108..15b6742 100644
--- a/src/racket/configure.ac
+++ b/src/racket/configure.ac
@@ -801,7 +801,7 @@ AC_COMPILE_IFELSE(
#ifdef __GNUC__
 return 0;
#else
-return 1;
+if; // should fail on any valid c compiler
#endif
}, using_gnu_cpp=yes, using_gnu_cpp=no)
 if test $using_gnu_cpp = yes ; then



I don't think I agree about the compare-and-swap test. If the
compiler's default mode on a given machine is i386, then I don't think
the `configure' script or other parts of the Racket build should try to
override that. The choice of architecture should be left up to the user
and system defaults.


You are probably right. We will most likely have to carry gccs default  
i386 burden around until 32bit platforms die out.


Tobias




At Sat, 2 Feb 2013 01:26:06 +0100, Tobias Hammer wrote:

Thanks for the detailed explanation. It's a lot clearer now why it's
needed.

But i figured out that the real culprit was cross-compilation in
combination with autoconf. autoconfs default rule for test results when
running cross-compilation was set to noinline not available, and  
therefore

setting the define to expand to nothing.
It should be, in this case and for inline too, enough to check for
compilation, not for running the test. If the attribute is not supported
the compilation should already fail.
I attached a patch to change these two test and fix a typo. Compilation
runs without any errors then.

While checking for more similar tests i noticed that the test for
compare-and-swap is completely screwed up. Even on a modern Core i7 with
gcc 4.x it fails with default settings on a 32bit OS. The CAS builtins
need at least -march=i686 there to run, otherwise you get undefined  
symbol
errors. That never happens on 64bit OS because gcc knows that every  
x86-64

processor has CAS operations. I think it would be a good choice to set
-march when using gcc with 32bit OS, assuming at least a pentium pro
processor might be ok nowadays. It must be remain unset for 64bit, or  
gcc

throws errors. Unfortunately my autoconf skills are far too limited to
provide a patch.

Tobias



On Fri, 01 Feb 2013 19:30:15 +0100, Matthew Flatt mfl...@cs.utah.edu
wrote:

 At Fri, 1 Feb 2013 12:23:59 +0100, Tobias Hammer wrote:
 i am getting the following error when i try to compile racket-textual
 on a
 a version of gcc that does not support the 'noinline' attribute:

 xsrc/place.c: In function 'place_start_proc':
 xsrc/place.c:2793: warning: assignment makes pointer from integer
 without
 a cast
 xsrc/place.c: At top level:
 xsrc/place.c:3185: error: conflicting types for
 'place_start_proc_after_stack'
 xsrc/place.c:2793: note: previous implicit declaration of
 'place_start_proc_after_stack' was here

 The cause is that the forward declaration of
 'place_start_proc_after_stack' is missing. It was originally there (L
 95)
 but the MZ_DO_NOT_INLINE macro expands to nothing, effectively  
removing

 the declaration.

 The wrapping macro was added in commit 9692765e2 but the commit  
message
 gives no real reason why it is needed. I am a bit worried to revert  
the
 change because i don't know which bug i could reintroduce. What  
would be

 the correct fix to compile 5.3.2?

 Hopefully, the right fix is to make `MZ_DO_NOT_INLINE(decl)' expand to
 `decl' if no no inline annotation is available.

 If place_start_proc_after_stack() is inlined at its only use, whcih is
 in place_start_proc(), then a new place will not register its stack
 bounds correctly for the implementation of continuations. The
 implementation of continuations assumes that local variables in
 place_start_proc_after_stack() are shallower on the stack than
 variables in place_start_proc(), and inlining can defeat that
 assumption.

 If there's no way to say no inlining and inlining of that function
 can still happen, then we'll have to work harder to confuse the C
 compiler. The same is true for any other use of MZ_DO_NOT_INLINE().

_
 Racket Developers list:
 http://lists.racket-lang.org/dev


[racket-dev] git head setup displays problems and warnings:

2013-02-15 Thread Matthias Felleisen

   context...:
/Users/matthias/plt/collects/unstable/2d/private/lexer.rkt:31:2: 
 2dcond-lexer
/Users/matthias/plt/collects/syntax-color/module-lexer.rkt:25:0: 
 module-lexer
/Users/matthias/plt/collects/scribble/private/manual-code.rkt:68:12: loop
/Users/matthias/plt/collects/scribble/private/manual-code.rkt:68:12: loop
/Users/matthias/plt/collects/scribble/private/manual-code.rkt:68:12: loop
/Users/matthias/plt/collects/scribble/private/manual-code.rkt:68:12: loop
/Users/matthias/plt/collects/scribble/private/manual-code.rkt:68:12: loop
/Users/matthias/plt/collects/scribble/private/manual-code.rkt:55:0: 
 typeset-code15
/Users/matthias/plt/collects/unstable/scribblings/2d.scrbl: [running body]
/Users/matthias/plt/collects/unstable/scribblings/unstable.scrbl: 
 [traversing imports]
/Users/matthias/plt/collects/setup/scribble.rkt:586:0: 
 load-doc/ensure-prefix
/Users/matthias/plt/collects/setup/scribble.rkt:776:13
/Users/matthias/plt/collects/setup/parallel-do.rkt:418:20: loop
 raco setup: 0 running: web-server/scribblings/web-server-internal.scrbl
 raco setup: 1 running: web-server/scribblings/tutorial/continue.scrbl
 raco setup: 0 running: xml/xml.scrbl
 raco setup: 1 running: xrepl/xrepl.scrbl
 raco setup: WARNING: undefined tag in plot/scribblings/plot.scrbl:
 raco setup:  ((lib plot/scribblings/common.rkt) sequence/c)
 raco setup:  ((lib plot/scribblings/common.rkt) treeof)
 raco setup: WARNING: undefined tag in net/scribblings/net.scrbl:
 raco setup:  ((lib unstable/contract.rkt) tcp-listen-port?)
 raco setup: WARNING: undefined tag in teachpack/teachpack.scrbl:
 raco setup:  (tech worldstate)
 raco setup:  (tech s expression)
 raco setup:  (tech package)
 raco setup: WARNING: undefined tag in web-server/scribblings/web-server.scrbl:
 raco setup:  ((lib web-server/private/util.rkt) read/bytes)
 raco setup:  ((lib web-server/private/util.rkt) tcp-listen-port?)
 raco setup:  ((lib web-server/private/util.rkt) write/bytes)
 raco setup: WARNING: undefined tag in 
 web-server/scribblings/web-server-internal.scrbl:
 raco setup:  ((lib unstable/contract.rkt) path-piece?)
 raco setup:  ((lib unstable/contract.rkt) tcp-listen-port?)
 raco setup:  ((lib web-server/private/util.rkt) path-piece?)
 raco setup:  ((lib web-server/private/util.rkt) port-number?)




_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] Scribble: feature request - module paths for image

2013-02-15 Thread David Van Horn
I have a scribble document that is built from two distinct locations, 
which makes using the Scribble image form nearly impossible since it 
takes a path relative to the build location.  (My work around is 
symbolic links in the file system.)


What would solve my problem is the ability to pass a module-path prefix, 
e.g. (image 'foo/bar/baz some-image.png).


Does this seem like a sensible thing to add?

(BTW, the collects option doesn't help me because I need to reference 
module locations that are not in the main collection.)


David
_
 Racket Developers list:
 http://lists.racket-lang.org/dev


Re: [racket-dev] Scribble: feature request - module paths for image

2013-02-15 Thread Jay McCarthy
Does define-runtime-path work? Should it?

On Fri, Feb 15, 2013 at 8:42 AM, David Van Horn dvanh...@ccs.neu.edu wrote:
 I have a scribble document that is built from two distinct locations, which
 makes using the Scribble image form nearly impossible since it takes a path
 relative to the build location.  (My work around is symbolic links in the
 file system.)

 What would solve my problem is the ability to pass a module-path prefix,
 e.g. (image 'foo/bar/baz some-image.png).

 Does this seem like a sensible thing to add?

 (BTW, the collects option doesn't help me because I need to reference module
 locations that are not in the main collection.)

 David
 _
  Racket Developers list:
  http://lists.racket-lang.org/dev



--
Jay McCarthy j...@cs.byu.edu
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

The glory of God is Intelligence - DC 93
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] git head setup displays problems and warnings:

2013-02-15 Thread Robby Findler
I've just pushed a fix for the runtime error at the beginning there, but
I'll note that this part:

 raco setup: WARNING: undefined tag in teachpack/teachpack.scrbl:
 raco setup:  (tech worldstate)
 raco setup:  (tech s expression)
 raco setup:  (tech package)

has been on your list for more than a few weeks.

Robby


On Fri, Feb 15, 2013 at 9:18 AM, Matthias Felleisen matth...@ccs.neu.edu
wrote:


context...:
 /Users/matthias/plt/collects/unstable/2d/private/lexer.rkt:31:2:
2dcond-lexer
 /Users/matthias/plt/collects/syntax-color/module-lexer.rkt:25:0:
module-lexer
 /Users/matthias/plt/collects/scribble/private/manual-code.rkt:68:12:
loop
 /Users/matthias/plt/collects/scribble/private/manual-code.rkt:68:12:
loop
 /Users/matthias/plt/collects/scribble/private/manual-code.rkt:68:12:
loop
 /Users/matthias/plt/collects/scribble/private/manual-code.rkt:68:12:
loop
 /Users/matthias/plt/collects/scribble/private/manual-code.rkt:68:12:
loop
 /Users/matthias/plt/collects/scribble/private/manual-code.rkt:55:0:
typeset-code15
 /Users/matthias/plt/collects/unstable/scribblings/2d.scrbl: [running
body]
 /Users/matthias/plt/collects/unstable/scribblings/unstable.scrbl:
[traversing imports]
 /Users/matthias/plt/collects/setup/scribble.rkt:586:0:
load-doc/ensure-prefix
 /Users/matthias/plt/collects/setup/scribble.rkt:776:13
 /Users/matthias/plt/collects/setup/parallel-do.rkt:418:20: loop
  raco setup: 0 running: web-server/scribblings/web-server-internal.scrbl
  raco setup: 1 running: web-server/scribblings/tutorial/continue.scrbl
  raco setup: 0 running: xml/xml.scrbl
  raco setup: 1 running: xrepl/xrepl.scrbl
  raco setup: WARNING: undefined tag in plot/scribblings/plot.scrbl:
  raco setup:  ((lib plot/scribblings/common.rkt) sequence/c)
  raco setup:  ((lib plot/scribblings/common.rkt) treeof)
  raco setup: WARNING: undefined tag in net/scribblings/net.scrbl:
  raco setup:  ((lib unstable/contract.rkt) tcp-listen-port?)
  raco setup: WARNING: undefined tag in teachpack/teachpack.scrbl:
  raco setup:  (tech worldstate)
  raco setup:  (tech s expression)
  raco setup:  (tech package)
  raco setup: WARNING: undefined tag in
web-server/scribblings/web-server.scrbl:
  raco setup:  ((lib web-server/private/util.rkt) read/bytes)
  raco setup:  ((lib web-server/private/util.rkt) tcp-listen-port?)
  raco setup:  ((lib web-server/private/util.rkt) write/bytes)
  raco setup: WARNING: undefined tag in
web-server/scribblings/web-server-internal.scrbl:
  raco setup:  ((lib unstable/contract.rkt) path-piece?)
  raco setup:  ((lib unstable/contract.rkt) tcp-listen-port?)
  raco setup:  ((lib web-server/private/util.rkt) path-piece?)
  raco setup:  ((lib web-server/private/util.rkt) port-number?)




 _
   Racket Developers list:
   http://lists.racket-lang.org/dev
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] extflonum unboxing, f80vector ffi

2013-02-15 Thread Matthew Flatt
Merged - thanks!

I'm not certain why the example below didn't work for you, but I think
it had to do with shuffling unboxed arguments to `loop'. Please check
whether the current version works; it now works for me.

There was a mismatch in the order that unboxed arguments are gathered
for the call and the order that they're expected, and that mismatch
made shuffling the arguments complex. Now, unboxed arguments are
accumulated directly to the right order in memory, and
generate_fp_argument_shuffle() is replaced by a simple
generate_fp_argument_shift().

At Fri, 15 Feb 2013 13:44:38 +0300, Michael Filonenko wrote:
 Hi all.
 
 This time I use the github pull requesting tool, which is more
 comfortable for annotation, I think.
 
 The following merge request https://github.com/plt/racket/pull/245 contains:
 
   * small fixes for extflonum arithmetic: two functions were not jitted.
   * experimental extflonum unboxing
   * f80vector type for ffi (sorry, not documented yet)
 
 I used the extfl flag and therefore did much less copypaste than previous 
 time.
 
 Unfortunately the extflonum unboxing is not stable and is disabled by default.
 You can uncomment USE_EXTFLONUM_UNBOXING definition in jit.h to turn
 on extfl unboxing.
 
 The following test case fails all the time:
 
   (require racket/unsafe/ops)
 
   (let ()
 (define f (lambda (x)
 (collect-garbage)
 (let loop ([a 0.0t0][v 0.0t0][n 1000])
   (if (zero? n)
   v
   (if (odd? n)
   (let ([b (unsafe-extfl+ a a)])
 (loop b v (sub1 n)))
   ;; First arg is un place, but may need re-boxing
   (loop a
 (unsafe-extfl+ v x)
 (- n 1)))
 (let ((res (f 1.0t0)))
   (when (not (equal? res 500.0t0))
 (printf error extfl ~a~% res
 
 If the (collect-garbage) call is removed, then the test can pass (or not).
 My hypothesis is that the gc collects unboxed extflonums as garbage,
 which pollutes the memory and breaks further calculations.
 
 Other than that, I ran out of ideas. I continue exploring the gc,
 but an advice would be of great help. How do you think, what other
 reason could it be?
 
 
 --
 With best regards, Michael Filonenko
 _
   Racket Developers list:
   http://lists.racket-lang.org/dev
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Scribble: feature request - module paths for image

2013-02-15 Thread David Van Horn

On 2/15/13 10:47 AM, Jay McCarthy wrote:

Does define-runtime-path work?


Yes, for some value of yes.

This works (specific to my context, but easy to generalize):

#lang scribble/base
@(require racket/runtime-path)
@(require (for-syntax racket/base))

@(define-runtime-module-path-index id 'book)
@(define (fig name)
  (path-string
   (resolved-module-path-name
(module-path-index-resolve
 (module-path-index-join (format figures/~a name) id)

@image[#:suffixes '(.png .pdf)]{@fig{quick-lists1}}


So for now my problem is solved, but

a) am I making this more complicated than needed?
b) if not, should it really be this complicated?

Thanks,
David


_
 Racket Developers list:
 http://lists.racket-lang.org/dev


Re: [racket-dev] Scribble: feature request - module paths for image

2013-02-15 Thread Matthew Flatt
Does `collection-file-path' work?

Here's a small example:

 #lang scribble/base

 @image[(collection-file-path heart.png icons)]


I think this is closer to your example (but untested):

 #lang scribble/base

 @(define (fig name)
(collection-file-path name book figures))

 @image[#:suffixes '(.png .pdf) (fig quick-lists1)]


At Fri, 15 Feb 2013 15:19:29 -0500, David Van Horn wrote:
 On 2/15/13 10:47 AM, Jay McCarthy wrote:
  Does define-runtime-path work?
 
 Yes, for some value of yes.
 
 This works (specific to my context, but easy to generalize):
 
 #lang scribble/base
 @(require racket/runtime-path)
 @(require (for-syntax racket/base))
 
 @(define-runtime-module-path-index id 'book)
 @(define (fig name)
(path-string
 (resolved-module-path-name
  (module-path-index-resolve
   (module-path-index-join (format figures/~a name) id)
 
 @image[#:suffixes '(.png .pdf)]{@fig{quick-lists1}}
 
 
 So for now my problem is solved, but
 
 a) am I making this more complicated than needed?
 b) if not, should it really be this complicated?
 
 Thanks,
 David

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Scribble: feature request - module paths for image

2013-02-15 Thread David Van Horn

On 2/15/13 3:34 PM, Matthew Flatt wrote:

#lang scribble/base

  @(define (fig name)
 (collection-file-path name book figures))

  @image[#:suffixes '(.png .pdf) (fig quick-lists1)]


Excellent!  Thank you, this works (I figured I was making things worse 
than they had to be, but man is it intimidating when you start reading 
about paths in the docs).


David

_
 Racket Developers list:
 http://lists.racket-lang.org/dev


Re: [racket-dev] Scribble: feature request - module paths for image

2013-02-15 Thread Sam Tobin-Hochstadt
On Fri, Feb 15, 2013 at 3:36 PM, David Van Horn dvanh...@ccs.neu.edu wrote:
 On 2/15/13 3:34 PM, Matthew Flatt wrote:

 #lang scribble/base

   @(define (fig name)
  (collection-file-path name book figures))

   @image[#:suffixes '(.png .pdf) (fig quick-lists1)]


 Excellent!  Thank you, this works (I figured I was making things worse than
 they had to be, but man is it intimidating when you start reading about
 paths in the docs).

If this works, then the docs need some clarification. I'm not exactly
sure what, or I'd do it, but the docs for `image` say: The path
argument also can be a result of path-main-collects-relative.

Sam
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] Fix for PR13305 displays oddly in Opera

2013-02-15 Thread Asumu Takikawa
Hi all,

A few days ago, PR 13305 was fixed in commit
29031f0972ead0d3cd26d61f163b5e5b59e9ffce. Unfortunately, the fix makes
some identifiers in the docs display oddly in Opera. I've attached some
screenshots that demonstrate the issue.

Cheers,
Asumu
attachment: toc.pngattachment: broken-toc.png_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Fix for PR13305 displays oddly in Opera

2013-02-15 Thread Danny Yoo
On Fri, Feb 15, 2013 at 2:37 PM, Asumu Takikawa as...@ccs.neu.edu wrote:
 Hi all,

 A few days ago, PR 13305 was fixed in commit
 29031f0972ead0d3cd26d61f163b5e5b59e9ffce. Unfortunately, the fix makes
 some identifiers in the docs display oddly in Opera. I've attached some
 screenshots that demonstrate the issue.

Drats. That's my regression then.  But Quirksmode said that
zero-width-space works under Opera.
(http://www.quirksmode.org/oddsandends/wbr.html)

Should I revert the change?
_
  Racket Developers list:
  http://lists.racket-lang.org/dev