[{"id":36885,"web_url":"https://patchwork.libcamera.org/comment/36885/","msgid":"<176346972656.880260.12326683026681949275@isaac-ThinkPad-T16-Gen-2>","date":"2025-11-18T12:42:06","subject":"Re: [PATCH v4 19/21] test: libipa: Remove legacy fixed point\n\tconversion test","submitter":{"id":215,"url":"https://patchwork.libcamera.org/api/people/215/","name":"Isaac Scott","email":"isaac.scott@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch!\n\nReviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>\n\nQuoting Kieran Bingham (2025-11-14 00:54:23)\n> Now that the fixed point conversions are equally covered by the new Q types,\n> the legacy tests for fixedToFloatingPoint and floatingToFixedPoint are\n> redundant.\n> \n> Remove them.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  test/ipa/libipa/fixedpoint.cpp | 78 ----------------------------------\n>  1 file changed, 78 deletions(-)\n> \n> diff --git a/test/ipa/libipa/fixedpoint.cpp b/test/ipa/libipa/fixedpoint.cpp\n> index e3428272fae5..357af6afa75e 100644\n> --- a/test/ipa/libipa/fixedpoint.cpp\n> +++ b/test/ipa/libipa/fixedpoint.cpp\n> @@ -26,80 +26,6 @@ using Q4_7 = Quantized<FixedPointQTraits<4, 7, int16_t>>;\n>  class FixedPointUtilsTest : public Test\n>  {\n>  protected:\n> -       /* R for real, I for integer */\n> -       template<unsigned int IntPrec, unsigned int FracPrec, typename I, typename R>\n> -       int testFixedToFloat(I input, R expected)\n> -       {\n> -               R out = fixedToFloatingPoint<IntPrec, FracPrec, R>(input);\n> -               R prec = 1.0 / (1 << FracPrec);\n> -               if (std::abs(out - expected) > prec) {\n> -                       cerr << \"Reverse conversion expected \" << input\n> -                            << \" to convert to \" << expected\n> -                            << \", got \" << out << std::endl;\n> -                       return TestFail;\n> -               }\n> -\n> -               return TestPass;\n> -       }\n> -\n> -       template<unsigned int IntPrec, unsigned int FracPrec, typename T>\n> -       int testSingleFixedPoint(double input, T expected)\n> -       {\n> -               T ret = floatingToFixedPoint<IntPrec, FracPrec, T>(input);\n> -               if (ret != expected) {\n> -                       cerr << \"Expected \" << input << \" to convert to \"\n> -                            << expected << \", got \" << ret << std::endl;\n> -                       return TestFail;\n> -               }\n> -\n> -               /*\n> -                * The precision check is fairly arbitrary but is based on what\n> -                * the rkisp1 is capable of in the crosstalk module.\n> -                */\n> -               double f = fixedToFloatingPoint<IntPrec, FracPrec, double>(ret);\n> -               if (std::abs(f - input) > 0.005) {\n> -                       cerr << \"Reverse conversion expected \" << ret\n> -                            << \" to convert to \" << input\n> -                            << \", got \" << f << std::endl;\n> -                       return TestFail;\n> -               }\n> -\n> -               return TestPass;\n> -       }\n> -\n> -       int testFixedPoint()\n> -       {\n> -               /*\n> -                * The second 7.992 test is to test that unused bits don't\n> -                * affect the result.\n> -                */\n> -               std::map<double, int16_t> testCases = {\n> -                       { 7.992, 0x3ff },\n> -                       {   0.2, 0x01a },\n> -                       {  -0.2, 0x7e6 },\n> -                       {  -0.8, 0x79a },\n> -                       {  -0.4, 0x7cd },\n> -                       {  -1.4, 0x74d },\n> -                       {    -8, 0x400 },\n> -                       {     0, 0 },\n> -               };\n> -\n> -               int ret;\n> -               for (const auto &testCase : testCases) {\n> -                       ret = testSingleFixedPoint<4, 7, int16_t>(testCase.first,\n> -                                                                  testCase.second);\n> -                       if (ret != TestPass)\n> -                               return ret;\n> -               }\n> -\n> -               /* Special case with a superfluous one in the unused bits */\n> -               ret = testFixedToFloat<4, 7, int16_t, double>(0xbff, 7.992);\n> -               if (ret != TestPass)\n> -                       return ret;\n> -\n> -               return TestPass;\n> -       }\n> -\n>         template<typename Q>\n>         int quantizedCheck(float input, typename Q::QuantizedType expected, float value)\n>         {\n> @@ -266,10 +192,6 @@ protected:\n>         {\n>                 unsigned int fails = 0;\n>  \n> -               /* fixed point conversion test */\n> -               if (testFixedPoint() != TestPass)\n> -                       fails++;\n> -\n>                 if (testFixedPointQuantizers() != TestPass)\n>                         fails++;\n>  \n> -- \n> 2.51.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 14C92C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 18 Nov 2025 12:42:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C1EE660AA4;\n\tTue, 18 Nov 2025 13:42:10 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 42E0D606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 18 Nov 2025 13:42:09 +0100 (CET)","from thinkpad.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7E57C1E33;\n\tTue, 18 Nov 2025 13:40:05 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"qrvSUby1\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763469605;\n\tbh=qPm186+bDHT2pmUAm1Vib9+GSW8ygIvTjDrYwgxJdWw=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=qrvSUby1BOmipyQJVXOZpKiF1JFyiFZztT2hMzr6sKgeE/+1/Ttv+VUEW7PLSFCHT\n\thFhveOJjnQyY2U8ZgMOcMn+2mAvABZu3hd4HoUa9q/zAsVyR0qjoHyyYSGfelM71ap\n\tkaC4L1p21j+Q8DShOEAv+LIhOlBpVEbj9CPRsDJM=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251114005428.90024-20-kieran.bingham@ideasonboard.com>","References":"<20251114005428.90024-1-kieran.bingham@ideasonboard.com>\n\t<20251114005428.90024-20-kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v4 19/21] test: libipa: Remove legacy fixed point\n\tconversion test","From":"Isaac Scott <isaac.scott@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Tue, 18 Nov 2025 12:42:06 +0000","Message-ID":"<176346972656.880260.12326683026681949275@isaac-ThinkPad-T16-Gen-2>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":36899,"web_url":"https://patchwork.libcamera.org/comment/36899/","msgid":"<20251119043001.GS10711@pendragon.ideasonboard.com>","date":"2025-11-19T04:30:01","subject":"Re: [PATCH v4 19/21] test: libipa: Remove legacy fixed point\n\tconversion test","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Nov 14, 2025 at 12:54:23AM +0000, Kieran Bingham wrote:\n> Now that the fixed point conversions are equally covered by the new Q types,\n> the legacy tests for fixedToFloatingPoint and floatingToFixedPoint are\n> redundant.\n> \n> Remove them.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  test/ipa/libipa/fixedpoint.cpp | 78 ----------------------------------\n>  1 file changed, 78 deletions(-)\n> \n> diff --git a/test/ipa/libipa/fixedpoint.cpp b/test/ipa/libipa/fixedpoint.cpp\n> index e3428272fae5..357af6afa75e 100644\n> --- a/test/ipa/libipa/fixedpoint.cpp\n> +++ b/test/ipa/libipa/fixedpoint.cpp\n> @@ -26,80 +26,6 @@ using Q4_7 = Quantized<FixedPointQTraits<4, 7, int16_t>>;\n>  class FixedPointUtilsTest : public Test\n>  {\n>  protected:\n> -\t/* R for real, I for integer */\n> -\ttemplate<unsigned int IntPrec, unsigned int FracPrec, typename I, typename R>\n> -\tint testFixedToFloat(I input, R expected)\n> -\t{\n> -\t\tR out = fixedToFloatingPoint<IntPrec, FracPrec, R>(input);\n> -\t\tR prec = 1.0 / (1 << FracPrec);\n> -\t\tif (std::abs(out - expected) > prec) {\n> -\t\t\tcerr << \"Reverse conversion expected \" << input\n> -\t\t\t     << \" to convert to \" << expected\n> -\t\t\t     << \", got \" << out << std::endl;\n> -\t\t\treturn TestFail;\n> -\t\t}\n> -\n> -\t\treturn TestPass;\n> -\t}\n> -\n> -\ttemplate<unsigned int IntPrec, unsigned int FracPrec, typename T>\n> -\tint testSingleFixedPoint(double input, T expected)\n> -\t{\n> -\t\tT ret = floatingToFixedPoint<IntPrec, FracPrec, T>(input);\n> -\t\tif (ret != expected) {\n> -\t\t\tcerr << \"Expected \" << input << \" to convert to \"\n> -\t\t\t     << expected << \", got \" << ret << std::endl;\n> -\t\t\treturn TestFail;\n> -\t\t}\n> -\n> -\t\t/*\n> -\t\t * The precision check is fairly arbitrary but is based on what\n> -\t\t * the rkisp1 is capable of in the crosstalk module.\n> -\t\t */\n> -\t\tdouble f = fixedToFloatingPoint<IntPrec, FracPrec, double>(ret);\n> -\t\tif (std::abs(f - input) > 0.005) {\n> -\t\t\tcerr << \"Reverse conversion expected \" << ret\n> -\t\t\t     << \" to convert to \" << input\n> -\t\t\t     << \", got \" << f << std::endl;\n> -\t\t\treturn TestFail;\n> -\t\t}\n> -\n> -\t\treturn TestPass;\n> -\t}\n> -\n> -\tint testFixedPoint()\n> -\t{\n> -\t\t/*\n> -\t\t * The second 7.992 test is to test that unused bits don't\n> -\t\t * affect the result.\n> -\t\t */\n> -\t\tstd::map<double, int16_t> testCases = {\n> -\t\t\t{ 7.992, 0x3ff },\n> -\t\t\t{   0.2, 0x01a },\n> -\t\t\t{  -0.2, 0x7e6 },\n> -\t\t\t{  -0.8, 0x79a },\n> -\t\t\t{  -0.4, 0x7cd },\n> -\t\t\t{  -1.4, 0x74d },\n> -\t\t\t{    -8, 0x400 },\n> -\t\t\t{     0, 0 },\n> -\t\t};\n> -\n> -\t\tint ret;\n> -\t\tfor (const auto &testCase : testCases) {\n> -\t\t\tret = testSingleFixedPoint<4, 7, int16_t>(testCase.first,\n> -\t\t\t\t\t\t\t\t   testCase.second);\n> -\t\t\tif (ret != TestPass)\n> -\t\t\t\treturn ret;\n> -\t\t}\n> -\n> -\t\t/* Special case with a superfluous one in the unused bits */\n> -\t\tret = testFixedToFloat<4, 7, int16_t, double>(0xbff, 7.992);\n> -\t\tif (ret != TestPass)\n> -\t\t\treturn ret;\n> -\n> -\t\treturn TestPass;\n> -\t}\n> -\n>  \ttemplate<typename Q>\n>  \tint quantizedCheck(float input, typename Q::QuantizedType expected, float value)\n>  \t{\n> @@ -266,10 +192,6 @@ protected:\n>  \t{\n>  \t\tunsigned int fails = 0;\n>  \n> -\t\t/* fixed point conversion test */\n> -\t\tif (testFixedPoint() != TestPass)\n> -\t\t\tfails++;\n> -\n>  \t\tif (testFixedPointQuantizers() != TestPass)\n>  \t\t\tfails++;\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3EA38C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 19 Nov 2025 04:30:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D9C5860A81;\n\tWed, 19 Nov 2025 05:30:34 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 97B96609D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Nov 2025 05:30:33 +0100 (CET)","from pendragon.ideasonboard.com (unknown [205.220.129.225])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 350D1DD9;\n\tWed, 19 Nov 2025 05:28:25 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"YKDQtD5p\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763526509;\n\tbh=UmGI+In8u0A3qpFc29gBOtuSuPmONKdQituL7r5acPY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=YKDQtD5pKdxO/IqYXe9rsky8dGvaEC3X2aoEURhTrHqRgLCUlR+9+K7b1EYoXO8cM\n\toHiu3yYwcBXBEywae5LF0i5X6y0w/0l80jGFfaoR7E5bTo0XLjkSdSrXkkM5xarl4c\n\t4SZ+oZev9bBSzMormeCPp+xgpCBbEc1LZn1h2PQ4=","Date":"Wed, 19 Nov 2025 13:30:01 +0900","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Subject":"Re: [PATCH v4 19/21] test: libipa: Remove legacy fixed point\n\tconversion test","Message-ID":"<20251119043001.GS10711@pendragon.ideasonboard.com>","References":"<20251114005428.90024-1-kieran.bingham@ideasonboard.com>\n\t<20251114005428.90024-20-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20251114005428.90024-20-kieran.bingham@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]