From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id B22ED6F3C8; Tue, 20 Sep 2022 13:10:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B22ED6F3C8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1663668645; bh=SUd9SO1hIUUEDSPny/Yz5J19I1HkI6GuPTMaavxT5K4=; h=In-Reply-To:Date:References:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ePYdaEp0xcIxGpP/7bNPN06FXYJNRvDe0LLBKJtB4R1yz3AxOWavqy3vxshYB9drj SOCOMPcqzslM9MTxm1h+Tt6efckxnzRDgj6BOSTVrHO1hgGaqUV6lm9tJqcd7BvivN ch3pWr5czE38avJr70RTSLNaadUZRwR7kqs8419A= Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.179.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6EF4F6F3C8 for ; Tue, 20 Sep 2022 13:10:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6EF4F6F3C8 Received: by smtp3.mail.ru with esmtpa (envelope-from ) id 1oaaDC-0007JN-9o; Tue, 20 Sep 2022 13:10:42 +0300 Content-Type: multipart/alternative; boundary="Apple-Mail=_078BAE6C-14C5-41D5-A9B0-85050411989C" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) X-Priority: 3 (Normal) In-Reply-To: <1663667902.185627333@f160.i.mail.ru> Date: Tue, 20 Sep 2022 13:10:41 +0300 Message-Id: References: <20220912080158.12220-1-skaplun@tarantool.org> <1663573807.727706952@f769.i.mail.ru> <8E2BF2B3-C6BA-4F3E-A9AE-DA8F8413C4AF@tarantool.org> <1663667902.185627333@f160.i.mail.ru> To: Maxim Kokryashkin X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9EBD81B01C038F8F3A3096113935BA91E446B8F5C9EABD4E4182A05F538085040DCC662C5884584C0185B880E7E1501A2399D187BFD760142E10D795F24E71B43 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73B2A9F8A35432468EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637603D0B7FC8E46DFC8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D820BA9AC75A504A8279CA3CAA36F9CDA0117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520B1593CA6EC85F86DF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CDA532D2019E286A72D242C3BD2E3F4C64AD6D5ED66289B52698AB9A7B718F8C46E0066C2D8992A16725E5C173C3A84C3DF404FCFBB7C2CD3BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7888FFA144A8AE6D0731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 9604B64F49C60606AD91A466A1DEF99B296C473AB1E142185AC9E3593CE4B31AB1881A6453793CE9274300E5CE05BD4401A9E91200F654B0D4C601CEA03E70EE4BE6EA2CDDC0A3E0D0078E2B61B4928438F4CFE9A93CFD9F9C2B6934AE262D3EE7EAB7254005DCED8DA55E71E02F9FC08E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C1E32F4AD4B2486B749882430D445DF61052DB9E51B09AC06EBCCCCF63B7511C35BE704B1EB01D191D7E09C32AA3244C9C35B2B4D70C9B9962F1C8DD2125DA60C3B3ADDA61883BB5FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojHTo014vlcE/0LaWwdMT6PA== X-Mailru-Sender: 5AA3D5B9D8C486465A7E7C48E78B605DD55F45B9486FCF78185B880E7E1501A238066306E4938E9F60D8632BEC246C7D55B4A2144138A8805FC805B5969CB4993EE16157CC7DAB4272D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] FFI: Add tonumber() specialization for failed conversions. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: sergos via Tarantool-patches Reply-To: sergos Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" --Apple-Mail=_078BAE6C-14C5-41D5-A9B0-85050411989C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 First of all: s.ostanevich@s-ostanevich2:~/workspaces/t.sergos % uname -a = =20 Darwin s-ostanevich2 21.6.0 Darwin Kernel Version 21.6.0: Mon = Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64 Then I just built Tarantool with ninja: Tarantool 2.11.0-entrypoint-494-gdc147ec91 Target: Darwin-x86_64-debug Then I brought the test as a patch from the mail and run ninja test. The output says the test passes, while sources contains no patch. Am I = missing something? Sergos > On 20 Sep 2022, at 12:58, Maxim Kokryashkin = wrote: >=20 > Hi! > Are you sure you are doing everything right? > I=E2=80=99ve tested the test case both on M1 and x86 platforms and it = works perfectly fine. > -- > Best regards, > Maxim Kokryashkin > =20 > =20 > =D0=92=D1=82=D0=BE=D1=80=D0=BD=D0=B8=D0=BA, 20 =D1=81=D0=B5=D0=BD=D1=82=D1= =8F=D0=B1=D1=80=D1=8F 2022, 11:53 +03:00 =D0=BE=D1=82 sergos = : > =20 > Hi! > =20 > Thanks for the patch! > =20 > Unfortunately, the test doesn=E2=80=99t fail for me, using tarantool = test: > =20 > = /Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-= tests/lj-695-ffi-vararg-call.test.lua ...................... ok > = /Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-= tests/lj-584-bad-renames-for-sunk-values.test.lua .......... ok > = /Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-= tests/lj-408-tonumber-cdata-record.test.lua ................ ok > = /Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-= tests/gh-6189-cur_L.test.lua ............................... ok > = /Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test/tarantool-= tests/lj-418-assert-any-type.test.lua ...................... ok > =20 > The sources at the build time are: > =20 > void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd) > { > CTState *cts =3D ctype_ctsG(J2G(J)); > CType *d, *ct =3D lj_ctype_rawref(cts, = cdataV(&rd->argv[0])->ctypeid); > if (ctype_isenum(ct->info)) ct =3D ctype_child(cts, ct); > if (ctype_isnum(ct->info) || ctype_iscomplex(ct->info)) { > if (ctype_isinteger_or_bool(ct->info) && ct->size <=3D 4 && > !(ct->size =3D=3D 4 && (ct->info & CTF_UNSIGNED))) > d =3D ctype_get(cts, CTID_INT32); > else > d =3D ctype_get(cts, CTID_DOUBLE); > J->base[0] =3D crec_ct_tv(J, d, 0, J->base[0], &rd->argv[0]); > } else { > J->base[0] =3D TREF_NIL; > } > } > =20 > Means, test passess even without the patch. > =20 > Sergos > =20 >> On 19 Sep 2022, at 10:50, Maxim Kokryashkin = = > wrote: >> =20 >> Hi, Sergey! >> Thanks for the patch! >> LGTM, except for a single nit below: >>=20 >> When `tonumber()` is recorded (as a part of a trace) for cdata = argument >> can't be converted to number the `nil` value is recorded as the = yielded >> result. But without special check on trace for cdata type this nil = will >> be returned for another type of cdata that can be converted. >> The first sentence lacks commas and is completely unreadable. >> I suggest the following fix: >> | When `tonumber()` is recorded (as a part of a trace) for a cdata = argument that can't be converted to number, the `nil` value is | = recorded as the yielded result. >>=20 >> This patch adds the corresponding check for recoding of failed cdata >> conversions. >> Typo: s/recoding/recording >> =20 >> >> -- >> Best regards, >> Maxim Kokryashkin >> =20 >=20 > =20 --Apple-Mail=_078BAE6C-14C5-41D5-A9B0-85050411989C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
First of all:

= s.ostanevich@s-ostanevich2:~/workspaces/t.sergos % uname -a  =                     =                     =        
Darwin = s-ostanevich2 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 = PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64

Then I just built Tarantool = with ninja:

= Tarantool 2.11.0-entrypoint-494-gdc147ec91
= Target: Darwin-x86_64-debug

Then I = brought the test as a patch from the mail and run ninja = test.

The output says the = test passes, while sources contains no patch. Am I missing = something?

Sergos

On 20 = Sep 2022, at 12:58, Maxim Kokryashkin <m.kokryashkin@tarantool.org> wrote:

Hi!
Are you sure = you are doing everything right?
I=E2=80=99ve tested = the test case both on M1 and x86 platforms and it works perfectly = fine.
--
Best regards,
Maxim = Kokryashkin
 
 
=D0=92=D1=82=D0=BE=D1= =80=D0=BD=D0=B8=D0=BA, 20 =D1=81=D0=B5=D0=BD=D1=82=D1=8F=D0=B1=D1=80=D1=8F= 2022, 11:53 +03:00 =D0=BE=D1=82 sergos <sergos@tarantool.org>:
 
Hi!
 
Thanks for the patch!
 
Unfortunately, the test doesn=E2=80= =99t fail for me, using tarantool test:
 
/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test= /tarantool-tests/lj-695-ffi-vararg-call.test.lua ...................... = ok
/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test= /tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua .......... = ok
/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test= /tarantool-tests/lj-408-tonumber-cdata-record.test.lua ................ = ok
/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test= /tarantool-tests/gh-6189-cur_L.test.lua ............................... = ok
/Users/s.ostanevich/workspaces/t.sergos/third_party/luajit/test= /tarantool-tests/lj-418-assert-any-type.test.lua ...................... = ok
 
The = sources at the build time are:
 
void = LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData = *rd)
{
  = CTState *cts =3D ctype_ctsG(J2G(J));
  = CType *d, *ct =3D lj_ctype_rawref(cts, = cdataV(&rd->argv[0])->ctypeid);
  = if (ctype_isenum(ct->info)) ct =3D = ctype_child(cts, ct);
  = if (ctype_isnum(ct->info) || = ctype_iscomplex(ct->info)) {
  =   if = (ctype_isinteger_or_bool(ct->info) && ct->size <=3D = 4 &&
  =       !(ct->size =3D=3D 4 && (ct->info & = CTF_UNSIGNED)))
  =     d =3D ctype_get(cts, CTID_INT32);
  =   else
  =     d =3D ctype_get(cts, CTID_DOUBLE);
  =   J->base[0] =3D = crec_ct_tv(J, d, 0, = J->base[0], = &rd->argv[0]);
  = } else = {
    J->base[0] =3D TREF_NIL;
  = }
}
 
Means, test passess even without the patch.
 
Sergos
 
On 19 Sep 2022, at 10:50, Maxim = Kokryashkin <m.kokryashkin@tarantool.org> = wrote:
 
Hi, = Sergey!
Thanks for the patch!
LGTM, except for a single nit below:

When `tonumber()` is recorded = (as a part of a trace) for cdata argument
can't be = converted to number the `nil` value is recorded as the yielded
result. But without special check on trace for cdata type = this nil will
be returned for another type of cdata that = can be converted.
The first sentence = lacks commas and is completely unreadable.
I = suggest the following fix:
| When `tonumber()` = is recorded (as a part of a trace) for a cdata argument that can't be = converted to number, the `nil` value is | recorded as the yielded = result.

This patch adds the corresponding check for recoding of = failed cdata
conversions.
Typo: s/recoding/recording
 
<snipped>
--
Best regards,
Maxim Kokryashkin
 
 

= --Apple-Mail=_078BAE6C-14C5-41D5-A9B0-85050411989C--