On Sun, Mar 8, 2009 at 4:55 PM, Andreas Raab <[hidden email]> wrote:
TBH, my fix is a quick hack that catches many obvious cases. But I need to work a little harder to arrive at the right fix. For example, even with my patch the following produces the wrong answer:
| coll | coll := OrderedCollection new. 1 to: 10 do: [:each| | i | i := each. coll add: [i]. i := i + 1]. coll collect: [:each| each value] (produces 11 .. 11 instead of 2 .. 11). Hopefully we can get these fixed quickly.
|
In reply to this post by Eliot Miranda-2
On Sun, 08 Mar 2009 21:46:44 +0100, Eliot Miranda wrote:
> > Eliot (phone) > > On 7 Mar 2009, at 22:24, "Klaus D. Witzel" wrote: > >> On Sat, 07 Mar 2009 18:51:01 +0100, Eliot Miranda wrote: >> >>> Hi Klaus, >> >> Hi Eliot, >> >> great job, native closures-support was overdue and is appreciated by >> the Squeakers. > > You're so welcome! I'm looking forward to the quality of the > implementation improving with wider usage. Lukas has already sent me a > bug report for which we have an acceptable fix. You may perhaps also want to check the attachment from Mantis #7311 that I created a minute ago: - http://bugs.squeak.org/view.php?id=7311 This .st has 61 tests which I've written for Marcus' NewCompiler project (testing sourceCode -> Parser -> nodes -> compiled method -> InstructionStream). Made a small change for adapting them to your passing EncoderForV3 to the parser. BTW: all green in the recent Squeak-3.10.2-Closures.image ;) There's perhaps more to come, did a buch of tests for Igor's parser for Moebius, mainly around syntax constructs. Adapting them may need some effort+time, they depend on accurate reporting of source code position. /Klaus > Best > Eliot (mobile compromised) ... -- "If at first, the idea is not absurd, then there is no hope for it". Albert Einstein |
On Mon, Mar 9, 2009 at 1:23 AM, Klaus D. Witzel <[hidden email]> wrote:
Cool! But TBH let's add a little yellow: testInlineBlockCollection1 | col | col := OrderedCollection new.
1 to: 11 do: [ :each | col add: [ each ] ]. self assert: (col collect: [ :each | each value ]) asArray = (1 to: 11) asArray
testInlineBlockCollection2 | col | col := OrderedCollection new.
1 to: 11 do: [ :each | | i | i := each. col add: [ i ]. i := i + 1 ]. self assert: (col collect: [ :each | each value ]) asArray = (2 to: 12) asArray
There's perhaps more to come, did a buch of tests for Igor's parser for Moebius, mainly around syntax constructs. Adapting them may need some effort+time, they depend on accurate reporting of source code position. |
On Mon, 09 Mar 2009 19:02:27 +0100, Eliot Miranda wrote:
> On Mon, Mar 9, 2009 at 1:23 AM, Klaus D. Witzel wrote: ... >> You may perhaps also want to check the attachment from Mantis #7311 >> that I >> created a minute ago: >> >> - http://bugs.squeak.org/view.php?id=7311 >> >> This .st has 61 tests which I've written for Marcus' NewCompiler project >> (testing sourceCode -> Parser -> nodes -> compiled method -> >> InstructionStream). Made a small change for adapting them to your >> passing >> EncoderForV3 to the parser. BTW: all green in the recent >> Squeak-3.10.2-Closures.image ;) > > Cool! But TBH let's add a little yellow: > > testInlineBlockCollection1 > | col | > col := OrderedCollection new. > 1 to: 11 do: [ :each | col add: [ each ] ]. > self assert: (col collect: [ :each | each value ]) asArray = (1 to: 11) > asArray > > testInlineBlockCollection2 > | col | > col := OrderedCollection new. > 1 to: 11 do: [ :each | | i | i := each. col add: [ i ]. i := i + 1 ]. > self assert: (col collect: [ :each | each value ]) asArray = (2 to: 12) > asArray Yellow, right, and they belong into ClosureCompilerTest. But they also raise questions: I've seen that one of the differences between the Encoder*XYZ's is #supportsClosureOpcodes being true/false but also #generateAsClosure plays a role. So the *Closures suffix is short for *EmitClosuresBytecode? Also, blocks are never emitted the old (non-closure) way? If they where (under whatever *config*, blocks emitted the old way) then both tests can only fail, that's why I ask. /Klaus -- "If at first, the idea is not absurd, then there is no hope for it". Albert Einstein |
In reply to this post by johnmci
> > > I will at some point push out a 3.8.22 VM that should put up a more > helpful dialog message, but people who have older VMs underfoot > should realize this behaviour should be an indication that perhaps > your VM is too old. Unfortunately the machine that I have designated for Bob to be an auto build/test server is a power-pc machine. What are the chances of a power-pc version of the closures vm? just interested to know Keith |
Keith Hodges wrote:
>> I will at some point push out a 3.8.22 VM that should put up a more >> helpful dialog message, but people who have older VMs underfoot >> should realize this behaviour should be an indication that perhaps >> your VM is too old. >> > Unfortunately the machine that I have designated for Bob to be an auto > build/test server is a power-pc machine. What are the chances of a > power-pc version of the closures vm? > > just interested to know > > Keith elsewhere! Keith |
Keith Hodges wrote:
> Keith Hodges wrote: > >>> I will at some point push out a 3.8.22 VM that should put up a more >>> helpful dialog message, but people who have older VMs underfoot >>> should realize this behaviour should be an indication that perhaps >>> your VM is too old. >>> >>> >> Unfortunately the machine that I have designated for Bob to be an auto >> build/test server is a power-pc machine. What are the chances of a >> power-pc version of the closures vm? >> >> just interested to know >> >> Keith >> > Ok I see it is designated beta1U for universal, so the problem lies > elsewhere! > > Keith > syntax error (not my code you understand) Keith |
In reply to this post by Klaus D. Witzel
Hi Klaus,
On Mon, Mar 9, 2009 at 11:04 AM, Klaus D. Witzel <[hidden email]> wrote: On Mon, 09 Mar 2009 19:02:27 +0100, Eliot Miranda wrote: The scheme is that by choosing the encoder one can choose the type of code generated. So that e.g. if you say (Parser new encoderClass: EncoderForV3PlusClosures;
parse: someString readStream class: MyClass) generate: #(0 0 0 0)
you'll get closure code and if you say (Parser new encoderClass: EncoderForV3;
parse: someString readStream class: MyClass) generate: #(0 0 0 0)
you'll get pre-closure old-block code. #supportsClosureOpcodes and #generateAsClosure are private internal messages various parts fo the compiler send to itself to bring this about. Encoder implements supportsClosureOpcodes to say if the concrete class is designed to produce closure code. BlockNode implements #generateAsClosure to tell clients whether it was created as a block node for a closure or for an old-style block. If they where (under whatever *config*, blocks emitted the old way) then both tests can only fail, that's why I ask. And on the wrong VM it'll crash. Only the CLosure VM that people are providing right now can run both new and old code. The StackVM we have in Qwaq (that I hope will be released sometime) will only run Closure code and die horribly if given old block code.
/Klaus |
In reply to this post by keith1y
Keith Hodges wrote:
> Keith Hodges wrote: > >> Keith Hodges wrote: >> >> >>>> I will at some point push out a 3.8.22 VM that should put up a more >>>> helpful dialog message, but people who have older VMs underfoot >>>> should realize this behaviour should be an indication that perhaps >>>> your VM is too old. >>>> >>>> >>>> >>> Unfortunately the machine that I have designated for Bob to be an auto >>> build/test server is a power-pc machine. What are the chances of a >>> power-pc version of the closures vm? >>> >>> just interested to know >>> >>> Keith >>> >>> >> Ok I see it is designated beta1U for universal, so the problem lies >> elsewhere! >> >> Keith >> >> > OK so assigining to closure temporaries is no-longer allowed and flags a > syntax error (not my code you understand) > > Keith > image recompile could cause problems? I have just fixed an instance in MCzInstaller>>#associate: Which assigns to the block temporary. associate: tokens | result | result _ Dictionary new. tokens pairsDo: [:key :value | value isString ifFalse: [value _ value collect: [:ea | self associate: ea]]. value = 'nil' ifTrue: [value _ '']. result at: key put: value]. ^ result The fix is so ugly that I am beginning to think that assigning to a block temp isn't such a bad idea after all. Keith |
In reply to this post by keith1y
On Mon, Mar 9, 2009 at 3:58 PM, Keith Hodges <[hidden email]> wrote:
There is a preference that allows one to compile old code that does assign to block arguments. Its called allowBlockArgumentAssignment. Of course one can assign to closure temporaries. e.g.
self do: [:i| | j | j := i + 1. ... But assigning to a block argument is dubious.
|
In reply to this post by keith1y
On Mon, Mar 9, 2009 at 4:06 PM, Keith Hodges <[hidden email]> wrote:
Depends on how you set the allowBlockArgumentAssignment preference.
I have just fixed an instance in MCzInstaller>>#associate: Which assigns If I could figure out what the domain and co-domain of tokens were I might be able to avoid that horrible value = 'nil' ifTrue: [value _ ''] phrase :)
|
In reply to this post by Eliot Miranda-2
Eliot Miranda wrote:
> > > On Mon, Mar 9, 2009 at 3:58 PM, Keith Hodges <[hidden email] > <mailto:[hidden email]>> wrote: > > Keith Hodges wrote: > > Keith Hodges wrote: > > > >>> I will at some point push out a 3.8.22 VM that should put up a > more > >>> helpful dialog message, but people who have older VMs underfoot > >>> should realize this behaviour should be an indication that perhaps > >>> your VM is too old. > >>> > >>> > >> Unfortunately the machine that I have designated for Bob to be > an auto > >> build/test server is a power-pc machine. What are the chances of a > >> power-pc version of the closures vm? > >> > >> just interested to know > >> > >> Keith > >> > > Ok I see it is designated beta1U for universal, so the problem lies > > elsewhere! > > > > Keith > > > OK so assigining to closure temporaries is no-longer allowed and > flags a > syntax error (not my code you understand) > > > There is a preference that allows one to compile old code that does > assign to block arguments. Its called allowBlockArgumentAssignment. > Of course one can assign to closure temporaries. e.g. > > self do: [:i| | j | j := i + 1. ... > > But assigning to a block argument is dubious. > I dutifully rewrote the offending code (Installer-Formats-kph.4.mcz) and bootstrapped it using a bog standard fileIn from the snapshot/source.st file. However the first thing that happens is that MczInstaller recompiles (invoked from #newSubclassOf: newSuper type: type instanceVariables: instVars from: oldClass) not sure why since the class instVar layout hasnt changed at all. In this case I am probably better off removing the old class before I load the new one, however, this indicates the nature of potential problems to come. Keith |
Keith Hodges wrote:
> Eliot Miranda wrote: > >> On Mon, Mar 9, 2009 at 3:58 PM, Keith Hodges <[hidden email] >> <mailto:[hidden email]>> wrote: >> >> Keith Hodges wrote: >> > Keith Hodges wrote: >> > >> >>> I will at some point push out a 3.8.22 VM that should put up a >> more >> >>> helpful dialog message, but people who have older VMs underfoot >> >>> should realize this behaviour should be an indication that perhaps >> >>> your VM is too old. >> >>> >> >>> >> >> Unfortunately the machine that I have designated for Bob to be >> an auto >> >> build/test server is a power-pc machine. What are the chances of a >> >> power-pc version of the closures vm? >> >> >> >> just interested to know >> >> >> >> Keith >> >> >> > Ok I see it is designated beta1U for universal, so the problem lies >> > elsewhere! >> > >> > Keith >> > >> OK so assigining to closure temporaries is no-longer allowed and >> flags a >> syntax error (not my code you understand) >> >> >> There is a preference that allows one to compile old code that does >> assign to block arguments. Its called allowBlockArgumentAssignment. >> Of course one can assign to closure temporaries. e.g. >> >> self do: [:i| | j | j := i + 1. ... >> >> But assigning to a block argument is dubious. >> >> > Working in 3.10.2-Closures image. > > I dutifully rewrote the offending code (Installer-Formats-kph.4.mcz) and > bootstrapped it using a bog standard fileIn from the snapshot/source.st > file. However the first thing that happens is that MczInstaller > recompiles (invoked from #newSubclassOf: newSuper type: type > instanceVariables: instVars from: oldClass) not sure why since the class > instVar layout hasnt changed at all. > > In this case I am probably better off removing the old class before I > load the new one, however, this indicates the nature of potential > problems to come. > > Keith essential in 3.10.2 until some form of audit of the size of the problem is carried out. Bob is happily building away, and so 3.10.2-closures-lpf is on its way Keith |
In reply to this post by keith1y
Well the 4.0.0beta1U macintosh squeak closure carbon VM *should* run
on powerpc. I can't quite tell from the note if this is the case, but let me assume it does unless I hear otherwise? On 9-Mar-09, at 4:44 PM, Keith Hodges wrote: > Keith Hodges wrote: >>> I will at some point push out a 3.8.22 VM that should put up a more >>> helpful dialog message, but people who have older VMs underfoot >>> should realize this behaviour should be an indication that perhaps >>> your VM is too old. >>> >> Unfortunately the machine that I have designated for Bob to be an >> auto >> build/test server is a power-pc machine. What are the chances of a >> power-pc version of the closures vm? >> >> just interested to know >> >> Keith > Ok I see it is designated beta1U for universal, so the problem lies > elsewhere! > > Keith > > -- = = = ======================================================================== John M. McIntosh <[hidden email]> Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com = = = ======================================================================== |
In reply to this post by keith1y
Keith Hodges wrote:
> So basically for a quiet life enabling those two preferences is > essential in 3.10.2 until some form of audit of the size of the problem > is carried out. > > Bob is happily building away, and so 3.10.2-closures-lpf is on its way Now there is some good news! (and yes, I agree we should enable these preferences for the time being to allow easier migration) Cheers, - Andreas |
In reply to this post by johnmci
John M McIntosh wrote:
> Well the 4.0.0beta1U macintosh squeak closure carbon VM *should* run > on powerpc. I can't > quite tell from the note if this is the case, but let me assume it > does unless I hear otherwise? Yes its fine, I had got the path to the vm wrong. Closures LPF has arrived: http://bob.warwick.st/release/Squeak3.10.2-closures-lpf http://ftp.squeak.org/3.11/Squeak3.10.2-closures-lpf I have been experimenting with recompiling existing packages with those preferences disabled. Installer passes PackageInfo-Base passes Monticello hits a problem, SyntaxError's are generated the resultant situation does not appear to be debuggable. When the debugger refuses to work, you have reached the limits of my expertise. To reproduce, open the image, switch the preferences off, and using Monticello Borwser select recompile package "Monticello.impl" Keith |
Bug found:
| c | c := 0. SystemNavigation default allObjectsDo: [ :a | c := c + 1 ]. c. doesn't seem to ever finish. Keith |
Keith Hodges wrote:
> Bug found: > > | c | > c := 0. > SystemNavigation default allObjectsDo: [ :a | c := c + 1 ]. > c. > > doesn't seem to ever finish. Ah, yes! Fix like this: MethodContext class>>allInstancesDo: aBlock "Only count until thisContext" | inst next | inst := self someInstance. [inst == thisContext] whileFalse:[ next := inst nextInstance. aBlock value: inst. inst := next] (otherwise activation of aBlock will create another context) Cheers, - Andreas |
In reply to this post by Eliot Miranda-2
Hi Eliot,
On Tue, 10 Mar 2009 01:04:29 +0100, Eliot Miranda wrote: > Hi Klaus, > > On Mon, Mar 9, 2009 at 11:04 AM, Klaus D. Witzel wrote: ... >> I've seen that one of the differences between the Encoder*XYZ's is >> #supportsClosureOpcodes being true/false but also #generateAsClosure >> plays a >> role. So the *Closures suffix is short for *EmitClosuresBytecode? Also, >> blocks are never emitted the old (non-closure) way? > > > The scheme is that by choosing the encoder one can choose the type of > code generated. So that e.g. if you say > > (Parser new > encoderClass: EncoderForV3PlusClosures; > parse: someString readStream class: MyClass) > generate: #(0 0 0 0) > > you'll get closure code and if you say > > (Parser new > encoderClass: EncoderForV3; > parse: someString readStream class: MyClass) > generate: #(0 0 0 0) > > you'll get pre-closure old-block code. Okay thanks, perfectly clear now. ... > And on the wrong VM it'll crash. Only the CLosure VM that people are > providing right now can run both new and old code. The StackVM we have > in > Qwaq (that I hope will be released sometime) will only run Closure code > and die horribly if given old block code. This implies that any test*ABC method which compiles source code and passes the wrong Encoder*XYZ to Parser can crash its VM. So one has to check, in such tests, what VM type is running. How can the VM be queried for that? /Klaus -- "If at first, the idea is not absurd, then there is no hope for it". Albert Einstein |
On Tue, Mar 10, 2009 at 12:48 AM, Klaus D. Witzel <[hidden email]> wrote: Hi Eliot, Good point. There isn't a straight-forward way in the normal VMs. In the Qwaq internal VMs I added the imageFormatVersion of the current VM as vm parameter #41. BTW, here is the complete list of things I've added
41 imageFormatVersion for the VM 42 nil (number of stack pages in use in Stack VM)
43 nil (desired number of stack pages in Stack VM) 44 nil (size of eden, in bytes in Stack VM)
45 nil (desired size of eden in Stack VM) 46-55 nil; reserved for VM parameters that persist in the image (such as eden above)
56 number of process switches since startup (read-only) 57 number of ioProcessEvents calls since startup (read-only)
58 number of ForceInterruptCheck calls since startup (read-only) 59 number of check event calls since startup (read-only)
There might be a way of constructing an empty closure on a null method and testing if a version of the closure primitive fails, but I prefer the image format parameter. In older VMs the vm parameter primitive should fail if given parameter 41. What say the VM devs? Can we add #41 as answering the imageFormatVersion of the VM?
|
Free forum by Nabble | Edit this page |