<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Timsort - Page 23 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=Timsort&amp;p=22">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Timsort&amp;p=24">3.Next</a>
</p>

<p><big> Formal verification </big></p>
<p>In 2015, Dutch and German researchers in the EU FP7 ENVISAGE project found a bug in the standard implementation of Timsort. It was fixed in 2015 in Python, Java, and Android.</p>

<p>Specifically, the invariants on stacked run sizes ensure a tight upper bound on the maximum size of the required stack.  The implementation preallocated a stack sufficient to sort 2<sup>64</sup> bytes of input, and avoided further overflow checks.</p>

<p>However, the guarantee requires the invariants to apply to every group of three</p><p>
<a accesskey="1" href="page.php?w=Timsort&amp;p=22">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Timsort&amp;p=24">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
