From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 7690A48C60 for ; Tue, 23 Jan 2024 19:33:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A2FA068CEC8; Tue, 23 Jan 2024 21:33:40 +0200 (EET) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4452E68ABB5 for ; Tue, 23 Jan 2024 21:33:34 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 714D2FF80B for ; Tue, 23 Jan 2024 19:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1706038413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cU3RlCR4O0NxIiKFr53oGViUcjHmjTun5A5XBoFXhZg=; b=hPh2mAj1D1qmrRfRYuuLslOQWrS9k8jsWGeqxr/fkgYXQSedZVOaqN7wdTivwy0sHsMz7L 7TbSElcHmGYLgGY7mo9LH0Or4t0Hk6b9IoOOeHYYUowNgUKvLmCns4NYU02pMWRS9dLgIi DMTsC9dt6HnQhIA5sgZ+qxTYa4P3q5t6Z+7MM5uHzR0QofNLI95JHftMXDJr7OLq3Qb0Js rmKXQgHS0W7cIDkvCjA7HfzaN+Al8dHPrqwHyfPz5go90uDvQQR45oPcrSH1GqPdtfb8Jv gC6Z/nPRtM3s+rdvwlWad51Ng5L+zz4tnNVgA4NxKOflM48F5tL03VafWd5lMg== Date: Tue, 23 Jan 2024 20:33:32 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240123193332.GB6420@pb2> References: <20231211164227.163BB4115B0@natalya.videolan.org> <20240123190704.GL1833374@pb2> <31822ef5-bd90-48be-84e4-c379a1672757@gmail.com> MIME-Version: 1.0 In-Reply-To: <31822ef5-bd90-48be-84e4-c379a1672757@gmail.com> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [FFmpeg-cvslog] checkasm: test for abs_pow34 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============8972101160589660269==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8972101160589660269== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XZCnwieMbaPVqH5Z" Content-Disposition: inline --XZCnwieMbaPVqH5Z Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 23, 2024 at 04:17:22PM -0300, James Almer wrote: > On 1/23/2024 4:07 PM, Michael Niedermayer wrote: > > On Mon, Dec 11, 2023 at 04:42:26PM +0000, sunyuechi wrote: > > > ffmpeg | branch: master | sunyuechi | Tue Nov= 28 14:08:12 2023 +0800| [1c3620b2bbe73db9239fcf605e8f535b58f03b86] | commi= tter: R=E9mi Denis-Courmont > > >=20 > > > checkasm: test for abs_pow34 > > >=20 > > > Signed-off-by: R=E9mi Denis-Courmont > > >=20 > > > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=3Dcommit;h=3D1c362= 0b2bbe73db9239fcf605e8f535b58f03b86 > > > --- > > >=20 > > > tests/checkasm/Makefile | 1 + > > > tests/checkasm/aacencdsp.c | 70 +++++++++++++++++++++++++++++++++++= +++++++++++ > > > tests/checkasm/checkasm.c | 3 ++ > > > tests/checkasm/checkasm.h | 1 + > > > tests/fate/checkasm.mak | 3 +- > > > 5 files changed, 77 insertions(+), 1 deletion(-) > > [...] > > > +static void test_abs_pow34(AACEncContext *s) { > > > +#define BUF_SIZE 1024 > > > + LOCAL_ALIGNED_32(float, in, [BUF_SIZE]); > > > + > > > + declare_func(void, float *, const float *, int); > > > + > > > + randomize_float(in, BUF_SIZE); > > > + > > > + if (check_func(s->abs_pow34, "abs_pow34")) { > > > + LOCAL_ALIGNED_32(float, out, [BUF_SIZE]); > > > + LOCAL_ALIGNED_32(float, out2, [BUF_SIZE]); > > > + > > > + call_ref(out, in, BUF_SIZE); > > > + call_new(out2, in, BUF_SIZE); > > > + > > > + if (memcmp(out, out2, BUF_SIZE * sizeof(float)) !=3D 0) > > > + fail(); > >=20 > > This is wrong if one of the functions is implemented in C > > C does not specify float to give bitexact results. Any equality check w= ith > > float thats expected to end in a reproduceable outcome is generally wro= ng >=20 > Yes, that's why float_near_abs_eps_array() or float_near_ulp_array() shou= ld > be used. >=20 > >=20 > > it also fails in practice > >=20 > > TEST checkasm-aacencdsp > > Test checkasm-aacencdsp failed. Look at tests/data/fate/checkasm-aacenc= dsp.err for details. > > src/tests/Makefile:308: recipe for target 'fate-checkasm-aacencdsp' fai= led > > make: *** [fate-checkasm-aacencdsp] Error 1 > >=20 > > checkasm: using random seed 2523748868 > > SSE: > > abs_pow34_sse (aacencdsp.c:55) > > - aacencdsp.abs_pow34 [FAILED] > > checkasm: 1 of 1 tests have failed > > threads=3D1 > >=20 > > thats on plain simple x86-32 >=20 > Can you check if the following passes for x86-32? >=20 > > diff --git a/tests/checkasm/aacencdsp.c b/tests/checkasm/aacencdsp.c > > index 684c775862..7cc8a01158 100644 > > --- a/tests/checkasm/aacencdsp.c > > +++ b/tests/checkasm/aacencdsp.c > > @@ -19,6 +19,7 @@ > > */ > >=20 > > #include > > +#include > >=20 > > #include "libavutil/mem.h" > > #include "libavutil/mem_internal.h" > > @@ -51,7 +52,7 @@ static void test_abs_pow34(AACEncContext *s) { > > call_ref(out, in, BUF_SIZE); > > call_new(out2, in, BUF_SIZE); > >=20 > > - if (memcmp(out, out2, BUF_SIZE * sizeof(float)) !=3D 0) > > + if (!float_near_abs_eps_array(out, out2, FLT_EPSILON, BUF_SIZE= )) > > fail(); > >=20 > > bench_new(out, in, BUF_SIZE); >=20 > That target tends to be pretty picky about the epsilon value because of t= he > 80 bits precision for floats. with float.h float_near_abs_eps_array Test checkasm-aacencdsp failed. Look at tests/data/fate/checkasm-aacencdsp.= err for details. checkasm: using random seed 4097080137 test failed comparing 5.68635 with 5.68635 (abs diff=3D4.76837e-07 with EPS= =3D1.19209e-07) SSE: abs_pow34_sse (aacencdsp.c:56) - aacencdsp.abs_pow34 [FAILED] checkasm: 1 of 1 tests have failed threads=3D1 src/tests/Makefile:317: recipe for target 'fate-checkasm-aacencdsp' failed make: *** [fate-checkasm-aacencdsp] Error 1 if (!float_near_abs_eps_array(out, out2, FLT_EPSILON*10, BUF_SIZE)) works but feels wrong this works too (only tested 100x on only x86-32 yet) if (!float_near_ulp_array(out, out2, 1, BUF_SIZE)) thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I am the wisest man alive, for I know one thing, and that is that I know nothing. -- Socrates --XZCnwieMbaPVqH5Z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZbAUiQAKCRBhHseHBAsP q0DSAJ9OGol4zTf1Q6HHVLeE5tDpTDzDowCdGA/Cw0fGXSSg88Oca4rNRgv9Iqk= =rjD+ -----END PGP SIGNATURE----- --XZCnwieMbaPVqH5Z-- --===============8972101160589660269== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============8972101160589660269==--