<div dir="ltr">Hi Tim,<div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 12, 2018 at 11:50 AM, tim Rowledge <span dir="ltr"><<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
<br>
> On 12-04-2018, at 9:45 AM, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> wrote:<br>
><br>
> So the process in going from 32 to 64 bits is<br>
> - load the 32-bit image into a 32-bit simulator<br>
> - clone all the objects that are preserved in a 64-bit simulator, creating a map<br>
> - pass through the 32-bit objects, updating the corresponding slot in the 64-bit simulator with the object at the map<br>
> - save the 64-bit image<br>
><br>
> And the process in going in the reverse direction would be to<br>
> - load the 64-bit image into a 64-bit simulator<br>
> - clone all the objects in a 32-bit simulator, creating a map<br>
> - pass through the 64-bit objects, updating the corresponding slot in the 32-bit simulator with the object at the map, or otherwise allocating a boxed object for the 64-bit immediate that has no equivalent immediate in 32-bits<br>
> - save the 32-bit image<br>
><br>
> I just timed converting a 34 Mb 32-bit Squeak 5.1 image to 64-bits on my 2.3Ghz Core i7 Mac Mini in a 63-bit Spur image.  It took 20.6 seconds to convert.  One would probably have to add another 0.5 seconds for start up costs.  And Pi is around 5x slower than Mac.  So conversion times would be anywhere from 15 seconds to 1 1/2 minutes for standard images, scaling more or less linearly with larger images.<br>
><br>
> I certainly don't see any way of doing this in orders of magnitude faster.  But that's my limitation ;-)<br>
><br>
> But this computation is ideal for Scorch/Sista right?  It's a series of loops.  It only ever does the same thing because input images are extremely similar.  The image could be trained on a suitably general input set before being deployed.  It would be very interesting to see how much faster Scorch/Sista manages to make image mapping.<br>
<br>
</span>So I guess we would have a 'native' utility image included with the normal system, that is set up to do this conversion from 'other' to 'native' as fast as possible, then quit and start the now-native image? The VM would be unchanged for normal usage except just possibly returning an error code if a wrong format image is specified and then the startup shell script(s) could do the run-converter-image pass. Faintly possible this would be a tad quicker than a specific test-first pass. Ah, I imagine we might be clever enough to detect the wrong format in the VM and then just load the converter image anyway, since we'd want to know where it lives and no other VM setup would have been done. The only extra trick would be storing the name of the converted image to run after the processing.<br></blockquote><div><br></div><div>That's right.  All this is trivial form the command line.  Prompt the user with "the image is X bits.  The VM is Y bits.  Do you want to convert?" form the launch script and do the dirty if asked.  From the app its a bit more difficult because we have to at least prompt the user in the GUI domain.  Ideally the converter would be one and the same image.  When run from the command line the converter would be launched headless and interrogate the user through stdio.  When run from the app it would use its own GUI and then relaunch.  If at all possible this should all be written in Smalltalk apart from the VM launching the converter image.  Some fragment of ckformat.c could be compiled into the VM to see if the image conversion was appropriate and to launch the converter image in the right mode.</div><div><br></div><div>Volunteers?  I'm happy to have a go at this when my decks are cleared, but that could be weeks away.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sure, on *nix it is simple enough to run a format-checker, run the converter if needed (remembering an UI to ask the user if they actually want to do that) and then run the real VM/image. Doing it under our own control seems more fun.<br>
<br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
>From C:\*.* to shining C:\*.*<br>
</blockquote></div><br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>