<div dir="ltr"><div>Hi Daniel,</div><div><br></div><div>On the .rst side, in docs/source/cmd_ref.rst you'll find /cmd/* which <a href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html">Sphinx expands</a> such that "matches are inserted into the list alphabetically". This is related specifically to the docs build, not to the binary help message. I thought the irreproducibility was in the output of the help command used in the yosys binary and not in the docs generated via Sphinx from rst generated by write_rst in kernel/register.cc, is that not the case?</div><div><br></div><div>Cheers</div><div>Emil<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 9, 2024 at 12:37 PM Daniel Gröber <<a href="mailto:dxld@darkboxed.org">dxld@darkboxed.org</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">Hi Emil, Hi Krystine,<br>
<br>
On Tue, Jul 09, 2024 at 11:37:02AM +0200, Emil Jiří Tywoniak wrote:<br>
> Thank you for the extensive information. I have looked at the ordering of<br>
> pass short_help strings and I find them to be ordered by iterating over<br>
> std::map<std::string, Pass*> pass_register; which clearly is defined<br>
> regardless of locale since std::map uses std::less for comparison which<br>
> uses operator< which for std::string is given as std::lexicographical_compare<br>
> which is described<br>
> <<a href="https://en.cppreference.com/w/cpp/algorithm/lexicographical_compare" rel="noreferrer" target="_blank">https://en.cppreference.com/w/cpp/algorithm/lexicographical_compare</a>> as<br>
> "If one range is a prefix of another, the shorter range is<br>
> lexicographically *less* than the other."<br>
<br>
Right I had found those docs too, but lexicographical ordering may still<br>
depend on locale.<br>
<br>
> Therefore synth_intel ought to always come before synth_intel_alm<br>
> regardless of stability or locale. Would you mind sharing information about<br>
> which locale was used and the commit this was tested at?<br>
<br>
I don't have that noted down unfortunately. These notes are from the<br>
trenches :]<br>
<br>
Reprotest just picks "random" locales AFAIK, but perhaps biased towards<br>
ones with interesting behaviours.<br>
<br>
On Tue, Jul 09, 2024 at 09:54:12PM +1200, Krystine Sherwin wrote:<br>
> If this is about the order of .rst files read by Sphinx during a docs build<br>
> (and in turn the order they are output and/or listed in the contents), the<br>
> command reference pages are detected by sphinx via globbing of<br>
> /docs/source/cmd/*. <br>
<br>
Aah, that would make sense. I forgot about disorderfs. Reprotest<br>
intentionally introduces readdir() reordering (if enabled/installed). That<br>
was IIRC why I could initially not reproduce this locally and only saw it<br>
in CI.<br>
<br>
> If that is giving different orders depending on locale<br>
> I imagine that would be a problem with Sphinx and not something we can<br>
> solve without providing a complete list of source files, which isn’t really<br>
> feasible.<br>
<br>
Where is this glob? Who expands it?<br>
<br>
Surely there should be a way sort the list after expansion.<br>
<br>
--Daniel<br>
</blockquote></div>