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 18C4D48C60 for ; Tue, 23 Jan 2024 19:49:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5463068D001; Tue, 23 Jan 2024 21:49:41 +0200 (EET) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D680968C7EA for ; Tue, 23 Jan 2024 21:49:34 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 0B721240006 for ; Tue, 23 Jan 2024 19:49:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1706039374; 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=dJxdSf4Ry4Cn1srUIN0vIWeWCh4BHZGGijKnQ41XfoM=; b=muaUpD94foUo/J/KDwHSmXnfsD2yAbRc2S2vlOvw8hUnmt/FhECFYjHyAkMttQ3j5koKLW /JevK3ns6nJ35qg/ONEAKhYMFcDh71iz+vnvvTHcwNUi214ufCDOqRvPqXevZb0pCIKC91 T7KjHHvaon/ARejZoGUjKDD+Js9uruka13lwmxPKpcrQyTakrvOLixUUh46lJ+0NAW13cD 5CuW25BQ5b/KAVyvxFegIPOZ0GjPj0TEMvt0Pjqh9dH+j6dpM8y1D7WvOaTI64kNmtfyfT 6s0c8nn4iotKvPsdQBK/SKxfW+BkkVLIPRp7UBCLPeeY9/TemLrH2vC2au4Q6w== Date: Tue, 23 Jan 2024 20:49:33 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240123194933.GC6420@pb2> References: <20231211164227.163BB4115B0@natalya.videolan.org> <20240123190704.GL1833374@pb2> <31822ef5-bd90-48be-84e4-c379a1672757@gmail.com> <20240123193332.GB6420@pb2> <3a290126-abc2-4c63-9913-a2a40b5abb6f@gmail.com> MIME-Version: 1.0 In-Reply-To: <3a290126-abc2-4c63-9913-a2a40b5abb6f@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="===============6506419350731224498==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6506419350731224498== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LFsAPG9bW6CNZKpm" Content-Disposition: inline --LFsAPG9bW6CNZKpm Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 23, 2024 at 04:40:46PM -0300, James Almer wrote: > On 1/23/2024 4:33 PM, Michael Niedermayer wrote: > > 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] | c= ommitter: 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=3D1= c3620b2bbe73db9239fcf605e8f535b58f03b86 > > > > > --- > > > > >=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 che= ck with > > > > float thats expected to end in a reproduceable outcome is generally= wrong > > >=20 > > > Yes, that's why float_near_abs_eps_array() or float_near_ulp_array() = should > > > be used. > > >=20 > > > >=20 > > > > it also fails in practice > > > >=20 > > > > TEST checkasm-aacencdsp > > > > Test checkasm-aacencdsp failed. Look at tests/data/fate/checkasm-aa= cencdsp.err for details. > > > > src/tests/Makefile:308: recipe for target 'fate-checkasm-aacencdsp'= failed > > > > 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 the > > > 80 bits precision for floats. > >=20 > >=20 > > with float.h > >=20 > > float_near_abs_eps_array > >=20 > > Test checkasm-aacencdsp failed. Look at tests/data/fate/checkasm-aacenc= dsp.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' fai= led > > make: *** [fate-checkasm-aacencdsp] Error 1 > >=20 > > if (!float_near_abs_eps_array(out, out2, FLT_EPSILON*10, BUF_SIZE)) > > works but feels wrong > >=20 > > this works too (only tested 100x on only x86-32 yet) > > if (!float_near_ulp_array(out, out2, 1, BUF_SIZE)) > >=20 > > thx >=20 > 1 is excessive. Some tests use an epsilon value like 0.005, so > FLT_EPSILON*10 is IMO fine. Or we could hardcode something like 0.000005 > instead if it passes. 1 ULP is the smallest that works tested 100x on mips, arm, mingw32 now too epsilon anything is IMHO wrong but iam happy to hear an argument why absolute is better than relative here (which is the difference bascially IIUC) absolute is bad as the difference in what can be represented is relative to the values size and so a absolute check will inevitably be very loose on small values or will fail on large ones thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The day soldiers stop bringing you their problems is the day you have stopp= ed=20 leading them. They have either lost confidence that you can help or conclud= ed=20 you do not care. Either case is a failure of leadership. - Colin Powell --LFsAPG9bW6CNZKpm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZbAYSQAKCRBhHseHBAsP q5mTAJ0adKNmkzoWNx0QlQYS+grWQWwpfQCfeMzYcB+JvgMnFILU865CFcUwr+s= =5Sp7 -----END PGP SIGNATURE----- --LFsAPG9bW6CNZKpm-- --===============6506419350731224498== 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". --===============6506419350731224498==--