<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, May 4, 2018 at 10:16 AM Sanjay Patel <<a href="mailto:spatel@rotateright.com">spatel@rotateright.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I understand the overfit argument (but in most cases it just shows that a unit test isn't minimized)...</div></blockquote><div><br>Even minimized tests sometimes need a few other things to setup the circumstance (many DWARF tests, for example - produce the full DWARF output, but maybe you only care about one part of it (maybe you care about the encoding of instruction ranges, but not the way names are rendered - but there's no option to produce only ranges without names (wouldn't really make sense)).<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">but I don't see how the complete auto-generated assertions could be worse at detecting a miscompile than incomplete manually-generated assertions?<br></div></blockquote><div><br>Generally overfitting wouldn't result in being bad at detecting failures, but excess false positives - if things in the output unrelated to the issue change (in intentional/benign ways) & cause the tests to fail often & become a burden for the project.<br><br>Not suggesting that's the case with these particular instances - but it's a tradeoff/concern to keep in mind.<br><br>- Dave<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The whole point of auto-generating complete checks is to catch miscompiles/regressions sooner. Ie, before they get committed and result in bug reports. I don't know how to mine the bugzilla stats on that, but it feels like we have made good progress on that front with better regression tests. Some history of the motivation and scripts here:<br><a href="https://bugs.llvm.org/show_bug.cgi?id=22897" target="_blank">https://bugs.llvm.org/show_bug.cgi?id=22897</a><br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 4, 2018 at 10:31 AM, David Blaikie via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yep - all about balance.<br><br>The main risk are tests that overfit (golden files being the worst case - checking that the entire output matches /exactly/ - this is what FileCheck is intended to help avoid) and maintainability. In the case of the autogenerated FileCheck lines I've seen so far - they seem like they still walk a fairly good line of checking exactly what's intended. Though I sometimes wonder if they're checking full combinatorial expansions that may not be required/desirable - always a tradeoff of just how black/white box tests are.<br></div><div class="m_-36201690491321786HOEnZb"><div class="m_-36201690491321786h5"><br><div class="gmail_quote"><div dir="ltr">On Fri, May 4, 2018 at 2:56 AM Alex Bradbury via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 4 May 2018 at 10:25, Alexandros Lamprineas via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> Hello llvm-dev,<br>
><br>
><br>
> On a recent code review I was asked to auto-generate assertion checks for my<br>
> unit test. I wasn't aware that this was even possible. I am referring to the<br>
> python `update` scripts under `utils` directory. My first reaction was wow!<br>
> I found it very practical and useful. It saves you significant amount of<br>
> time when writing a regression test. So I gave it a try. The generated<br>
> checks were satisfying enough, almost exactly what I wanted. Then I got a<br>
> bit sceptical about them. I am worried that auto-generating tests based on<br>
> the compiler output can be quite dangerous. The tests will always pass<br>
> regardless of whether the compiler emits right or wrong code, therefore you<br>
> have to be certain that they impose the desired compiler behaviour. I guess<br>
> the question here is how often we should be using those scripts.<br>
<br>
Like many test-related issues, it comes down to personal judgement. It<br>
is of course easy to create test/CodeGen/*/* tests that pass<br>
regardless of whether the compiler breaks broken code regardless of<br>
whether the test CHECK lines are generated by<br>
<a href="http://update_llc_test.checks.py" rel="noreferrer" target="_blank">update_llc_test.checks.py</a> or not.<br>
<br>
I find it very helpful to have auto-generated CHECK lines that pick up<br>
any codegen change, but this can of course be problematic for very<br>
large test cases that are likely to see churn due to scheduling or<br>
regallloc changes. Being able to regenerate the CHECK lines and view<br>
the diff is also incredibly helpful when rebasing or moving a patch<br>
between different branches.<br>
<br>
My policy for test/Codegen/RISCV is to use update_llc_test_checks.py<br>
wherever possible, except in cases where there are so many CHECK lines<br>
on the output that they obscure the property being tested, indicating<br>
that a more limited hand-crafted pattern would be superior.<br>
<br>
Best,<br>
<br>
Alex<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
</div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div></div>