Subject: bug#17020: closed (Re: bug#17020: [PATCH] tests: avoid false-positive failure on some AMD CPUs)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 17 Mar 2014 01:46:02 +0000

Your bug report

#17020: [PATCH] tests: avoid false-positive failure on some AMD CPUs

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
17020: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17020
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#17020: [PATCH] tests: avoid false-positive failure on some AMD CPUs
From: Jim Meyering <[email-masked]>
To: [email-masked]
Date: Sun, 16 Mar 2014 18:45:34 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

pushed

Subject: [PATCH] tests: avoid false-positive failure on some AMD CPUs
From: Jim Meyering <[email-masked]>
To: [email-masked]
Date: Sun, 16 Mar 2014 13:47:20 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

The variation is striking:
From 87acde8879f8edbaf95aa1a91147dc1cebffd4a5 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email-masked]>
Date: Sun, 16 Mar 2014 13:45:57 -0700
Subject: [PATCH] tests: avoid false-positive failure on some AMD CPUs

* tests/mb-non-UTF8-performance: Avoid false-positive failure
when run on certain AMD processors.
---
 tests/mb-non-UTF8-performance | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/mb-non-UTF8-performance b/tests/mb-non-UTF8-performance
index 640d5db..4ce3271 100755
--- a/tests/mb-non-UTF8-performance
+++ b/tests/mb-non-UTF8-performance
@@ -1,5 +1,7 @@
 #!/bin/sh
 # grep-2.17 would take nearly 200x longer to run the command below.
+# The 200x is on an Intel i7-based system.
+# On an AMD FX-4100, it would take up to 2500x longer.

 # Copyright 2014 Free Software Foundation, Inc.

@@ -29,8 +31,8 @@ LC_ALL=C grep -i foobar in; st=$?
 stop=$(hi_res_time_)

 # Use a multiple of the LC_ALL=C duration as the timeout for the JP/EUC test.
-# Typically, a multiple of 3 seems to be enough.
-timeout=$($AWK 'BEGIN { print 8 * ('$stop' - '$start')}' < /dev/null)
+# A multiple of 3 seems to be enough for i5,i7, but AMD needs >25.
+timeout=$($AWK 'BEGIN { print 30 * ('$stop' - '$start')}' < /dev/null)

 test $st = 1 || fail=1

-- 
1.9.0.167.g384364b