<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 28, 2018 at 2:53 PM Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<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 dir="ltr"><a href="http://bugs.squeak.org/view.php?id=3380" target="_blank">http://bugs.squeak.org/view.php?id=3380</a></div></div></blockquote><div><br></div><div>and </div><div> </div><div><div>Intervals:</div><div><div>   (0 to: 1) = (0 to: 5/3). "true"</div><div>   (0 to: 1) hash = (0 to: 5/3) hash. "false"</div></div></div><div><br></div><div>In the inbox is collections-cbc.810.mcz, which fixes both of these bugs.</div><div><br></div><div>You can test them out - #hash still replicates the bugs, while #hashBetterFastArrayCompatible (on Interval) and #hashBetterFastIntervalCompatible (on Array) makes both work.  The later also implements your idea of only testing some of the elements - the first and last 16.</div><div><br></div><div>It slows down hash speed of Interval roughly an order of magnitude, though.</div><div><br></div><div>If anyone hash ideas I'd be interested. Failing that, I'll ruminate on them for the next several days, and eventually push something in that fixes this (meanwhile moving that package to treated).</div><div>-----</div><div>Here is the series of 'tests' that I did while working on these with various timings.</div><div><br></div><div><div>{</div><div>[(1 to: 100 by: 1) hash] bench.</div><div>[(1 to: 100 by: 1) hashBetter] bench.</div><div>[(1 to: 100 by: 1) hashBetterAlsoFixBug3380] bench.</div><div>[(1 to: 100 by: 1) hashSlowerBetterAlsoFixBug3380] bench.</div><div>[(1 to: 100 by: 1) hashFastArrayCompatible] bench.</div><div>[(1 to: 100 by: 1) hashBetterFastArrayCompatible] bench.</div><div>'---'.</div><div>[(1 to: 100.3 by: 1) hash] bench.</div><div>[(1 to: 100.3 by: 1) hashBetter] bench.</div><div>[(1 to: 100.3 by: 1) hashBetterAlsoFixBug3380] bench.</div><div>[(1 to: 100.3 by: 1) hashSlowerBetterAlsoFixBug3380] bench.</div><div>[(1 to: 100.3 by: 1) hashFastArrayCompatible] bench.</div><div>[(1 to: 100.3 by: 1) hashBetterFastArrayCompatible] bench.</div><div>}</div><div><br></div><div>{</div><div><span style="white-space:pre">       </span>(0 to: 1) = (0 to: 5/3). </div><div><span style="white-space:pre">    </span>(0 to: 1) hash = (0 to: 5/3) hash.</div><div><span style="white-space:pre">    </span>(0 to: 1) hashBetter = (0 to: 5/3) hashBetter.</div><div><span style="white-space:pre">        </span>(0 to: 1) hashBetterAlsoFixBug3380 = (0 to: 5/3) hashBetterAlsoFixBug3380.</div><div><span style="white-space:pre">    </span>(0 to: 1) hashSlowerBetterAlsoFixBug3380 = (0 to: 5/3) hashSlowerBetterAlsoFixBug3380.</div><div><span style="white-space:pre">        </span>(0 to: 1) hashFastArrayCompatible = (0 to: 5/3) hashFastArrayCompatible.</div><div><span style="white-space:pre">      </span>(0 to: 1) hashBetterFastArrayCompatible = (0 to: 5/3) hashBetterFastArrayCompatible.</div><div>}</div><div><br></div><div><br></div><div>{</div><div><span style="white-space:pre">        </span>(1 to: 3) = #(1 2 3).</div><div><span style="white-space:pre"> </span>(1 to: 3) hash = #(1 2 3) hash.</div><div><span style="white-space:pre">       </span>(1 to: 3) hashBetter = #(1 2 3) hash.</div><div><span style="white-space:pre"> </span>(1 to: 3) hashBetterAlsoFixBug3380 = #(1 2 3) hash.</div><div><span style="white-space:pre">   </span>(1 to: 3) hashSlowerBetterAlsoFixBug3380 = #(1 2 3) hash.</div><div><span style="white-space:pre">     </span>(1 to: 3) hashFastArrayCompatible = #(1 2 3) hashFastIntervalCompatible.</div><div><span style="white-space:pre">      </span>(1 to: 3) hashBetterFastArrayCompatible = #(1 2 3) hashBetterFastIntervalCompatible.</div><div>}</div></div><div><br></div><div>-cbc<br></div></div></div></div></div></div>