Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Apr 2024 09:11:08 +0100
From:      Nuno Teixeira <eduardo@freebsd.org>
To:        FreeBSD Mailing List <freebsd-ports@freebsd.org>, Joseph Mingrone <jrm@freebsd.org>
Subject:   Re: size of long on all supported arches
Message-ID:  <CAFDf7U%2BfGq%2BoU0nKTGNd68gav38CoA5z1z9rWmm%2BTLAQjiYp4Q@mail.gmail.com>
In-Reply-To: <CAFDf7UKA_fZC=WO3-8VTiGUBvSnrZagNb9mwEcNAc-6Gnwa3zw@mail.gmail.com>
References:  <CAFDf7UKA_fZC=WO3-8VTiGUBvSnrZagNb9mwEcNAc-6Gnwa3zw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000ebb72606166ea1e3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

(...)

If anyone wants to test, I've included patch in commit:
https://cgit.freebsd.org/ports/commit/?id=3D89e4a1f2c1d1997b8414e2e648c7b4b=
7c829b63e

Nuno Teixeira <eduardo@freebsd.org> escreveu (sexta, 19/04/2024 =C3=A0(s) 0=
8:29):

> Hello all,
>
> I'm testing a fix for tests on a R port (math/R-cran-RcppArmadillo):
> https://github.com/RcppCore/RcppArmadillo/issues/408
>
> Resuming: test is failing because "tolerance" needs to get adjusted to
> work:
>
> ---- FAILED[data]: test_cube.R<44--45>
>    call| expect_equivalent(cx_fcube_test(cplx_cube), (cplx_cube^2), toler=
ance =3D critTol)
>    diff| Mean relative Mod difference: 1.512537e-07
>   ----- FAILED[data]: test_cube.R<81--82>
>    call| expect_equivalent(as_cx_fcube(cplx_cube), (cplx_cube^2), toleran=
ce =3D critTol)
>    diff| Mean relative Mod difference: 1.512537e-07
>   Error: 2 out of 314 tests failed
>
> is fixed by patching:
>
>  .onWindows <- .Platform$OS.type =3D=3D "windows"
> -critTol <- if (.onWindows) 1.0e-6 else 1.5e-7
> +critTol <- if (.onWindows || .Machine$sizeof.long =3D=3D 4 ||
> .Machine$sizeof.long =3D=3D 8) 1.0e-6 else 1.5e-7
>
> i.e., setting "tolerance" to 1.0e-6 value, test is ok (on systems bellow)
>
> With my hardware i7 and rpi4 I noted that long are:
>
> amd64   .Machine$sizeof.long =3D=3D 8
> i386    .Machine$sizeof.long =3D=3D 4
> aarch64 .Machine$sizeof.long =3D=3D 8
> armv7   .Machine$sizeof.long =3D=3D 4
>
> and suppose that is the same to all 32/64 bit supported systems?
>
> Upstream are sugesting using OS agnostic check to fix test, so, any bette=
r
> approach or sugestion is welcome.
>
> Thanks :)
>
> --
> Nuno Teixeira
> FreeBSD Committer (ports)
>


--=20
Nuno Teixeira
FreeBSD UNIX:  <eduardo@FreeBSD.org>   Web:  https://FreeBSD.org

--000000000000ebb72606166ea1e3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>(...)</div><div><br></div><div>If anyone wants to tes=
t, I&#39;ve included patch in commit:</div><div><a href=3D"https://cgit.fre=
ebsd.org/ports/commit/?id=3D89e4a1f2c1d1997b8414e2e648c7b4b7c829b63e">https=
://cgit.freebsd.org/ports/commit/?id=3D89e4a1f2c1d1997b8414e2e648c7b4b7c829=
b63e</a></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=
=3D"gmail_attr">Nuno Teixeira &lt;<a href=3D"mailto:eduardo@freebsd.org">ed=
uardo@freebsd.org</a>&gt; escreveu (sexta, 19/04/2024 =C3=A0(s) 08:29):<br>=
</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b=
order-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><d=
iv>Hello all,</div><div><br></div><div>I&#39;m testing a fix for tests on a=
 R port (math/R-cran-RcppArmadillo):</div><div><a href=3D"https://github.co=
m/RcppCore/RcppArmadillo/issues/408" target=3D"_blank">https://github.com/R=
cppCore/RcppArmadillo/issues/408</a></div><div><br></div><div>Resuming: tes=
t is failing because &quot;tolerance&quot; needs to get adjusted to work:<b=
r></div><div><br></div><div><pre><code>---- FAILED[data]: test_cube.R&lt;44=
--45&gt;
   call| expect_equivalent(cx_fcube_test(cplx_cube), (cplx_cube^2), toleran=
ce =3D critTol)
   diff| Mean relative Mod difference: 1.512537e-07
  ----- FAILED[data]: test_cube.R&lt;81--82&gt;
   call| expect_equivalent(as_cx_fcube(cplx_cube), (cplx_cube^2), tolerance=
 =3D critTol)
   diff| Mean relative Mod difference: 1.512537e-07
  Error: 2 out of 314 tests failed<br><br></code></pre>is fixed by patching=
:</div><div><br></div><div>=C2=A0.onWindows &lt;- .Platform$OS.type =3D=3D =
&quot;windows&quot;<br>-critTol &lt;- if (.onWindows) 1.0e-6 else 1.5e-7<br=
>+critTol &lt;- if (.onWindows || .Machine$sizeof.long =3D=3D 4 || .Machine=
$sizeof.long =3D=3D 8) 1.0e-6 else 1.5e-7</div><div><br></div><div>i.e., se=
tting &quot;tolerance&quot; to 1.0e-6 value, test is ok (on systems bellow)=
<br></div><div><br></div><div>With my hardware i7 and rpi4 I noted that lon=
g are:</div><div><br></div><div>amd64 =C2=A0 .Machine$sizeof.long =3D=3D 8<=
br>i386 =C2=A0 =C2=A0.Machine$sizeof.long =3D=3D 4<br>aarch64 .Machine$size=
of.long =3D=3D 8<br>armv7 =C2=A0 .Machine$sizeof.long =3D=3D 4</div><div><b=
r></div><div>and suppose that is the same to all 32/64 bit supported system=
s?</div><div><br></div><div>Upstream are sugesting using OS agnostic check =
to fix test, so, any better approach or sugestion is welcome.<br><br></div>=
<div>Thanks :)<br></div><div><br><span class=3D"gmail_signature_prefix">-- =
</span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"ltr"><spa=
n style=3D"color:rgb(102,102,102)">Nuno Teixeira<br>FreeBSD Committer (port=
s)</span></div></div></div></div>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"l=
tr"><div><font color=3D"#888888">Nuno Teixeira</font></div><div><div><font =
color=3D"#888888">
FreeBSD UNIX:=C2=A0 &lt;eduardo@FreeBSD.org&gt;=C2=A0 =C2=A0Web:=C2=A0 <a h=
ref=3D"https://FreeBSD.org" rel=3D"noreferrer" target=3D"_blank">https://Fr=
eeBSD.org</a><br></font></div></div></div></div>

--000000000000ebb72606166ea1e3--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7U%2BfGq%2BoU0nKTGNd68gav38CoA5z1z9rWmm%2BTLAQjiYp4Q>