<div dir="ltr">On Thu, Mar 28, 2013 at 12:11 PM, Renato Golin <span dir="ltr"><<a href="mailto:rengolin@systemcall.org" target="_blank">rengolin@systemcall.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On 28 March 2013 18:45, Daniel Dunbar <<a href="mailto:daniel@zuster.org">daniel@zuster.org</a>> wrote:<br>

> I seem to recall hitting a similar kind of bug in another benchmark, it is<br>
> possible to just change the sqlite code to use a more standard<br>
> implementation of the conversion (like sprintf?).<br>
<br>
</div>I tried, but vxprintf (the local version of vprintf) has a context<br>
passed in, which gets changed many times in many different branch<br>
options throughout the execution of vxprintf.<br>
<br>
I did try calling sprintf on the context buffer, but that wasn't<br>
enough. I also tried saving the double value into a temporary variable<br>
and re-use it in the end (avoiding most of the FP madness), but that<br>
incurred in the rounding issues I said earlier.<br>
<div class="im"><br>
<br>
> Makes sense. My preferred fix for those is to augment the input and<br>
> comparison routine so the array has a total ordering, which makes it<br>
> independent of the actual sort implementation. However, this can also be a<br>
> pain.<br>
<br>
</div>On all those examples, the input and the search space are both too<br>
big. I thought about using a stable sort instead of qsort, but haven't<br>
tried it yet.<br></blockquote><div><br></div><div style>I don't understand this comment. I just meant transforming the call to qsort so the sort would be stable, regardless of the actual sort implantation, by augmenting the comparator function with the index of the element in the incoming array (to disambiguate equality). See also <a href="http://en.wikipedia.org/wiki/Schwartzian_transform">http://en.wikipedia.org/wiki/Schwartzian_transform</a></div>
<div style><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
On anagram, the main issue is that the sort order is not direct, but<br>
depends on the current value of an array indexed by the element, which<br>
makes matters more complex.<br>
<div class="im"><br>
<br>
> This is another place where it might be very handy to have a platform<br>
> independent runtime library that we could build once and link in to all the<br>
> executables, and start accumulating implementations of all the things that<br>
> platform dependencies in the program output. Honestly, adding that shouldn't<br>
> even be that much work... maybe if I can scratch some time together...<br>
<br>
</div>The RNG implementation I've added to the other three tests could be a<br>
good start. Though you might find it hard to get it working on every<br>
platform variant, as much as other library writers... ;)<br>
<div class="im"><br>
<br>
> Do you have a comprehensive list of all the tests that are failing presumed<br>
> due to bogus reference output mismatches?<br>
<br>
</div>Yes!<br>
<br>
  - Failing on both ARM and Intel, exact same output<br>
    + MultiSource/Applications/Burg/burg<br>
    + MultiSource/Applications/lemon/lemon<br>
    + MultiSource/Benchmarks/Ptrdist/anagram/anagram<br>
<br>
 - Failing on both ARM and Intel, different output<br>
    + MultiSource/Applications/ClamAV/clamscan<br>
<br>
 - Failing only on Intel:<br>
    + MultiSource/Benchmarks/Olden/voronoi<br>
<br>
 - Failing only on ARM:<br>
    + MultiSource/Applications/sqlite3<br>
<br>
 - With:<br>
    + ARM: Chromebook Cortex-A15 hardfloat<br>
    + Intel: x86_64 core i7<br>
<br>
I can send you the Output directory of them all if you want (it's<br>
about 5M, so I won't copy the list).<br></blockquote><div><br></div><div style>I don't think that would help me much without being able to run them to understand the differences. The clamscan and voronoi failures sound familiar to me, from when I tried to get reference inputs tidied up on Linux, but I've forgotten the details.</div>
<div style><br></div><div style>If I get some time to look at this I'll just find a Linux environment to use to investigate, which should cover all the issues except for the sqlite3 one.</div><div style><br></div><div style>
 - Daniel</div><div style><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
cheers,<br>
--renato<br>
</blockquote></div><br></div></div>