From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 1/2] libstdc++: Work around some PSTL test failures for debug mode [PR90276]
Date: Wed, 26 Jun 2024 21:13:08 +0100 [thread overview]
Message-ID: <CACb0b4nUiP7W5xe=uMSpHw4Xx4rSEKoD1H6PEBNSr-vfhf+jQw@mail.gmail.com> (raw)
In-Reply-To: <20240620153526.2024602-1-jwakely@redhat.com>
Pushed to trunk now.
On Thu, 20 Jun 2024 at 16:36, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> Tested x86_64-linux.
>
> -- >8 --
>
> This addresses one known failure due to a bug in the upstream tests, and
> a number of timeouts due to the algorithms running much more slowly with
> debug mode checks enabled.
>
> libstdc++-v3/ChangeLog:
>
> PR libstdc++/90276
> * testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
> [_GLIBCXX_DEBUG]: Add xfail-run-if for debug mode.
> * testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
> [_GLIBCXX_DEBUG]: Reduce size of test data.
> * testsuite/25_algorithms/pstl/alg_sorting/includes.cc:
> Likewise.
> * testsuite/25_algorithms/pstl/alg_sorting/set_util.h:
> Likewise.
> ---
> .../25_algorithms/pstl/alg_nonmodifying/nth_element.cc | 4 ++++
> .../testsuite/25_algorithms/pstl/alg_sorting/includes.cc | 4 ++++
> .../testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc | 1 +
> .../testsuite/25_algorithms/pstl/alg_sorting/set_util.h | 4 ++++
> 4 files changed, 13 insertions(+)
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
> index 61bbca758b4..63e6abe2ea4 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
> @@ -133,7 +133,11 @@ void
> test_by_type(Generator1 generator1, Generator2 generator2, Compare comp)
> {
> using namespace std;
> +#ifdef _GLIBCXX_DEBUG
> + size_t max_size = 1000;
> +#else
> size_t max_size = 10000;
> +#endif
> Sequence<T> in1(max_size, [](size_t v) { return T(v); });
> Sequence<T> exp(max_size, [](size_t v) { return T(v); });
> size_t m;
> diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc
> index ed07810618d..1567c369c4c 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc
> @@ -77,7 +77,11 @@ void
> test_includes(Compare compare)
> {
>
> +#ifdef _GLIBCXX_DEBUG
> + const std::size_t n_max = 10000;
> +#else
> const std::size_t n_max = 1000000;
> +#endif
>
> // The rand()%(2*n+1) encourages generation of some duplicates.
> std::srand(42);
> diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
> index 6d441cc3ae9..797d0ee9340 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
> @@ -3,6 +3,7 @@
> // { dg-do run { target c++17 } }
> // { dg-timeout-factor 3 }
> // { dg-require-effective-target tbb_backend }
> +// { dg-xfail-run-if "see PR 90276" { debug_mode } }
>
> //===-- partial_sort.pass.cpp ---------------------------------------------===//
> //
> diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_util.h b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_util.h
> index ecf5cd1c89d..214e3452aa7 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_util.h
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_util.h
> @@ -51,7 +51,11 @@ namespace TestUtils
> void
> test_set_op(Compare compare)
> {
> +#ifdef _GLIBCXX_DEBUG
> + const std::size_t n_max = 1000;
> +#else
> const std::size_t n_max = 100000;
> +#endif
>
> // The rand()%(2*n+1) encourages generation of some duplicates.
> std::srand(4200);
> --
> 2.45.2
>
prev parent reply other threads:[~2024-06-26 20:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-20 15:35 Jonathan Wakely
2024-06-20 15:35 ` [PATCH 2/2] libstdc++: Increase timeouts for PSTL tests in " Jonathan Wakely
2024-06-26 20:13 ` Jonathan Wakely
2024-06-26 20:13 ` Jonathan Wakely [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACb0b4nUiP7W5xe=uMSpHw4Xx4rSEKoD1H6PEBNSr-vfhf+jQw@mail.gmail.com' \
--to=jwakely@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).