new Cog VMs available

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

new Cog VMs available

Eliot Miranda-2
Hi All,

    new Cog VMs are available, SimpleStackBasedCogit @ http://www.mirandabanda.org/files/Cog/VM/VM.r2359/ and StackToRegisterMappingCogit @ http://www.mirandabanda.org/files/Cog/VM/VM.r2361.  I think the new code generator is ready for prime time now.  I fixed a number of bugs over the past three weeks and we're now using the StackToRegisterMappingCogit internally at Teleplace.  There's still work to be done merging plugins and details with the standard VMs  but I hope that r2361 is production-ready as far as core Smalltalk execution is concerned.

Enjoy.


Eliot
Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

fstephany
Hi Eliot,

Probably a stupid question but what's the difference between
SimpleStackBasedCogit and StackToRegisterMappingCogit ?

>      new Cog VMs are available, SimpleStackBasedCogit @
> http://www.mirandabanda.org/files/Cog/VM/VM.r2359/ and
> StackToRegisterMappingCogit @
> http://www.mirandabanda.org/files/Cog/VM/VM.r2361.  I think the new code
> generator is ready for prime time now.  I fixed a number of bugs over
> the past three weeks and we're now using the StackToRegisterMappingCogit
> internally at Teleplace.


Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

Tudor Girba
Thanks Eliot.

And indeed, I subscribe to the below question as well :)

Cheers,
Doru



On 7 Feb 2011, at 09:12, Francois Stephany wrote:

> Hi Eliot,
>
> Probably a stupid question but what's the difference between SimpleStackBasedCogit and StackToRegisterMappingCogit ?
>
>>     new Cog VMs are available, SimpleStackBasedCogit @
>> http://www.mirandabanda.org/files/Cog/VM/VM.r2359/ and
>> StackToRegisterMappingCogit @
>> http://www.mirandabanda.org/files/Cog/VM/VM.r2361.  I think the new code
>> generator is ready for prime time now.  I fixed a number of bugs over
>> the past three weeks and we're now using the StackToRegisterMappingCogit
>> internally at Teleplace.
>
>

--
www.tudorgirba.com

"We are all great at making mistakes."








Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

Igor Stasenko
In reply to this post by fstephany
On 7 February 2011 09:12, Francois Stephany <[hidden email]> wrote:
> Hi Eliot,
>
> Probably a stupid question but what's the difference between
> SimpleStackBasedCogit and c?
>
SimpleStackBasedCogit maps values to machine registers when generating code,
while stack-based one uses stack for everything.

>>     new Cog VMs are available, SimpleStackBasedCogit @
>> http://www.mirandabanda.org/files/Cog/VM/VM.r2359/ and
>> StackToRegisterMappingCogit @
>> http://www.mirandabanda.org/files/Cog/VM/VM.r2361.  I think the new code
>> generator is ready for prime time now.  I fixed a number of bugs over
>> the past three weeks and we're now using the StackToRegisterMappingCogit
>> internally at Teleplace.
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

fstephany
Ok :)
In practice which one the end user should use ? Are there any
performance/stability difference ?

>> Probably a stupid question but what's the difference between
>> SimpleStackBasedCogit and c?
>>
> SimpleStackBasedCogit maps values to machine registers when generating code,
> while stack-based one uses stack for everything.
>


Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

Tudor Girba
Thanks Francois for asking the questions for me :)

Cheers,
Doru


On 7 Feb 2011, at 11:02, Francois Stephany wrote:

> Ok :)
> In practice which one the end user should use ? Are there any performance/stability difference ?
>
>>> Probably a stupid question but what's the difference between
>>> SimpleStackBasedCogit and c?
>>>
>> SimpleStackBasedCogit maps values to machine registers when generating code,
>> while stack-based one uses stack for everything.
>>
>
>

--
www.tudorgirba.com

"Problem solving efficiency grows with the abstractness level of problem understanding."




Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

S Krish
In reply to this post by Igor Stasenko
StackToRegisterMappingCogit maps values to machine registers when generating code,
while stack-based one uses stack for everything.

Guess that is what is meant.. 

Register based vms like Parrot will offer more info... As to motivation for this mapping



On Feb 7, 2011, at 2:53 PM, Igor Stasenko <[hidden email]> wrote:

On 7 February 2011 09:12, Francois Stephany <[hidden email]> wrote:
Hi Eliot,

Probably a stupid question but what's the difference between
SimpleStackBasedCogit and c?

SimpleStackBasedCogit maps values to machine registers when generating code,
while stack-based one uses stack for everything.

    new Cog VMs are available, SimpleStackBasedCogit @
http://www.mirandabanda.org/files/Cog/VM/VM.r2359/ and
StackToRegisterMappingCogit @
http://www.mirandabanda.org/files/Cog/VM/VM.r2361.  I think the new code
generator is ready for prime time now.  I fixed a number of bugs over
the past three weeks and we're now using the StackToRegisterMappingCogit
internally at Teleplace.






--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

Igor Stasenko
On 7 February 2011 12:28, Krishsmalltalk
<[hidden email]> wrote:
> StackToRegisterMappingCogit maps values to machine registers when generating
> code,
> while stack-based one uses stack for everything.
>
> Guess that is what is meant..
> Register based vms like Parrot will offer more info... As to motivation for
> this mapping
>

a motivation is simple: speed.
Access to CPU registers usually 2-5 orders of magnitude faster than
memory access.

>
> On Feb 7, 2011, at 2:53 PM, Igor Stasenko <[hidden email]> wrote:
>
> On 7 February 2011 09:12, Francois Stephany <[hidden email]>
> wrote:
>
> Hi Eliot,
>
> Probably a stupid question but what's the difference between
>
> SimpleStackBasedCogit and c?
>
> SimpleStackBasedCogit maps values to machine registers when generating code,
> while stack-based one uses stack for everything.
>
>     new Cog VMs are available, SimpleStackBasedCogit @
>
> http://www.mirandabanda.org/files/Cog/VM/VM.r2359/ and
>
> StackToRegisterMappingCogit @
>
> http://www.mirandabanda.org/files/Cog/VM/VM.r2361.  I think the new code
>
> generator is ready for prime time now.  I fixed a number of bugs over
>
> the past three weeks and we're now using the StackToRegisterMappingCogit
>
> internally at Teleplace.
>
>
>
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

fstephany
So StackToRegisterMappingCogit should be faster than the other ? If so,
why does the SimpleStackBasedCogit still exist ?

(Sorry but I'm a total newbie)


On 07/02/11 15:42, Igor Stasenko wrote:

> On 7 February 2011 12:28, Krishsmalltalk
> <[hidden email]>  wrote:
>> StackToRegisterMappingCogit maps values to machine registers when generating
>> code,
>> while stack-based one uses stack for everything.
>>
>> Guess that is what is meant..
>> Register based vms like Parrot will offer more info... As to motivation for
>> this mapping
>>
>
> a motivation is simple: speed.
> Access to CPU registers usually 2-5 orders of magnitude faster than
> memory access.
>
>>
>> On Feb 7, 2011, at 2:53 PM, Igor Stasenko<[hidden email]>  wrote:
>>
>> On 7 February 2011 09:12, Francois Stephany<[hidden email]>
>> wrote:
>>
>> Hi Eliot,
>>
>> Probably a stupid question but what's the difference between
>>
>> SimpleStackBasedCogit and c?
>>
>> SimpleStackBasedCogit maps values to machine registers when generating code,
>> while stack-based one uses stack for everything.
>>
>>      new Cog VMs are available, SimpleStackBasedCogit @
>>
>> http://www.mirandabanda.org/files/Cog/VM/VM.r2359/ and
>>
>> StackToRegisterMappingCogit @
>>
>> http://www.mirandabanda.org/files/Cog/VM/VM.r2361.  I think the new code
>>
>> generator is ready for prime time now.  I fixed a number of bugs over
>>
>> the past three weeks and we're now using the StackToRegisterMappingCogit
>>
>> internally at Teleplace.
>>
>>
>>
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>>
>
>
>


--
[hidden email]
http://www.agilitic.com
+32 (0)484/580.322


Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

Eliot Miranda-2
In reply to this post by fstephany
Hi Francois,

On Mon, Feb 7, 2011 at 12:12 AM, Francois Stephany <[hidden email]> wrote:
Hi Eliot,

Probably a stupid question but what's the difference between SimpleStackBasedCogit and StackToRegisterMappingCogit ?

See the following thread:


Here's a summary:

The SimpleStackBasedCogit is a one-to-one translation of bytecodes to machine code so tat every push or pop in the bytecode results in a corresponding push or pop in the generted code.  This results in a machine that passes all parameters on the stack and reifies all comparison results as either true or false.

The StackToRegisterMappingCogit defers generating code until it reaches a bytecode that consumes operands on the stack (i.e. a send, a temp or inst var store, a return, a closure creation or an Array creation ( {...} )).  This results in a machine that is able to pass parameters in registers for small arity sends (currently 0 or 1 arg), and able to inline some integer arithmetic and comparison, e.g. that involved in inlined to:do: loops, and can do some constant folding (hint: write 2 + 3 + 4 + i, not i + 2 + 3 + 4).

There are two main benefits.  The StackToRegisterMappingCogit produces machine code that is about 20% more compact than the SimpleStackBasedCogit (hence meaning less frequent code zone reclamations and better cache performance) and considerably faster for microbenchmarks, for example the empty 1 to: 100000000 do: [:i|] (equivalent to i := 1. [i <= 100000000] whileTrue: [i := i + 1]) is 4 times faster than the SimpleStackBasedCogit.  

At a macro level StackToRegisterMappingCogit speeds up code such as compiling a method by about 10%, with low-level arithmetic-intensive code showing greater speedups.

best,
Eliot



    new Cog VMs are available, SimpleStackBasedCogit @
http://www.mirandabanda.org/files/Cog/VM/VM.r2359/ and
StackToRegisterMappingCogit @
http://www.mirandabanda.org/files/Cog/VM/VM.r2361.  I think the new code
generator is ready for prime time now.  I fixed a number of bugs over
the past three weeks and we're now using the StackToRegisterMappingCogit
internally at Teleplace.



Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

Eliot Miranda-2
In reply to this post by fstephany


On Mon, Feb 7, 2011 at 6:52 AM, Francois Stephany <[hidden email]> wrote:
So StackToRegisterMappingCogit should be faster than the other ? If so, why does the SimpleStackBasedCogit still exist ?

Juts in case people find bugs with the StackToRegisterMappingCogit that are not in SimpleStackBasedCogit.  SimpleStackBasedCogit is "mature"; we've used it for almost two years at Teleplace, and while I've fixed serious bugs in it in the past month it is quite possibly less buggy than StackToRegisterMappingCogit.


(Sorry but I'm a total newbie)

One can only learn by asking questions.  Not knowing, one is not in a position to know whether a question is stupid or not, so one must not be afraid of asking stupid questions if one wants to learn.  Please continue.

best,
Eliot





On 07/02/11 15:42, Igor Stasenko wrote:
On 7 February 2011 12:28, Krishsmalltalk
<[hidden email]>  wrote:
StackToRegisterMappingCogit maps values to machine registers when generating
code,
while stack-based one uses stack for everything.

Guess that is what is meant..
Register based vms like Parrot will offer more info... As to motivation for
this mapping


a motivation is simple: speed.
Access to CPU registers usually 2-5 orders of magnitude faster than
memory access.


On Feb 7, 2011, at 2:53 PM, Igor Stasenko<[hidden email]>  wrote:

On 7 February 2011 09:12, Francois Stephany<[hidden email]>
wrote:

Hi Eliot,

Probably a stupid question but what's the difference between

SimpleStackBasedCogit and c?

SimpleStackBasedCogit maps values to machine registers when generating code,
while stack-based one uses stack for everything.

    new Cog VMs are available, SimpleStackBasedCogit @

http://www.mirandabanda.org/files/Cog/VM/VM.r2359/ and

StackToRegisterMappingCogit @

http://www.mirandabanda.org/files/Cog/VM/VM.r2361.  I think the new code

generator is ready for prime time now.  I fixed a number of bugs over

the past three weeks and we're now using the StackToRegisterMappingCogit

internally at Teleplace.






--
Best regards,
Igor Stasenko AKA sig.







--
[hidden email]
http://www.agilitic.com
+32 (0)484/580.322



Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

Damien Pollet
In reply to this post by fstephany
On Mon, Feb 7, 2011 at 09:12, Francois Stephany
<[hidden email]> wrote:
> Probably a stupid question but what's the difference between
> SimpleStackBasedCogit and StackToRegisterMappingCogit ?

And would it make sense to name the VM binaries/applications to
reflect which interpreter they use? Alternatively, is there some way
to see that from the image?

--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet

Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

Eliot Miranda-2


On Mon, Feb 7, 2011 at 11:16 AM, Damien Pollet <[hidden email]> wrote:
On Mon, Feb 7, 2011 at 09:12, Francois Stephany
<[hidden email]> wrote:
> Probably a stupid question but what's the difference between
> SimpleStackBasedCogit and StackToRegisterMappingCogit ?

And would it make sense to name the VM binaries/applications to
reflect which interpreter they use? Alternatively, is there some way
to see that from the image?

At least for the Cog VMs Smalltalk getSystemAttribute: 1007 answers the interpreter and 1008 answers the Cogit, if any.
 

--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet


Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

fstephany
In reply to this post by Eliot Miranda-2
Thanks for your pointer and explanations Eliot !


> On Mon, Feb 7, 2011 at 6:52 AM, Francois Stephany
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     So StackToRegisterMappingCogit should be faster than the other ? If
>     so, why does the SimpleStackBasedCogit still exist ?
>
>
> Juts in case people find bugs with the StackToRegisterMappingCogit that
> are not in SimpleStackBasedCogit.  SimpleStackBasedCogit is "mature";
> we've used it for almost two years at Teleplace, and while I've fixed
> serious bugs in it in the past month it is quite possibly less buggy
> than StackToRegisterMappingCogit.
>
>
>     (Sorry but I'm a total newbie)
>
>
> One can only learn by asking questions.  Not knowing, one is not in a
> position to know whether a question is stupid or not, so one must not be
> afraid of asking stupid questions if one wants to learn.  Please continue.
>
> best,
> Eliot


Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

Levente Uzonyi-2
In reply to this post by Eliot Miranda-2
On Sun, 6 Feb 2011, Eliot Miranda wrote:

> Hi All,
>
>    new Cog VMs are available, SimpleStackBasedCogit @
> http://www.mirandabanda.org/files/Cog/VM/VM.r2359/ and
> StackToRegisterMappingCogit @
> http://www.mirandabanda.org/files/Cog/VM/VM.r2361.  I think the new code
> generator is ready for prime time now.  I fixed a number of bugs over the
> past three weeks and we're now using the StackToRegisterMappingCogit
> internally at Teleplace.  There's still work to be done merging plugins and
> details with the standard VMs  but I hope that r2361 is production-ready as
> far as core Smalltalk execution is concerned.
>
> Enjoy.

Thanks, StackToRegisterMappingCogit is really impressive. IIRC for the
4.1.1 VM Andreas fixed something about ImageSegment loading which is
missing from the CogVMs. It would be good to have that fix, because now
arrayOfRoots is nil when I'm trying to load an ImageSegment. It's not
urgent at all, because I could work the problem around using the new
SqueakVMs which can read Cog images and have the fix.


Levente

>
>
> Eliot
>

Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

Schwab,Wilhelm K
New vms that read cog images - as in cog is no longer a one-way street?  That would make it safer/easier to test.




________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Levente Uzonyi [[hidden email]]
Sent: Tuesday, February 08, 2011 2:19 PM
To: Pharo Development
Cc: Squeak Virtual Machine Development Discussion; The general-purpose Squeak developers list
Subject: Re: [Pharo-project] new Cog VMs available

On Sun, 6 Feb 2011, Eliot Miranda wrote:

> Hi All,
>
>    new Cog VMs are available, SimpleStackBasedCogit @
> http://www.mirandabanda.org/files/Cog/VM/VM.r2359/ and
> StackToRegisterMappingCogit @
> http://www.mirandabanda.org/files/Cog/VM/VM.r2361.  I think the new code
> generator is ready for prime time now.  I fixed a number of bugs over the
> past three weeks and we're now using the StackToRegisterMappingCogit
> internally at Teleplace.  There's still work to be done merging plugins and
> details with the standard VMs  but I hope that r2361 is production-ready as
> far as core Smalltalk execution is concerned.
>
> Enjoy.

Thanks, StackToRegisterMappingCogit is really impressive. IIRC for the
4.1.1 VM Andreas fixed something about ImageSegment loading which is
missing from the CogVMs. It would be good to have that fix, because now
arrayOfRoots is nil when I'm trying to load an ImageSegment. It's not
urgent at all, because I could work the problem around using the new
SqueakVMs which can read Cog images and have the fix.


Levente

>
>
> Eliot
>


Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

Henrik Sperre Johansen
On 09.02.2011 02:31, Schwab,Wilhelm K wrote:
> New vms that read cog images - as in cog is no longer a one-way street?  That would make it safer/easier to test.
Yes.

Cheers,
Henry

Reply | Threaded
Open this post in threaded view
|

Re: new Cog VMs available

Schwab,Wilhelm K
GREAT!!!!!


________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Henrik Sperre Johansen [[hidden email]]
Sent: Tuesday, February 08, 2011 8:38 PM
To: [hidden email]
Subject: Re: [Pharo-project] new Cog VMs available

On 09.02.2011 02:31, Schwab,Wilhelm K wrote:
> New vms that read cog images - as in cog is no longer a one-way street?  That would make it safer/easier to test.
Yes.

Cheers,
Henry