Tarantool development patches archive
 help / color / mirror / Atom feed
From: sergos via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] FFI: Add tonumber() specialization for failed conversions.
Date: Wed, 21 Sep 2022 15:19:40 +0300	[thread overview]
Message-ID: <7378A34A-6A2D-4634-B7A0-C9AA33267042@tarantool.org> (raw)
In-Reply-To: <Yyr9g+03O095SK37@root>

[-- Attachment #1: Type: text/plain, Size: 7871 bytes --]

Hi!

I see four ‘ok’s as a result of run. 
See the full output for the run with dump() below:


s.ostanevich@s-ostanevich2:~/workspaces/t.sergos/third_party/luajit/test/tarantool-tests % ../../../../build-debug/src/tarantool -e 'require"jit.dump".start("ib")' lj-408-tonumber-cdata-record.test.lua

TAP version 13
1..4
---- TRACE 1 start lj-408-tonumber-cdata-record.test.lua:17
0001  GGET     1   0      ; "tonumber"
0002  MOV      3   0
0003  CALL     1   2   2
0000  . FUNCC               ; tonumber
0004  RET1     1   2
---- TRACE 1 IR
0001    fun SLOAD  #0    R
0002    tab FLOAD  0001  func.env
0003    int FLOAD  0002  tab.hmask
0004 >  int EQ     0003  +63 
0005    p64 FLOAD  0002  tab.node
0006 >  p64 HREFK  0005  "tonumber" @8
0007 >  fun HLOAD  0006
0008 >  cdt SLOAD  #2    T
0009 >  fun EQ     0007  tonumber
---- TRACE 1 stop -> return

ok - recorded with NULL and not converted for NULL
---- TRACE 2 start tap.lua:44
0001  TGETS    4   0   0  ; "total"
0002  ADDVN    4   4   0  ; 1
0003  TSETS    4   0   0  ; "total"
0004  GGET     4   1      ; "io"
0005  TGETS    4   4   2  ; "write"
0006  GGET     6   3      ; "string"
0007  TGETS    6   6   4  ; "rep"
0008  KSTR     8   5      ; " "
0009  TGETS    9   0   6  ; "level"
0010  MULNV    9   9   1  ; 4
0011  CALL     6   0   3
0000  . FUNCC               ; string.rep
0012  CALLM    4   1   0
0000  . FUNCC               ; io.write
0013  ISF          1
0014  JMP      4 => 0025
0015  GGET     4   1      ; "io"
0016  TGETS    4   4   2  ; "write"
0017  GGET     6   3      ; "string"
0018  TGETS    6   6   7  ; "format"
0019  KSTR     8   8      ; "ok - %s\n"
---- TRACE 2 abort tap.lua:48 -- error thrown or hook called during recording

ok - recorded with NULL and converted for 0LL
---- TRACE flush

---- TRACE 1 start lj-408-tonumber-cdata-record.test.lua:17
0001  GGET     1   0      ; "tonumber"
0002  MOV      3   0
0003  CALL     1   2   2
0000  . FUNCC               ; tonumber
0004  RET1     1   2
---- TRACE 1 IR
0001    fun SLOAD  #0    R
0002    tab FLOAD  0001  func.env
0003    int FLOAD  0002  tab.hmask
0004 >  int EQ     0003  +63 
0005    p64 FLOAD  0002  tab.node
0006 >  p64 HREFK  0005  "tonumber" @8
0007 >  fun HLOAD  0006
0008 >  cdt SLOAD  #2    T
0009 >  fun EQ     0007  tonumber
0010    u16 FLOAD  0008  cdata.ctypeid
0011 >  int EQ     0010  +11 
0012    i64 FLOAD  0008  cdata.int64
0013    num CONV   0012  num.i64
---- TRACE 1 stop -> return

ok - recorded with 0LL and converted for 0LL
---- TRACE 2 start tap.lua:44
0001  TGETS    4   0   0  ; "total"
0002  ADDVN    4   4   0  ; 1
0003  TSETS    4   0   0  ; "total"
0004  GGET     4   1      ; "io"
0005  TGETS    4   4   2  ; "write"
0006  GGET     6   3      ; "string"
0007  TGETS    6   6   4  ; "rep"
0008  KSTR     8   5      ; " "
0009  TGETS    9   0   6  ; "level"
0010  MULNV    9   9   1  ; 4
0011  CALL     6   0   3
0000  . FUNCC               ; string.rep
0012  CALLM    4   1   0
0000  . FUNCC               ; io.write
0013  ISF          1
0014  JMP      4 => 0025
0015  GGET     4   1      ; "io"
0016  TGETS    4   4   2  ; "write"
0017  GGET     6   3      ; "string"
0018  TGETS    6   6   7  ; "format"
0019  KSTR     8   8      ; "ok - %s\n"
---- TRACE 2 abort tap.lua:48 -- error thrown or hook called during recording

ok - recorded with 0LL and not converted for NULL
---- TRACE 2 start tarantool.lua:66
0016  UGET     2   1      ; fiber
0017  TGETS    2   2   4  ; "sleep"
0018  MOV      4   1
0019  CALL     2   1   2
0000  . FUNCC               ; C:10b23f5e0
---- TRACE 2 IR
0001    fun SLOAD  #0    R
0002 >  p64 UREFC  0001  #1  
0003 >  tab ULOAD  0002
0004    int FLOAD  0003  tab.hmask
0005 >  int EQ     0004  +31 
0006    p64 FLOAD  0003  tab.node
0007 >  p64 HREFK  0006  "sleep" @4
0008 >  fun HLOAD  0007
0009 >  num SLOAD  #3    T
0010 >  fun EQ     0008  C:10b23f5e0
---- TRACE 2 stop -> stitch

s.ostanevich@s-ostanevich2:~/workspaces/t.sergos/third_party/luajit/test/tarantool-tests % git status
HEAD detached at ae79d993
Untracked files:
  (use "git add <file>..." to include in what will be committed)
	../../patch
	../../src/lj_opt_narrow.c.orig
	../../src/lj_opt_narrow.c.rej
	gh-6976-narrowing-of-unary-minus.test.lua
	lj-408-tonumber-cdata-record.test.lua

nothing added to commit but untracked files present (use "git add" to track)
s.ostanevich@s-ostanevich2:~/workspaces/t.sergos/third_party/luajit/test/tarantool-tests % git diff
s.ostanevich@s-ostanevich2:~/workspaces/t.sergos/third_party/luajit/test/tarantool-tests % 
s.ostanevich@s-ostanevich2:~/workspaces/t.sergos/third_party/luajit/test/tarantool-tests % git -C ../../../.. describe 
2.11.0-entrypoint-494-gdc147ec91



> On 21 Sep 2022, at 15:03, Sergey Kaplun <skaplun@tarantool.org> wrote:
> 
> Hi, Sergos!
> 
> Thanks for the review!
> 
> On 20.09.22, sergos wrote:
>> 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:
> 
> I tried run the test suite with ninja, but it's failed:
> | $ ninja -C build tarantool-tests
> | ...
> | /home/burii/builds_workspace/tarantool/master/third_party/luajit/test/tarantool-tests/lj-408.test.lua ...................................... 
> | not ok - recorded with NULL and converted for 0LL
> | Dubious, test returned 1 (wstat 256, 0x100)
> | Failed 1/4 subtests 
> |...
> | ninja: build stopped: subcommand failed.
> 
>> 
>> 	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.
> 
> May you check the test output running without ninja like the follwing,
> please:
> 
> | $ ../src/tarantool app-tap/lj-408-tonumber-cdata-record.test.lua 
> | TAP version 13
> | 1..4
> | ok - recorded with NULL and not converted for NULL
> | not ok - recorded with NULL and converted for 0LL
> |   ---
> |   filename: app-tap/lj-408-tonumber-cdata-record.test.lua
> |   line: 0
> |   trace:
> |   - line: 0
> |     source: '@app-tap/lj-408-tonumber-cdata-record.test.lua'
> |     filename: app-tap/lj-408-tonumber-cdata-record.test.lua
> |     what: main
> |     namewhat: 
> |     src: app-tap/lj-408-tonumber-cdata-record.test.lua
> |   ...
> | ok - recorded with 0LL and converted for 0LL
> | ok - recorded with 0LL and not converted for NULL
> | # failed subtest: 1
> 
> Also, please, check `jit.dump()` output. Maybe there is not trace for
> some reason.
> You can run the following command:
> | $ ../src/tarantool -e 'require"jit.dump".start("ib")' app-tap/lj-408-tonumber-cdata-record.test.lua
> 
> The start of output should be the following without the patch.
> 
> | 1..4
> | ---- TRACE 1 start lj-408-tonumber-cdata-record.test.lua:17
> | 0001  GGET     1   0      ; "tonumber"
> | 0002  MOV      2   0
> | 0003  CALL     1   2   2
> | 0000  . FUNCC               ; tonumber
> | 0004  RET1     1   2
> | ---- TRACE 1 IR
> | 0001    fun SLOAD  #0    R
> | 0002    tab FLOAD  0001  func.env
> | 0003    int FLOAD  0002  tab.hmask
> | 0004 >  int EQ     0003  +63 
> | 0005    p32 FLOAD  0002  tab.node
> | 0006 >  p32 HREFK  0005  "tonumber" @8
> | 0007 >  fun HLOAD  0006
> | 0008 >  cdt SLOAD  #1    T
> | 0009 >  fun EQ     0007  tonumber
> | ---- TRACE 1 stop -> return
> | ...
> 
>> 
>> The output says the test passes, while sources contains no patch. Am I missing something?
>> 
>> Sergos
>> 
> 
> <snipped>
> 
>>> 
>> 
> 
> -- 
> Best regards,
> Sergey Kaplun


[-- Attachment #2: Type: text/html, Size: 39192 bytes --]

  reply	other threads:[~2022-09-21 12:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12  8:01 Sergey Kaplun via Tarantool-patches
2022-09-19  7:50 ` Maxim Kokryashkin via Tarantool-patches
2022-09-20  8:53   ` sergos via Tarantool-patches
2022-09-20  9:58     ` Maxim Kokryashkin via Tarantool-patches
2022-09-20 10:10       ` sergos via Tarantool-patches
2022-09-21 12:03         ` Sergey Kaplun via Tarantool-patches
2022-09-21 12:19           ` sergos via Tarantool-patches [this message]
2022-09-22 11:28             ` Sergey Kaplun via Tarantool-patches
2022-09-25 21:37               ` sergos via Tarantool-patches
2022-09-28  7:37                 ` Sergey Kaplun via Tarantool-patches
2022-09-24 14:49   ` Sergey Kaplun via Tarantool-patches
2022-11-11  8:54 ` Igor Munkin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7378A34A-6A2D-4634-B7A0-C9AA33267042@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=sergos@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit] FFI: Add tonumber() specialization for failed conversions.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox