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 4004D5A3799; Tue, 22 Aug 2023 18:48:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4004D5A3799 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1692719334; bh=MbhzXScFDbKE5UzhxeV1PuuKrvV8fqVmUFbeC8R29GQ=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=D8FlpvTuCLsLwKePkFDq7XMrceE2kmDLCR7Vay8YWJGNXki+ixZGjBmW3ouk4kWO3 4hE3HjOVCWL2Eelo9fGmZ1nDv9oaBJ1mb/DYWPnC+0A5PAToeAY07Kh/xCVDPOmYg/ w1+VclTpcPJrzERxpYL4I92/MmRp+9pq6z6Rlx4A= Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [95.163.41.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6E1E25992B1 for ; Tue, 22 Aug 2023 18:48:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6E1E25992B1 Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1qYTci-00ByHo-2O; Tue, 22 Aug 2023 18:48:53 +0300 Date: Tue, 22 Aug 2023 18:44:08 +0300 To: Sergey Bronnikov Message-ID: References: <20230815123215.510-1-skaplun@tarantool.org> <27744ffa-a0f8-56dc-15f7-3c367b68a7f8@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <27744ffa-a0f8-56dc-15f7-3c367b68a7f8@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD90D1D1AB54508998154743820A78DF337F4722C12BCC8CA79182A05F5380850404C228DA9ACA6FE27B209A36334265C1D820CD3CE8F8C78D2853BD864A56FBD29F25FB1652E484EBE X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70CB15FA6C489297DEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371777B963B59186248638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8DDF350E4F4B0CDDF2AE7534640B2FA0F117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2FD16FCC8DB5F8BEA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751F618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EEC65AC60A1F0286FE4DC33E588678F033D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE3B28C6475D0D323309735652A29929C6CC4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947C062BEEFFB5F8EA3E2E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F890A246B268E114E35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A5BA54C24496190092A02183C795D78D2FEC975A2F77FDD626F87CCE6106E1FC07E67D4AC08A07B9B065B78C30F681404DCB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFE51C5FDA7C0A0F93FAF9AB19E59E8305D5584A510A905D535366B7ACE02FC8FB8657CCA151A12AF5A7CA3A83B0F0804D07045B89231A3EA2DE1692A7600F076BE48CAC7CA610320002C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojjgfIa8ZOPyeGiYmOLpJdVA== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769D4ECC3C6D21AC44E820CD3CE8F8C78D27958A49548C749F6DEDBA653FF35249392D99EB8CC7091A70E183A470755BFD208F19895AA18418972D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Fix maxslots when recording BC_VARG, part 3. 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: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the review! Fixed your comment and force-pushed the branch. On 21.08.23, Sergey Bronnikov wrote: > Hi, Sergey > > thanks for the patch! See comment inline. > > > On 8/15/23 15:32, Sergey Kaplun wrote: > > From: Mike Pall > > +local anchor > > +local N_ITER = 5 > > +local SIDE_ITER = N_ITER - 1 > > +for i = 1, N_ITER do > > + -- In case, when `BC_VARG` set the VARG slot to the non-top > > + -- stack slot, `maxslot` value was unconditionally set to the > > + -- destination slot, so the following snapshot is used: > > + -- SNAP #4 [ ---- ---- ---- nil ] > > + -- instead of: > > + -- SNAP #4 [ ---- nil ---- ---- 0009 0001 ---- 0009 ] > > + -- Since these slots are omitted, they are not restored > > + -- correctly, when restoring from snapshot for this side exit. > > + anchor = ... > > + if i > SIDE_ITER then > > + -- XXX: Don't use `test:ok()` here to avoid double-running of > > + -- tests in case of `i` incorrect restoring from the snapshot. > > + assert(i > SIDE_ITER) > > + end > > +end > > + > > +test:ok(true, 'BC_VARG recording 0th frame depth, 1 result') > > This always passed testcase is confused and it will confuse everyone who > will use test. > > I propose to replace test:ok() to test:diag: > > > > or you can define a global variable and replace assert with assigning > result to this variable. I preferred this option: =================================================================== diff --git a/test/tarantool-tests/lj-1046-fix-bc-varg-recording.test.lua b/test/tarantool-tests/lj-1046-fix-bc-varg-recording.test.lua index 30a87e54..8bdd49eb 100644 --- a/test/tarantool-tests/lj-1046-fix-bc-varg-recording.test.lua +++ b/test/tarantool-tests/lj-1046-fix-bc-varg-recording.test.lua @@ -11,6 +11,9 @@ jit.opt.start('hotloop=1') local anchor local N_ITER = 5 local SIDE_ITER = N_ITER - 1 + +local consistent_snap_restore = false + for i = 1, N_ITER do -- This trace generates the following IRs: -- 0001 > int SLOAD #7 CRI @@ -45,11 +48,12 @@ for i = 1, N_ITER do -- XXX: `test:ok()` isn't used here to avoid double-running of -- tests in case of `i` incorrect restoration from the -- snapshot. - assert(i > SIDE_ITER) + consistent_snap_restore = i > SIDE_ITER + break end end -test:ok(true, 'BC_VARG recording 0th frame depth, 1 result') +test:ok(consistent_snap_restore, 'BC_VARG recording 0th frame depth, 1 result') -- Now the same case, but with an additional frame, so VARG slots -- are defined on the trace. @@ -59,14 +63,17 @@ local function varg_frame(anchor, i, side_iter, ...) -- XXX: `test:ok()` isn't used here to avoid double-running of -- tests in case of `i` incorrect restoration from the -- snapshot. - assert(i > side_iter) + consistent_snap_restore = i > side_iter end end +consistent_snap_restore = false + for i = 1, N_ITER do varg_frame(nil, i, SIDE_ITER) end -test:ok(true, 'BC_VARG recording with VARG slots defined on trace, 1 result') +test:ok(consistent_snap_restore, + 'BC_VARG recording with VARG slots defined on trace, 1 result') test:done(true) =================================================================== > > then check expected and actual value for global variable using test:ok(). > > > > > + -- Best regards, Sergey Kaplun