From patchwork Thu Jun 20 15:35:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1950255 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jPJ2G+9b; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4l580Wsvz20KL for ; Fri, 21 Jun 2024 01:38:36 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4AB3E3894C08 for ; Thu, 20 Jun 2024 15:38:34 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 7AC7F38930F7 for ; Thu, 20 Jun 2024 15:35:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7AC7F38930F7 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7AC7F38930F7 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718897747; cv=none; b=JGhCI+zOMzCFsYED1cgKe+ehVD6v3BAikL8Y03UVTxgudmuJ74BPh2SOAPEBxCMF27Q7TmqOWCnXXRXH/TgB+f749yhcTyx/ltW7UBkrt6kdZr36ba5iCwMmWsXzVSbFTvu/ckKR978KPeBvtA6QF1Gb4Hz+Ddt0v+e3ljy1Uz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718897747; c=relaxed/simple; bh=2QxGzR+OcfCnTvO6KN8nsIsf+Ck7VIWmrLHyPN10gBI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GVXX+ZB8Ao7xfwVX3kR+3zohIT80ZsH26Yl9ooJLUbE1SyI1zFbiLDUc2vBAwaJgcuMuZIHGr9IWx1thdXfE0TZ9ewVO8F6CHxqgm1Q8f2SXena1Ip47PNNQfSdxwvpd+UZqsW0qrqlRTybvkkelLamC85/BXoQE4xmnvGV4LN8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718897746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PkZYKMZFwDxXXb1X0Vgntit+G7XQ9PRmUmcSyz5QVcY=; b=jPJ2G+9bwjcXVR/kHYFe0gj7IK+XfIcbI45L+eXrG6czqTynS4VPNf+o/tzz2bb78z6Vfm v/Tiek7ACHzasxEHOomVxBlW5kFfSwCIlV5ZzORAwDFxb5+w/UgFLK3sq74jG7ehEMKYi3 DIzTJd5iy25Q/uGS1Xi19F9MN9QRLC0= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-544-bByIRZsKNJKTL6axhaEzFw-1; Thu, 20 Jun 2024 11:35:43 -0400 X-MC-Unique: bByIRZsKNJKTL6axhaEzFw-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 60AA21955D68; Thu, 20 Jun 2024 15:35:38 +0000 (UTC) Received: from localhost (unknown [10.42.28.182]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5BC0E1956075; Thu, 20 Jun 2024 15:35:32 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH 1/2] libstdc++: Work around some PSTL test failures for debug mode [PR90276] Date: Thu, 20 Jun 2024 16:35:12 +0100 Message-ID: <20240620153526.2024602-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org 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 in1(max_size, [](size_t v) { return T(v); }); Sequence 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);