<div dir="ltr"><div>We are overwriting upper row because taking hdir=-1 because of overlap</div><div>The problem is not that we write too far, but that we pick too early (on previous row), and it is related to ???</div><div><br></div><div>preload!!</div><div><br></div>To determine if we must preload, we have to take the endBits when the direction is reversed due to overlap (hDir = -1)<br>   endBits := (sx + bbW - 1 bitAnd: pixPerM1) + 1<br>First error above: checkSourceOverlap has already done that:<br> sx := sx + bbW - 1.<br>So it must be:<br>   endBits := (sx bitAnd: pixPerM1) + 1<br>  <br>Then we build mask1:<br>        m1 := destMSB = (hDir > 0)<br>         ifTrue: [AllOnes >> (32 - (startBits * destDepth))]<br>             ifFalse: [AllOnes << (32 - (startBits * destDepth)) bitAnd: AllOnes].<br>Second error above: if we have reversed direction (hDir = -1), then we              must build mask2:<br>    destMSB<br>               ifTrue: [mask2 := AllOnes << (32 - (endBits * destDepth)) bitAnd: AllOnes]<br>              ifFalse: [mask2 := AllOnes >> (32 - (endBits * destDepth))].<br>Replace mask2 by m1 and endBits by startBits (because startBits contains endBits if hDir=-1)<br>And you see that the conditions destMSB is reversed...<br><br>Last thing: on 64bits, mask1 and mask2 have been declared int64...<br>But we only want 32 bits mask.<br>That is why I have protected with the bitAnd: AllOnes<br>(and thus removed the cCode:inSmalltalk: simulation guard)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 21 févr. 2020 à 23:40, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Several candidates, maybe I missed some:<br></div><div><a href="https://source.squeak.org/VMMaker/VMMaker.oscog-eem.2461.diff" target="_blank">https://source.squeak.org/VMMaker/VMMaker.oscog-eem.2461.diff</a><div><a href="https://source.squeak.org/VMMaker/VMMaker.oscog-eem.2460.diff" target="_blank">https://source.squeak.org/VMMaker/VMMaker.oscog-eem.2460.diff</a> (Oct 2018)<br></div><div><a href="https://source.squeak.org/VMMaker/VMMaker.oscog-eem.2284.diff" target="_blank">https://source.squeak.org/VMMaker/VMMaker.oscog-eem.2284.diff</a></div><div><a href="https://source.squeak.org/VMMaker/VMMaker.oscog-" target="_blank">https://source.squeak.org/VMMaker/VMMaker.oscog-</a> nice.2281.diff</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 21 févr. 2020 à 23:13, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I do not observe the artifacts at same smear step (nor any other) with</div><div>VM [CoInterpreterPrimitives VMMaker.oscog-eem.2266] 5.0.201708312323</div><div><br></div><div>That's just 222 commits to bissect...<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 21 févr. 2020 à 23:00, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>There's already a problem with end 2018 VM</div><div>VM [CoInterpreterPrimitives VMMaker.oscog-eem.2488] 5.0.201812040127</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 21 févr. 2020 à 22:48, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Interesting case to debug...</div><div>In 64bits VM, a problem first appears in first smear:distance: operation (direction 1@0 to the right) at skew=16...</div><div><br></div><div><div><img src="cid:ii_k6womxvo0" alt="Capture d’écran 2020-02-21 à 22.24.03.png" width="424" height="436"><br><br></div></div><div><div><br></div><div>It seems that we copy bits too far to the right (hence we overwrite the bottom rows)</div><div>Fortunately, the artefacts outside polygon bounds disappear at final bitAnd operation, but that's scary!<br></div><div><br></div></div><div>It could be:</div><div>- case of overlap detection failure (#checkSourceOverlap), but the code did not change</div><div>- bad initialisation in #sourceSkewAndPointerInit (the one I corrected in 2019)</div><div> <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/426" target="_blank">https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/426</a></div><div>- bug in #copyLoop (which I also corrected in 2019)</div><div><a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/441" target="_blank">https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/441</a></div><div><br></div><div>Weird kind of integer overflow? (I've made most of the int unsigned, so this might not be detected by UB sanitizer).<br></div><div><br></div><div>Or could it be that the extra buffer overrun that I removed did have a side effect of filling more gaps?</div><div>It would be interesting to observe what happens at same #smear:distance: step with older VM.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 21 févr. 2020 à 20:39, Stéphane Rollandin <<a href="mailto:lecteur@zogotounga.net" target="_blank">lecteur@zogotounga.net</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> Hmmm... the form was still filled in Squeak 5.1 (Update 16549), <br>
> VM 201701311639 (32-bit). Not so in Squeak 5.2.<br>
<br>
Yes, but that same 5.1 image with a current VM has the problem...<br>
<br>
Stef<br>
<br>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>