Simulating trunk6.image in Spur64VMMaker

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

Simulating trunk6.image in Spur64VMMaker

K K Subbu
 
All,

I tried simulating latest trunk6.image in Squeak#19335 on
sqcogspur64linuxht built on linux (Ubuntu 16.04):

| sis |
sis := StackInterpreterSimulator newWithOptions: #(ObjectMemory
Spur32BitMemoryManager).
sis desiredNumStackPages: 8.
sis assertValidExecutionPointersAtEachStep: false.
sis openOn: 'trunk6.image'.
sis openAsMorph; run

The image opens successfully, but I get a small blinking rectangle to
the left of the Squeak icon on the docking bar. Response is terribly
slow (about 20s to bring up the World menu) even when cpu is at 30-40%.

What am I doing wrong?

What are the options if I want to open V3 images in this simulator?

TIA .. Subbu
Reply | Threaded
Open this post in threaded view
|

Re: Simulating trunk6.image in Spur64VMMaker

Eliot Miranda-2
 
Hi Subbu,

On Mon, Feb 10, 2020 at 4:58 AM K K Subbu <[hidden email]> wrote:
 
All,

I tried simulating latest trunk6.image in Squeak#19335 on
sqcogspur64linuxht built on linux (Ubuntu 16.04):

| sis |
sis := StackInterpreterSimulator newWithOptions: #(ObjectMemory
Spur32BitMemoryManager).
sis desiredNumStackPages: 8.
sis assertValidExecutionPointersAtEachStep: false.
sis openOn: 'trunk6.image'.
sis openAsMorph; run

The image opens successfully, but I get a small blinking rectangle to
the left of the Squeak icon on the docking bar.

The rectangle blinks whenever the simulator calls ioRelinquishProcessorForMicroseconds:, which is the heart of primitiveRelinquishProcessor.  SO the blinking rectangle shows you that the system is running but has nothing to do.

Response is terribly
slow (about 20s to bring up the World menu) even when cpu is at 30-40%.

What am I doing wrong?

Nothing.  The simulator is slow.  It allows very high-level development of the VM.  But it does not perform anything like as fast as the production VM.  Even though it is thousands of times slower than the real VM it permits development of the VM at rates that are, in my experience, ten to a hundred times faster.

If you want to develop specific primitives, optimizations, etc, that are invoked from specific Smalltalk expressions you'll find simulating the "reader" image, which contains a Real-Eval-Print Loop (a REPL), much easier than trying to interact with the desktop through the world menu.  It is also perfectly repeatable.  Another approach is to save the image using a doit and have that doit include, after the snapshot, the code you want to run.  Another technique that saves time is to save the image containing the simulator with an open simulator having reached some point, such as the start of a garbage collection.  You can then rerun the code you're interested in my reloading the image and continuing the simulator.

 
What are the options if I want to open V3 images in this simulator?

Just change  ObjectMemory Spur32BitMemoryManager to ObjectMemory NewObjectMemory

TIA .. Subbu

_,,,^..^,,,_
best, Eliot
Reply | Threaded
Open this post in threaded view
|

Re: Simulating trunk6.image in Spur64VMMaker

K K Subbu
 
On 10/02/20 8:59 PM, Eliot Miranda wrote:
> If you want to develop specific primitives, optimizations, etc, that are
> invoked from specific Smalltalk expressions you'll find simulating the
> "reader" image, which contains a Real-Eval-Print Loop (a REPL), much
> easier than trying to interact with the desktop through the world menu.

Thank you very much for your quick and detailed response. I created a swiki:

  http://wiki.squeak.org/squeak/6640
  http://wiki.squeak.org/squeak/79 (updated)

> It is also perfectly repeatable.  Another approach is to save the image
> using a doit and have that doit include, after the snapshot, the code
> you want to run.  Another technique that saves time is to save the image
> containing the simulator with an open simulator having reached some
> point, such as the start of a garbage collection. You can then rerun the
> code you're interested in my reloading the image and continuing the
> simulator.

I saw Clement's excellent video at https://youtu.be/hctMBGAXVSs and his
blog https://clementbera.wordpress.com/2016/05/30/simulating-the-cog-vm/

>     What are the options if I want to open V3 images in this simulator?
>
>
> Just change  ObjectMemory Spur32BitMemoryManager to ObjectMemory
> NewObjectMemory

I could'nt get the simulator to open 6502/6504 images. I got
'incomaptible image format' error [sic]. When I tried with ObjectMemory,
I got a MNU on coInterpreter in initialize.

Regards .. Subbu
Reply | Threaded
Open this post in threaded view
|

Re: Simulating trunk6.image in Spur64VMMaker

Eliot Miranda-2
 
Hi Subbu,

> On Feb 10, 2020, at 11:45 PM, K K Subbu <[hidden email]> wrote:
>
> On 10/02/20 8:59 PM, Eliot Miranda wrote:
>> If you want to develop specific primitives, optimizations, etc, that are invoked from specific Smalltalk expressions you'll find simulating the "reader" image, which contains a Real-Eval-Print Loop (a REPL), much easier than trying to interact with the desktop through the world menu.
>
> Thank you very much for your quick and detailed response. I created a swiki:
>
> http://wiki.squeak.org/squeak/6640
> http://wiki.squeak.org/squeak/79 (updated)
>
>> It is also perfectly repeatable.  Another approach is to save the image using a doit and have that doit include, after the snapshot, the code you want to run.  Another technique that saves time is to save the image containing the simulator with an open simulator having reached some point, such as the start of a garbage collection. You can then rerun the code you're interested in my reloading the image and continuing the simulator.
>
> I saw Clement's excellent video at https://youtu.be/hctMBGAXVSs and his blog https://clementbera.wordpress.com/2016/05/30/simulating-the-cog-vm/
>
>>    What are the options if I want to open V3 images in this simulator?
>> Just change  ObjectMemory Spur32BitMemoryManager to ObjectMemory NewObjectMemory
>
> I could'nt get the simulator to open 6502/6504 images. I got 'incomaptible image format' error [sic]. When I tried with ObjectMemory, I got a MNU on coInterpreter in initialize.

IIRC Cog only runs 6505 images.  There’s the closure bytecode set constraint and floating point order constraint.  And ObjectMemory won’t work.  If must be NewObjectMemory.

A useful but difficult task would be to merge David’s VMMaker Context interpreter into Andreas’ much improved Context interpreter that he did at Qwaq, that was my starting point for Cog (& is the Context interpreter in VMMaker.oscog).  Amongst his improvements were the profiling improvements that support AndresProfiler.

> Regards .. Subbu
Reply | Threaded
Open this post in threaded view
|

Re: Simulating trunk6.image in Spur64VMMaker

David T. Lewis
 
On Tue, Feb 11, 2020 at 12:12:08AM -0800, Eliot Miranda wrote:

>  
> Hi Subbu,
>
> > On Feb 10, 2020, at 11:45 PM, K K Subbu <[hidden email]> wrote:
> >
> > ???On 10/02/20 8:59 PM, Eliot Miranda wrote:
> >> If you want to develop specific primitives, optimizations, etc, that are invoked from specific Smalltalk expressions you'll find simulating the "reader" image, which contains a Real-Eval-Print Loop (a REPL), much easier than trying to interact with the desktop through the world menu.
> >
> > Thank you very much for your quick and detailed response. I created a swiki:
> >
> > http://wiki.squeak.org/squeak/6640
> > http://wiki.squeak.org/squeak/79 (updated)
> >
> >> It is also perfectly repeatable.  Another approach is to save the image using a doit and have that doit include, after the snapshot, the code you want to run.  Another technique that saves time is to save the image containing the simulator with an open simulator having reached some point, such as the start of a garbage collection. You can then rerun the code you're interested in my reloading the image and continuing the simulator.
> >
> > I saw Clement's excellent video at https://youtu.be/hctMBGAXVSs and his blog https://clementbera.wordpress.com/2016/05/30/simulating-the-cog-vm/
> >
> >>    What are the options if I want to open V3 images in this simulator?
> >> Just change  ObjectMemory Spur32BitMemoryManager to ObjectMemory NewObjectMemory
> >
> > I could'nt get the simulator to open 6502/6504 images. I got 'incomaptible image format' error [sic]. When I tried with ObjectMemory, I got a MNU on coInterpreter in initialize.
>
> IIRC Cog only runs 6505 images.  There???s the closure bytecode set constraint and floating point order constraint.  And ObjectMemory won???t work.  If must be NewObjectMemory.

Cog can run 6505 images in addition to 6504 (but it cannot run 6502).
The only real difference between 6504 and 6505 is the word ordering
of Float objects, which gets resolved in the process of loading the
image.

I don't know if it matters, but if you want to run a 6504 image
in the simulator it would probably be a good idea to first run
that image on Cog and save it, such that the image is stored
as 6505.

>
> A useful but difficult task would be to merge David???s VMMaker Context interpreter into Andreas??? much improved Context interpreter that he did at Qwaq, that was my starting point for Cog (& is the Context interpreter in VMMaker.oscog).  Amongst his improvements were the profiling improvements that support AndresProfiler.
>

Indeed the AndreasProfiler support is an important missing thing in
the "interpreter VM" code base.

The ContextInterpreter in VMMaker "trunk" (as opposed to VMMaker.oscog
for Cog/Spur) is nothing more that a refactoring of Interpreter into
the stack interpreter and (original) context interpreter. Today it
contains the development work for "interpreter VM" since the oscog/trunk
fork.

At some point, I tried to incorporate Andreas' profiler work from
VMMaker.oscog into ContextInterpreter, but I was not successful in
getting it to work. It would still be an important and good thing
to do.

Dave
 
Reply | Threaded
Open this post in threaded view
|

Re: Simulating trunk6.image in Spur64VMMaker

K K Subbu
 
On 12/02/20 6:56 PM, David T. Lewis wrote:
> I don't know if it matters, but if you want to run a 6504 image in
> the simulator it would probably be a good idea to first run that
> image on Cog and save it, such that the image is stored as 6505.

This is a good trick. Thanks

> The ContextInterpreter in VMMaker "trunk" (as opposed to
> VMMaker.oscog for Cog/Spur) is nothing more that a refactoring of
> Interpreter into the stack interpreter and (original) context
> interpreter. Today it contains the development work for "interpreter
> VM" since the oscog/trunk fork.

Good info. I added it to Squeak swiki http://wiki.squeak.org/squeak/6642

Regards .. Subbu