* [Tarantool-patches] [PATCH v2 luajit 01/45] test: don't run JIT-based LuaJIT tests without JIT
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-21 15:24 ` Sergey Bronnikov via Tarantool-patches
` (2 more replies)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 02/45] test: actualize <LuaJIT-tests/README.md> Sergey Kaplun via Tarantool-patches
` (45 subsequent siblings)
46 siblings, 3 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
Before this patch +jit flag is given to the LuaJIT test suite
unconditionally even when LuaJIT is built as a pure interpreter.
This patch fixes the behaviour by setting the flag only when
`LUAJIT_DISABLE_JIT` option is not set.
Needed for tarantool/tarantool#9398
---
test/LuaJIT-tests/CMakeLists.txt | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/test/LuaJIT-tests/CMakeLists.txt b/test/LuaJIT-tests/CMakeLists.txt
index 9fbe9bf5..019762e0 100644
--- a/test/LuaJIT-tests/CMakeLists.txt
+++ b/test/LuaJIT-tests/CMakeLists.txt
@@ -42,11 +42,15 @@ if(LUAJIT_USE_ASAN)
endif()
endif()
+if(NOT LUAJIT_DISABLE_JIT)
+ list(APPEND LUAJIT_TEST_TAGS_EXTRA +jit)
+endif()
+
if(LUAJIT_NO_UNWIND)
# Test <catch_cpp.lua> verifies the interoperability with C++
# ABI exceptions, so it requires external unwinding enabled.
# Hence, skip them otherwise.
- set(LUAJIT_TEST_TAGS_EXTRA +internal_unwinder)
+ list(APPEND LUAJIT_TEST_TAGS_EXTRA +internal_unwinder)
endif()
if(CMAKE_C_FLAGS MATCHES "-march=skylake-avx512")
@@ -55,7 +59,7 @@ if(CMAKE_C_FLAGS MATCHES "-march=skylake-avx512")
# built with the enabled AVX512 instruction set, see
# https://github.com/tarantool/tarantool/issues/6787.
# Hence, skip this when "skylake-avx512" is passed.
- set(LUAJIT_TEST_TAGS_EXTRA +avx512)
+ list(APPEND LUAJIT_TEST_TAGS_EXTRA +avx512)
endif()
set(TEST_SUITE_NAME "LuaJIT-tests")
@@ -73,7 +77,7 @@ add_test_suite_target(LuaJIT-tests
set(test_title "test/${TEST_SUITE_NAME}")
add_test(NAME "${test_title}"
COMMAND ${LUAJIT_TEST_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/test.lua
- +slow +ffi +bit +jit ${LUAJIT_TEST_TAGS_EXTRA}
+ +slow +ffi +bit ${LUAJIT_TEST_TAGS_EXTRA}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
set_tests_properties("${test_title}" PROPERTIES
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 01/45] test: don't run JIT-based LuaJIT tests without JIT
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 01/45] test: don't run JIT-based LuaJIT tests without JIT Sergey Kaplun via Tarantool-patches
@ 2024-08-21 15:24 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:53 ` Maxim Kokryashkin via Tarantool-patches
2024-09-04 22:55 ` Maxim Kokryashkin via Tarantool-patches
2 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-21 15:24 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 357 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> Before this patch +jit flag is given to the LuaJIT test suite
> unconditionally even when LuaJIT is built as a pure interpreter.
>
> This patch fixes the behaviour by setting the flag only when
> `LUAJIT_DISABLE_JIT` option is not set.
>
> Needed for tarantool/tarantool#9398
thanks for the patch! LGTM
[-- Attachment #2: Type: text/html, Size: 839 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 01/45] test: don't run JIT-based LuaJIT tests without JIT
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 01/45] test: don't run JIT-based LuaJIT tests without JIT Sergey Kaplun via Tarantool-patches
2024-08-21 15:24 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 22:53 ` Maxim Kokryashkin via Tarantool-patches
2024-09-04 22:55 ` Maxim Kokryashkin via Tarantool-patches
2 siblings, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 22:53 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 01/45] test: don't run JIT-based LuaJIT tests without JIT
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 01/45] test: don't run JIT-based LuaJIT tests without JIT Sergey Kaplun via Tarantool-patches
2024-08-21 15:24 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:53 ` Maxim Kokryashkin via Tarantool-patches
@ 2024-09-04 22:55 ` Maxim Kokryashkin via Tarantool-patches
2 siblings, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 22:55 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 02/45] test: actualize <LuaJIT-tests/README.md>
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 01/45] test: don't run JIT-based LuaJIT tests without JIT Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-21 15:27 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:54 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 03/45] test: enable <misc/alias_alloc.lua> LuaJIT test Sergey Kaplun via Tarantool-patches
` (44 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch syncs up the description of the LuaJIT-tests suite with the
current status. Also, it adds a description of the subcategories of
tests on which future patches will be based.
Relates to tarantool/tarantool#9398
---
test/LuaJIT-tests/README.md | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/test/LuaJIT-tests/README.md b/test/LuaJIT-tests/README.md
index ff16ac8e..210ca232 100644
--- a/test/LuaJIT-tests/README.md
+++ b/test/LuaJIT-tests/README.md
@@ -91,19 +91,28 @@ Your test(s) should not write to stdout or stderr, nor should they mutate
global state. After your test(s) are written, you should be able to determine
which features they require, and put on metadata appropriately.
+## Subcategories of tests ##
+
+The currently valid and runable tests are placed in the following directories:
+
+* `bc` -- tests for the current bytecode implementation.
+* `lang` -- testing the language implementation. This includes parsing, error
+ handling, GC behaviour, etc.
+* `lib` -- namely, tests for built-in libraries.
+* `opt` -- tests for JIT compiler optimizations.
+* `trace` -- tests for JIT compiler behaviour (including `phi` subdirectory).
+
## Completing the tidy-up of the test suite ##
Some files/directories in this directory need some thought:
* `common/ffi_util.inc` - Needs renaming and being made `require`-able.
- * `lib/ffi` - Tests need converting to structure described in this document.
* `lib/table/misc.lua` - Tests need organising and converting to structure
described in this document.
* `misc` - Tests need organising and converting to structure described in
this document.
* `src` - C/C++ source which needs to be compiled into a dynamic library and
- loaded for certain tests. Need to figure out a good way of handling
- C/C++ source.
+ loaded for certain tests.
* `sysdep` - Need to figure out a good way of handling these.
* `unportable` - Need to figure out a good way of handling these.
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 02/45] test: actualize <LuaJIT-tests/README.md>
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 02/45] test: actualize <LuaJIT-tests/README.md> Sergey Kaplun via Tarantool-patches
@ 2024-08-21 15:27 ` Sergey Bronnikov via Tarantool-patches
2024-08-21 16:40 ` Sergey Kaplun via Tarantool-patches
2024-09-04 22:54 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-21 15:27 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 445 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch syncs up the description of the LuaJIT-tests suite with the
> current status. Also, it adds a description of the subcategories of
> tests on which future patches will be based.
>
> Relates to tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
I would move this commit to the of patch series. Otherwise, "current
status" is confused,
because it is not current, actually.
[-- Attachment #2: Type: text/html, Size: 953 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 02/45] test: actualize <LuaJIT-tests/README.md>
2024-08-21 15:27 ` Sergey Bronnikov via Tarantool-patches
@ 2024-08-21 16:40 ` Sergey Kaplun via Tarantool-patches
0 siblings, 0 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 16:40 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the review!
Please, consider my answers below.
On 21.08.24, Sergey Bronnikov wrote:
> Sergey,
>
> On 21.08.2024 11:58, Sergey Kaplun wrote:
> > This patch syncs up the description of the LuaJIT-tests suite with the
> > current status. Also, it adds a description of the subcategories of
> > tests on which future patches will be based.
> >
> > Relates to tarantool/tarantool#9398
> > ---
>
> thanks for the patch! LGTM
>
> I would move this commit to the of patch series. Otherwise, "current
> status" is confused,
>
> because it is not current, actually.
I suppose it shouldn't be confusing, since the misc/ directory is
mentioned in the next section (as tests that are not enabled). And its
mention is deleted in the last commit of the series.
Should I rephrase the commit message somehow?
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 02/45] test: actualize <LuaJIT-tests/README.md>
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 02/45] test: actualize <LuaJIT-tests/README.md> Sergey Kaplun via Tarantool-patches
2024-08-21 15:27 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 22:54 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 22:54 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 03/45] test: enable <misc/alias_alloc.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 01/45] test: don't run JIT-based LuaJIT tests without JIT Sergey Kaplun via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 02/45] test: actualize <LuaJIT-tests/README.md> Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-21 16:15 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:55 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 04/45] test: refactor <alias_alloc.lua> " Sergey Kaplun via Tarantool-patches
` (43 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the <alias_alloc.lua> test from the <misc> to the
created <opt/mem> directory, includes it in <index>, and names subtests.
Testing optimizations in <lj_opt_mem.c> requires CSE, DCE, FOLD, and FWD
optimizations enabled. Hence, the corresponding flags are used for the
<mem> directory in <index>.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/opt/index | 1 +
.../{misc => opt/mem}/alias_alloc.lua | 15 ++++++---------
test/LuaJIT-tests/opt/mem/index | 1 +
3 files changed, 8 insertions(+), 9 deletions(-)
rename test/LuaJIT-tests/{misc => opt/mem}/alias_alloc.lua (72%)
create mode 100644 test/LuaJIT-tests/opt/mem/index
diff --git a/test/LuaJIT-tests/opt/index b/test/LuaJIT-tests/opt/index
index 94d50aec..8c43b56e 100644
--- a/test/LuaJIT-tests/opt/index
+++ b/test/LuaJIT-tests/opt/index
@@ -3,4 +3,5 @@ fold +fold
fwd +fwd
fuse.lua +fuse
loop +loop
+mem +cse +dse +fold +fwd
sink +sink
diff --git a/test/LuaJIT-tests/misc/alias_alloc.lua b/test/LuaJIT-tests/opt/mem/alias_alloc.lua
similarity index 72%
rename from test/LuaJIT-tests/misc/alias_alloc.lua
rename to test/LuaJIT-tests/opt/mem/alias_alloc.lua
index 02fe618d..7347169a 100644
--- a/test/LuaJIT-tests/misc/alias_alloc.lua
+++ b/test/LuaJIT-tests/opt/mem/alias_alloc.lua
@@ -1,5 +1,4 @@
-
-do
+do --- ALOAD forwarding, same table.
local t = {1}
local x
for i=1,100 do
@@ -10,7 +9,7 @@ do
assert(x == 100 and t[1] == 100)
end
-do
+do --- ALOAD forwarding, different tables.
local t = {1}
local x,y
for i=1,100 do
@@ -22,7 +21,7 @@ do
assert(x == 100 and y == 101)
end
-do
+do --- FLOAD forwarding.
local mt = {}
local t = setmetatable({}, mt)
local x
@@ -33,16 +32,15 @@ do
end
end
--- See also sink_alloc.lua
-do
+-- See also <opt/sink/alloc.lua>.
+do --- Forwarding the constant-on-trace table in the complex add.
local x,k={1,2},{3,4}
for i=1,100 do x = {x[1]+k[1], x[2]+k[2]} end
assert(x[1] == 301)
assert(x[2] == 402)
end
--- FLOAD for tab.asize/tab.array crossing NEWREF.
-do
+do --- FLOAD forwarding for tab.asize/tab.array crossing NEWREF.
local t = {1}
for i=1,100 do
local v = {}
@@ -51,4 +49,3 @@ do
w[1] = t[1]
end
end
-
diff --git a/test/LuaJIT-tests/opt/mem/index b/test/LuaJIT-tests/opt/mem/index
new file mode 100644
index 00000000..0b1856ed
--- /dev/null
+++ b/test/LuaJIT-tests/opt/mem/index
@@ -0,0 +1 @@
+alias_alloc.lua
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 03/45] test: enable <misc/alias_alloc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 03/45] test: enable <misc/alias_alloc.lua> LuaJIT test Sergey Kaplun via Tarantool-patches
@ 2024-08-21 16:15 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:55 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-21 16:15 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 444 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the <alias_alloc.lua> test from the <misc> to the
> created <opt/mem> directory, includes it in <index>, and names subtests.
>
> Testing optimizations in <lj_opt_mem.c> requires CSE, DCE, FOLD, and FWD
> optimizations enabled. Hence, the corresponding flags are used for the
> <mem> directory in <index>.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
[-- Attachment #2: Type: text/html, Size: 953 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 03/45] test: enable <misc/alias_alloc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 03/45] test: enable <misc/alias_alloc.lua> LuaJIT test Sergey Kaplun via Tarantool-patches
2024-08-21 16:15 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 22:55 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 22:55 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 04/45] test: refactor <alias_alloc.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (2 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 03/45] test: enable <misc/alias_alloc.lua> LuaJIT test Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-21 16:18 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:55 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 05/45] test: refactor <lang/coroutine.lua> " Sergey Kaplun via Tarantool-patches
` (42 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch refactors the aforementioned test to make its code style
closer to ours.
Relates to tarantool/tarantool#9398
---
test/LuaJIT-tests/opt/mem/alias_alloc.lua | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/test/LuaJIT-tests/opt/mem/alias_alloc.lua b/test/LuaJIT-tests/opt/mem/alias_alloc.lua
index 7347169a..a9627b55 100644
--- a/test/LuaJIT-tests/opt/mem/alias_alloc.lua
+++ b/test/LuaJIT-tests/opt/mem/alias_alloc.lua
@@ -1,7 +1,7 @@
do --- ALOAD forwarding, same table.
local t = {1}
local x
- for i=1,100 do
+ for i = 1, 100 do
local v = {i}
t[1] = v[1]
x = v[1]
@@ -12,9 +12,9 @@ end
do --- ALOAD forwarding, different tables.
local t = {1}
local x,y
- for i=1,100 do
+ for i = 1, 100 do
local v = {i}
- local w = {i+1}
+ local w = {i + 1}
x = v[1]
y = w[1]
end
@@ -25,7 +25,7 @@ do --- FLOAD forwarding.
local mt = {}
local t = setmetatable({}, mt)
local x
- for i=1,100 do
+ for _ = 1, 100 do
local v = {}
setmetatable(v, getmetatable(t))
assert(getmetatable(v) == mt)
@@ -34,15 +34,16 @@ end
-- See also <opt/sink/alloc.lua>.
do --- Forwarding the constant-on-trace table in the complex add.
- local x,k={1,2},{3,4}
- for i=1,100 do x = {x[1]+k[1], x[2]+k[2]} end
+ local x, k = {1, 2}, {3, 4}
+ for _ = 1, 100 do x = {x[1] + k[1], x[2] + k[2]} end
assert(x[1] == 301)
assert(x[2] == 402)
end
+
do --- FLOAD forwarding for tab.asize/tab.array crossing NEWREF.
local t = {1}
- for i=1,100 do
+ for _ = 1, 100 do
local v = {}
local w = {}
v[1] = t[1]
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 05/45] test: refactor <lang/coroutine.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (3 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 04/45] test: refactor <alias_alloc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-21 16:20 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:56 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 06/45] test: remove <misc/coro_yield.lua> " Sergey Kaplun via Tarantool-patches
` (41 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch refactors the <lang/coroutine.lua> test by adding a simple
check for the content of a `debug.traceback()` result. Also, the test is
moved to the <lib/coroutine/> directory.
Also, it removes the <misc/coro_traceback.lua> since it is the same test
that wasn't cleaned up during the refactoring in the original
repository.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/coroutine.lua | 8 --------
test/LuaJIT-tests/lang/index | 1 -
test/LuaJIT-tests/lib/coroutine/index | 1 +
test/LuaJIT-tests/lib/coroutine/traceback.lua | 14 ++++++++++++++
test/LuaJIT-tests/misc/coro_traceback.lua | 8 --------
5 files changed, 15 insertions(+), 17 deletions(-)
delete mode 100644 test/LuaJIT-tests/lang/coroutine.lua
create mode 100644 test/LuaJIT-tests/lib/coroutine/traceback.lua
delete mode 100644 test/LuaJIT-tests/misc/coro_traceback.lua
diff --git a/test/LuaJIT-tests/lang/coroutine.lua b/test/LuaJIT-tests/lang/coroutine.lua
deleted file mode 100644
index 405135c9..00000000
--- a/test/LuaJIT-tests/lang/coroutine.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-do --- traceback
- local co = coroutine.create(function()
- local x = nil
- local y = x.x
- end)
- assert(coroutine.resume(co) == false)
- debug.traceback(co)
-end
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 4ff7a297..803f32d8 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -14,7 +14,6 @@ concat.lua
self.lua
table.lua
upvalue
-coroutine.lua
tail_recursion.lua
vararg_jit.lua
gc.lua
diff --git a/test/LuaJIT-tests/lib/coroutine/index b/test/LuaJIT-tests/lib/coroutine/index
index 9c5c17ec..c4dc6cf1 100644
--- a/test/LuaJIT-tests/lib/coroutine/index
+++ b/test/LuaJIT-tests/lib/coroutine/index
@@ -1 +1,2 @@
+traceback.lua
yield.lua
diff --git a/test/LuaJIT-tests/lib/coroutine/traceback.lua b/test/LuaJIT-tests/lib/coroutine/traceback.lua
new file mode 100644
index 00000000..2b900ef1
--- /dev/null
+++ b/test/LuaJIT-tests/lib/coroutine/traceback.lua
@@ -0,0 +1,14 @@
+do --- traceback
+ local function badfunc()
+ local x = nil
+ local y = x.x
+ end
+
+ local co = coroutine.create(badfunc)
+ assert(coroutine.resume(co) == false)
+
+ local traceback = debug.traceback(co)
+ local line = debug.getinfo(badfunc).linedefined
+
+ assert(traceback:match('traceback:.*:' .. line))
+end
diff --git a/test/LuaJIT-tests/misc/coro_traceback.lua b/test/LuaJIT-tests/misc/coro_traceback.lua
deleted file mode 100644
index 2676d2c6..00000000
--- a/test/LuaJIT-tests/misc/coro_traceback.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-
-local co = coroutine.create(function()
- local x = nil
- local y = x.x
-end)
-assert(coroutine.resume(co) == false)
-debug.traceback(co)
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 05/45] test: refactor <lang/coroutine.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 05/45] test: refactor <lang/coroutine.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 16:20 ` Sergey Bronnikov via Tarantool-patches
2024-08-21 16:27 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:56 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-21 16:20 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 577 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch refactors the <lang/coroutine.lua> test by adding a simple
> check for the content of a `debug.traceback()` result. Also, the test is
> moved to the <lib/coroutine/> directory.
>
> Also, it removes the <misc/coro_traceback.lua> since it is the same test
> that wasn't cleaned up during the refactoring in the original
> repository.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
Please add a note to the top of the file that test is fragile
and depends on a number of lines in the file.
[-- Attachment #2: Type: text/html, Size: 1186 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 05/45] test: refactor <lang/coroutine.lua> LuaJIT test
2024-08-21 16:20 ` Sergey Bronnikov via Tarantool-patches
@ 2024-08-21 16:27 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-21 16:27 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 777 bytes --]
Hi, again
On 21.08.2024 19:20, Sergey Bronnikov via Tarantool-patches wrote:
>
> Sergey,
>
> On 21.08.2024 11:58, Sergey Kaplun wrote:
>> This patch refactors the <lang/coroutine.lua> test by adding a simple
>> check for the content of a `debug.traceback()` result. Also, the test is
>> moved to the <lib/coroutine/> directory.
>>
>> Also, it removes the <misc/coro_traceback.lua> since it is the same test
>> that wasn't cleaned up during the refactoring in the original
>> repository.
>>
>> Part of tarantool/tarantool#9398
>> ---
>
> thanks for the patch! LGTM
>
> Please add a note to the top of the file that test is fragile
>
> and depends on a number of lines in the file.
>
Please disregard, <linedefined> is not defined as a constant number in
the test.
LGTM then.
[-- Attachment #2: Type: text/html, Size: 1861 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 05/45] test: refactor <lang/coroutine.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 05/45] test: refactor <lang/coroutine.lua> " Sergey Kaplun via Tarantool-patches
2024-08-21 16:20 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 22:56 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 22:56 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 06/45] test: remove <misc/coro_yield.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (4 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 05/45] test: refactor <lang/coroutine.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-21 16:23 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:56 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 07/45] test: enable <misc/debug_gc.lua> " Sergey Kaplun via Tarantool-patches
` (40 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch removes the aforementioned test since it is identical to the
<lib/coroutine/yield.lua> test, which wasn't cleaned up during the
refactoring in the original repository.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/coro_yield.lua | 111 --------------------------
1 file changed, 111 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/coro_yield.lua
diff --git a/test/LuaJIT-tests/misc/coro_yield.lua b/test/LuaJIT-tests/misc/coro_yield.lua
deleted file mode 100644
index ae3206e0..00000000
--- a/test/LuaJIT-tests/misc/coro_yield.lua
+++ /dev/null
@@ -1,111 +0,0 @@
-local create = coroutine.create
-local wrap = coroutine.wrap
-local resume = coroutine.resume
-local yield = coroutine.yield
-
--- Test stack overflow handling on return from coroutine.
-do
- wrap(function()
- local co = create(function()
- yield(string.byte(string.rep(" ", 100), 1, 100))
- end)
- assert(select('#', resume(co)) == 101)
- end)()
-end
-
-do
- wrap(function()
- local f = wrap(function()
- yield(string.byte(string.rep(" ", 100), 1, 100))
- end)
- assert(select('#', f()) == 100)
- end)()
-end
-
-do
- local function cogen(x)
- return wrap(function(n) repeat x = x+n; n = yield(x) until false end),
- wrap(function(n) repeat x = x*n; n = yield(x) until false end)
- end
-
- local a,b=cogen(3)
- local c,d=cogen(5)
- assert(d(b(c(a(d(b(c(a(1)))))))) == 168428160)
-end
-
-do
- local function verify(what, expect, ...)
- local got = {...}
- for i=1,100 do
- if expect[i] ~= got[i] then
- error("FAIL " .. what)
- end
- if expect[i] == nil then
- break
- end
- end
- end
-
- local function cofunc(...)
- verify("call", { 1, "foo" }, ...)
- verify("yield", { "bar" }, yield(2, "test"))
- verify("pcall yield", { true, "again" }, pcall(yield, "from pcall"))
- return "end"
- end
-
- local co = create(cofunc)
- verify("resume", { true, 2, "test" }, resume(co, 1, "foo"))
- verify("resume pcall", { true, "from pcall" }, resume(co, "bar"))
- verify("resume end", { true, "end" }, resume(co, "again"))
-end
-
-do
- local function verify(expect, func, ...)
- local co = create(func)
- for i=1,100 do
- local ok, res = resume(co, ...)
- if not ok then
- if expect[i] ~= nil then
- error("too few results: ["..i.."] = "..tostring(expect[i]).." (got: "..tostring(res)..")")
- end
- break
- end
- if expect[i] ~= res then
- error("bad result: ["..i.."] = "..tostring(res).." (should be: "..tostring(expect[i])..")")
- end
- end
- end
-
- verify({ 42, 99 },
- function(x) pcall(yield, x) return 99 end,
- 42)
-
- verify({ 42, 99 },
- function(x) pcall(function(y) yield(y) end, x) return 99 end,
- 42)
-
- verify({ 42, 99 },
- function(x) xpcall(yield, debug.traceback, x) return 99 end,
- 42)
-
- verify({ 45, 44, 43, 42, 99 },
- function(x, y)
- for i in
- function(o, k)
- yield(o+k)
- if k ~= 0 then return k-1 end
- end,x,y do
- end
- return 99
- end,
- 42, 3)
-
- verify({ 84, 99 },
- function(x)
- local o = setmetatable({ x },
- {__add = function(a, b) yield(a[1]+b[1]) return 99 end })
- return o+o
- end,
- 42)
-end
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 06/45] test: remove <misc/coro_yield.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 06/45] test: remove <misc/coro_yield.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 16:23 ` Sergey Bronnikov via Tarantool-patches
2024-08-21 16:36 ` Sergey Kaplun via Tarantool-patches
2024-09-04 22:56 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-21 16:23 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 361 bytes --]
Sergey,
thanks for the patch!
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch removes the aforementioned test since it is identical to the
Line's width is 70 symbols, please split.
LGTM
> <lib/coroutine/yield.lua> test, which wasn't cleaned up during the
> refactoring in the original repository.
>
> Part of tarantool/tarantool#9398
> ---
<snipped>
[-- Attachment #2: Type: text/html, Size: 1076 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 06/45] test: remove <misc/coro_yield.lua> LuaJIT test
2024-08-21 16:23 ` Sergey Bronnikov via Tarantool-patches
@ 2024-08-21 16:36 ` Sergey Kaplun via Tarantool-patches
2024-08-22 15:04 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 1 reply; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 16:36 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the review!
Please consider my answers below.
On 21.08.24, Sergey Bronnikov wrote:
> Sergey,
>
> thanks for the patch!
>
> On 21.08.2024 11:58, Sergey Kaplun wrote:
> > This patch removes the aforementioned test since it is identical to the
>
> Line's width is 70 symbols, please split.
The maximum line's width is 72 symbols, see [1]. It is 71 here, so
ignoring.
Side note: I use (if not forgot) the Vim auto-formatting for the gitcommit.
For the code style, it needs some tuning and configuration.
:help v_gq
>
> LGTM
>
> > <lib/coroutine/yield.lua> test, which wasn't cleaned up during the
> > refactoring in the original repository.
> >
> > Part of tarantool/tarantool#9398
> > ---
> <snipped>
[1]: https://github.com/tarantool/tarantool/wiki/Code-review-procedure#commit-message
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 06/45] test: remove <misc/coro_yield.lua> LuaJIT test
2024-08-21 16:36 ` Sergey Kaplun via Tarantool-patches
@ 2024-08-22 15:04 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 15:04 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 894 bytes --]
On 21.08.2024 19:36, Sergey Kaplun wrote:
> Hi, Sergey!
> Thanks for the review!
> Please consider my answers below.
>
> On 21.08.24, Sergey Bronnikov wrote:
>> Sergey,
>>
>> thanks for the patch!
>>
>> On 21.08.2024 11:58, Sergey Kaplun wrote:
>>> This patch removes the aforementioned test since it is identical to the
>> Line's width is 70 symbols, please split.
> The maximum line's width is 72 symbols, see [1]. It is 71 here, so
> ignoring.
>
> Side note: I use (if not forgot) the Vim auto-formatting for the gitcommit.
> For the code style, it needs some tuning and configuration.
> :help v_gq
>
Thanks! LGTM
>> LGTM
>>
>>> <lib/coroutine/yield.lua> test, which wasn't cleaned up during the
>>> refactoring in the original repository.
>>>
>>> Part of tarantool/tarantool#9398
>>> ---
>> <snipped>
> [1]:https://github.com/tarantool/tarantool/wiki/Code-review-procedure#commit-message
>
[-- Attachment #2: Type: text/html, Size: 2095 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 06/45] test: remove <misc/coro_yield.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 06/45] test: remove <misc/coro_yield.lua> " Sergey Kaplun via Tarantool-patches
2024-08-21 16:23 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 22:56 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 22:56 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 07/45] test: enable <misc/debug_gc.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (5 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 06/45] test: remove <misc/coro_yield.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 15:04 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:57 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 08/45] test: enable <misc/dualnum.lua> " Sergey Kaplun via Tarantool-patches
` (39 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory (with slightly renaming to be consistent with other names),
includes it in <index>, and names the subtest.
Also, it changes the number of iterations to trigger the GC since the
number of objects is different when running the test as a part of the
LuaJIT test suite.
Part of tarantool/tarantool#9398
---
.../{misc/debug_gc.lua => lang/gc_debug.lua} | 31 ++++++++++++-------
test/LuaJIT-tests/lang/index | 1 +
2 files changed, 20 insertions(+), 12 deletions(-)
rename test/LuaJIT-tests/{misc/debug_gc.lua => lang/gc_debug.lua} (63%)
diff --git a/test/LuaJIT-tests/misc/debug_gc.lua b/test/LuaJIT-tests/lang/gc_debug.lua
similarity index 63%
rename from test/LuaJIT-tests/misc/debug_gc.lua
rename to test/LuaJIT-tests/lang/gc_debug.lua
index 30fb2b99..bb30adc1 100644
--- a/test/LuaJIT-tests/misc/debug_gc.lua
+++ b/test/LuaJIT-tests/lang/gc_debug.lua
@@ -1,12 +1,7 @@
-
--- Do not run this test unless the JIT compiler is turned off.
-if jit and jit.status and jit.status() then return end
-
local caught, caught_line, caught_mm
local function gcmeta()
if caught ~= "end" then
--- print(debug.traceback())
-- This may point to the wrong instruction if in a JIT trace.
-- But there's no guarantee if, when or where any GC steps occur.
local dbg = debug.getinfo(2)
@@ -22,7 +17,7 @@ local function testgc(mm, f)
local u = newproxy(true)
getmetatable(u).__gc = gcmeta
u = nil
- for i=1,100000 do
+ for i = 1, 1e7 do
f(i)
-- This check may be hoisted. __gc is not supposed to have side-effects.
if caught then break end
@@ -38,10 +33,22 @@ local function testgc(mm, f)
end
end
-local x
-testgc("__gc", function(i) x = {} end)
-testgc("__gc", function(i) x = {1} end)
-testgc("__gc", function(i) x = function() end end)
-testgc("__concat", function(i) x = i.."" end)
+do --- Test __gc metamethod info
+ -- Do not run this test unless the JIT compiler is turned off.
+ local jit_need_restore = false
+ if jit and jit.status and jit.status() then
+ jit_need_restore = true
+ jit.off()
+ end
+
+ local x
+ testgc("__gc", function(i) x = {} end)
+ testgc("__gc", function(i) x = {1} end)
+ testgc("__gc", function(i) x = function() end end)
+ testgc("__concat", function(i) x = i.."" end)
-caught = "end"
+ caught = "end"
+ if jit_need_restore then
+ jit.on()
+ end
+end
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 803f32d8..4d9feafd 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -17,5 +17,6 @@ upvalue
tail_recursion.lua
vararg_jit.lua
gc.lua
+gc_debug.lua
goto.lua +goto
meta
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 07/45] test: enable <misc/debug_gc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 07/45] test: enable <misc/debug_gc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 15:04 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:57 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 15:04 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 495 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory (with slightly renaming to be consistent with other names),
> includes it in <index>, and names the subtest.
>
> Also, it changes the number of iterations to trigger the GC since the
> number of objects is different when running the test as a part of the
> LuaJIT test suite.
>
> Part of tarantool/tarantool#9398
> ---
<snipped>
thanks for the patch! LGTM
[-- Attachment #2: Type: text/html, Size: 1027 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 07/45] test: enable <misc/debug_gc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 07/45] test: enable <misc/debug_gc.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 15:04 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 22:57 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 22:57 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 08/45] test: enable <misc/dualnum.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (6 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 07/45] test: enable <misc/debug_gc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 14:54 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:57 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 09/45] test: refactor <lang/dualnum.lua> " Sergey Kaplun via Tarantool-patches
` (38 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory, includes it in <index>, and names subtests.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/{misc => lang}/dualnum.lua | 12 +++++-------
test/LuaJIT-tests/lang/index | 1 +
2 files changed, 6 insertions(+), 7 deletions(-)
rename test/LuaJIT-tests/{misc => lang}/dualnum.lua (82%)
diff --git a/test/LuaJIT-tests/misc/dualnum.lua b/test/LuaJIT-tests/lang/dualnum.lua
similarity index 82%
rename from test/LuaJIT-tests/misc/dualnum.lua
rename to test/LuaJIT-tests/lang/dualnum.lua
index 5f1288c8..d0b1e5d2 100644
--- a/test/LuaJIT-tests/misc/dualnum.lua
+++ b/test/LuaJIT-tests/lang/dualnum.lua
@@ -1,20 +1,18 @@
+-- Test LuaJIT Dualnum mode behaviour.
--- Positive overflow
-do
+do --- Positive overflow.
local x = 0
for i=2147483446,2147483647,2 do x = x + 1 end
assert(x == 101)
end
--- Negative overflow
-do
+do --- Negative overflow.
local x = 0
for i=-2147483447,-2147483648,-2 do x = x + 1 end
assert(x == 101)
end
--- SLOAD with number to integer conversion.
-do
+do --- SLOAD with number to integer conversion.
local k = 1
local a, b, c = 1/k, 20/k, 1/k
for i=1,20 do
@@ -22,7 +20,7 @@ do
end
end
-do
+do --- min/max correctness.
local function fmin(a, b)
for i=1,100 do a = math.min(a, b) end
return a
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 4d9feafd..b0e7f073 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -6,6 +6,7 @@ catch_wrap.lua
compare.lua
compare_nan.lua
constant
+dualnum.lua
for.lua
length.lua
lightud.lua
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 08/45] test: enable <misc/dualnum.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 08/45] test: enable <misc/dualnum.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 14:54 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:57 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 14:54 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory, includes it in <index>, and names subtests.
>
> Part of tarantool/tarantool#9398
> ---
>
<snipped>
thanks for the patch! LGTM
[-- Attachment #2: Type: text/html, Size: 786 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 08/45] test: enable <misc/dualnum.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 08/45] test: enable <misc/dualnum.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 14:54 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 22:57 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 22:57 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 09/45] test: refactor <lang/dualnum.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (7 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 08/45] test: enable <misc/dualnum.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 15:05 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:58 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 10/45] test: remove <misc/fori_coerce.lua> " Sergey Kaplun via Tarantool-patches
` (37 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch refactors the aforementioned test to make its code style
closer to ours.
Relates to tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/dualnum.lua | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/LuaJIT-tests/lang/dualnum.lua b/test/LuaJIT-tests/lang/dualnum.lua
index d0b1e5d2..bc52b742 100644
--- a/test/LuaJIT-tests/lang/dualnum.lua
+++ b/test/LuaJIT-tests/lang/dualnum.lua
@@ -2,31 +2,31 @@
do --- Positive overflow.
local x = 0
- for i=2147483446,2147483647,2 do x = x + 1 end
+ for _ = 2147483446, 2147483647, 2 do x = x + 1 end
assert(x == 101)
end
do --- Negative overflow.
local x = 0
- for i=-2147483447,-2147483648,-2 do x = x + 1 end
+ for _ = -2147483447, -2147483648, -2 do x = x + 1 end
assert(x == 101)
end
do --- SLOAD with number to integer conversion.
local k = 1
local a, b, c = 1/k, 20/k, 1/k
- for i=1,20 do
- for j=a,b,c do end
+ for _ = 1, 20 do
+ for _ = a, b, c do end
end
end
do --- min/max correctness.
local function fmin(a, b)
- for i=1,100 do a = math.min(a, b) end
+ for _ = 1, 100 do a = math.min(a, b) end
return a
end
local function fmax(a, b)
- for i=1,100 do a = math.max(a, b) end
+ for _ = 1, 100 do a = math.max(a, b) end
return a
end
assert(fmin(1, 3) == 1)
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 09/45] test: refactor <lang/dualnum.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 09/45] test: refactor <lang/dualnum.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 15:05 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:58 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 15:05 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1537 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch refactors the aforementioned test to make its code style
> closer to ours.
>
> Relates to tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/lang/dualnum.lua | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/test/LuaJIT-tests/lang/dualnum.lua b/test/LuaJIT-tests/lang/dualnum.lua
> index d0b1e5d2..bc52b742 100644
> --- a/test/LuaJIT-tests/lang/dualnum.lua
> +++ b/test/LuaJIT-tests/lang/dualnum.lua
> @@ -2,31 +2,31 @@
>
> do --- Positive overflow.
> local x = 0
> - for i=2147483446,2147483647,2 do x = x + 1 end
> + for _ = 2147483446, 2147483647, 2 do x = x + 1 end
> assert(x == 101)
> end
>
> do --- Negative overflow.
> local x = 0
> - for i=-2147483447,-2147483648,-2 do x = x + 1 end
> + for _ = -2147483447, -2147483648, -2 do x = x + 1 end
> assert(x == 101)
> end
>
> do --- SLOAD with number to integer conversion.
> local k = 1
> local a, b, c = 1/k, 20/k, 1/k
> - for i=1,20 do
> - for j=a,b,c do end
> + for _ = 1, 20 do
> + for _ = a, b, c do end
> end
> end
>
> do --- min/max correctness.
> local function fmin(a, b)
> - for i=1,100 do a = math.min(a, b) end
> + for _ = 1, 100 do a = math.min(a, b) end
> return a
> end
> local function fmax(a, b)
> - for i=1,100 do a = math.max(a, b) end
> + for _ = 1, 100 do a = math.max(a, b) end
> return a
> end
> assert(fmin(1, 3) == 1)
[-- Attachment #2: Type: text/html, Size: 2085 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 09/45] test: refactor <lang/dualnum.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 09/45] test: refactor <lang/dualnum.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 15:05 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 22:58 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 22:58 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 10/45] test: remove <misc/fori_coerce.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (8 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 09/45] test: refactor <lang/dualnum.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 14:53 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:58 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 11/45] test: remove <misc/fori_dir.lua> " Sergey Kaplun via Tarantool-patches
` (36 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch removes the aforementioned test since it is part of the
<lang/for.lua> test.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/fori_coerce.lua | 33 --------------------------
1 file changed, 33 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/fori_coerce.lua
diff --git a/test/LuaJIT-tests/misc/fori_coerce.lua b/test/LuaJIT-tests/misc/fori_coerce.lua
deleted file mode 100644
index 7330943b..00000000
--- a/test/LuaJIT-tests/misc/fori_coerce.lua
+++ /dev/null
@@ -1,33 +0,0 @@
-
-do
- local n = 1
- local x = 0
- for i=1,20 do
- for j=n,100 do x = x + 1 end
- if i == 13 then n = "2" end
- end
- assert(x == 1993)
-end
-
-do
- local n = 1
- local x = 0
- for i=1,20 do
- for j=n,100 do x = x + 1 end
- if i == 10 then n = "2" end
- end
- assert(x == 1990)
-end
-
-do
- local function f()
- local n = 1
- local x = 0
- for i=1,20 do
- for j=n,100 do x = x + 1 end
- if i == 10 then n = "x" end
- end
- end
- assert(not pcall(f))
-end
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 10/45] test: remove <misc/fori_coerce.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 10/45] test: remove <misc/fori_coerce.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 14:53 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:58 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 14:53 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch removes the aforementioned test since it is part of the
> <lang/for.lua> test.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/misc/fori_coerce.lua | 33 --------------------------
> 1 file changed, 33 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/fori_coerce.lua
>
> diff --git a/test/LuaJIT-tests/misc/fori_coerce.lua b/test/LuaJIT-tests/misc/fori_coerce.lua
> deleted file mode 100644
> index 7330943b..00000000
> --- a/test/LuaJIT-tests/misc/fori_coerce.lua
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -
> -do
> - local n = 1
> - local x = 0
> - for i=1,20 do
> - for j=n,100 do x = x + 1 end
> - if i == 13 then n = "2" end
> - end
> - assert(x == 1993)
> -end
> -
> -do
> - local n = 1
> - local x = 0
> - for i=1,20 do
> - for j=n,100 do x = x + 1 end
> - if i == 10 then n = "2" end
> - end
> - assert(x == 1990)
> -end
> -
> -do
> - local function f()
> - local n = 1
> - local x = 0
> - for i=1,20 do
> - for j=n,100 do x = x + 1 end
> - if i == 10 then n = "x" end
> - end
> - end
> - assert(not pcall(f))
> -end
> -
[-- Attachment #2: Type: text/html, Size: 1771 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 10/45] test: remove <misc/fori_coerce.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 10/45] test: remove <misc/fori_coerce.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 14:53 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 22:58 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 22:58 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 11/45] test: remove <misc/fori_dir.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (9 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 10/45] test: remove <misc/fori_coerce.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 15:05 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:58 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 12/45] test: remove <misc/gc_rechain.lua> " Sergey Kaplun via Tarantool-patches
` (35 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch removes the aforementioned test since it is part of the
<lang/for.lua> test.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/for_dir.lua | 13 -------------
1 file changed, 13 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/for_dir.lua
diff --git a/test/LuaJIT-tests/misc/for_dir.lua b/test/LuaJIT-tests/misc/for_dir.lua
deleted file mode 100644
index 4dd38dee..00000000
--- a/test/LuaJIT-tests/misc/for_dir.lua
+++ /dev/null
@@ -1,13 +0,0 @@
-
-local a,b,c = 10,1,-1
-for i=1,20 do
- if c == -1 then
- a,b,c = 1,10,1
- else
- a,b,c = 10,1,-1
- end
- local x = 0
- for i=a,b,c do for j=1,10 do end x=x+1 end
- assert(x == 10)
-end
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 11/45] test: remove <misc/fori_dir.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 11/45] test: remove <misc/fori_dir.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 15:05 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:58 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 15:05 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 812 bytes --]
Sergey
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch removes the aforementioned test since it is part of the
> <lang/for.lua> test.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/misc/for_dir.lua | 13 -------------
> 1 file changed, 13 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/for_dir.lua
>
> diff --git a/test/LuaJIT-tests/misc/for_dir.lua b/test/LuaJIT-tests/misc/for_dir.lua
> deleted file mode 100644
> index 4dd38dee..00000000
> --- a/test/LuaJIT-tests/misc/for_dir.lua
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -
> -local a,b,c = 10,1,-1
> -for i=1,20 do
> - if c == -1 then
> - a,b,c = 1,10,1
> - else
> - a,b,c = 10,1,-1
> - end
> - local x = 0
> - for i=a,b,c do for j=1,10 do end x=x+1 end
> - assert(x == 10)
> -end
> -
[-- Attachment #2: Type: text/html, Size: 1434 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 11/45] test: remove <misc/fori_dir.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 11/45] test: remove <misc/fori_dir.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 15:05 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 22:58 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 22:58 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 12/45] test: remove <misc/gc_rechain.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (10 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 11/45] test: remove <misc/fori_dir.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 14:53 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:59 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 13/45] test: enable <misc/gc_trace.lua> " Sergey Kaplun via Tarantool-patches
` (34 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch removes the aforementioned test since it is part of the
<lang/gc.lua> test.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/gc_rechain.lua | 32 ---------------------------
1 file changed, 32 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/gc_rechain.lua
diff --git a/test/LuaJIT-tests/misc/gc_rechain.lua b/test/LuaJIT-tests/misc/gc_rechain.lua
deleted file mode 100644
index 285f4086..00000000
--- a/test/LuaJIT-tests/misc/gc_rechain.lua
+++ /dev/null
@@ -1,32 +0,0 @@
-
-do
- local k
-
- collectgarbage()
-
- local t = {}
- t.ac = 1
-
- t.nn = 1
- t.mm = 1
- t.nn = nil
- t.mm = nil
-
- k = "a".."i"
- t[k] = 2
-
- t.ad = 3
-
- t[k] = nil
- k = nil
-
- collectgarbage()
-
- k = "a".."f"
- t[k] = 4
-
- t.ak = 5
-
- assert(t[k] == 4)
-end
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 12/45] test: remove <misc/gc_rechain.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 12/45] test: remove <misc/gc_rechain.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 14:53 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 22:59 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 14:53 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 967 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch removes the aforementioned test since it is part of the
> <lang/gc.lua> test.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/misc/gc_rechain.lua | 32 ---------------------------
> 1 file changed, 32 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/gc_rechain.lua
>
> diff --git a/test/LuaJIT-tests/misc/gc_rechain.lua b/test/LuaJIT-tests/misc/gc_rechain.lua
> deleted file mode 100644
> index 285f4086..00000000
> --- a/test/LuaJIT-tests/misc/gc_rechain.lua
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -
> -do
> - local k
> -
> - collectgarbage()
> -
> - local t = {}
> - t.ac = 1
> -
> - t.nn = 1
> - t.mm = 1
> - t.nn = nil
> - t.mm = nil
> -
> - k = "a".."i"
> - t[k] = 2
> -
> - t.ad = 3
> -
> - t[k] = nil
> - k = nil
> -
> - collectgarbage()
> -
> - k = "a".."f"
> - t[k] = 4
> -
> - t.ak = 5
> -
> - assert(t[k] == 4)
> -end
> -
[-- Attachment #2: Type: text/html, Size: 1551 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 12/45] test: remove <misc/gc_rechain.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 12/45] test: remove <misc/gc_rechain.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 14:53 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 22:59 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 22:59 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 13/45] test: enable <misc/gc_trace.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (11 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 12/45] test: remove <misc/gc_rechain.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
[not found] ` <4f43c5dc-d8c2-48a1-a26b-00b626ce69e5@tarantool.org>
` (2 more replies)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 14/45] test: refactor <trace/gc.lua> " Sergey Kaplun via Tarantool-patches
` (33 subsequent siblings)
46 siblings, 3 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names subtests.
The first test is adjusted to be runable in the test suite.
Part of tarantool/tarantool#9398
---
.../{misc/gc_trace.lua => trace/gc.lua} | 30 +++++++++++--------
test/LuaJIT-tests/trace/index | 1 +
2 files changed, 18 insertions(+), 13 deletions(-)
rename test/LuaJIT-tests/{misc/gc_trace.lua => trace/gc.lua} (56%)
diff --git a/test/LuaJIT-tests/misc/gc_trace.lua b/test/LuaJIT-tests/trace/gc.lua
similarity index 56%
rename from test/LuaJIT-tests/misc/gc_trace.lua
rename to test/LuaJIT-tests/trace/gc.lua
index bc38ce0c..43d7ae55 100644
--- a/test/LuaJIT-tests/misc/gc_trace.lua
+++ b/test/LuaJIT-tests/trace/gc.lua
@@ -1,18 +1,23 @@
+local jutil = require("jit.util")
-if not jit or not jit.status or not jit.status() then return end
-
-collectgarbage()
-for j=1,100 do
- loadstring("for i=1,100 do end")()
+do --- Collect dead traces.
+ jit.flush()
+ collectgarbage()
+ -- Prevent the creation of side traces.
+ jit.off()
+ for j=1,100 do
+ jit.on()
+ loadstring("for i=1,100 do end")()
+ jit.off()
+ end
+ jit.on()
+ collectgarbage()
+ assert(jutil.traceinfo(1) == nil)
+ assert(jutil.traceinfo(2) == nil)
+ assert(jutil.traceinfo(3) == nil)
end
-local jutil = require("jit.util")
-assert(jutil.traceinfo(90) == nil)
-collectgarbage()
-assert(jutil.traceinfo(1) == nil)
-assert(jutil.traceinfo(2) == nil)
-assert(jutil.traceinfo(3) == nil)
-do
+do --- Check KGC marking.
local f
local function reccb(tr)
if f == nil then
@@ -34,4 +39,3 @@ do
end
jit.attach(reccb)
end
-
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index ea7a22e0..46c8f5d2 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -1,6 +1,7 @@
exit_frame.lua
exit_growstack.lua
exit_jfuncf.lua
+gc.lua
gc64_slot_revival.lua
phi
snap.lua
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
[parent not found: <4f43c5dc-d8c2-48a1-a26b-00b626ce69e5@tarantool.org>]
* Re: [Tarantool-patches] [PATCH v2 luajit 13/45] test: enable <misc/gc_trace.lua> LuaJIT test
[not found] ` <4f43c5dc-d8c2-48a1-a26b-00b626ce69e5@tarantool.org>
@ 2024-08-22 12:54 ` Sergey Kaplun via Tarantool-patches
0 siblings, 0 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-22 12:54 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Sergey,
Thanks for the review!
Please consider my answers below.
On 22.08.24, Sergey Bronnikov wrote:
> Sergey,
>
> On 21.08.2024 11:58, Sergey Kaplun wrote:
> > This patch moves the aforementioned test from the <misc> to the <trace/>
> > directory, includes it in <index>, and names subtests.
> >
> > The first test is adjusted to be runable in the test suite.
> >
> > Part of tarantool/tarantool#9398
> > ---
> thanks for the patch! LGTM with two minor comments below.
<snipped>
> > +do --- Collect dead traces.
> > + jit.flush()
> > + collectgarbage()
> > + -- Prevent the creation of side traces.
> > + jit.off()
> > + for j=1,100 do
> add whitespaces please
It is refactored in the next patch
> > + jit.on()
> > + loadstring("for i=1,100 do end")()
> and here too
Ditto.
> > + jit.off()
<snipped>
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 13/45] test: enable <misc/gc_trace.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 13/45] test: enable <misc/gc_trace.lua> " Sergey Kaplun via Tarantool-patches
[not found] ` <4f43c5dc-d8c2-48a1-a26b-00b626ce69e5@tarantool.org>
@ 2024-08-22 15:06 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:04 ` Maxim Kokryashkin via Tarantool-patches
2 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 15:06 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2209 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <trace/>
> directory, includes it in <index>, and names subtests.
>
> The first test is adjusted to be runable in the test suite.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> .../{misc/gc_trace.lua => trace/gc.lua} | 30 +++++++++++--------
> test/LuaJIT-tests/trace/index | 1 +
> 2 files changed, 18 insertions(+), 13 deletions(-)
> rename test/LuaJIT-tests/{misc/gc_trace.lua => trace/gc.lua} (56%)
>
> diff --git a/test/LuaJIT-tests/misc/gc_trace.lua b/test/LuaJIT-tests/trace/gc.lua
> similarity index 56%
> rename from test/LuaJIT-tests/misc/gc_trace.lua
> rename to test/LuaJIT-tests/trace/gc.lua
> index bc38ce0c..43d7ae55 100644
> --- a/test/LuaJIT-tests/misc/gc_trace.lua
> +++ b/test/LuaJIT-tests/trace/gc.lua
> @@ -1,18 +1,23 @@
> +local jutil = require("jit.util")
>
> -if not jit or not jit.status or not jit.status() then return end
> -
> -collectgarbage()
> -for j=1,100 do
> - loadstring("for i=1,100 do end")()
> +do --- Collect dead traces.
> + jit.flush()
> + collectgarbage()
> + -- Prevent the creation of side traces.
> + jit.off()
> + for j=1,100 do
> + jit.on()
> + loadstring("for i=1,100 do end")()
> + jit.off()
> + end
> + jit.on()
> + collectgarbage()
> + assert(jutil.traceinfo(1) == nil)
> + assert(jutil.traceinfo(2) == nil)
> + assert(jutil.traceinfo(3) == nil)
> end
> -local jutil = require("jit.util")
> -assert(jutil.traceinfo(90) == nil)
> -collectgarbage()
> -assert(jutil.traceinfo(1) == nil)
> -assert(jutil.traceinfo(2) == nil)
> -assert(jutil.traceinfo(3) == nil)
>
> -do
> +do --- Check KGC marking.
> local f
> local function reccb(tr)
> if f == nil then
> @@ -34,4 +39,3 @@ do
> end
> jit.attach(reccb)
> end
> -
> diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
> index ea7a22e0..46c8f5d2 100644
> --- a/test/LuaJIT-tests/trace/index
> +++ b/test/LuaJIT-tests/trace/index
> @@ -1,6 +1,7 @@
> exit_frame.lua
> exit_growstack.lua
> exit_jfuncf.lua
> +gc.lua
> gc64_slot_revival.lua
> phi
> snap.lua
[-- Attachment #2: Type: text/html, Size: 2750 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 13/45] test: enable <misc/gc_trace.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 13/45] test: enable <misc/gc_trace.lua> " Sergey Kaplun via Tarantool-patches
[not found] ` <4f43c5dc-d8c2-48a1-a26b-00b626ce69e5@tarantool.org>
2024-08-22 15:06 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:04 ` Maxim Kokryashkin via Tarantool-patches
2 siblings, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:04 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 14/45] test: refactor <trace/gc.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (12 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 13/45] test: enable <misc/gc_trace.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 14:53 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:04 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 15/45] test: enable <misc/gcstep.lua> " Sergey Kaplun via Tarantool-patches
` (32 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch refactors the aforementioned test to make its code style
closer to ours.
Relates to tarantool/tarantool#9398
---
test/LuaJIT-tests/trace/gc.lua | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/LuaJIT-tests/trace/gc.lua b/test/LuaJIT-tests/trace/gc.lua
index 43d7ae55..f6b40aac 100644
--- a/test/LuaJIT-tests/trace/gc.lua
+++ b/test/LuaJIT-tests/trace/gc.lua
@@ -5,9 +5,9 @@ do --- Collect dead traces.
collectgarbage()
-- Prevent the creation of side traces.
jit.off()
- for j=1,100 do
+ for _ = 1, 100 do
jit.on()
- loadstring("for i=1,100 do end")()
+ loadstring("for _ = 1, 100 do end")()
jit.off()
end
jit.on()
@@ -29,7 +29,7 @@ do --- Check KGC marking.
end
end
jit.attach(reccb, "record")
- for i=1,200 do
+ for i = 1, 200 do
if i % 5 == 0 then
f = function() end
elseif f then
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 14/45] test: refactor <trace/gc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 14/45] test: refactor <trace/gc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 14:53 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:04 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 14:53 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1046 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch refactors the aforementioned test to make its code style
> closer to ours.
>
> Relates to tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/trace/gc.lua | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/test/LuaJIT-tests/trace/gc.lua b/test/LuaJIT-tests/trace/gc.lua
> index 43d7ae55..f6b40aac 100644
> --- a/test/LuaJIT-tests/trace/gc.lua
> +++ b/test/LuaJIT-tests/trace/gc.lua
> @@ -5,9 +5,9 @@ do --- Collect dead traces.
> collectgarbage()
> -- Prevent the creation of side traces.
> jit.off()
> - for j=1,100 do
> + for _ = 1, 100 do
> jit.on()
> - loadstring("for i=1,100 do end")()
> + loadstring("for _ = 1, 100 do end")()
> jit.off()
> end
> jit.on()
> @@ -29,7 +29,7 @@ do --- Check KGC marking.
> end
> end
> jit.attach(reccb, "record")
> - for i=1,200 do
> + for i = 1, 200 do
> if i % 5 == 0 then
> f = function() end
> elseif f then
[-- Attachment #2: Type: text/html, Size: 1640 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 14/45] test: refactor <trace/gc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 14/45] test: refactor <trace/gc.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 14:53 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:04 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:04 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 15/45] test: enable <misc/gcstep.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (13 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 14/45] test: refactor <trace/gc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 12:14 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:05 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 16/45] test: enable <misc/hook_active.lua> " Sergey Kaplun via Tarantool-patches
` (31 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory (with slightly renaming to be consistent with other names),
includes it in <index>, and names the subtests.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/gc_step.lua | 39 ++++++++++++++++++++++++++++++
test/LuaJIT-tests/lang/index | 1 +
test/LuaJIT-tests/misc/gcstep.lua | 33 -------------------------
3 files changed, 40 insertions(+), 33 deletions(-)
create mode 100644 test/LuaJIT-tests/lang/gc_step.lua
delete mode 100644 test/LuaJIT-tests/misc/gcstep.lua
diff --git a/test/LuaJIT-tests/lang/gc_step.lua b/test/LuaJIT-tests/lang/gc_step.lua
new file mode 100644
index 00000000..756d7a61
--- /dev/null
+++ b/test/LuaJIT-tests/lang/gc_step.lua
@@ -0,0 +1,39 @@
+local function testgc(what, func)
+ collectgarbage()
+ local oc = gcinfo()
+ func()
+ local nc = gcinfo()
+ assert(nc < oc * 4, "GC step missing for " .. what)
+end
+
+do --- TNEW
+ testgc("TNEW", function()
+ for _ = 1, 10000 do
+ local _ = {}
+ end
+ end)
+end
+
+do --- TDUP
+ testgc("TDUP", function()
+ for _ = 1, 10000 do
+ local _ = {1}
+ end
+ end)
+end
+
+do --- FNEW
+ testgc("FNEW", function()
+ for _ = 1, 10000 do
+ local function _() end
+ end
+ end)
+end
+
+do --- CAT
+ testgc("CAT", function()
+ for i = 1, 10000 do
+ local _ = "x" .. i
+ end
+ end)
+end
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index b0e7f073..274425bf 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -19,5 +19,6 @@ tail_recursion.lua
vararg_jit.lua
gc.lua
gc_debug.lua
+gc_step.lua
goto.lua +goto
meta
diff --git a/test/LuaJIT-tests/misc/gcstep.lua b/test/LuaJIT-tests/misc/gcstep.lua
deleted file mode 100644
index 533356b7..00000000
--- a/test/LuaJIT-tests/misc/gcstep.lua
+++ /dev/null
@@ -1,33 +0,0 @@
-
-local function testgc(what, func)
- collectgarbage()
- local oc = gcinfo()
- func()
- local nc = gcinfo()
- assert(nc < oc*4, "GC step missing for "..what)
-end
-
-testgc("TNEW", function()
- for i=1,10000 do
- local t = {}
- end
-end)
-
-testgc("TDUP", function()
- for i=1,10000 do
- local t = {1}
- end
-end)
-
-testgc("FNEW", function()
- for i=1,10000 do
- local function f() end
- end
-end)
-
-testgc("CAT", function()
- for i=1,10000 do
- local s = "x"..i
- end
-end)
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 15/45] test: enable <misc/gcstep.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 15/45] test: enable <misc/gcstep.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 12:14 ` Sergey Bronnikov via Tarantool-patches
2024-08-22 12:57 ` Sergey Kaplun via Tarantool-patches
2024-09-04 23:05 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 12:14 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2754 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory (with slightly renaming to be consistent with other names),
> includes it in <index>, and names the subtests.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! Please adjust a width of lines in commit message.
LGTM
> test/LuaJIT-tests/lang/gc_step.lua | 39 ++++++++++++++++++++++++++++++
> test/LuaJIT-tests/lang/index | 1 +
> test/LuaJIT-tests/misc/gcstep.lua | 33 -------------------------
> 3 files changed, 40 insertions(+), 33 deletions(-)
> create mode 100644 test/LuaJIT-tests/lang/gc_step.lua
> delete mode 100644 test/LuaJIT-tests/misc/gcstep.lua
>
> diff --git a/test/LuaJIT-tests/lang/gc_step.lua b/test/LuaJIT-tests/lang/gc_step.lua
> new file mode 100644
> index 00000000..756d7a61
> --- /dev/null
> +++ b/test/LuaJIT-tests/lang/gc_step.lua
> @@ -0,0 +1,39 @@
> +local function testgc(what, func)
> + collectgarbage()
> + local oc = gcinfo()
> + func()
> + local nc = gcinfo()
> + assert(nc < oc * 4, "GC step missing for " .. what)
> +end
> +
> +do --- TNEW
> + testgc("TNEW", function()
> + for _ = 1, 10000 do
> + local _ = {}
> + end
> + end)
> +end
> +
> +do --- TDUP
> + testgc("TDUP", function()
> + for _ = 1, 10000 do
> + local _ = {1}
> + end
> + end)
> +end
> +
> +do --- FNEW
> + testgc("FNEW", function()
> + for _ = 1, 10000 do
> + local function _() end
> + end
> + end)
> +end
> +
> +do --- CAT
> + testgc("CAT", function()
> + for i = 1, 10000 do
> + local _ = "x" .. i
> + end
> + end)
> +end
> diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> index b0e7f073..274425bf 100644
> --- a/test/LuaJIT-tests/lang/index
> +++ b/test/LuaJIT-tests/lang/index
> @@ -19,5 +19,6 @@ tail_recursion.lua
> vararg_jit.lua
> gc.lua
> gc_debug.lua
> +gc_step.lua
> goto.lua +goto
> meta
> diff --git a/test/LuaJIT-tests/misc/gcstep.lua b/test/LuaJIT-tests/misc/gcstep.lua
> deleted file mode 100644
> index 533356b7..00000000
> --- a/test/LuaJIT-tests/misc/gcstep.lua
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -
> -local function testgc(what, func)
> - collectgarbage()
> - local oc = gcinfo()
> - func()
> - local nc = gcinfo()
> - assert(nc < oc*4, "GC step missing for "..what)
> -end
> -
> -testgc("TNEW", function()
> - for i=1,10000 do
> - local t = {}
> - end
> -end)
> -
> -testgc("TDUP", function()
> - for i=1,10000 do
> - local t = {1}
> - end
> -end)
> -
> -testgc("FNEW", function()
> - for i=1,10000 do
> - local function f() end
> - end
> -end)
> -
> -testgc("CAT", function()
> - for i=1,10000 do
> - local s = "x"..i
> - end
> -end)
> -
[-- Attachment #2: Type: text/html, Size: 3256 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 15/45] test: enable <misc/gcstep.lua> LuaJIT test
2024-08-22 12:14 ` Sergey Bronnikov via Tarantool-patches
@ 2024-08-22 12:57 ` Sergey Kaplun via Tarantool-patches
2024-08-22 15:07 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 1 reply; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-22 12:57 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the review!
See my answers below.
On 22.08.24, Sergey Bronnikov wrote:
> Sergey,
>
> On 21.08.2024 11:58, Sergey Kaplun wrote:
> > This patch moves the aforementioned test from the <misc> to the <lang/>
> > directory (with slightly renaming to be consistent with other names),
> > includes it in <index>, and names the subtests.
> >
> > Part of tarantool/tarantool#9398
> > ---
>
> thanks for the patch! Please adjust a width of lines in commit message.
The commit message is already adjusted correct: the maximum width is 72
symbols (see [1]). Or what do you mean?
>
> LGTM
>
<snipped>
[1]: https://github.com/tarantool/tarantool/wiki/Code-review-procedure#commit-message
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 15/45] test: enable <misc/gcstep.lua> LuaJIT test
2024-08-22 12:57 ` Sergey Kaplun via Tarantool-patches
@ 2024-08-22 15:07 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 15:07 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 844 bytes --]
On 22.08.2024 15:57, Sergey Kaplun wrote:
> Hi, Sergey!
> Thanks for the review!
> See my answers below.
>
> On 22.08.24, Sergey Bronnikov wrote:
>> Sergey,
>>
>> On 21.08.2024 11:58, Sergey Kaplun wrote:
>>> This patch moves the aforementioned test from the <misc> to the <lang/>
>>> directory (with slightly renaming to be consistent with other names),
>>> includes it in <index>, and names the subtests.
>>>
>>> Part of tarantool/tarantool#9398
>>> ---
>> thanks for the patch! Please adjust a width of lines in commit message.
> The commit message is already adjusted correct: the maximum width is 72
> symbols (see [1]). Or what do you mean?
Seems I forgot a number for max line length in a commit message body :-/
LGTM
>
>> LGTM
>>
> <snipped>
>
> [1]:https://github.com/tarantool/tarantool/wiki/Code-review-procedure#commit-message
>
[-- Attachment #2: Type: text/html, Size: 1986 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 15/45] test: enable <misc/gcstep.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 15/45] test: enable <misc/gcstep.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 12:14 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:05 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:05 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 16/45] test: enable <misc/hook_active.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (14 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 15/45] test: enable <misc/gcstep.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-23 14:35 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:11 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 17/45] test: enable <misc/hook_line.lua> " Sergey Kaplun via Tarantool-patches
` (30 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory, includes it in <index>, names the subtests, and slightly
reformates the code style to make it closer to ours.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/hook_active.lua | 102 +++++++++++++++++++++++++
test/LuaJIT-tests/lang/index | 1 +
test/LuaJIT-tests/misc/hook_active.lua | 95 -----------------------
3 files changed, 103 insertions(+), 95 deletions(-)
create mode 100644 test/LuaJIT-tests/lang/hook_active.lua
delete mode 100644 test/LuaJIT-tests/misc/hook_active.lua
diff --git a/test/LuaJIT-tests/lang/hook_active.lua b/test/LuaJIT-tests/lang/hook_active.lua
new file mode 100644
index 00000000..a5f38055
--- /dev/null
+++ b/test/LuaJIT-tests/lang/hook_active.lua
@@ -0,0 +1,102 @@
+local ctest = require("libctest")
+
+local called = 0
+local function clearhook() debug.sethook(nil, "", 0) end
+
+do --- Return from pcall with active hook must prepend true. FF pcall.
+ called = 0
+ debug.sethook(function() called = called + 1; assert(pcall(function() end) == true); clearhook() end, "", 1)
+ do local x = 1 end
+ assert(called == 1)
+end
+
+do --- Hook with special caught error must not unblock hooks. FF pcall.
+ called = 0
+ debug.sethook(function() called = called + 1; pcall(nil); clearhook() end, "", 1)
+ do local x = 1 end
+ assert(called == 1)
+end
+
+do --- Hook with caught error must not unblock hooks. FF pcall.
+ called = 0
+ local function p2() error("") end
+ debug.sethook(function() called = called + 1; pcall(p2); clearhook() end, "", 1)
+ do local x = 1 end
+ assert(called == 1)
+end
+
+do --- Hook with special caught error must not unblock hooks. C pcall.
+ called = 0
+ debug.sethook(function() called = called + 1; ctest.pcall(nil); clearhook() end, "", 1)
+ do local x = 1 end
+ assert(called == 1)
+end
+
+do --- Hook with caught error must not unblock hooks. C pcall.
+ called = 0
+ local function p2() error("") end
+ debug.sethook(function() called = called + 1; ctest.pcall(p2); clearhook() end, "", 1)
+ do local x = 1 end
+ assert(called == 1)
+end
+
+do --- Regular pcall must not block hooks.
+ debug.sethook(function() called = called + 1 end, "", 1)
+ pcall(function() end)
+ called = 0
+ do local x = 1 end
+ assert(called > 0)
+ pcall(function() error("") end)
+ called = 0
+ do local x = 1 end
+ assert(called > 0)
+ ctest.pcall(function() end)
+ called = 0
+ do local x = 1 end
+ assert(called > 0)
+ ctest.pcall(function() error("") end)
+ called = 0
+ do local x = 1 end
+ assert(called > 0)
+ clearhook()
+end
+
+do --- Hook with uncaught error must unblock hooks. FF pcall.
+ called = 0
+ pcall(function()
+ debug.sethook(function()
+ local old = called
+ called = 1
+ if old == 0 then error("") end
+ end, "", 1)
+ do local x = 1 end
+ end)
+ assert(called == 1)
+ called = 2
+ do local x = 1 end
+ assert(called == 1, "hook not unblocked after uncaught error")
+ clearhook()
+ called = 2
+ do local x = 1 end
+ assert(called == 2)
+end
+
+do --- Hook with uncaught error must unblock hooks. C pcall.
+ called = 0
+ ctest.pcall(function()
+ debug.sethook(function()
+ local old = called
+ called = 1
+ if old == 0 then error("") end
+ end, "", 1)
+ do local x = 1 end
+ end)
+ assert(called == 1)
+ called = 2
+ do local x = 1 end
+ assert(called == 1, "hook not unblocked after uncaught error")
+ clearhook()
+ called = 2
+ do local x = 1 end
+ assert(called == 2)
+end
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 274425bf..8cecfa08 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -8,6 +8,7 @@ compare_nan.lua
constant
dualnum.lua
for.lua
+hook_active.lua
length.lua
lightud.lua
modulo.lua
diff --git a/test/LuaJIT-tests/misc/hook_active.lua b/test/LuaJIT-tests/misc/hook_active.lua
deleted file mode 100644
index 37dfc379..00000000
--- a/test/LuaJIT-tests/misc/hook_active.lua
+++ /dev/null
@@ -1,95 +0,0 @@
-local ctest = require("ctest")
-
-local called = 0
-local function clearhook() debug.sethook(nil, "", 0) end
-
--- Return from pcall with active hook must prepend true. FF pcall.
-called = 0
-debug.sethook(function() called=called+1; assert(pcall(function() end) == true); clearhook() end, "", 1)
-do local x = 1 end
-assert(called == 1)
-
--- Hook with special caught error must not unblock hooks. FF pcall.
-called = 0
-debug.sethook(function() called=called+1; pcall(nil); clearhook() end, "", 1)
-do local x = 1 end
-assert(called == 1)
-
--- Hook with caught error must not unblock hooks. FF pcall.
-called = 0
-local function p2() error("") end
-debug.sethook(function() called=called+1; pcall(p2); clearhook() end, "", 1)
-do local x = 1 end
-assert(called == 1)
-
--- Hook with special caught error must not unblock hooks. C pcall.
-called = 0
-debug.sethook(function() called=called+1; ctest.pcall(nil); clearhook() end, "", 1)
-do local x = 1 end
-assert(called == 1)
-
--- Hook with caught error must not unblock hooks. C pcall
-called = 0
-local function p2() error("") end
-debug.sethook(function() called=called+1; ctest.pcall(p2); clearhook() end, "", 1)
-do local x = 1 end
-assert(called == 1)
-
--- Regular pcall must not block hooks.
-debug.sethook(function() called=called+1 end, "", 1)
-pcall(function() end)
-called = 0
-do local x = 1 end
-assert(called > 0)
-pcall(function() error("") end)
-called = 0
-do local x = 1 end
-assert(called > 0)
-ctest.pcall(function() end)
-called = 0
-do local x = 1 end
-assert(called > 0)
-ctest.pcall(function() error("") end)
-called = 0
-do local x = 1 end
-assert(called > 0)
-clearhook()
-
--- Hook with uncaught error must unblock hooks. FF pcall
-called = 0
-pcall(function()
- debug.sethook(function()
- local old = called
- called = 1
- if old == 0 then error("") end
- end, "", 1)
- do local x = 1 end
-end)
-assert(called == 1)
-called = 2
-do local x = 1 end
-assert(called == 1, "hook not unblocked after uncaught error")
-clearhook()
-called = 2
-do local x = 1 end
-assert(called == 2)
-
--- Hook with uncaught error must unblock hooks. C pcall
-called = 0
-ctest.pcall(function()
- debug.sethook(function()
- local old = called
- called = 1
- if old == 0 then error("") end
- end, "", 1)
- do local x = 1 end
-end)
-assert(called == 1)
-called = 2
-do local x = 1 end
-assert(called == 1, "hook not unblocked after uncaught error")
-clearhook()
-called = 2
-do local x = 1 end
-assert(called == 2)
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 16/45] test: enable <misc/hook_active.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 16/45] test: enable <misc/hook_active.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-23 14:35 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:11 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-23 14:35 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 7124 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory, includes it in <index>, names the subtests, and slightly
> reformates the code style to make it closer to ours.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/lang/hook_active.lua | 102 +++++++++++++++++++++++++
> test/LuaJIT-tests/lang/index | 1 +
> test/LuaJIT-tests/misc/hook_active.lua | 95 -----------------------
> 3 files changed, 103 insertions(+), 95 deletions(-)
> create mode 100644 test/LuaJIT-tests/lang/hook_active.lua
> delete mode 100644 test/LuaJIT-tests/misc/hook_active.lua
>
> diff --git a/test/LuaJIT-tests/lang/hook_active.lua b/test/LuaJIT-tests/lang/hook_active.lua
> new file mode 100644
> index 00000000..a5f38055
> --- /dev/null
> +++ b/test/LuaJIT-tests/lang/hook_active.lua
> @@ -0,0 +1,102 @@
> +local ctest = require("libctest")
> +
> +local called = 0
> +local function clearhook() debug.sethook(nil, "", 0) end
> +
> +do --- Return from pcall with active hook must prepend true. FF pcall.
> + called = 0
> + debug.sethook(function() called = called + 1; assert(pcall(function() end) == true); clearhook() end, "", 1)
> + do local x = 1 end
> + assert(called == 1)
> +end
> +
> +do --- Hook with special caught error must not unblock hooks. FF pcall.
> + called = 0
> + debug.sethook(function() called = called + 1; pcall(nil); clearhook() end, "", 1)
> + do local x = 1 end
> + assert(called == 1)
> +end
> +
> +do --- Hook with caught error must not unblock hooks. FF pcall.
> + called = 0
> + local function p2() error("") end
> + debug.sethook(function() called = called + 1; pcall(p2); clearhook() end, "", 1)
> + do local x = 1 end
> + assert(called == 1)
> +end
> +
> +do --- Hook with special caught error must not unblock hooks. C pcall.
> + called = 0
> + debug.sethook(function() called = called + 1; ctest.pcall(nil); clearhook() end, "", 1)
> + do local x = 1 end
> + assert(called == 1)
> +end
> +
> +do --- Hook with caught error must not unblock hooks. C pcall.
> + called = 0
> + local function p2() error("") end
> + debug.sethook(function() called = called + 1; ctest.pcall(p2); clearhook() end, "", 1)
> + do local x = 1 end
> + assert(called == 1)
> +end
> +
> +do --- Regular pcall must not block hooks.
> + debug.sethook(function() called = called + 1 end, "", 1)
> + pcall(function() end)
> + called = 0
> + do local x = 1 end
> + assert(called > 0)
> + pcall(function() error("") end)
> + called = 0
> + do local x = 1 end
> + assert(called > 0)
> + ctest.pcall(function() end)
> + called = 0
> + do local x = 1 end
> + assert(called > 0)
> + ctest.pcall(function() error("") end)
> + called = 0
> + do local x = 1 end
> + assert(called > 0)
> + clearhook()
> +end
> +
> +do --- Hook with uncaught error must unblock hooks. FF pcall.
> + called = 0
> + pcall(function()
> + debug.sethook(function()
> + local old = called
> + called = 1
> + if old == 0 then error("") end
> + end, "", 1)
> + do local x = 1 end
> + end)
> + assert(called == 1)
> + called = 2
> + do local x = 1 end
> + assert(called == 1, "hook not unblocked after uncaught error")
> + clearhook()
> + called = 2
> + do local x = 1 end
> + assert(called == 2)
> +end
> +
> +do --- Hook with uncaught error must unblock hooks. C pcall.
> + called = 0
> + ctest.pcall(function()
> + debug.sethook(function()
> + local old = called
> + called = 1
> + if old == 0 then error("") end
> + end, "", 1)
> + do local x = 1 end
> + end)
> + assert(called == 1)
> + called = 2
> + do local x = 1 end
> + assert(called == 1, "hook not unblocked after uncaught error")
> + clearhook()
> + called = 2
> + do local x = 1 end
> + assert(called == 2)
> +end
> diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> index 274425bf..8cecfa08 100644
> --- a/test/LuaJIT-tests/lang/index
> +++ b/test/LuaJIT-tests/lang/index
> @@ -8,6 +8,7 @@ compare_nan.lua
> constant
> dualnum.lua
> for.lua
> +hook_active.lua
> length.lua
> lightud.lua
> modulo.lua
> diff --git a/test/LuaJIT-tests/misc/hook_active.lua b/test/LuaJIT-tests/misc/hook_active.lua
> deleted file mode 100644
> index 37dfc379..00000000
> --- a/test/LuaJIT-tests/misc/hook_active.lua
> +++ /dev/null
> @@ -1,95 +0,0 @@
> -local ctest = require("ctest")
> -
> -local called = 0
> -local function clearhook() debug.sethook(nil, "", 0) end
> -
> --- Return from pcall with active hook must prepend true. FF pcall.
> -called = 0
> -debug.sethook(function() called=called+1; assert(pcall(function() end) == true); clearhook() end, "", 1)
> -do local x = 1 end
> -assert(called == 1)
> -
> --- Hook with special caught error must not unblock hooks. FF pcall.
> -called = 0
> -debug.sethook(function() called=called+1; pcall(nil); clearhook() end, "", 1)
> -do local x = 1 end
> -assert(called == 1)
> -
> --- Hook with caught error must not unblock hooks. FF pcall.
> -called = 0
> -local function p2() error("") end
> -debug.sethook(function() called=called+1; pcall(p2); clearhook() end, "", 1)
> -do local x = 1 end
> -assert(called == 1)
> -
> --- Hook with special caught error must not unblock hooks. C pcall.
> -called = 0
> -debug.sethook(function() called=called+1; ctest.pcall(nil); clearhook() end, "", 1)
> -do local x = 1 end
> -assert(called == 1)
> -
> --- Hook with caught error must not unblock hooks. C pcall
> -called = 0
> -local function p2() error("") end
> -debug.sethook(function() called=called+1; ctest.pcall(p2); clearhook() end, "", 1)
> -do local x = 1 end
> -assert(called == 1)
> -
> --- Regular pcall must not block hooks.
> -debug.sethook(function() called=called+1 end, "", 1)
> -pcall(function() end)
> -called = 0
> -do local x = 1 end
> -assert(called > 0)
> -pcall(function() error("") end)
> -called = 0
> -do local x = 1 end
> -assert(called > 0)
> -ctest.pcall(function() end)
> -called = 0
> -do local x = 1 end
> -assert(called > 0)
> -ctest.pcall(function() error("") end)
> -called = 0
> -do local x = 1 end
> -assert(called > 0)
> -clearhook()
> -
> --- Hook with uncaught error must unblock hooks. FF pcall
> -called = 0
> -pcall(function()
> - debug.sethook(function()
> - local old = called
> - called = 1
> - if old == 0 then error("") end
> - end, "", 1)
> - do local x = 1 end
> -end)
> -assert(called == 1)
> -called = 2
> -do local x = 1 end
> -assert(called == 1, "hook not unblocked after uncaught error")
> -clearhook()
> -called = 2
> -do local x = 1 end
> -assert(called == 2)
> -
> --- Hook with uncaught error must unblock hooks. C pcall
> -called = 0
> -ctest.pcall(function()
> - debug.sethook(function()
> - local old = called
> - called = 1
> - if old == 0 then error("") end
> - end, "", 1)
> - do local x = 1 end
> -end)
> -assert(called == 1)
> -called = 2
> -do local x = 1 end
> -assert(called == 1, "hook not unblocked after uncaught error")
> -clearhook()
> -called = 2
> -do local x = 1 end
> -assert(called == 2)
> -
[-- Attachment #2: Type: text/html, Size: 7365 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 16/45] test: enable <misc/hook_active.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 16/45] test: enable <misc/hook_active.lua> " Sergey Kaplun via Tarantool-patches
2024-08-23 14:35 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:11 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:11 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 17/45] test: enable <misc/hook_line.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (15 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 16/45] test: enable <misc/hook_active.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-23 14:38 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:12 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 18/45] test: enable <misc/hook_norecord.lua> " Sergey Kaplun via Tarantool-patches
` (29 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory, includes it in <index>, names the subtests, and adjusts the
line numbers in the assertions and filters to match LuaJIT behaviour and
the new code layout. Also, it slightly refactors the code to make it
closer to our code style.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/hook_line.lua | 45 ++++++++++++++++++++++++++++
test/LuaJIT-tests/lang/index | 1 +
test/LuaJIT-tests/misc/hook_line.lua | 41 -------------------------
3 files changed, 46 insertions(+), 41 deletions(-)
create mode 100644 test/LuaJIT-tests/lang/hook_line.lua
delete mode 100644 test/LuaJIT-tests/misc/hook_line.lua
diff --git a/test/LuaJIT-tests/lang/hook_line.lua b/test/LuaJIT-tests/lang/hook_line.lua
new file mode 100644
index 00000000..733e5513
--- /dev/null
+++ b/test/LuaJIT-tests/lang/hook_line.lua
@@ -0,0 +1,45 @@
+-- The test depends on the number of lines in the file.
+local lines = {}
+local function hook()
+ lines[#lines + 1] = debug.getinfo(2).currentline
+end
+
+local function dummy()
+end -- <-- line 8
+
+do --- Base test: cycles, function calls.
+ debug.sethook(hook, "l", 0)
+ -- <-- line 12
+ local x
+ dummy()
+ local y = 1
+ dummy() dummy()
+ local z = 2; local r = true
+ while y < 4 do y = y + 1 end
+ while z < 4 do
+ z = z + 1
+ end
+ -- <-- line 22
+ local v
+ debug.sethook(nil, "", 0)
+
+ assert(#lines > 0)
+ while lines[1] < 12 do table.remove(lines, 1) end
+ while lines[#lines] > 22 do table.remove(lines) end
+
+ local s = table.concat(lines, " ")
+ assert(s == "13 14 8 15 16 8 8 17 18 18 18 18 19 20 19 20 19" or
+ s == "13 14 8 15 16 8 16 8 17 18 18 18 18 19 20 19 20 19")
+end
+
+do --- Not visited the end of the function definition.
+ lines = {}
+ local function f()
+ if true then return end
+ local function x() end
+ end -- <-- line 40
+ debug.sethook(hook, "l", 0)
+ f()
+ debug.sethook(nil, "", 0)
+ for i = 1, #lines do assert(lines[i] ~= 40) end
+end
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 8cecfa08..ae59bc56 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -9,6 +9,7 @@ constant
dualnum.lua
for.lua
hook_active.lua
+hook_line.lua
length.lua
lightud.lua
modulo.lua
diff --git a/test/LuaJIT-tests/misc/hook_line.lua b/test/LuaJIT-tests/misc/hook_line.lua
deleted file mode 100644
index 36f71080..00000000
--- a/test/LuaJIT-tests/misc/hook_line.lua
+++ /dev/null
@@ -1,41 +0,0 @@
-local lines = {}
-local function hook()
- lines[#lines+1] = debug.getinfo(2).currentline
-end
-
-local function dummy()
-end -- <-- line 7
-
-debug.sethook(hook, "l", 0)
--- <-- line 10
-local x
-dummy()
-local y = 1
-dummy() dummy()
-local z = 2; local r = true
-while y < 4 do y = y + 1 end
-while z < 4 do
- z = z + 1
-end
--- <-- line 20
-local v
-debug.sethook(nil, "", 0)
-
-assert(#lines > 0)
-while lines[1] < 10 do table.remove(lines, 1) end
-while lines[#lines] > 20 do table.remove(lines) end
-
-local s = table.concat(lines, " ")
-assert(s == "11 12 7 13 14 7 7 15 16 16 16 16 17 18 17 18 17" or
- s == "11 12 7 13 14 7 14 7 15 16 16 16 16 17 18 17 18 17")
-
-lines = {}
-local function f()
- if true then return end
- local function x() end
-end -- <-- line 36
-debug.sethook(hook, "l", 0)
-f()
-debug.sethook(nil, "", 0)
-for i=1,#lines do assert(lines[i] ~= 36) end
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 17/45] test: enable <misc/hook_line.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 17/45] test: enable <misc/hook_line.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-23 14:38 ` Sergey Bronnikov via Tarantool-patches
2024-08-26 6:39 ` Sergey Kaplun via Tarantool-patches
2024-09-04 23:12 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-23 14:38 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 3862 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory, includes it in <index>, names the subtests, and adjusts the
> line numbers in the assertions and filters to match LuaJIT behaviour and
> the new code layout. Also, it slightly refactors the code to make it
> closer to our code style.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM with a minor comment.
> test/LuaJIT-tests/lang/hook_line.lua | 45 ++++++++++++++++++++++++++++
> test/LuaJIT-tests/lang/index | 1 +
> test/LuaJIT-tests/misc/hook_line.lua | 41 -------------------------
> 3 files changed, 46 insertions(+), 41 deletions(-)
> create mode 100644 test/LuaJIT-tests/lang/hook_line.lua
> delete mode 100644 test/LuaJIT-tests/misc/hook_line.lua
>
> diff --git a/test/LuaJIT-tests/lang/hook_line.lua b/test/LuaJIT-tests/lang/hook_line.lua
> new file mode 100644
> index 00000000..733e5513
> --- /dev/null
> +++ b/test/LuaJIT-tests/lang/hook_line.lua
> @@ -0,0 +1,45 @@
> +-- The test depends on the number of lines in the file.
> +local lines = {}
> +local function hook()
> + lines[#lines + 1] = debug.getinfo(2).currentline
> +end
> +
> +local function dummy()
> +end -- <-- line 8
> +
> +do --- Base test: cycles, function calls.
> + debug.sethook(hook, "l", 0)
> + -- <-- line 12
> + local x
> + dummy()
> + local y = 1
> + dummy() dummy()
I would place a second call to a separate line. Feel free to ignore.
> + local z = 2; local r = true
> + while y < 4 do y = y + 1 end
> + while z < 4 do
> + z = z + 1
> + end
> + -- <-- line 22
> + local v
> + debug.sethook(nil, "", 0)
> +
> + assert(#lines > 0)
> + while lines[1] < 12 do table.remove(lines, 1) end
> + while lines[#lines] > 22 do table.remove(lines) end
> +
> + local s = table.concat(lines, " ")
> + assert(s == "13 14 8 15 16 8 8 17 18 18 18 18 19 20 19 20 19" or
> + s == "13 14 8 15 16 8 16 8 17 18 18 18 18 19 20 19 20 19")
> +end
> +
> +do --- Not visited the end of the function definition.
> + lines = {}
> + local function f()
> + if true then return end
> + local function x() end
> + end -- <-- line 40
> + debug.sethook(hook, "l", 0)
> + f()
> + debug.sethook(nil, "", 0)
> + for i = 1, #lines do assert(lines[i] ~= 40) end
> +end
> diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> index 8cecfa08..ae59bc56 100644
> --- a/test/LuaJIT-tests/lang/index
> +++ b/test/LuaJIT-tests/lang/index
> @@ -9,6 +9,7 @@ constant
> dualnum.lua
> for.lua
> hook_active.lua
> +hook_line.lua
> length.lua
> lightud.lua
> modulo.lua
> diff --git a/test/LuaJIT-tests/misc/hook_line.lua b/test/LuaJIT-tests/misc/hook_line.lua
> deleted file mode 100644
> index 36f71080..00000000
> --- a/test/LuaJIT-tests/misc/hook_line.lua
> +++ /dev/null
> @@ -1,41 +0,0 @@
> -local lines = {}
> -local function hook()
> - lines[#lines+1] = debug.getinfo(2).currentline
> -end
> -
> -local function dummy()
> -end -- <-- line 7
> -
> -debug.sethook(hook, "l", 0)
> --- <-- line 10
> -local x
> -dummy()
> -local y = 1
> -dummy() dummy()
> -local z = 2; local r = true
> -while y < 4 do y = y + 1 end
> -while z < 4 do
> - z = z + 1
> -end
> --- <-- line 20
> -local v
> -debug.sethook(nil, "", 0)
> -
> -assert(#lines > 0)
> -while lines[1] < 10 do table.remove(lines, 1) end
> -while lines[#lines] > 20 do table.remove(lines) end
> -
> -local s = table.concat(lines, " ")
> -assert(s == "11 12 7 13 14 7 7 15 16 16 16 16 17 18 17 18 17" or
> - s == "11 12 7 13 14 7 14 7 15 16 16 16 16 17 18 17 18 17")
> -
> -lines = {}
> -local function f()
> - if true then return end
> - local function x() end
> -end -- <-- line 36
> -debug.sethook(hook, "l", 0)
> -f()
> -debug.sethook(nil, "", 0)
> -for i=1,#lines do assert(lines[i] ~= 36) end
> -
[-- Attachment #2: Type: text/html, Size: 4590 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 17/45] test: enable <misc/hook_line.lua> LuaJIT test
2024-08-23 14:38 ` Sergey Bronnikov via Tarantool-patches
@ 2024-08-26 6:39 ` Sergey Kaplun via Tarantool-patches
2024-08-29 9:44 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 1 reply; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-26 6:39 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Sergey,
Thanks for the review!
Please, consider my answers below.
On 23.08.24, Sergey Bronnikov wrote:
> Sergey,
>
> On 21.08.2024 11:58, Sergey Kaplun wrote:
> > This patch moves the aforementioned test from the <misc> to the <lang/>
> > directory, includes it in <index>, names the subtests, and adjusts the
> > line numbers in the assertions and filters to match LuaJIT behaviour and
> > the new code layout. Also, it slightly refactors the code to make it
> > closer to our code style.
> >
> > Part of tarantool/tarantool#9398
> > ---
> thanks for the patch! LGTM with a minor comment.
<snipped>
> > +do --- Base test: cycles, function calls.
> > + debug.sethook(hook, "l", 0)
> > + -- <-- line 12
> > + local x
> > + dummy()
> > + local y = 1
> > + dummy() dummy()
>
> I would place a second call to a separate line. Feel free to ignore.
I guess this tests the line number to return (16) here, see the expected
array with line numbers below.
>
>
>
> > + local z = 2; local r = true
> > + while y < 4 do y = y + 1 end
> > + while z < 4 do
> > + z = z + 1
> > + end
> > + -- <-- line 22
> > + local v
> > + debug.sethook(nil, "", 0)
> > +
> > + assert(#lines > 0)
> > + while lines[1] < 12 do table.remove(lines, 1) end
> > + while lines[#lines] > 22 do table.remove(lines) end
> > +
> > + local s = table.concat(lines, " ")
> > + assert(s == "13 14 8 15 16 8 8 17 18 18 18 18 19 20 19 20 19" or
> > + s == "13 14 8 15 16 8 16 8 17 18 18 18 18 19 20 19 20 19")
<snipped>
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 17/45] test: enable <misc/hook_line.lua> LuaJIT test
2024-08-26 6:39 ` Sergey Kaplun via Tarantool-patches
@ 2024-08-29 9:44 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-29 9:44 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 464 bytes --]
Hi, Sergey,
On 26.08.2024 09:39, Sergey Kaplun wrote:
<snipped>
>>> +do --- Base test: cycles, function calls.
>>> + debug.sethook(hook, "l", 0)
>>> + -- <-- line 12
>>> + local x
>>> + dummy()
>>> + local y = 1
>>> + dummy() dummy()
>> I would place a second call to a separate line. Feel free to ignore.
> I guess this tests the line number to return (16) here, see the expected
> array with line numbers below.
>
>
Ah, right. Thanks!
LGTM
<snipped>
[-- Attachment #2: Type: text/html, Size: 1276 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 17/45] test: enable <misc/hook_line.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 17/45] test: enable <misc/hook_line.lua> " Sergey Kaplun via Tarantool-patches
2024-08-23 14:38 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:12 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:12 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 18/45] test: enable <misc/hook_norecord.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (16 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 17/45] test: enable <misc/hook_line.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-09-04 23:12 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 19/45] test: enable <misc/hook_record.lua> " Sergey Kaplun via Tarantool-patches
` (28 subsequent siblings)
46 siblings, 1 reply; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names the subtest. Also, it
slightly refactors the code to make it closer to our code style.
The test is adjusted to be runable in the test suite by adding the
`jit.flush()` to avoid collisions of traces.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/hook_norecord.lua | 12 ------------
test/LuaJIT-tests/trace/hook_norecord.lua | 12 ++++++++++++
test/LuaJIT-tests/trace/index | 1 +
3 files changed, 13 insertions(+), 12 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/hook_norecord.lua
create mode 100644 test/LuaJIT-tests/trace/hook_norecord.lua
diff --git a/test/LuaJIT-tests/misc/hook_norecord.lua b/test/LuaJIT-tests/misc/hook_norecord.lua
deleted file mode 100644
index 8e7cba05..00000000
--- a/test/LuaJIT-tests/misc/hook_norecord.lua
+++ /dev/null
@@ -1,12 +0,0 @@
-
-if not jit or not jit.status or not jit.status() then return end
-
-local called = false
-local function f() local x = "wrong"; called = true end
-jit.off(f)
-debug.sethook(f, "", 5)
-for i=1,1000 do local a,b,c,d,e,f=1,2,3,4,5,6 end
-assert(called)
--- Check that no trace was generated.
-assert(require("jit.util").traceinfo(1) == nil)
-
diff --git a/test/LuaJIT-tests/trace/hook_norecord.lua b/test/LuaJIT-tests/trace/hook_norecord.lua
new file mode 100644
index 00000000..4c39bade
--- /dev/null
+++ b/test/LuaJIT-tests/trace/hook_norecord.lua
@@ -0,0 +1,12 @@
+do --- Abort trace recording on any hook call.
+ local called = false
+ local function f() local x = "wrong"; called = true end
+ jit.off(f)
+ jit.flush()
+ debug.sethook(f, "", 5)
+ for _ = 1, 1000 do local a, b, c, d, e, f = 1, 2, 3, 4, 5, 6 end
+ assert(called)
+ -- Check that no trace was generated.
+ assert(require("jit.util").traceinfo(1) == nil)
+ debug.sethook()
+end
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index 46c8f5d2..595a71d2 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -3,6 +3,7 @@ exit_growstack.lua
exit_jfuncf.lua
gc.lua
gc64_slot_revival.lua
+hook_norecord.lua
phi
snap.lua
stitch.lua
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 19/45] test: enable <misc/hook_record.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (17 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 18/45] test: enable <misc/hook_norecord.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-23 15:12 ` Sergey Bronnikov via Tarantool-patches
` (2 more replies)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 20/45] test: enable <misc/hook_top.lua> " Sergey Kaplun via Tarantool-patches
` (27 subsequent siblings)
46 siblings, 3 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names the subtest. Also, it
slightly refactors the code to make it closer to our code style.
The test is adjusted to be runable in the test suite by adding the
`jit.flush()` to avoid collisions of traces. Also, the number of
iterations for the compiled loop inside the hook is increased to avoid
hotcount collisions.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/hook_record.lua | 8 --------
test/LuaJIT-tests/trace/hook_record.lua | 7 +++++++
test/LuaJIT-tests/trace/index | 1 +
3 files changed, 8 insertions(+), 8 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/hook_record.lua
create mode 100644 test/LuaJIT-tests/trace/hook_record.lua
diff --git a/test/LuaJIT-tests/misc/hook_record.lua b/test/LuaJIT-tests/misc/hook_record.lua
deleted file mode 100644
index 6f1646de..00000000
--- a/test/LuaJIT-tests/misc/hook_record.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-
-if not jit or not jit.status or not jit.status() then return end
-
-debug.sethook(function() for i=1,100 do end end, "", 10)
-for i=1,10 do end
-debug.sethook()
-assert((require("jit.util").traceinfo(1)))
-
diff --git a/test/LuaJIT-tests/trace/hook_record.lua b/test/LuaJIT-tests/trace/hook_record.lua
new file mode 100644
index 00000000..684e1139
--- /dev/null
+++ b/test/LuaJIT-tests/trace/hook_record.lua
@@ -0,0 +1,7 @@
+do --- Recording traces inside the hook.
+ jit.flush()
+ debug.sethook(function() for _ = 1, 1000 do end end, "", 10)
+ for _ = 1, 10 do end
+ debug.sethook()
+ assert((require("jit.util").traceinfo(1)))
+end
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index 595a71d2..63af7870 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -4,6 +4,7 @@ exit_jfuncf.lua
gc.lua
gc64_slot_revival.lua
hook_norecord.lua
+hook_record.lua
phi
snap.lua
stitch.lua
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 19/45] test: enable <misc/hook_record.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 19/45] test: enable <misc/hook_record.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-23 15:12 ` Sergey Bronnikov via Tarantool-patches
2024-08-23 15:15 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:12 ` Maxim Kokryashkin via Tarantool-patches
2 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-23 15:12 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2157 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <trace/>
> directory, includes it in <index>, and names the subtest. Also, it
> slightly refactors the code to make it closer to our code style.
>
> The test is adjusted to be runable in the test suite by adding the
> `jit.flush()` to avoid collisions of traces. Also, the number of
> iterations for the compiled loop inside the hook is increased to avoid
> hotcount collisions.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/misc/hook_record.lua | 8 --------
> test/LuaJIT-tests/trace/hook_record.lua | 7 +++++++
> test/LuaJIT-tests/trace/index | 1 +
> 3 files changed, 8 insertions(+), 8 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/hook_record.lua
> create mode 100644 test/LuaJIT-tests/trace/hook_record.lua
>
> diff --git a/test/LuaJIT-tests/misc/hook_record.lua b/test/LuaJIT-tests/misc/hook_record.lua
> deleted file mode 100644
> index 6f1646de..00000000
> --- a/test/LuaJIT-tests/misc/hook_record.lua
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -
> -if not jit or not jit.status or not jit.status() then return end
> -
> -debug.sethook(function() for i=1,100 do end end, "", 10)
> -for i=1,10 do end
> -debug.sethook()
> -assert((require("jit.util").traceinfo(1)))
> -
> diff --git a/test/LuaJIT-tests/trace/hook_record.lua b/test/LuaJIT-tests/trace/hook_record.lua
> new file mode 100644
> index 00000000..684e1139
> --- /dev/null
> +++ b/test/LuaJIT-tests/trace/hook_record.lua
> @@ -0,0 +1,7 @@
> +do --- Recording traces inside the hook.
> + jit.flush()
> + debug.sethook(function() for _ = 1, 1000 do end end, "", 10)
> + for _ = 1, 10 do end
> + debug.sethook()
> + assert((require("jit.util").traceinfo(1)))
> +end
> diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
> index 595a71d2..63af7870 100644
> --- a/test/LuaJIT-tests/trace/index
> +++ b/test/LuaJIT-tests/trace/index
> @@ -4,6 +4,7 @@ exit_jfuncf.lua
> gc.lua
> gc64_slot_revival.lua
> hook_norecord.lua
> +hook_record.lua
> phi
> snap.lua
> stitch.lua
[-- Attachment #2: Type: text/html, Size: 2729 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 19/45] test: enable <misc/hook_record.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 19/45] test: enable <misc/hook_record.lua> " Sergey Kaplun via Tarantool-patches
2024-08-23 15:12 ` Sergey Bronnikov via Tarantool-patches
@ 2024-08-23 15:15 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:12 ` Maxim Kokryashkin via Tarantool-patches
2 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-23 15:15 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2157 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <trace/>
> directory, includes it in <index>, and names the subtest. Also, it
> slightly refactors the code to make it closer to our code style.
>
> The test is adjusted to be runable in the test suite by adding the
> `jit.flush()` to avoid collisions of traces. Also, the number of
> iterations for the compiled loop inside the hook is increased to avoid
> hotcount collisions.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/misc/hook_record.lua | 8 --------
> test/LuaJIT-tests/trace/hook_record.lua | 7 +++++++
> test/LuaJIT-tests/trace/index | 1 +
> 3 files changed, 8 insertions(+), 8 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/hook_record.lua
> create mode 100644 test/LuaJIT-tests/trace/hook_record.lua
>
> diff --git a/test/LuaJIT-tests/misc/hook_record.lua b/test/LuaJIT-tests/misc/hook_record.lua
> deleted file mode 100644
> index 6f1646de..00000000
> --- a/test/LuaJIT-tests/misc/hook_record.lua
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -
> -if not jit or not jit.status or not jit.status() then return end
> -
> -debug.sethook(function() for i=1,100 do end end, "", 10)
> -for i=1,10 do end
> -debug.sethook()
> -assert((require("jit.util").traceinfo(1)))
> -
> diff --git a/test/LuaJIT-tests/trace/hook_record.lua b/test/LuaJIT-tests/trace/hook_record.lua
> new file mode 100644
> index 00000000..684e1139
> --- /dev/null
> +++ b/test/LuaJIT-tests/trace/hook_record.lua
> @@ -0,0 +1,7 @@
> +do --- Recording traces inside the hook.
> + jit.flush()
> + debug.sethook(function() for _ = 1, 1000 do end end, "", 10)
> + for _ = 1, 10 do end
> + debug.sethook()
> + assert((require("jit.util").traceinfo(1)))
> +end
> diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
> index 595a71d2..63af7870 100644
> --- a/test/LuaJIT-tests/trace/index
> +++ b/test/LuaJIT-tests/trace/index
> @@ -4,6 +4,7 @@ exit_jfuncf.lua
> gc.lua
> gc64_slot_revival.lua
> hook_norecord.lua
> +hook_record.lua
> phi
> snap.lua
> stitch.lua
[-- Attachment #2: Type: text/html, Size: 2729 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 19/45] test: enable <misc/hook_record.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 19/45] test: enable <misc/hook_record.lua> " Sergey Kaplun via Tarantool-patches
2024-08-23 15:12 ` Sergey Bronnikov via Tarantool-patches
2024-08-23 15:15 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:12 ` Maxim Kokryashkin via Tarantool-patches
2 siblings, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:12 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 20/45] test: enable <misc/hook_top.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (18 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 19/45] test: enable <misc/hook_record.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-23 15:17 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:13 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 21/45] test: enable <misc/jit_flush.lua> " Sergey Kaplun via Tarantool-patches
` (26 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory, includes it in <index>, and names the subtests.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/hook_top.lua | 59 +++++++++++++++++++++++++++++
test/LuaJIT-tests/lang/index | 1 +
test/LuaJIT-tests/misc/hook_top.lua | 55 ---------------------------
3 files changed, 60 insertions(+), 55 deletions(-)
create mode 100644 test/LuaJIT-tests/lang/hook_top.lua
delete mode 100644 test/LuaJIT-tests/misc/hook_top.lua
diff --git a/test/LuaJIT-tests/lang/hook_top.lua b/test/LuaJIT-tests/lang/hook_top.lua
new file mode 100644
index 00000000..4cab2559
--- /dev/null
+++ b/test/LuaJIT-tests/lang/hook_top.lua
@@ -0,0 +1,59 @@
+local t = {}
+for i = 1, 26 do t[i] = string.char(96 + i) end
+
+local function tcheck(t1, t2)
+ assert(#t1 == #t2)
+ for i = 1, #t1 do assert(t1[i] == t2[i]) end
+end
+
+local function foo1(...) -- VARG RETM
+ return ...
+end
+
+local function foo2(...) -- VARG UCLO RETM
+ local function dummy() end
+ return ...
+end
+
+local function foo3(...) -- VARG UCLO -> RETM
+ do return ... end
+ local function dummy() end
+end
+
+local function foo4() -- UCLO UCLO RET
+ do
+ local x
+ local function dummy() return x end
+ end
+end
+
+local function foo5(a)
+ assert(a == "bar")
+end
+
+do --- Run hook on each bytecode instruction.
+ local called = false
+ debug.sethook(function() local x = "wrong"; called = true end, "", 1)
+ tcheck(t, {foo1(unpack(t))}) -- CALLM TSETM
+ assert(called)
+ called = false
+ tcheck(t, {foo2(unpack(t))})
+ assert(called)
+ called = false
+ tcheck(t, {foo3(unpack(t))})
+ assert(called)
+ called = false
+ foo4()
+ assert(called)
+ debug.sethook(nil)
+end
+
+do --- Set local variable given to a function inside the hook.
+ debug.sethook(function()
+ local name, val = debug.getlocal(2, 1)
+ assert(name == "a" and val == nil)
+ debug.setlocal(2, 1, "bar")
+ debug.sethook(nil)
+ end, "c")
+ foo5()
+end
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index ae59bc56..327b40fe 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -10,6 +10,7 @@ dualnum.lua
for.lua
hook_active.lua
hook_line.lua
+hook_top.lua
length.lua
lightud.lua
modulo.lua
diff --git a/test/LuaJIT-tests/misc/hook_top.lua b/test/LuaJIT-tests/misc/hook_top.lua
deleted file mode 100644
index f809fcea..00000000
--- a/test/LuaJIT-tests/misc/hook_top.lua
+++ /dev/null
@@ -1,55 +0,0 @@
-
-local t = {}
-for i=1,26 do t[i] = string.char(96+i) end
-
-local function tcheck(t1, t2)
- assert(#t1 == #t2)
- for i=1,#t1 do assert(t1[i] == t2[i]) end
-end
-
-local function foo1(...) -- VARG RETM
- return ...
-end
-
-local function foo2(...) -- VARG UCLO RETM
- local function dummy() end
- return ...
-end
-
-local function foo3(...) -- VARG UCLO -> RETM
- do return ... end
- local function dummy() end
-end
-
-local function foo4() -- UCLO UCLO RET
- do
- local x
- local function dummy() return x end
- end
-end
-
-called = false
-debug.sethook(function() local x = "wrong"; called = true end, "", 1)
-tcheck(t, {foo1(unpack(t))}) -- CALLM TSETM
-assert(called)
-called = false
-tcheck(t, {foo2(unpack(t))})
-assert(called)
-called = false
-tcheck(t, {foo2(unpack(t))})
-assert(called)
-called = false
-foo4()
-assert(called)
-
-debug.sethook(function()
- local name, val = debug.getlocal(2, 1)
- assert(name == "a" and val == nil)
- debug.setlocal(2, 1, "bar")
- debug.sethook(nil)
-end, "c")
-local function foo5(a)
- assert(a == "bar")
-end
-foo5()
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 20/45] test: enable <misc/hook_top.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 20/45] test: enable <misc/hook_top.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-23 15:17 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:13 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-23 15:17 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 3987 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory, includes it in <index>, and names the subtests.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/lang/hook_top.lua | 59 +++++++++++++++++++++++++++++
> test/LuaJIT-tests/lang/index | 1 +
> test/LuaJIT-tests/misc/hook_top.lua | 55 ---------------------------
> 3 files changed, 60 insertions(+), 55 deletions(-)
> create mode 100644 test/LuaJIT-tests/lang/hook_top.lua
> delete mode 100644 test/LuaJIT-tests/misc/hook_top.lua
>
> diff --git a/test/LuaJIT-tests/lang/hook_top.lua b/test/LuaJIT-tests/lang/hook_top.lua
> new file mode 100644
> index 00000000..4cab2559
> --- /dev/null
> +++ b/test/LuaJIT-tests/lang/hook_top.lua
> @@ -0,0 +1,59 @@
> +local t = {}
> +for i = 1, 26 do t[i] = string.char(96 + i) end
> +
> +local function tcheck(t1, t2)
> + assert(#t1 == #t2)
> + for i = 1, #t1 do assert(t1[i] == t2[i]) end
> +end
> +
> +local function foo1(...) -- VARG RETM
> + return ...
> +end
> +
> +local function foo2(...) -- VARG UCLO RETM
> + local function dummy() end
> + return ...
> +end
> +
> +local function foo3(...) -- VARG UCLO -> RETM
> + do return ... end
> + local function dummy() end
> +end
> +
> +local function foo4() -- UCLO UCLO RET
> + do
> + local x
> + local function dummy() return x end
> + end
> +end
> +
> +local function foo5(a)
> + assert(a == "bar")
> +end
> +
> +do --- Run hook on each bytecode instruction.
> + local called = false
> + debug.sethook(function() local x = "wrong"; called = true end, "", 1)
> + tcheck(t, {foo1(unpack(t))}) -- CALLM TSETM
> + assert(called)
> + called = false
> + tcheck(t, {foo2(unpack(t))})
> + assert(called)
> + called = false
> + tcheck(t, {foo3(unpack(t))})
> + assert(called)
> + called = false
> + foo4()
> + assert(called)
> + debug.sethook(nil)
> +end
> +
> +do --- Set local variable given to a function inside the hook.
> + debug.sethook(function()
> + local name, val = debug.getlocal(2, 1)
> + assert(name == "a" and val == nil)
> + debug.setlocal(2, 1, "bar")
> + debug.sethook(nil)
> + end, "c")
> + foo5()
> +end
> diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> index ae59bc56..327b40fe 100644
> --- a/test/LuaJIT-tests/lang/index
> +++ b/test/LuaJIT-tests/lang/index
> @@ -10,6 +10,7 @@ dualnum.lua
> for.lua
> hook_active.lua
> hook_line.lua
> +hook_top.lua
> length.lua
> lightud.lua
> modulo.lua
> diff --git a/test/LuaJIT-tests/misc/hook_top.lua b/test/LuaJIT-tests/misc/hook_top.lua
> deleted file mode 100644
> index f809fcea..00000000
> --- a/test/LuaJIT-tests/misc/hook_top.lua
> +++ /dev/null
> @@ -1,55 +0,0 @@
> -
> -local t = {}
> -for i=1,26 do t[i] = string.char(96+i) end
> -
> -local function tcheck(t1, t2)
> - assert(#t1 == #t2)
> - for i=1,#t1 do assert(t1[i] == t2[i]) end
> -end
> -
> -local function foo1(...) -- VARG RETM
> - return ...
> -end
> -
> -local function foo2(...) -- VARG UCLO RETM
> - local function dummy() end
> - return ...
> -end
> -
> -local function foo3(...) -- VARG UCLO -> RETM
> - do return ... end
> - local function dummy() end
> -end
> -
> -local function foo4() -- UCLO UCLO RET
> - do
> - local x
> - local function dummy() return x end
> - end
> -end
> -
> -called = false
> -debug.sethook(function() local x = "wrong"; called = true end, "", 1)
> -tcheck(t, {foo1(unpack(t))}) -- CALLM TSETM
> -assert(called)
> -called = false
> -tcheck(t, {foo2(unpack(t))})
> -assert(called)
> -called = false
> -tcheck(t, {foo2(unpack(t))})
> -assert(called)
> -called = false
> -foo4()
> -assert(called)
> -
> -debug.sethook(function()
> - local name, val = debug.getlocal(2, 1)
> - assert(name == "a" and val == nil)
> - debug.setlocal(2, 1, "bar")
> - debug.sethook(nil)
> -end, "c")
> -local function foo5(a)
> - assert(a == "bar")
> -end
> -foo5()
> -
[-- Attachment #2: Type: text/html, Size: 4378 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 20/45] test: enable <misc/hook_top.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 20/45] test: enable <misc/hook_top.lua> " Sergey Kaplun via Tarantool-patches
2024-08-23 15:17 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:13 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:13 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 21/45] test: enable <misc/jit_flush.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (19 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 20/45] test: enable <misc/hook_top.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-23 15:30 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:14 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 22/45] test: remove <misc/loop_unroll.lua> " Sergey Kaplun via Tarantool-patches
` (25 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names subtests.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/jit_flush.lua | 50 --------------------
test/LuaJIT-tests/trace/index | 1 +
test/LuaJIT-tests/trace/jit_flush.lua | 66 +++++++++++++++++++++++++++
3 files changed, 67 insertions(+), 50 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/jit_flush.lua
create mode 100644 test/LuaJIT-tests/trace/jit_flush.lua
diff --git a/test/LuaJIT-tests/misc/jit_flush.lua b/test/LuaJIT-tests/misc/jit_flush.lua
deleted file mode 100644
index ead1e4e9..00000000
--- a/test/LuaJIT-tests/misc/jit_flush.lua
+++ /dev/null
@@ -1,50 +0,0 @@
-
-if not jit or not jit.status or not jit.status() then return end
-
-for i=1,100 do
- if i==50 then jit.flush(2) end
- for j=1,100 do end
- for j=1,100 do end
-end
-
-jit.flush()
-
-local function f() for i=1,100 do end end
-for i=1,100 do local x = gcinfo(); f() end
-
-jit.flush()
-
-local function fib(n)
- if n < 2 then return 1 end
- return fib(n-2) + fib(n-1)
-end
-
-fib(11)
-
-jit.flush()
-
-local names = {}
-for i=1,100 do names[i] = i end
-
-function f()
- for k,v in ipairs(names) do end
-end
-
-f()
-
-for i=1,2 do
- f()
- f()
- jit.flush()
-end
-
-jit.flush()
-
-jit.flush(1) -- ignored
-jit.flush(2) -- ignored
-for i=1,1e7 do end -- causes trace #1
-
-jit.flush(2) -- ignored
-jit.flush(1) -- ok
-jit.flush(1) -- crashes
-
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index 63af7870..3ab095a7 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -5,6 +5,7 @@ gc.lua
gc64_slot_revival.lua
hook_norecord.lua
hook_record.lua
+jit_flush.lua
phi
snap.lua
stitch.lua
diff --git a/test/LuaJIT-tests/trace/jit_flush.lua b/test/LuaJIT-tests/trace/jit_flush.lua
new file mode 100644
index 00000000..a995921e
--- /dev/null
+++ b/test/LuaJIT-tests/trace/jit_flush.lua
@@ -0,0 +1,66 @@
+do --- Flushing a trace that is a link for another trace.
+ -- TRACE 3 stop -> 2
+ jit.flush()
+ for i = 1, 100 do
+ if i == 50 then jit.flush(2) end
+ for _ = 1, 100 do end
+ for _ = 1, 100 do end
+ end
+
+ jit.flush()
+end
+
+do --- Flushing stitched trace.
+ jit.flush()
+ local function f() for _ = 1, 100 do end end
+ for _ = 1, 100 do local x = gcinfo(); f() end
+
+ jit.flush()
+end
+
+do --- Flushing trace with up-recursion.
+ jit.flush()
+
+ local function fib(n)
+ if n < 2 then return 1 end
+ return fib(n - 2) + fib(n - 1)
+ end
+
+ fib(11)
+
+ jit.flush()
+end
+
+do --- Flush in the loop.
+ jit.flush()
+
+ local names = {}
+ for i = 1, 100 do names[i] = i end
+
+ local function f()
+ for k, v in ipairs(names) do end
+ end
+
+ f()
+
+ for _ = 1, 2 do
+ f()
+ f()
+ jit.flush()
+ end
+
+ jit.flush()
+end
+
+
+do --- Flushes of not existed traces.
+ jit.flush()
+
+ jit.flush(1) -- ignored
+ jit.flush(2) -- ignored
+ for _ = 1, 1e7 do end -- causes trace #1
+
+ jit.flush(2) -- ignored
+ jit.flush(1) -- ok
+ jit.flush(1) -- crashes
+end
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 21/45] test: enable <misc/jit_flush.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 21/45] test: enable <misc/jit_flush.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-23 15:30 ` Sergey Bronnikov via Tarantool-patches
2024-08-26 6:50 ` Sergey Kaplun via Tarantool-patches
2024-09-04 23:14 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-23 15:30 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 3550 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <trace/>
> directory, includes it in <index>, and names subtests.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM with a minor comment
> test/LuaJIT-tests/misc/jit_flush.lua | 50 --------------------
> test/LuaJIT-tests/trace/index | 1 +
> test/LuaJIT-tests/trace/jit_flush.lua | 66 +++++++++++++++++++++++++++
> 3 files changed, 67 insertions(+), 50 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/jit_flush.lua
> create mode 100644 test/LuaJIT-tests/trace/jit_flush.lua
>
> diff --git a/test/LuaJIT-tests/misc/jit_flush.lua b/test/LuaJIT-tests/misc/jit_flush.lua
> deleted file mode 100644
> index ead1e4e9..00000000
> --- a/test/LuaJIT-tests/misc/jit_flush.lua
> +++ /dev/null
> @@ -1,50 +0,0 @@
> -
> -if not jit or not jit.status or not jit.status() then return end
> -
> -for i=1,100 do
> - if i==50 then jit.flush(2) end
> - for j=1,100 do end
> - for j=1,100 do end
> -end
> -
> -jit.flush()
> -
> -local function f() for i=1,100 do end end
> -for i=1,100 do local x = gcinfo(); f() end
> -
> -jit.flush()
> -
> -local function fib(n)
> - if n < 2 then return 1 end
> - return fib(n-2) + fib(n-1)
> -end
> -
> -fib(11)
> -
> -jit.flush()
> -
> -local names = {}
> -for i=1,100 do names[i] = i end
> -
> -function f()
> - for k,v in ipairs(names) do end
> -end
> -
> -f()
> -
> -for i=1,2 do
> - f()
> - f()
> - jit.flush()
> -end
> -
> -jit.flush()
> -
> -jit.flush(1) -- ignored
> -jit.flush(2) -- ignored
> -for i=1,1e7 do end -- causes trace #1
> -
> -jit.flush(2) -- ignored
> -jit.flush(1) -- ok
> -jit.flush(1) -- crashes
> -
> diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
> index 63af7870..3ab095a7 100644
> --- a/test/LuaJIT-tests/trace/index
> +++ b/test/LuaJIT-tests/trace/index
> @@ -5,6 +5,7 @@ gc.lua
> gc64_slot_revival.lua
> hook_norecord.lua
> hook_record.lua
> +jit_flush.lua
> phi
> snap.lua
> stitch.lua
> diff --git a/test/LuaJIT-tests/trace/jit_flush.lua b/test/LuaJIT-tests/trace/jit_flush.lua
> new file mode 100644
> index 00000000..a995921e
> --- /dev/null
> +++ b/test/LuaJIT-tests/trace/jit_flush.lua
> @@ -0,0 +1,66 @@
> +do --- Flushing a trace that is a link for another trace.
> + -- TRACE 3 stop -> 2
> + jit.flush()
> + for i = 1, 100 do
> + if i == 50 then jit.flush(2) end
> + for _ = 1, 100 do end
> + for _ = 1, 100 do end
> + end
> +
> + jit.flush()
> +end
> +
> +do --- Flushing stitched trace.
> + jit.flush()
> + local function f() for _ = 1, 100 do end end
> + for _ = 1, 100 do local x = gcinfo(); f() end
> +
> + jit.flush()
> +end
> +
> +do --- Flushing trace with up-recursion.
> + jit.flush()
> +
> + local function fib(n)
> + if n < 2 then return 1 end
> + return fib(n - 2) + fib(n - 1)
> + end
> +
> + fib(11)
> +
> + jit.flush()
> +end
> +
> +do --- Flush in the loop.
> + jit.flush()
> +
> + local names = {}
> + for i = 1, 100 do names[i] = i end
> +
> + local function f()
> + for k, v in ipairs(names) do end
> + end
> +
> + f()
> +
> + for _ = 1, 2 do
> + f()
> + f()
> + jit.flush()
> + end
> +
> + jit.flush()
> +end
> +
> +
please remove excess newline
> +do --- Flushes of not existed traces.
> + jit.flush()
> +
> + jit.flush(1) -- ignored
> + jit.flush(2) -- ignored
> + for _ = 1, 1e7 do end -- causes trace #1
> +
> + jit.flush(2) -- ignored
> + jit.flush(1) -- ok
> + jit.flush(1) -- crashes
> +end
[-- Attachment #2: Type: text/html, Size: 4143 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 21/45] test: enable <misc/jit_flush.lua> LuaJIT test
2024-08-23 15:30 ` Sergey Bronnikov via Tarantool-patches
@ 2024-08-26 6:50 ` Sergey Kaplun via Tarantool-patches
2024-08-29 9:44 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 1 reply; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-26 6:50 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the review!
Fixed your comments and force-pushed the branch.
On 23.08.24, Sergey Bronnikov wrote:
> Sergey,
>
>
> On 21.08.2024 11:58, Sergey Kaplun wrote:
> > This patch moves the aforementioned test from the <misc> to the <trace/>
> > directory, includes it in <index>, and names subtests.
> >
> > Part of tarantool/tarantool#9398
> > ---
> thanks for the patch! LGTM with a minor comment
<snipped>
> > diff --git a/test/LuaJIT-tests/trace/jit_flush.lua b/test/LuaJIT-tests/trace/jit_flush.lua
> > new file mode 100644
> > index 00000000..a995921e
> > --- /dev/null
> > +++ b/test/LuaJIT-tests/trace/jit_flush.lua
<snipped>
> > +
> > +
> please remove excess newline
Fixed, thanks!
See the iterative patch below.
===================================================================
diff --git a/test/LuaJIT-tests/trace/jit_flush.lua b/test/LuaJIT-tests/trace/jit_flush.lua
index a995921e..4cdf2c39 100644
--- a/test/LuaJIT-tests/trace/jit_flush.lua
+++ b/test/LuaJIT-tests/trace/jit_flush.lua
@@ -52,7 +52,6 @@ do --- Flush in the loop.
jit.flush()
end
-
do --- Flushes of not existed traces.
jit.flush()
===================================================================
> > +do --- Flushes of not existed traces.
> > + jit.flush()
> > +
> > + jit.flush(1) -- ignored
> > + jit.flush(2) -- ignored
> > + for _ = 1, 1e7 do end -- causes trace #1
> > +
> > + jit.flush(2) -- ignored
> > + jit.flush(1) -- ok
> > + jit.flush(1) -- crashes
> > +end
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 21/45] test: enable <misc/jit_flush.lua> LuaJIT test
2024-08-26 6:50 ` Sergey Kaplun via Tarantool-patches
@ 2024-08-29 9:44 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-29 9:44 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1638 bytes --]
Hi, Sergey,
thanks for the fixes! LGTM
On 26.08.2024 09:50, Sergey Kaplun wrote:
> Hi, Sergey!
> Thanks for the review!
> Fixed your comments and force-pushed the branch.
>
> On 23.08.24, Sergey Bronnikov wrote:
>> Sergey,
>>
>>
>> On 21.08.2024 11:58, Sergey Kaplun wrote:
>>> This patch moves the aforementioned test from the <misc> to the <trace/>
>>> directory, includes it in <index>, and names subtests.
>>>
>>> Part of tarantool/tarantool#9398
>>> ---
>> thanks for the patch! LGTM with a minor comment
> <snipped>
>
>>> diff --git a/test/LuaJIT-tests/trace/jit_flush.lua b/test/LuaJIT-tests/trace/jit_flush.lua
>>> new file mode 100644
>>> index 00000000..a995921e
>>> --- /dev/null
>>> +++ b/test/LuaJIT-tests/trace/jit_flush.lua
> <snipped>
>
>>> +
>>> +
>> please remove excess newline
> Fixed, thanks!
> See the iterative patch below.
>
> ===================================================================
> diff --git a/test/LuaJIT-tests/trace/jit_flush.lua b/test/LuaJIT-tests/trace/jit_flush.lua
> index a995921e..4cdf2c39 100644
> --- a/test/LuaJIT-tests/trace/jit_flush.lua
> +++ b/test/LuaJIT-tests/trace/jit_flush.lua
> @@ -52,7 +52,6 @@ do --- Flush in the loop.
> jit.flush()
> end
>
> -
> do --- Flushes of not existed traces.
> jit.flush()
>
> ===================================================================
>
>>> +do --- Flushes of not existed traces.
>>> + jit.flush()
>>> +
>>> + jit.flush(1) -- ignored
>>> + jit.flush(2) -- ignored
>>> + for _ = 1, 1e7 do end -- causes trace #1
>>> +
>>> + jit.flush(2) -- ignored
>>> + jit.flush(1) -- ok
>>> + jit.flush(1) -- crashes
>>> +end
[-- Attachment #2: Type: text/html, Size: 2923 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 21/45] test: enable <misc/jit_flush.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 21/45] test: enable <misc/jit_flush.lua> " Sergey Kaplun via Tarantool-patches
2024-08-23 15:30 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:14 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:14 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 22/45] test: remove <misc/loop_unroll.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (20 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 21/45] test: enable <misc/jit_flush.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 12:33 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:14 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 23/45] test: enable <misc/parse_comp.lua> " Sergey Kaplun via Tarantool-patches
` (24 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch removes the aforementioned test since it is part of the
<opt/loop/unroll.lua> test.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/loop_unroll.lua | 35 --------------------------
1 file changed, 35 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/loop_unroll.lua
diff --git a/test/LuaJIT-tests/misc/loop_unroll.lua b/test/LuaJIT-tests/misc/loop_unroll.lua
deleted file mode 100644
index 1700fac9..00000000
--- a/test/LuaJIT-tests/misc/loop_unroll.lua
+++ /dev/null
@@ -1,35 +0,0 @@
-
--- type instability on loop unroll -> record unroll
-do
- local flip = true
- for i=1,100 do flip = not flip end
- assert(flip == true)
-end
-
-do
- local t = {}
- local a, b, c = 1, "", t
- for i=1,100 do a,b,c=b,c,a end
- assert(c == 1 and a == "" and b == t)
-end
-
--- FAILFOLD on loop unroll -> LJ_TRERR_GFAIL -> record unroll
-do
- local t = { 1, 2 }
- local k = 2
- local x = 0
- for i=1,200 do
- x = x + t[k]
- k = k == 1 and 2 or 1
- end
- assert(x == 300 and k == 2)
-end
-
--- Unroll if inner loop aborts.
-local j = 0
-for i = 1,100 do
- repeat
- j = j+1
- until true
-end
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 22/45] test: remove <misc/loop_unroll.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 22/45] test: remove <misc/loop_unroll.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 12:33 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:14 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 12:33 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch removes the aforementioned test since it is part of the
> <opt/loop/unroll.lua> test.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/misc/loop_unroll.lua | 35 --------------------------
> 1 file changed, 35 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/loop_unroll.lua
>
> diff --git a/test/LuaJIT-tests/misc/loop_unroll.lua b/test/LuaJIT-tests/misc/loop_unroll.lua
> deleted file mode 100644
> index 1700fac9..00000000
> --- a/test/LuaJIT-tests/misc/loop_unroll.lua
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -
> --- type instability on loop unroll -> record unroll
> -do
> - local flip = true
> - for i=1,100 do flip = not flip end
> - assert(flip == true)
> -end
> -
> -do
> - local t = {}
> - local a, b, c = 1, "", t
> - for i=1,100 do a,b,c=b,c,a end
> - assert(c == 1 and a == "" and b == t)
> -end
> -
> --- FAILFOLD on loop unroll -> LJ_TRERR_GFAIL -> record unroll
> -do
> - local t = { 1, 2 }
> - local k = 2
> - local x = 0
> - for i=1,200 do
> - x = x + t[k]
> - k = k == 1 and 2 or 1
> - end
> - assert(x == 300 and k == 2)
> -end
> -
> --- Unroll if inner loop aborts.
> -local j = 0
> -for i = 1,100 do
> - repeat
> - j = j+1
> - until true
> -end
> -
[-- Attachment #2: Type: text/html, Size: 1912 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 22/45] test: remove <misc/loop_unroll.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 22/45] test: remove <misc/loop_unroll.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 12:33 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:14 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:14 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 23/45] test: enable <misc/parse_comp.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (21 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 22/45] test: remove <misc/loop_unroll.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:07 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:14 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 24/45] test: enable <misc/parse_esc.lua> " Sergey Kaplun via Tarantool-patches
` (23 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory, includes it in <index>, and names the subtests.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/index | 1 +
test/LuaJIT-tests/lang/parse_comp.lua | 12 ++++++++++++
test/LuaJIT-tests/misc/parse_comp.lua | 13 -------------
3 files changed, 13 insertions(+), 13 deletions(-)
create mode 100644 test/LuaJIT-tests/lang/parse_comp.lua
delete mode 100644 test/LuaJIT-tests/misc/parse_comp.lua
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 327b40fe..371a5768 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -17,6 +17,7 @@ modulo.lua
concat.lua
self.lua
table.lua
+parse_comp.lua
upvalue
tail_recursion.lua
vararg_jit.lua
diff --git a/test/LuaJIT-tests/lang/parse_comp.lua b/test/LuaJIT-tests/lang/parse_comp.lua
new file mode 100644
index 00000000..ee6a74de
--- /dev/null
+++ b/test/LuaJIT-tests/lang/parse_comp.lua
@@ -0,0 +1,12 @@
+do --- Parse inline comparisions expressions, base.
+ local f = {{n = 5}}
+ local a = f[1].n
+ assert(1 < a)
+ assert(1 < (f[1].n))
+ assert(1 < f[1].n)
+end
+
+do --- Parse inline comparisions expressions with not.
+ local tt = { a = 1 }
+ assert(not(0 >= tt.a))
+end
diff --git a/test/LuaJIT-tests/misc/parse_comp.lua b/test/LuaJIT-tests/misc/parse_comp.lua
deleted file mode 100644
index 5e1948da..00000000
--- a/test/LuaJIT-tests/misc/parse_comp.lua
+++ /dev/null
@@ -1,13 +0,0 @@
-
-do
- local f = {{n=5}}
- local a = f[1].n
- assert(1 < a)
- assert(1 < (f[1].n))
- assert(1 < f[1].n)
-end
-
-do
- tt = { a = 1 }
- assert(not(0 >= tt.a))
-end
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 23/45] test: enable <misc/parse_comp.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 23/45] test: enable <misc/parse_comp.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:07 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:14 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:07 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1881 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory, includes it in <index>, and names the subtests.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/lang/index | 1 +
> test/LuaJIT-tests/lang/parse_comp.lua | 12 ++++++++++++
> test/LuaJIT-tests/misc/parse_comp.lua | 13 -------------
> 3 files changed, 13 insertions(+), 13 deletions(-)
> create mode 100644 test/LuaJIT-tests/lang/parse_comp.lua
> delete mode 100644 test/LuaJIT-tests/misc/parse_comp.lua
>
> diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> index 327b40fe..371a5768 100644
> --- a/test/LuaJIT-tests/lang/index
> +++ b/test/LuaJIT-tests/lang/index
> @@ -17,6 +17,7 @@ modulo.lua
> concat.lua
> self.lua
> table.lua
> +parse_comp.lua
> upvalue
> tail_recursion.lua
> vararg_jit.lua
> diff --git a/test/LuaJIT-tests/lang/parse_comp.lua b/test/LuaJIT-tests/lang/parse_comp.lua
> new file mode 100644
> index 00000000..ee6a74de
> --- /dev/null
> +++ b/test/LuaJIT-tests/lang/parse_comp.lua
> @@ -0,0 +1,12 @@
> +do --- Parse inline comparisions expressions, base.
> + local f = {{n = 5}}
> + local a = f[1].n
> + assert(1 < a)
> + assert(1 < (f[1].n))
> + assert(1 < f[1].n)
> +end
> +
> +do --- Parse inline comparisions expressions with not.
> + local tt = { a = 1 }
> + assert(not(0 >= tt.a))
> +end
> diff --git a/test/LuaJIT-tests/misc/parse_comp.lua b/test/LuaJIT-tests/misc/parse_comp.lua
> deleted file mode 100644
> index 5e1948da..00000000
> --- a/test/LuaJIT-tests/misc/parse_comp.lua
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -
> -do
> - local f = {{n=5}}
> - local a = f[1].n
> - assert(1 < a)
> - assert(1 < (f[1].n))
> - assert(1 < f[1].n)
> -end
> -
> -do
> - tt = { a = 1 }
> - assert(not(0 >= tt.a))
> -end
[-- Attachment #2: Type: text/html, Size: 2464 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 23/45] test: enable <misc/parse_comp.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 23/45] test: enable <misc/parse_comp.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:07 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:14 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:14 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 24/45] test: enable <misc/parse_esc.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (22 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 23/45] test: enable <misc/parse_comp.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:28 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:14 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 25/45] test: enable <misc/parse_misc.lua> " Sergey Kaplun via Tarantool-patches
` (22 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory, includes it in <index>, and names the subtest.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/index | 1 +
test/LuaJIT-tests/lang/parse_esc.lua | 10 ++++++++++
test/LuaJIT-tests/misc/parse_esc.lua | 7 -------
3 files changed, 11 insertions(+), 7 deletions(-)
create mode 100644 test/LuaJIT-tests/lang/parse_esc.lua
delete mode 100644 test/LuaJIT-tests/misc/parse_esc.lua
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 371a5768..0d1175a8 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -18,6 +18,7 @@ concat.lua
self.lua
table.lua
parse_comp.lua
+parse_esc.lua
upvalue
tail_recursion.lua
vararg_jit.lua
diff --git a/test/LuaJIT-tests/lang/parse_esc.lua b/test/LuaJIT-tests/lang/parse_esc.lua
new file mode 100644
index 00000000..c14d347a
--- /dev/null
+++ b/test/LuaJIT-tests/lang/parse_esc.lua
@@ -0,0 +1,10 @@
+do --- Base parsing of escape sequences.
+ assert("\79\126" == "O~")
+ assert("\x4f\x7e" == "O~")
+ assert(loadstring[[return "\xxx"]] == nil)
+ assert(loadstring[[return "\xxx"]] == nil)
+
+ assert(assert(loadstring[[return "abc \z
+
+ def"]])() == "abc def")
+end
diff --git a/test/LuaJIT-tests/misc/parse_esc.lua b/test/LuaJIT-tests/misc/parse_esc.lua
deleted file mode 100644
index 4bcce0e8..00000000
--- a/test/LuaJIT-tests/misc/parse_esc.lua
+++ /dev/null
@@ -1,7 +0,0 @@
-assert("\79\126" == "O~")
-assert("\x4f\x7e" == "O~")
-assert(loadstring[[return "\xxx"]] == nil)
-assert(loadstring[[return "\xxx"]] == nil)
-assert(assert(loadstring[[return "abc \z
-
- def"]])() == "abc def")
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 24/45] test: enable <misc/parse_esc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 24/45] test: enable <misc/parse_esc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:28 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:14 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:28 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1898 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory, includes it in <index>, and names the subtest.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/lang/index | 1 +
> test/LuaJIT-tests/lang/parse_esc.lua | 10 ++++++++++
> test/LuaJIT-tests/misc/parse_esc.lua | 7 -------
> 3 files changed, 11 insertions(+), 7 deletions(-)
> create mode 100644 test/LuaJIT-tests/lang/parse_esc.lua
> delete mode 100644 test/LuaJIT-tests/misc/parse_esc.lua
>
> diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> index 371a5768..0d1175a8 100644
> --- a/test/LuaJIT-tests/lang/index
> +++ b/test/LuaJIT-tests/lang/index
> @@ -18,6 +18,7 @@ concat.lua
> self.lua
> table.lua
> parse_comp.lua
> +parse_esc.lua
> upvalue
> tail_recursion.lua
> vararg_jit.lua
> diff --git a/test/LuaJIT-tests/lang/parse_esc.lua b/test/LuaJIT-tests/lang/parse_esc.lua
> new file mode 100644
> index 00000000..c14d347a
> --- /dev/null
> +++ b/test/LuaJIT-tests/lang/parse_esc.lua
> @@ -0,0 +1,10 @@
> +do --- Base parsing of escape sequences.
> + assert("\79\126" == "O~")
> + assert("\x4f\x7e" == "O~")
> + assert(loadstring[[return "\xxx"]] == nil)
> + assert(loadstring[[return "\xxx"]] == nil)
> +
> + assert(assert(loadstring[[return "abc \z
> +
> + def"]])() == "abc def")
> +end
> diff --git a/test/LuaJIT-tests/misc/parse_esc.lua b/test/LuaJIT-tests/misc/parse_esc.lua
> deleted file mode 100644
> index 4bcce0e8..00000000
> --- a/test/LuaJIT-tests/misc/parse_esc.lua
> +++ /dev/null
> @@ -1,7 +0,0 @@
> -assert("\79\126" == "O~")
> -assert("\x4f\x7e" == "O~")
> -assert(loadstring[[return "\xxx"]] == nil)
> -assert(loadstring[[return "\xxx"]] == nil)
> -assert(assert(loadstring[[return "abc \z
> -
> - def"]])() == "abc def")
[-- Attachment #2: Type: text/html, Size: 2477 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 24/45] test: enable <misc/parse_esc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 24/45] test: enable <misc/parse_esc.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:28 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:14 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:14 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 25/45] test: enable <misc/parse_misc.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (23 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 24/45] test: enable <misc/parse_esc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:31 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:15 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 26/45] test: enable <misc/phi_conv.lua> " Sergey Kaplun via Tarantool-patches
` (21 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory, includes it in <index>, names the subtests, and adds checks
for the Lua version.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/index | 1 +
test/LuaJIT-tests/lang/parse_misc.lua | 31 +++++++++++++++++++++++++++
test/LuaJIT-tests/misc/parse_misc.lua | 31 ---------------------------
3 files changed, 32 insertions(+), 31 deletions(-)
create mode 100644 test/LuaJIT-tests/lang/parse_misc.lua
delete mode 100644 test/LuaJIT-tests/misc/parse_misc.lua
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 0d1175a8..726c8d16 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -19,6 +19,7 @@ self.lua
table.lua
parse_comp.lua
parse_esc.lua
+parse_misc.lua
upvalue
tail_recursion.lua
vararg_jit.lua
diff --git a/test/LuaJIT-tests/lang/parse_misc.lua b/test/LuaJIT-tests/lang/parse_misc.lua
new file mode 100644
index 00000000..c95758a3
--- /dev/null
+++ b/test/LuaJIT-tests/lang/parse_misc.lua
@@ -0,0 +1,31 @@
+do --- Ambiguous syntax: function call vs. new statement. +lua==5.2
+ assert(assert(loadstring([[
+ local function f() return 99 end
+ return f
+ ()
+ ]]))() == 99)
+end
+
+do --- Ambiguous syntax: function call vs. new statement. +lua<5.2
+ assert(loadstring([[
+ local function f() return 99 end
+ return f
+ ()
+ ]]) == nil)
+end
+
+do --- UTF-8 identifiers.
+ assert(loadstring([[
+ local ä = 1
+ local aäa = 2
+ local äöü·€晶 = 3
+
+ assert(ä == 1)
+ assert(aäa == 2)
+ assert(äöü·€晶 == 3)
+
+ assert(#"ä" == 2)
+ assert(#"aäa" == 4)
+ assert(#"äöü·€晶" == 14)
+ ]]))()
+end
diff --git a/test/LuaJIT-tests/misc/parse_misc.lua b/test/LuaJIT-tests/misc/parse_misc.lua
deleted file mode 100644
index 8031ec17..00000000
--- a/test/LuaJIT-tests/misc/parse_misc.lua
+++ /dev/null
@@ -1,31 +0,0 @@
-
--- Ambiguous syntax: function call vs. new statement.
-if os.getenv("LUA52") then
- assert(assert(loadstring([[
-local function f() return 99 end
-return f
-()
-]]))() == 99)
-else
- assert(loadstring([[
-local function f() return 99 end
-return f
-()
-]]) == nil)
-end
-
--- UTF-8 identifiers.
-assert(loadstring([[
-local ä = 1
-local aäa = 2
-local äöü·€晶 = 3
-
-assert(ä == 1)
-assert(aäa == 2)
-assert(äöü·€晶 == 3)
-
-assert(#"ä" == 2)
-assert(#"aäa" == 4)
-assert(#"äöü·€晶" == 14)
-]]))()
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 25/45] test: enable <misc/parse_misc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 25/45] test: enable <misc/parse_misc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:31 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:15 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:31 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2754 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory, includes it in <index>, names the subtests, and adds checks
> for the Lua version.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/lang/index | 1 +
> test/LuaJIT-tests/lang/parse_misc.lua | 31 +++++++++++++++++++++++++++
> test/LuaJIT-tests/misc/parse_misc.lua | 31 ---------------------------
> 3 files changed, 32 insertions(+), 31 deletions(-)
> create mode 100644 test/LuaJIT-tests/lang/parse_misc.lua
> delete mode 100644 test/LuaJIT-tests/misc/parse_misc.lua
>
> diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> index 0d1175a8..726c8d16 100644
> --- a/test/LuaJIT-tests/lang/index
> +++ b/test/LuaJIT-tests/lang/index
> @@ -19,6 +19,7 @@ self.lua
> table.lua
> parse_comp.lua
> parse_esc.lua
> +parse_misc.lua
> upvalue
> tail_recursion.lua
> vararg_jit.lua
> diff --git a/test/LuaJIT-tests/lang/parse_misc.lua b/test/LuaJIT-tests/lang/parse_misc.lua
> new file mode 100644
> index 00000000..c95758a3
> --- /dev/null
> +++ b/test/LuaJIT-tests/lang/parse_misc.lua
> @@ -0,0 +1,31 @@
> +do --- Ambiguous syntax: function call vs. new statement. +lua==5.2
> + assert(assert(loadstring([[
> + local function f() return 99 end
> + return f
> + ()
> + ]]))() == 99)
> +end
> +
> +do --- Ambiguous syntax: function call vs. new statement. +lua<5.2
> + assert(loadstring([[
> + local function f() return 99 end
> + return f
> + ()
> + ]]) == nil)
> +end
> +
> +do --- UTF-8 identifiers.
> + assert(loadstring([[
> + local ä = 1
> + local aäa = 2
> + local äöü·€晶 = 3
> +
> + assert(ä == 1)
> + assert(aäa == 2)
> + assert(äöü·€晶 == 3)
> +
> + assert(#"ä" == 2)
> + assert(#"aäa" == 4)
> + assert(#"äöü·€晶" == 14)
> + ]]))()
> +end
> diff --git a/test/LuaJIT-tests/misc/parse_misc.lua b/test/LuaJIT-tests/misc/parse_misc.lua
> deleted file mode 100644
> index 8031ec17..00000000
> --- a/test/LuaJIT-tests/misc/parse_misc.lua
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -
> --- Ambiguous syntax: function call vs. new statement.
> -if os.getenv("LUA52") then
> - assert(assert(loadstring([[
> -local function f() return 99 end
> -return f
> -()
> -]]))() == 99)
> -else
> - assert(loadstring([[
> -local function f() return 99 end
> -return f
> -()
> -]]) == nil)
> -end
> -
> --- UTF-8 identifiers.
> -assert(loadstring([[
> -local ä = 1
> -local aäa = 2
> -local äöü·€晶 = 3
> -
> -assert(ä == 1)
> -assert(aäa == 2)
> -assert(äöü·€晶 == 3)
> -
> -assert(#"ä" == 2)
> -assert(#"aäa" == 4)
> -assert(#"äöü·€晶" == 14)
> -]]))()
> -
[-- Attachment #2: Type: text/html, Size: 3251 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 25/45] test: enable <misc/parse_misc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 25/45] test: enable <misc/parse_misc.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:31 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:15 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:15 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 26/45] test: enable <misc/phi_conv.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (24 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 25/45] test: enable <misc/parse_misc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:39 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 27/45] test: refactor <trace/phi/conv.lua> " Sergey Kaplun via Tarantool-patches
` (20 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the
<trace/phi/> directory, includes it in <index>, and names the subtests.
Part of tarantool/tarantool#9398
---
.../{misc/phi_conv.lua => trace/phi/conv.lua} | 33 ++++++++++---------
test/LuaJIT-tests/trace/phi/index | 1 +
2 files changed, 19 insertions(+), 15 deletions(-)
rename test/LuaJIT-tests/{misc/phi_conv.lua => trace/phi/conv.lua} (69%)
diff --git a/test/LuaJIT-tests/misc/phi_conv.lua b/test/LuaJIT-tests/trace/phi/conv.lua
similarity index 69%
rename from test/LuaJIT-tests/misc/phi_conv.lua
rename to test/LuaJIT-tests/trace/phi/conv.lua
index 8d7bea5f..267423c2 100644
--- a/test/LuaJIT-tests/misc/phi_conv.lua
+++ b/test/LuaJIT-tests/trace/phi/conv.lua
@@ -1,18 +1,5 @@
-
local bit = require("bit")
-local Rm = {}
-for i=0,16 do Rm[i] = 0 end
-
-for k=1,10 do
- local seed = 1
- for i=16,0,-1 do
- seed = bit.band(seed*9069, 0x7fffffff)
- Rm[i] = seed
- end
- assert(seed == 1952688301)
-end
-
local retindex = 0
local retdata = { 3, 1, 1, 1, 0, 3, 1, 0, 0, 2, 0, 2, 0, 0, 3, 1, 1, 1, 1 }
@@ -47,7 +34,23 @@ local function test()
end
end
-if jit and jit.status and jit.status() then jit.opt.start("hotloop=1") end
+do --- PHI for CONV num.int before ASTORE.
+ local Rm = {}
+ for i=0,16 do Rm[i] = 0 end
-test()
+ for k=1,10 do
+ local seed = 1
+ for i=16,0,-1 do
+ seed = bit.band(seed*9069, 0x7fffffff)
+ Rm[i] = seed
+ end
+ assert(seed == 1952688301)
+ end
+end
+
+do --- PHI for CONV num.int of lookup.
+ jit.opt.start("hotloop=1")
+ test()
+ jit.opt.start("hotloop=56")
+end
diff --git a/test/LuaJIT-tests/trace/phi/index b/test/LuaJIT-tests/trace/phi/index
index 74a07333..a72d37a0 100644
--- a/test/LuaJIT-tests/trace/phi/index
+++ b/test/LuaJIT-tests/trace/phi/index
@@ -1,3 +1,4 @@
copyspill.lua
+conv.lua
ref.lua
rotate.lua
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 26/45] test: enable <misc/phi_conv.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 26/45] test: enable <misc/phi_conv.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:39 ` Sergey Bronnikov via Tarantool-patches
2024-08-22 13:41 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:39 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2221 bytes --]
Sergey,
thanks for the patch! LGTM with a minor comment below.
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the
> <trace/phi/> directory, includes it in <index>, and names the subtests.
>
> Part of tarantool/tarantool#9398
> ---
> .../{misc/phi_conv.lua => trace/phi/conv.lua} | 33 ++++++++++---------
> test/LuaJIT-tests/trace/phi/index | 1 +
> 2 files changed, 19 insertions(+), 15 deletions(-)
> rename test/LuaJIT-tests/{misc/phi_conv.lua => trace/phi/conv.lua} (69%)
>
> diff --git a/test/LuaJIT-tests/misc/phi_conv.lua b/test/LuaJIT-tests/trace/phi/conv.lua
> similarity index 69%
> rename from test/LuaJIT-tests/misc/phi_conv.lua
> rename to test/LuaJIT-tests/trace/phi/conv.lua
> index 8d7bea5f..267423c2 100644
> --- a/test/LuaJIT-tests/misc/phi_conv.lua
> +++ b/test/LuaJIT-tests/trace/phi/conv.lua
> @@ -1,18 +1,5 @@
> -
> local bit = require("bit")
>
> -local Rm = {}
> -for i=0,16 do Rm[i] = 0 end
> -
> -for k=1,10 do
> - local seed = 1
> - for i=16,0,-1 do
> - seed = bit.band(seed*9069, 0x7fffffff)
> - Rm[i] = seed
> - end
> - assert(seed == 1952688301)
> -end
> -
> local retindex = 0
> local retdata = { 3, 1, 1, 1, 0, 3, 1, 0, 0, 2, 0, 2, 0, 0, 3, 1, 1, 1, 1 }
>
> @@ -47,7 +34,23 @@ local function test()
> end
> end
>
> -if jit and jit.status and jit.status() then jit.opt.start("hotloop=1") end
> +do --- PHI for CONV num.int before ASTORE.
> + local Rm = {}
> + for i=0,16 do Rm[i] = 0 end
please add whitespaces
>
> -test()
> + for k=1,10 do
please add whitespaces
> + local seed = 1
> + for i=16,0,-1 do
please add whitespaces
> + seed = bit.band(seed*9069, 0x7fffffff)
> + Rm[i] = seed
> + end
> + assert(seed == 1952688301)
> + end
> +end
> +
> +do --- PHI for CONV num.int of lookup.
> + jit.opt.start("hotloop=1")
> + test()
> + jit.opt.start("hotloop=56")
> +end
>
> diff --git a/test/LuaJIT-tests/trace/phi/index b/test/LuaJIT-tests/trace/phi/index
> index 74a07333..a72d37a0 100644
> --- a/test/LuaJIT-tests/trace/phi/index
> +++ b/test/LuaJIT-tests/trace/phi/index
> @@ -1,3 +1,4 @@
> copyspill.lua
> +conv.lua
> ref.lua
> rotate.lua
[-- Attachment #2: Type: text/html, Size: 3151 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 26/45] test: enable <misc/phi_conv.lua> LuaJIT test
2024-08-22 13:39 ` Sergey Bronnikov via Tarantool-patches
@ 2024-08-22 13:41 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:41 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2453 bytes --]
On 22.08.2024 16:39, Sergey Bronnikov via Tarantool-patches wrote:
>
> Sergey,
>
> thanks for the patch! LGTM with a minor comment below.
>
please disregard comments, these issues were fixed in the following commit
>
> On 21.08.2024 11:58, Sergey Kaplun wrote:
>> This patch moves the aforementioned test from the <misc> to the
>> <trace/phi/> directory, includes it in <index>, and names the subtests.
>>
>> Part of tarantool/tarantool#9398
>> ---
>> .../{misc/phi_conv.lua => trace/phi/conv.lua} | 33 ++++++++++---------
>> test/LuaJIT-tests/trace/phi/index | 1 +
>> 2 files changed, 19 insertions(+), 15 deletions(-)
>> rename test/LuaJIT-tests/{misc/phi_conv.lua => trace/phi/conv.lua} (69%)
>>
>> diff --git a/test/LuaJIT-tests/misc/phi_conv.lua b/test/LuaJIT-tests/trace/phi/conv.lua
>> similarity index 69%
>> rename from test/LuaJIT-tests/misc/phi_conv.lua
>> rename to test/LuaJIT-tests/trace/phi/conv.lua
>> index 8d7bea5f..267423c2 100644
>> --- a/test/LuaJIT-tests/misc/phi_conv.lua
>> +++ b/test/LuaJIT-tests/trace/phi/conv.lua
>> @@ -1,18 +1,5 @@
>> -
>> local bit = require("bit")
>>
>> -local Rm = {}
>> -for i=0,16 do Rm[i] = 0 end
>> -
>> -for k=1,10 do
>> - local seed = 1
>> - for i=16,0,-1 do
>> - seed = bit.band(seed*9069, 0x7fffffff)
>> - Rm[i] = seed
>> - end
>> - assert(seed == 1952688301)
>> -end
>> -
>> local retindex = 0
>> local retdata = { 3, 1, 1, 1, 0, 3, 1, 0, 0, 2, 0, 2, 0, 0, 3, 1, 1, 1, 1 }
>>
>> @@ -47,7 +34,23 @@ local function test()
>> end
>> end
>>
>> -if jit and jit.status and jit.status() then jit.opt.start("hotloop=1") end
>> +do --- PHI for CONV num.int before ASTORE.
>> + local Rm = {}
>> + for i=0,16 do Rm[i] = 0 end
> please add whitespaces
>>
>> -test()
>> + for k=1,10 do
> please add whitespaces
>> + local seed = 1
>> + for i=16,0,-1 do
> please add whitespaces
>> + seed = bit.band(seed*9069, 0x7fffffff)
>> + Rm[i] = seed
>> + end
>> + assert(seed == 1952688301)
>> + end
>> +end
>> +
>> +do --- PHI for CONV num.int of lookup.
>> + jit.opt.start("hotloop=1")
>> + test()
>> + jit.opt.start("hotloop=56")
>> +end
>>
>> diff --git a/test/LuaJIT-tests/trace/phi/index b/test/LuaJIT-tests/trace/phi/index
>> index 74a07333..a72d37a0 100644
>> --- a/test/LuaJIT-tests/trace/phi/index
>> +++ b/test/LuaJIT-tests/trace/phi/index
>> @@ -1,3 +1,4 @@
>> copyspill.lua
>> +conv.lua
>> ref.lua
>> rotate.lua
[-- Attachment #2: Type: text/html, Size: 3742 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 26/45] test: enable <misc/phi_conv.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 26/45] test: enable <misc/phi_conv.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:39 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:16 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 27/45] test: refactor <trace/phi/conv.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (25 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 26/45] test: enable <misc/phi_conv.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:41 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 28/45] test: enable <misc/recurse_deep.lua> " Sergey Kaplun via Tarantool-patches
` (19 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch refactors the aforementioned test to make its code style
closer to ours.
Relates to tarantool/tarantool#9398
---
test/LuaJIT-tests/trace/phi/conv.lua | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/LuaJIT-tests/trace/phi/conv.lua b/test/LuaJIT-tests/trace/phi/conv.lua
index 267423c2..45383ed7 100644
--- a/test/LuaJIT-tests/trace/phi/conv.lua
+++ b/test/LuaJIT-tests/trace/phi/conv.lua
@@ -15,7 +15,7 @@ local maskhuf = { 0x0002, 0x0003, 0x0004, 0x0005, }
local function decodeCode()
local lookup = get_bits()
local code = hufcodes[lookup]
- local z = {1,1,1,1}
+ local z = {1, 1, 1, 1}
if not code then
for i = 1, 4 do
lookup = bit.bor(lookup, bit.lshift(get_bits(), i + 1))
@@ -29,19 +29,19 @@ local function decodeCode()
end
local function test()
- for i = 1, 6 do
+ for _ = 1, 6 do
decodeCode()
end
end
do --- PHI for CONV num.int before ASTORE.
local Rm = {}
- for i=0,16 do Rm[i] = 0 end
+ for i = 0, 16 do Rm[i] = 0 end
- for k=1,10 do
+ for _ = 1, 10 do
local seed = 1
- for i=16,0,-1 do
- seed = bit.band(seed*9069, 0x7fffffff)
+ for i = 16, 0, -1 do
+ seed = bit.band(seed * 9069, 0x7fffffff)
Rm[i] = seed
end
assert(seed == 1952688301)
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 27/45] test: refactor <trace/phi/conv.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 27/45] test: refactor <trace/phi/conv.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:41 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:41 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1477 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch refactors the aforementioned test to make its code style
> closer to ours.
>
> Relates to tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/trace/phi/conv.lua | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/test/LuaJIT-tests/trace/phi/conv.lua b/test/LuaJIT-tests/trace/phi/conv.lua
> index 267423c2..45383ed7 100644
> --- a/test/LuaJIT-tests/trace/phi/conv.lua
> +++ b/test/LuaJIT-tests/trace/phi/conv.lua
> @@ -15,7 +15,7 @@ local maskhuf = { 0x0002, 0x0003, 0x0004, 0x0005, }
> local function decodeCode()
> local lookup = get_bits()
> local code = hufcodes[lookup]
> - local z = {1,1,1,1}
> + local z = {1, 1, 1, 1}
> if not code then
> for i = 1, 4 do
> lookup = bit.bor(lookup, bit.lshift(get_bits(), i + 1))
> @@ -29,19 +29,19 @@ local function decodeCode()
> end
>
> local function test()
> - for i = 1, 6 do
> + for _ = 1, 6 do
> decodeCode()
> end
> end
>
> do --- PHI for CONV num.int before ASTORE.
> local Rm = {}
> - for i=0,16 do Rm[i] = 0 end
> + for i = 0, 16 do Rm[i] = 0 end
>
> - for k=1,10 do
> + for _ = 1, 10 do
> local seed = 1
> - for i=16,0,-1 do
> - seed = bit.band(seed*9069, 0x7fffffff)
> + for i = 16, 0, -1 do
> + seed = bit.band(seed * 9069, 0x7fffffff)
> Rm[i] = seed
> end
> assert(seed == 1952688301)
[-- Attachment #2: Type: text/html, Size: 2042 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 27/45] test: refactor <trace/phi/conv.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 27/45] test: refactor <trace/phi/conv.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:41 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:16 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 28/45] test: enable <misc/recurse_deep.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (26 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 27/45] test: refactor <trace/phi/conv.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:44 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 29/45] test: remove <misc/recurse_tail.lua> " Sergey Kaplun via Tarantool-patches
` (18 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory (with slightly renaming to be consistent with other names),
includes it in <index>, and names the subtests.
Part of tarantool/tarantool#9398
---
.../{misc/recurse_deep.lua => lang/deep_recursion.lua} | 8 +++-----
test/LuaJIT-tests/lang/index | 1 +
2 files changed, 4 insertions(+), 5 deletions(-)
rename test/LuaJIT-tests/{misc/recurse_deep.lua => lang/deep_recursion.lua} (84%)
diff --git a/test/LuaJIT-tests/misc/recurse_deep.lua b/test/LuaJIT-tests/lang/deep_recursion.lua
similarity index 84%
rename from test/LuaJIT-tests/misc/recurse_deep.lua
rename to test/LuaJIT-tests/lang/deep_recursion.lua
index 9b9af295..732dd529 100644
--- a/test/LuaJIT-tests/misc/recurse_deep.lua
+++ b/test/LuaJIT-tests/lang/deep_recursion.lua
@@ -1,5 +1,4 @@
-
-do
+do --- Recursion sum.
local function sum(n)
if n == 1 then return 1 end
return n + sum(n-1)
@@ -7,7 +6,7 @@ do
assert(sum(200) == 20100)
end
-do
+do --- Recursion wiht pcall.
local pcall = pcall
local tr1
local x = 0
@@ -19,11 +18,10 @@ do
assert(tr1(200) == true and x == 200)
end
-do
+do --- Recursion fibonacci.
local function fib(n)
if n < 2 then return 1 end
return fib(n-2) + fib(n-1)
end
assert(fib(15) == 987)
end
-
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 726c8d16..5c9e7ea4 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -6,6 +6,7 @@ catch_wrap.lua
compare.lua
compare_nan.lua
constant
+deep_recursion.lua
dualnum.lua
for.lua
hook_active.lua
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 28/45] test: enable <misc/recurse_deep.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 28/45] test: enable <misc/recurse_deep.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:44 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:44 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory (with slightly renaming to be consistent with other names),
> includes it in <index>, and names the subtests.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> .../{misc/recurse_deep.lua => lang/deep_recursion.lua} | 8 +++-----
> test/LuaJIT-tests/lang/index | 1 +
> 2 files changed, 4 insertions(+), 5 deletions(-)
> rename test/LuaJIT-tests/{misc/recurse_deep.lua => lang/deep_recursion.lua} (84%)
>
> diff --git a/test/LuaJIT-tests/misc/recurse_deep.lua b/test/LuaJIT-tests/lang/deep_recursion.lua
> similarity index 84%
> rename from test/LuaJIT-tests/misc/recurse_deep.lua
> rename to test/LuaJIT-tests/lang/deep_recursion.lua
> index 9b9af295..732dd529 100644
> --- a/test/LuaJIT-tests/misc/recurse_deep.lua
> +++ b/test/LuaJIT-tests/lang/deep_recursion.lua
> @@ -1,5 +1,4 @@
> -
> -do
> +do --- Recursion sum.
> local function sum(n)
> if n == 1 then return 1 end
> return n + sum(n-1)
> @@ -7,7 +6,7 @@ do
> assert(sum(200) == 20100)
> end
>
> -do
> +do --- Recursion wiht pcall.
> local pcall = pcall
> local tr1
> local x = 0
> @@ -19,11 +18,10 @@ do
> assert(tr1(200) == true and x == 200)
> end
>
> -do
> +do --- Recursion fibonacci.
> local function fib(n)
> if n < 2 then return 1 end
> return fib(n-2) + fib(n-1)
> end
> assert(fib(15) == 987)
> end
> -
> diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> index 726c8d16..5c9e7ea4 100644
> --- a/test/LuaJIT-tests/lang/index
> +++ b/test/LuaJIT-tests/lang/index
> @@ -6,6 +6,7 @@ catch_wrap.lua
> compare.lua
> compare_nan.lua
> constant
> +deep_recursion.lua
> dualnum.lua
> for.lua
> hook_active.lua
[-- Attachment #2: Type: text/html, Size: 2434 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 28/45] test: enable <misc/recurse_deep.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 28/45] test: enable <misc/recurse_deep.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:44 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:16 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 29/45] test: remove <misc/recurse_tail.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (27 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 28/45] test: enable <misc/recurse_deep.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:45 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 30/45] test: enable <misc/stack_gc.lua> " Sergey Kaplun via Tarantool-patches
` (17 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch removes the aforementioned test since it is part of the
<lang/tail_recursion.lua> test.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/recurse_tail.lua | 22 ----------------------
1 file changed, 22 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/recurse_tail.lua
diff --git a/test/LuaJIT-tests/misc/recurse_tail.lua b/test/LuaJIT-tests/misc/recurse_tail.lua
deleted file mode 100644
index ef764432..00000000
--- a/test/LuaJIT-tests/misc/recurse_tail.lua
+++ /dev/null
@@ -1,22 +0,0 @@
-
-do
- local tr1
- function tr1(n)
- if n <= 0 then return 0 end
- return tr1(n-1)
- end
- assert(tr1(200) == 0)
-end
-
-do
- local tr1, tr2
- function tr1(n)
- if n <= 0 then return 0 end
- return tr2(n-1)
- end
- function tr2(n)
- return tr1(n)
- end
- assert(tr2(200) == 0)
-end
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 29/45] test: remove <misc/recurse_tail.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 29/45] test: remove <misc/recurse_tail.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:45 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:45 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 985 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch removes the aforementioned test since it is part of the
> <lang/tail_recursion.lua> test.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/misc/recurse_tail.lua | 22 ----------------------
> 1 file changed, 22 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/recurse_tail.lua
>
> diff --git a/test/LuaJIT-tests/misc/recurse_tail.lua b/test/LuaJIT-tests/misc/recurse_tail.lua
> deleted file mode 100644
> index ef764432..00000000
> --- a/test/LuaJIT-tests/misc/recurse_tail.lua
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -
> -do
> - local tr1
> - function tr1(n)
> - if n <= 0 then return 0 end
> - return tr1(n-1)
> - end
> - assert(tr1(200) == 0)
> -end
> -
> -do
> - local tr1, tr2
> - function tr1(n)
> - if n <= 0 then return 0 end
> - return tr2(n-1)
> - end
> - function tr2(n)
> - return tr1(n)
> - end
> - assert(tr2(200) == 0)
> -end
> -
[-- Attachment #2: Type: text/html, Size: 1610 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 29/45] test: remove <misc/recurse_tail.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 29/45] test: remove <misc/recurse_tail.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:45 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:16 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 30/45] test: enable <misc/stack_gc.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (28 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 29/45] test: remove <misc/recurse_tail.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:46 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 31/45] test: refactor <lang/gc_stack.lua> " Sergey Kaplun via Tarantool-patches
` (16 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory (with slightly renaming to be consistent with other names),
includes it in <index>, and names the subtests.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/{misc/stack_gc.lua => lang/gc_stack.lua} | 4 +---
test/LuaJIT-tests/lang/index | 1 +
2 files changed, 2 insertions(+), 3 deletions(-)
rename test/LuaJIT-tests/{misc/stack_gc.lua => lang/gc_stack.lua} (91%)
diff --git a/test/LuaJIT-tests/misc/stack_gc.lua b/test/LuaJIT-tests/lang/gc_stack.lua
similarity index 91%
rename from test/LuaJIT-tests/misc/stack_gc.lua
rename to test/LuaJIT-tests/lang/gc_stack.lua
index 656a06a0..cd3d8f90 100644
--- a/test/LuaJIT-tests/misc/stack_gc.lua
+++ b/test/LuaJIT-tests/lang/gc_stack.lua
@@ -1,5 +1,4 @@
-
-do
+do --- Marking sparse stack.
local t = setmetatable({}, { __index=function(t, k)
k = k - 1
if k == 0 then
@@ -12,4 +11,3 @@ do
end})
local x = t[50]
end
-
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 5c9e7ea4..b262c555 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -26,6 +26,7 @@ tail_recursion.lua
vararg_jit.lua
gc.lua
gc_debug.lua
+gc_stack.lua
gc_step.lua
goto.lua +goto
meta
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 30/45] test: enable <misc/stack_gc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 30/45] test: enable <misc/stack_gc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:46 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:46 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1477 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory (with slightly renaming to be consistent with other names),
> includes it in <index>, and names the subtests.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/{misc/stack_gc.lua => lang/gc_stack.lua} | 4 +---
> test/LuaJIT-tests/lang/index | 1 +
> 2 files changed, 2 insertions(+), 3 deletions(-)
> rename test/LuaJIT-tests/{misc/stack_gc.lua => lang/gc_stack.lua} (91%)
>
> diff --git a/test/LuaJIT-tests/misc/stack_gc.lua b/test/LuaJIT-tests/lang/gc_stack.lua
> similarity index 91%
> rename from test/LuaJIT-tests/misc/stack_gc.lua
> rename to test/LuaJIT-tests/lang/gc_stack.lua
> index 656a06a0..cd3d8f90 100644
> --- a/test/LuaJIT-tests/misc/stack_gc.lua
> +++ b/test/LuaJIT-tests/lang/gc_stack.lua
> @@ -1,5 +1,4 @@
> -
> -do
> +do --- Marking sparse stack.
> local t = setmetatable({}, { __index=function(t, k)
> k = k - 1
> if k == 0 then
> @@ -12,4 +11,3 @@ do
> end})
> local x = t[50]
> end
> -
> diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> index 5c9e7ea4..b262c555 100644
> --- a/test/LuaJIT-tests/lang/index
> +++ b/test/LuaJIT-tests/lang/index
> @@ -26,6 +26,7 @@ tail_recursion.lua
> vararg_jit.lua
> gc.lua
> gc_debug.lua
> +gc_stack.lua
> gc_step.lua
> goto.lua +goto
> meta
[-- Attachment #2: Type: text/html, Size: 2080 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 30/45] test: enable <misc/stack_gc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 30/45] test: enable <misc/stack_gc.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:46 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:16 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:16 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 31/45] test: refactor <lang/gc_stack.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (29 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 30/45] test: enable <misc/stack_gc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:47 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:17 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 32/45] test: enable <misc/stack_purge.lua> " Sergey Kaplun via Tarantool-patches
` (15 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch refactors the aforementioned test to make its code style
closer to ours.
Relates to tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/gc_stack.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/LuaJIT-tests/lang/gc_stack.lua b/test/LuaJIT-tests/lang/gc_stack.lua
index cd3d8f90..8aee57e3 100644
--- a/test/LuaJIT-tests/lang/gc_stack.lua
+++ b/test/LuaJIT-tests/lang/gc_stack.lua
@@ -1,5 +1,5 @@
do --- Marking sparse stack.
- local t = setmetatable({}, { __index=function(t, k)
+ local t = setmetatable({}, { __index = function(t, k)
k = k - 1
if k == 0 then
collectgarbage() -- Mark stack, including holes.
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 31/45] test: refactor <lang/gc_stack.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 31/45] test: refactor <lang/gc_stack.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:47 ` Sergey Bronnikov via Tarantool-patches
2024-08-26 6:56 ` Sergey Kaplun via Tarantool-patches
2024-09-04 23:17 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:47 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 931 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch refactors the aforementioned test to make its code style
> closer to ours.
>
> Relates to tarantool/tarantool#9398
> ---
thanks for the patch! LGTM with a minor:
probably line 10 needs more whitespaces:
> do local a,b,c,d,e,f,g,h,i,j,k,l,m,n end -- Ensure bigger frame
size.
> test/LuaJIT-tests/lang/gc_stack.lua | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/LuaJIT-tests/lang/gc_stack.lua b/test/LuaJIT-tests/lang/gc_stack.lua
> index cd3d8f90..8aee57e3 100644
> --- a/test/LuaJIT-tests/lang/gc_stack.lua
> +++ b/test/LuaJIT-tests/lang/gc_stack.lua
> @@ -1,5 +1,5 @@
> do --- Marking sparse stack.
> - local t = setmetatable({}, { __index=function(t, k)
> + local t = setmetatable({}, { __index = function(t, k)
> k = k - 1
> if k == 0 then
> collectgarbage() -- Mark stack, including holes.
[-- Attachment #2: Type: text/html, Size: 1614 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 31/45] test: refactor <lang/gc_stack.lua> LuaJIT test
2024-08-22 13:47 ` Sergey Bronnikov via Tarantool-patches
@ 2024-08-26 6:56 ` Sergey Kaplun via Tarantool-patches
2024-08-29 9:45 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 1 reply; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-26 6:56 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the review!
Fixed your comments and force-pushed the branch.
On 22.08.24, Sergey Bronnikov wrote:
> Sergey,
>
>
> On 21.08.2024 11:58, Sergey Kaplun wrote:
> > This patch refactors the aforementioned test to make its code style
> > closer to ours.
> >
> > Relates to tarantool/tarantool#9398
> > ---
>
> thanks for the patch! LGTM with a minor:
>
> probably line 10 needs more whitespaces:
>
> > do local a,b,c,d,e,f,g,h,i,j,k,l,m,n end -- Ensure bigger frame
> size.
Fixed thanks!
See the iterative patch below.
===================================================================
diff --git a/test/LuaJIT-tests/lang/gc_stack.lua b/test/LuaJIT-tests/lang/gc_stack.lua
index 8aee57e3..d05d4402 100644
--- a/test/LuaJIT-tests/lang/gc_stack.lua
+++ b/test/LuaJIT-tests/lang/gc_stack.lua
@@ -7,7 +7,10 @@ do --- Marking sparse stack.
else
return t[k] -- Leaves holes in each frame.
end
- do local a,b,c,d,e,f,g,h,i,j,k,l,m,n end -- Ensure bigger frame size.
+ do
+ -- Ensure bigger frame size.
+ local a, b, c, d, e, f, g, h, i, j, k, l, m, n
+ end
end})
local x = t[50]
end
===================================================================
>
> > test/LuaJIT-tests/lang/gc_stack.lua | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/test/LuaJIT-tests/lang/gc_stack.lua b/test/LuaJIT-tests/lang/gc_stack.lua
> > index cd3d8f90..8aee57e3 100644
> > --- a/test/LuaJIT-tests/lang/gc_stack.lua
> > +++ b/test/LuaJIT-tests/lang/gc_stack.lua
> > @@ -1,5 +1,5 @@
> > do --- Marking sparse stack.
> > - local t = setmetatable({}, { __index=function(t, k)
> > + local t = setmetatable({}, { __index = function(t, k)
> > k = k - 1
> > if k == 0 then
> > collectgarbage() -- Mark stack, including holes.
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 31/45] test: refactor <lang/gc_stack.lua> LuaJIT test
2024-08-26 6:56 ` Sergey Kaplun via Tarantool-patches
@ 2024-08-29 9:45 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-29 9:45 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1037 bytes --]
Hi, Sergey,
On 26.08.2024 09:56, Sergey Kaplun wrote:
<snipped>
>> thanks for the patch! LGTM with a minor:
>>
>> probably line 10 needs more whitespaces:
>>
>> > do local a,b,c,d,e,f,g,h,i,j,k,l,m,n end -- Ensure bigger frame
>> size.
> Fixed thanks!
> See the iterative patch below.
>
> ===================================================================
> diff --git a/test/LuaJIT-tests/lang/gc_stack.lua b/test/LuaJIT-tests/lang/gc_stack.lua
> index 8aee57e3..d05d4402 100644
> --- a/test/LuaJIT-tests/lang/gc_stack.lua
> +++ b/test/LuaJIT-tests/lang/gc_stack.lua
> @@ -7,7 +7,10 @@ do --- Marking sparse stack.
> else
> return t[k] -- Leaves holes in each frame.
> end
> - do local a,b,c,d,e,f,g,h,i,j,k,l,m,n end -- Ensure bigger frame size.
> + do
> + -- Ensure bigger frame size.
> + local a, b, c, d, e, f, g, h, i, j, k, l, m, n
> + end
> end})
> local x = t[50]
> end
> ===================================================================
>
Thanks! LGTM
<snipped>
[-- Attachment #2: Type: text/html, Size: 1756 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 31/45] test: refactor <lang/gc_stack.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 31/45] test: refactor <lang/gc_stack.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:47 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:17 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:17 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 32/45] test: enable <misc/stack_purge.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (30 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 31/45] test: refactor <lang/gc_stack.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:49 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:18 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 33/45] test: refactor <trace/stack_purge.lua> " Sergey Kaplun via Tarantool-patches
` (14 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names the subtest.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/trace/index | 1 +
test/LuaJIT-tests/{misc => trace}/stack_purge.lua | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
rename test/LuaJIT-tests/{misc => trace}/stack_purge.lua (87%)
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index 3ab095a7..4826f429 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -8,4 +8,5 @@ hook_record.lua
jit_flush.lua
phi
snap.lua
+stack_purge.lua
stitch.lua
diff --git a/test/LuaJIT-tests/misc/stack_purge.lua b/test/LuaJIT-tests/trace/stack_purge.lua
similarity index 87%
rename from test/LuaJIT-tests/misc/stack_purge.lua
rename to test/LuaJIT-tests/trace/stack_purge.lua
index bfaee0f3..6d2876af 100644
--- a/test/LuaJIT-tests/misc/stack_purge.lua
+++ b/test/LuaJIT-tests/trace/stack_purge.lua
@@ -1,4 +1,3 @@
-
-- Must preserve the modified function slot in the RET snapshot.
local function a()
local _,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_
@@ -20,6 +19,7 @@ local function c()
end
end
-jit.off(c)
-c()
-
+do --- Don't purge the function to return from SNAP.
+ jit.off(c)
+ c()
+end
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 32/45] test: enable <misc/stack_purge.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 32/45] test: enable <misc/stack_purge.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:49 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:18 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:49 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1520 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <trace/>
> directory, includes it in <index>, and names the subtest.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/trace/index | 1 +
> test/LuaJIT-tests/{misc => trace}/stack_purge.lua | 8 ++++----
> 2 files changed, 5 insertions(+), 4 deletions(-)
> rename test/LuaJIT-tests/{misc => trace}/stack_purge.lua (87%)
>
> diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
> index 3ab095a7..4826f429 100644
> --- a/test/LuaJIT-tests/trace/index
> +++ b/test/LuaJIT-tests/trace/index
> @@ -8,4 +8,5 @@ hook_record.lua
> jit_flush.lua
> phi
> snap.lua
> +stack_purge.lua
> stitch.lua
> diff --git a/test/LuaJIT-tests/misc/stack_purge.lua b/test/LuaJIT-tests/trace/stack_purge.lua
> similarity index 87%
> rename from test/LuaJIT-tests/misc/stack_purge.lua
> rename to test/LuaJIT-tests/trace/stack_purge.lua
> index bfaee0f3..6d2876af 100644
> --- a/test/LuaJIT-tests/misc/stack_purge.lua
> +++ b/test/LuaJIT-tests/trace/stack_purge.lua
> @@ -1,4 +1,3 @@
> -
> -- Must preserve the modified function slot in the RET snapshot.
> local function a()
> local _,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_
> @@ -20,6 +19,7 @@ local function c()
> end
> end
>
> -jit.off(c)
> -c()
> -
> +do --- Don't purge the function to return from SNAP.
> + jit.off(c)
> + c()
> +end
[-- Attachment #2: Type: text/html, Size: 2123 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 32/45] test: enable <misc/stack_purge.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 32/45] test: enable <misc/stack_purge.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:49 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:18 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:18 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 33/45] test: refactor <trace/stack_purge.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (31 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 32/45] test: enable <misc/stack_purge.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:49 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:18 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 34/45] test: enable <misc/stackov.lua> " Sergey Kaplun via Tarantool-patches
` (13 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch refactors the aforementioned test to make its code style
closer to ours.
Relates to tarantool/tarantool#9398
---
test/LuaJIT-tests/trace/stack_purge.lua | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/LuaJIT-tests/trace/stack_purge.lua b/test/LuaJIT-tests/trace/stack_purge.lua
index 6d2876af..e4108b20 100644
--- a/test/LuaJIT-tests/trace/stack_purge.lua
+++ b/test/LuaJIT-tests/trace/stack_purge.lua
@@ -11,11 +11,11 @@ local function b()
end
local function c()
- for j=1,10 do
- for i=1,50 do b() b() b() end
+ for _ = 1, 10 do
+ for _ = 1, 50 do b() b() b() end
collectgarbage()
local t = {}
- for i=1,50 do t = {t} end
+ for _ = 1, 50 do t = {t} end
end
end
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 33/45] test: refactor <trace/stack_purge.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 33/45] test: refactor <trace/stack_purge.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:49 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:18 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:49 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 880 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch refactors the aforementioned test to make its code style
> closer to ours.
>
> Relates to tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/trace/stack_purge.lua | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/test/LuaJIT-tests/trace/stack_purge.lua b/test/LuaJIT-tests/trace/stack_purge.lua
> index 6d2876af..e4108b20 100644
> --- a/test/LuaJIT-tests/trace/stack_purge.lua
> +++ b/test/LuaJIT-tests/trace/stack_purge.lua
> @@ -11,11 +11,11 @@ local function b()
> end
>
> local function c()
> - for j=1,10 do
> - for i=1,50 do b() b() b() end
> + for _ = 1, 10 do
> + for _ = 1, 50 do b() b() b() end
> collectgarbage()
> local t = {}
> - for i=1,50 do t = {t} end
> + for _ = 1, 50 do t = {t} end
> end
> end
>
[-- Attachment #2: Type: text/html, Size: 1495 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 33/45] test: refactor <trace/stack_purge.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 33/45] test: refactor <trace/stack_purge.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:49 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:18 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:18 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 34/45] test: enable <misc/stackov.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (32 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 33/45] test: refactor <trace/stack_purge.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:51 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 35/45] test: enable <misc/stackovc.lua> " Sergey Kaplun via Tarantool-patches
` (12 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory, includes it in <index>, names the subtests, and adds testing
of the error message for all non-tail call cases.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/index | 1 +
test/LuaJIT-tests/lang/stackov.lua | 48 ++++++++++++++++++++++++++++++
test/LuaJIT-tests/misc/stackov.lua | 40 -------------------------
3 files changed, 49 insertions(+), 40 deletions(-)
create mode 100644 test/LuaJIT-tests/lang/stackov.lua
delete mode 100644 test/LuaJIT-tests/misc/stackov.lua
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index b262c555..fa6db3c3 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -17,6 +17,7 @@ lightud.lua
modulo.lua
concat.lua
self.lua
+stackov.lua
table.lua
parse_comp.lua
parse_esc.lua
diff --git a/test/LuaJIT-tests/lang/stackov.lua b/test/LuaJIT-tests/lang/stackov.lua
new file mode 100644
index 00000000..21ae40b6
--- /dev/null
+++ b/test/LuaJIT-tests/lang/stackov.lua
@@ -0,0 +1,48 @@
+local function f()
+ f()
+end
+
+local function g(i)
+ g(i)
+end
+
+local function vtail(...)
+ return vtail(1, ...)
+end
+
+local function vcall(...)
+ vcall(1, ...)
+end
+
+local function test_error_msg(func, s)
+ local first = string.match(s, "[^\n]+")
+ local line = debug.getinfo(func, "S").linedefined + 1
+ assert(string.match(first, ":" .. line .. ": stack overflow$"))
+
+ local n = 1
+ for _ in string.gmatch(s, "\n") do n = n + 1 end
+ assert(n == 1 + 1 + 11 + 1 + 10)
+end
+
+do --- Base test.
+ local err, s = xpcall(f, debug.traceback)
+ assert(err == false)
+ test_error_msg(f, s)
+end
+
+do --- Stack overflow with non-empty arg list.
+ local err, s = xpcall(g, debug.traceback, 1)
+ assert(err == false)
+ test_error_msg(g, s)
+end
+
+do --- Vararg tail call with non-empty arg list. +slow
+ local err, s = xpcall(vtail, debug.traceback, 1)
+ assert(err == false)
+end
+
+do --- Vararg non-tail call.
+ local err, s = xpcall(vcall, debug.traceback, 1)
+ assert(err == false)
+ test_error_msg(vcall, s)
+end
diff --git a/test/LuaJIT-tests/misc/stackov.lua b/test/LuaJIT-tests/misc/stackov.lua
deleted file mode 100644
index ef105af6..00000000
--- a/test/LuaJIT-tests/misc/stackov.lua
+++ /dev/null
@@ -1,40 +0,0 @@
-
-local function f()
- f()
-end
-
-local err, s = xpcall(f, debug.traceback)
-assert(err == false)
-
-local first = string.match(s, "[^\n]+")
-local line = debug.getinfo(f, "S").linedefined+1
-assert(string.match(first, ":"..line..": stack overflow$"))
-
-local n = 1
-for _ in string.gmatch(s, "\n") do n = n + 1 end
-assert(n == 1+1+11+1+10)
-
-local function g(i)
- g(i)
-end
-
-local err, s = xpcall(g, debug.traceback, 1)
-assert(err == false)
-
---[[
--- too slow
-local function vtail(...)
- return vtail(1, ...)
-end
-
-local err, s = xpcall(vtail, debug.traceback, 1)
-assert(err == false)
---]]
-
-local function vcall(...)
- vcall(1, ...)
-end
-
-local err, s = xpcall(vcall, debug.traceback, 1)
-assert(err == false)
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 34/45] test: enable <misc/stackov.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 34/45] test: enable <misc/stackov.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:51 ` Sergey Bronnikov via Tarantool-patches
2024-08-22 14:34 ` Sergey Kaplun via Tarantool-patches
2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:51 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 3504 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory, includes it in <index>, names the subtests, and adds testing
> of the error message for all non-tail call cases.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM with a minor comment below.
> test/LuaJIT-tests/lang/index | 1 +
> test/LuaJIT-tests/lang/stackov.lua | 48 ++++++++++++++++++++++++++++++
Probably filename "stack_overflow.lua" will be better. Feel free to ignore.
> test/LuaJIT-tests/misc/stackov.lua | 40 -------------------------
> 3 files changed, 49 insertions(+), 40 deletions(-)
> create mode 100644 test/LuaJIT-tests/lang/stackov.lua
> delete mode 100644 test/LuaJIT-tests/misc/stackov.lua
>
> diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> index b262c555..fa6db3c3 100644
> --- a/test/LuaJIT-tests/lang/index
> +++ b/test/LuaJIT-tests/lang/index
> @@ -17,6 +17,7 @@ lightud.lua
> modulo.lua
> concat.lua
> self.lua
> +stackov.lua
> table.lua
> parse_comp.lua
> parse_esc.lua
> diff --git a/test/LuaJIT-tests/lang/stackov.lua b/test/LuaJIT-tests/lang/stackov.lua
> new file mode 100644
> index 00000000..21ae40b6
> --- /dev/null
> +++ b/test/LuaJIT-tests/lang/stackov.lua
> @@ -0,0 +1,48 @@
> +local function f()
> + f()
> +end
> +
> +local function g(i)
> + g(i)
> +end
> +
> +local function vtail(...)
> + return vtail(1, ...)
> +end
> +
> +local function vcall(...)
> + vcall(1, ...)
> +end
> +
> +local function test_error_msg(func, s)
> + local first = string.match(s, "[^\n]+")
> + local line = debug.getinfo(func, "S").linedefined + 1
> + assert(string.match(first, ":" .. line .. ": stack overflow$"))
> +
> + local n = 1
> + for _ in string.gmatch(s, "\n") do n = n + 1 end
> + assert(n == 1 + 1 + 11 + 1 + 10)
> +end
> +
> +do --- Base test.
> + local err, s = xpcall(f, debug.traceback)
> + assert(err == false)
> + test_error_msg(f, s)
> +end
> +
> +do --- Stack overflow with non-empty arg list.
> + local err, s = xpcall(g, debug.traceback, 1)
> + assert(err == false)
> + test_error_msg(g, s)
> +end
> +
> +do --- Vararg tail call with non-empty arg list. +slow
> + local err, s = xpcall(vtail, debug.traceback, 1)
> + assert(err == false)
> +end
> +
> +do --- Vararg non-tail call.
> + local err, s = xpcall(vcall, debug.traceback, 1)
> + assert(err == false)
> + test_error_msg(vcall, s)
> +end
> diff --git a/test/LuaJIT-tests/misc/stackov.lua b/test/LuaJIT-tests/misc/stackov.lua
> deleted file mode 100644
> index ef105af6..00000000
> --- a/test/LuaJIT-tests/misc/stackov.lua
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -
> -local function f()
> - f()
> -end
> -
> -local err, s = xpcall(f, debug.traceback)
> -assert(err == false)
> -
> -local first = string.match(s, "[^\n]+")
> -local line = debug.getinfo(f, "S").linedefined+1
> -assert(string.match(first, ":"..line..": stack overflow$"))
> -
> -local n = 1
> -for _ in string.gmatch(s, "\n") do n = n + 1 end
> -assert(n == 1+1+11+1+10)
> -
> -local function g(i)
> - g(i)
> -end
> -
> -local err, s = xpcall(g, debug.traceback, 1)
> -assert(err == false)
> -
> ---[[
> --- too slow
> -local function vtail(...)
> - return vtail(1, ...)
> -end
> -
> -local err, s = xpcall(vtail, debug.traceback, 1)
> -assert(err == false)
> ---]]
> -
> -local function vcall(...)
> - vcall(1, ...)
> -end
> -
> -local err, s = xpcall(vcall, debug.traceback, 1)
> -assert(err == false)
> -
[-- Attachment #2: Type: text/html, Size: 4135 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 34/45] test: enable <misc/stackov.lua> LuaJIT test
2024-08-22 13:51 ` Sergey Bronnikov via Tarantool-patches
@ 2024-08-22 14:34 ` Sergey Kaplun via Tarantool-patches
2024-08-23 15:42 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 1 reply; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-22 14:34 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the review!
Please consider my answer below.
On 22.08.24, Sergey Bronnikov wrote:
> Sergey,
>
> On 21.08.2024 11:58, Sergey Kaplun wrote:
> > This patch moves the aforementioned test from the <misc> to the <lang/>
> > directory, includes it in <index>, names the subtests, and adds testing
> > of the error message for all non-tail call cases.
> >
> > Part of tarantool/tarantool#9398
> > ---
> thanks for the patch! LGTM with a minor comment below.
> > test/LuaJIT-tests/lang/index | 1 +
> > test/LuaJIT-tests/lang/stackov.lua | 48 ++++++++++++++++++++++++++++++
> Probably filename "stack_overflow.lua" will be better. Feel free to ignore.
I prefer to leave it as is, since it is consistent with the error name
in sources, if you don't insist.
> > test/LuaJIT-tests/misc/stackov.lua | 40 -------------------------
> > 3 files changed, 49 insertions(+), 40 deletions(-)
> > create mode 100644 test/LuaJIT-tests/lang/stackov.lua
> > delete mode 100644 test/LuaJIT-tests/misc/stackov.lua
> >
<snipped>
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 34/45] test: enable <misc/stackov.lua> LuaJIT test
2024-08-22 14:34 ` Sergey Kaplun via Tarantool-patches
@ 2024-08-23 15:42 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-23 15:42 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1177 bytes --]
Sergey,
On 22.08.2024 17:34, Sergey Kaplun wrote:
> Hi, Sergey!
> Thanks for the review!
> Please consider my answer below.
>
> On 22.08.24, Sergey Bronnikov wrote:
>> Sergey,
>>
>> On 21.08.2024 11:58, Sergey Kaplun wrote:
>>> This patch moves the aforementioned test from the <misc> to the <lang/>
>>> directory, includes it in <index>, names the subtests, and adds testing
>>> of the error message for all non-tail call cases.
>>>
>>> Part of tarantool/tarantool#9398
>>> ---
>> thanks for the patch! LGTM with a minor comment below.
>>> test/LuaJIT-tests/lang/index | 1 +
>>> test/LuaJIT-tests/lang/stackov.lua | 48 ++++++++++++++++++++++++++++++
>> Probably filename "stack_overflow.lua" will be better. Feel free to ignore.
> I prefer to leave it as is, since it is consistent with the error name
> in sources, if you don't insist.
Ok, let's leave it as is. LGTM as I said previously.
>
>>> test/LuaJIT-tests/misc/stackov.lua | 40 -------------------------
>>> 3 files changed, 49 insertions(+), 40 deletions(-)
>>> create mode 100644 test/LuaJIT-tests/lang/stackov.lua
>>> delete mode 100644 test/LuaJIT-tests/misc/stackov.lua
>>>
> <snipped>
>
[-- Attachment #2: Type: text/html, Size: 2350 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 34/45] test: enable <misc/stackov.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 34/45] test: enable <misc/stackov.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:51 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:19 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 35/45] test: enable <misc/stackovc.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (33 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 34/45] test: enable <misc/stackov.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 13:53 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 36/45] test: enable <misc/tcall_base.lua> " Sergey Kaplun via Tarantool-patches
` (11 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory (with slightly renaming to be consistent with other names),
includes it in <index>, and names the subtest.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/index | 1 +
test/LuaJIT-tests/lang/stackov_c.lua | 12 ++++++++++++
test/LuaJIT-tests/misc/stackovc.lua | 4 ----
3 files changed, 13 insertions(+), 4 deletions(-)
create mode 100644 test/LuaJIT-tests/lang/stackov_c.lua
delete mode 100644 test/LuaJIT-tests/misc/stackovc.lua
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index fa6db3c3..8da748d0 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -18,6 +18,7 @@ modulo.lua
concat.lua
self.lua
stackov.lua
+stackov_c.lua
table.lua
parse_comp.lua
parse_esc.lua
diff --git a/test/LuaJIT-tests/lang/stackov_c.lua b/test/LuaJIT-tests/lang/stackov_c.lua
new file mode 100644
index 00000000..cea1a09e
--- /dev/null
+++ b/test/LuaJIT-tests/lang/stackov_c.lua
@@ -0,0 +1,12 @@
+do --- Too many results to unpack.
+ local j = 1e4
+ local co = coroutine.create(function()
+ local t = {}
+ for i = 1, j do
+ t[i] = i
+ end
+ return unpack(t)
+ end)
+ local ok, err = coroutine.resume(co)
+ assert(not ok and string.find(err, "unpack"))
+end
diff --git a/test/LuaJIT-tests/misc/stackovc.lua b/test/LuaJIT-tests/misc/stackovc.lua
deleted file mode 100644
index c00bcbd8..00000000
--- a/test/LuaJIT-tests/misc/stackovc.lua
+++ /dev/null
@@ -1,4 +0,0 @@
-local j = 1e4
-local co = coroutine.create(function() t = {} for i = 1, j do t[i] = i end return unpack(t) end)
-local ok, err = coroutine.resume(co)
-assert(not ok and string.find(err, "unpack"))
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 35/45] test: enable <misc/stackovc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 35/45] test: enable <misc/stackovc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 13:53 ` Sergey Bronnikov via Tarantool-patches
2024-08-22 14:36 ` Sergey Kaplun via Tarantool-patches
2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 13:53 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1982 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory (with slightly renaming to be consistent with other names),
> includes it in <index>, and names the subtest.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM with comment below.
> test/LuaJIT-tests/lang/index | 1 +
> test/LuaJIT-tests/lang/stackov_c.lua | 12 ++++++++++++
May be "stackoverflow_coro.lua"?
> test/LuaJIT-tests/misc/stackovc.lua | 4 ----
> 3 files changed, 13 insertions(+), 4 deletions(-)
> create mode 100644 test/LuaJIT-tests/lang/stackov_c.lua
> delete mode 100644 test/LuaJIT-tests/misc/stackovc.lua
>
> diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> index fa6db3c3..8da748d0 100644
> --- a/test/LuaJIT-tests/lang/index
> +++ b/test/LuaJIT-tests/lang/index
> @@ -18,6 +18,7 @@ modulo.lua
> concat.lua
> self.lua
> stackov.lua
> +stackov_c.lua
> table.lua
> parse_comp.lua
> parse_esc.lua
> diff --git a/test/LuaJIT-tests/lang/stackov_c.lua b/test/LuaJIT-tests/lang/stackov_c.lua
> new file mode 100644
> index 00000000..cea1a09e
> --- /dev/null
> +++ b/test/LuaJIT-tests/lang/stackov_c.lua
> @@ -0,0 +1,12 @@
> +do --- Too many results to unpack.
> + local j = 1e4
> + local co = coroutine.create(function()
> + local t = {}
> + for i = 1, j do
> + t[i] = i
> + end
> + return unpack(t)
> + end)
> + local ok, err = coroutine.resume(co)
> + assert(not ok and string.find(err, "unpack"))
> +end
> diff --git a/test/LuaJIT-tests/misc/stackovc.lua b/test/LuaJIT-tests/misc/stackovc.lua
> deleted file mode 100644
> index c00bcbd8..00000000
> --- a/test/LuaJIT-tests/misc/stackovc.lua
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -local j = 1e4
> -local co = coroutine.create(function() t = {} for i = 1, j do t[i] = i end return unpack(t) end)
> -local ok, err = coroutine.resume(co)
> -assert(not ok and string.find(err, "unpack"))
[-- Attachment #2: Type: text/html, Size: 2753 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 35/45] test: enable <misc/stackovc.lua> LuaJIT test
2024-08-22 13:53 ` Sergey Bronnikov via Tarantool-patches
@ 2024-08-22 14:36 ` Sergey Kaplun via Tarantool-patches
2024-08-23 15:41 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 1 reply; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-22 14:36 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the review!
Please consider my answer below.
On 22.08.24, Sergey Bronnikov wrote:
> Sergey,
>
> On 21.08.2024 11:58, Sergey Kaplun wrote:
> > This patch moves the aforementioned test from the <misc> to the <lang/>
> > directory (with slightly renaming to be consistent with other names),
> > includes it in <index>, and names the subtest.
> >
> > Part of tarantool/tarantool#9398
> > ---
> thanks for the patch! LGTM with comment below.
> > test/LuaJIT-tests/lang/index | 1 +
> > test/LuaJIT-tests/lang/stackov_c.lua | 12 ++++++++++++
> May be "stackoverflow_coro.lua"?
I suppose the main idea is the possible stack overflow in the C function
(more accurate built-in function) `unpack`. I prefer to leave the old
name to avoid confusion.
> > test/LuaJIT-tests/misc/stackovc.lua | 4 ----
> > 3 files changed, 13 insertions(+), 4 deletions(-)
> > create mode 100644 test/LuaJIT-tests/lang/stackov_c.lua
> > delete mode 100644 test/LuaJIT-tests/misc/stackovc.lua
> >
> > diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> > index fa6db3c3..8da748d0 100644
> > --- a/test/LuaJIT-tests/lang/index
> > +++ b/test/LuaJIT-tests/lang/index
> > @@ -18,6 +18,7 @@ modulo.lua
> > concat.lua
> > self.lua
> > stackov.lua
> > +stackov_c.lua
> > table.lua
> > parse_comp.lua
> > parse_esc.lua
> > diff --git a/test/LuaJIT-tests/lang/stackov_c.lua b/test/LuaJIT-tests/lang/stackov_c.lua
> > new file mode 100644
> > index 00000000..cea1a09e
> > --- /dev/null
> > +++ b/test/LuaJIT-tests/lang/stackov_c.lua
> > @@ -0,0 +1,12 @@
> > +do --- Too many results to unpack.
> > + local j = 1e4
> > + local co = coroutine.create(function()
> > + local t = {}
> > + for i = 1, j do
> > + t[i] = i
> > + end
> > + return unpack(t)
> > + end)
> > + local ok, err = coroutine.resume(co)
> > + assert(not ok and string.find(err, "unpack"))
> > +end
> > diff --git a/test/LuaJIT-tests/misc/stackovc.lua b/test/LuaJIT-tests/misc/stackovc.lua
> > deleted file mode 100644
> > index c00bcbd8..00000000
> > --- a/test/LuaJIT-tests/misc/stackovc.lua
> > +++ /dev/null
> > @@ -1,4 +0,0 @@
> > -local j = 1e4
> > -local co = coroutine.create(function() t = {} for i = 1, j do t[i] = i end return unpack(t) end)
> > -local ok, err = coroutine.resume(co)
> > -assert(not ok and string.find(err, "unpack"))
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 35/45] test: enable <misc/stackovc.lua> LuaJIT test
2024-08-22 14:36 ` Sergey Kaplun via Tarantool-patches
@ 2024-08-23 15:41 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-23 15:41 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 886 bytes --]
Sergey,
On 22.08.2024 17:36, Sergey Kaplun wrote:
> Hi, Sergey!
> Thanks for the review!
> Please consider my answer below.
>
> On 22.08.24, Sergey Bronnikov wrote:
>> Sergey,
>>
>> On 21.08.2024 11:58, Sergey Kaplun wrote:
>>> This patch moves the aforementioned test from the <misc> to the <lang/>
>>> directory (with slightly renaming to be consistent with other names),
>>> includes it in <index>, and names the subtest.
>>>
>>> Part of tarantool/tarantool#9398
>>> ---
>> thanks for the patch! LGTM with comment below.
>>> test/LuaJIT-tests/lang/index | 1 +
>>> test/LuaJIT-tests/lang/stackov_c.lua | 12 ++++++++++++
>> May be "stackoverflow_coro.lua"?
> I suppose the main idea is the possible stack overflow in the C function
> (more accurate built-in function) `unpack`. I prefer to leave the old
> name to avoid confusion.
>
>
LGTM as I said before.
<snipped>
[-- Attachment #2: Type: text/html, Size: 1796 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 35/45] test: enable <misc/stackovc.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 35/45] test: enable <misc/stackovc.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 13:53 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:19 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 36/45] test: enable <misc/tcall_base.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (34 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 35/45] test: enable <misc/stackovc.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 14:11 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 37/45] test: refactor <trace/tcall_base.lua> " Sergey Kaplun via Tarantool-patches
` (10 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names the subtest.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/trace/index | 1 +
test/LuaJIT-tests/{misc => trace}/tcall_base.lua | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
rename test/LuaJIT-tests/{misc => trace}/tcall_base.lua (66%)
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index 4826f429..9de3b478 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -10,3 +10,4 @@ phi
snap.lua
stack_purge.lua
stitch.lua
+tcall_base.lua
diff --git a/test/LuaJIT-tests/misc/tcall_base.lua b/test/LuaJIT-tests/trace/tcall_base.lua
similarity index 66%
rename from test/LuaJIT-tests/misc/tcall_base.lua
rename to test/LuaJIT-tests/trace/tcall_base.lua
index c6c4ae1a..7d8d75e0 100644
--- a/test/LuaJIT-tests/misc/tcall_base.lua
+++ b/test/LuaJIT-tests/trace/tcall_base.lua
@@ -1,4 +1,3 @@
-
local r = 0
local function g()
r = r + 1
@@ -14,7 +13,8 @@ local function f()
end
end
-g() -- Compile this loop first.
-for i=1,50 do f() end
-assert(r == 51)
-
+do --- Recording tailcall at base slot.
+ g() -- Compile this loop first.
+ for i=1,50 do f() end
+ assert(r == 51)
+end
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 36/45] test: enable <misc/tcall_base.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 36/45] test: enable <misc/tcall_base.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 14:11 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 14:11 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1486 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <trace/>
> directory, includes it in <index>, and names the subtest.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/trace/index | 1 +
> test/LuaJIT-tests/{misc => trace}/tcall_base.lua | 10 +++++-----
> 2 files changed, 6 insertions(+), 5 deletions(-)
> rename test/LuaJIT-tests/{misc => trace}/tcall_base.lua (66%)
>
> diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
> index 4826f429..9de3b478 100644
> --- a/test/LuaJIT-tests/trace/index
> +++ b/test/LuaJIT-tests/trace/index
> @@ -10,3 +10,4 @@ phi
> snap.lua
> stack_purge.lua
> stitch.lua
> +tcall_base.lua
> diff --git a/test/LuaJIT-tests/misc/tcall_base.lua b/test/LuaJIT-tests/trace/tcall_base.lua
> similarity index 66%
> rename from test/LuaJIT-tests/misc/tcall_base.lua
> rename to test/LuaJIT-tests/trace/tcall_base.lua
> index c6c4ae1a..7d8d75e0 100644
> --- a/test/LuaJIT-tests/misc/tcall_base.lua
> +++ b/test/LuaJIT-tests/trace/tcall_base.lua
> @@ -1,4 +1,3 @@
> -
> local r = 0
> local function g()
> r = r + 1
> @@ -14,7 +13,8 @@ local function f()
> end
> end
>
> -g() -- Compile this loop first.
> -for i=1,50 do f() end
> -assert(r == 51)
> -
> +do --- Recording tailcall at base slot.
> + g() -- Compile this loop first.
> + for i=1,50 do f() end
> + assert(r == 51)
> +end
[-- Attachment #2: Type: text/html, Size: 2088 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 36/45] test: enable <misc/tcall_base.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 36/45] test: enable <misc/tcall_base.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 14:11 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:19 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 37/45] test: refactor <trace/tcall_base.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (35 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 36/45] test: enable <misc/tcall_base.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 14:12 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 38/45] test: enable <misc/tcall_loop.lua> " Sergey Kaplun via Tarantool-patches
` (9 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch refactors the aforementioned test to make its code style
closer to ours.
Relates to tarantool/tarantool#9398
---
test/LuaJIT-tests/trace/tcall_base.lua | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/LuaJIT-tests/trace/tcall_base.lua b/test/LuaJIT-tests/trace/tcall_base.lua
index 7d8d75e0..65fc118e 100644
--- a/test/LuaJIT-tests/trace/tcall_base.lua
+++ b/test/LuaJIT-tests/trace/tcall_base.lua
@@ -1,11 +1,11 @@
local r = 0
local function g()
r = r + 1
- for i=1,100 do end
+ for _ = 1, 100 do end
end
local function f()
- for j=1,20 do
+ for j = 1, 20 do
if j > 19 then
return g() -- Tailcall at base.
-- Let this link to the already compiled loop in g().
@@ -15,6 +15,6 @@ end
do --- Recording tailcall at base slot.
g() -- Compile this loop first.
- for i=1,50 do f() end
+ for _ = 1, 50 do f() end
assert(r == 51)
end
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 37/45] test: refactor <trace/tcall_base.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 37/45] test: refactor <trace/tcall_base.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 14:12 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 14:12 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch refactors the aforementioned test to make its code style
> closer to ours.
>
> Relates to tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/trace/tcall_base.lua | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/test/LuaJIT-tests/trace/tcall_base.lua b/test/LuaJIT-tests/trace/tcall_base.lua
> index 7d8d75e0..65fc118e 100644
> --- a/test/LuaJIT-tests/trace/tcall_base.lua
> +++ b/test/LuaJIT-tests/trace/tcall_base.lua
> @@ -1,11 +1,11 @@
> local r = 0
> local function g()
> r = r + 1
> - for i=1,100 do end
> + for _ = 1, 100 do end
> end
>
> local function f()
> - for j=1,20 do
> + for j = 1, 20 do
> if j > 19 then
> return g() -- Tailcall at base.
> -- Let this link to the already compiled loop in g().
> @@ -15,6 +15,6 @@ end
>
> do --- Recording tailcall at base slot.
> g() -- Compile this loop first.
> - for i=1,50 do f() end
> + for _ = 1, 50 do f() end
> assert(r == 51)
> end
[-- Attachment #2: Type: text/html, Size: 1670 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 37/45] test: refactor <trace/tcall_base.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 37/45] test: refactor <trace/tcall_base.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 14:12 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:19 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 38/45] test: enable <misc/tcall_loop.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (36 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 37/45] test: refactor <trace/tcall_base.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 14:14 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 39/45] test: enable <misc/tonumber_scan.lua> " Sergey Kaplun via Tarantool-patches
` (8 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names the subtest.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/tcall_loop.lua | 8 --------
test/LuaJIT-tests/trace/index | 1 +
test/LuaJIT-tests/trace/tcall_loop.lua | 10 ++++++++++
3 files changed, 11 insertions(+), 8 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/tcall_loop.lua
create mode 100644 test/LuaJIT-tests/trace/tcall_loop.lua
diff --git a/test/LuaJIT-tests/misc/tcall_loop.lua b/test/LuaJIT-tests/misc/tcall_loop.lua
deleted file mode 100644
index d3c6f1a6..00000000
--- a/test/LuaJIT-tests/misc/tcall_loop.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-local function f(i)
- if i > 0 then return f(i-1) end
- return 1
-end
-
-local x = 0
-for i=1,100 do x = x + f(1000) end
-assert(x == 100)
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index 9de3b478..1b8fb8f4 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -11,3 +11,4 @@ snap.lua
stack_purge.lua
stitch.lua
tcall_base.lua
+tcall_loop.lua
diff --git a/test/LuaJIT-tests/trace/tcall_loop.lua b/test/LuaJIT-tests/trace/tcall_loop.lua
new file mode 100644
index 00000000..7d872644
--- /dev/null
+++ b/test/LuaJIT-tests/trace/tcall_loop.lua
@@ -0,0 +1,10 @@
+local function f(i)
+ if i > 0 then return f(i - 1) end
+ return 1
+end
+
+do --- Recording tailcall with the loop for the tail recursion.
+ local x = 0
+ for _ = 1, 100 do x = x + f(1000) end
+ assert(x == 100)
+end
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 38/45] test: enable <misc/tcall_loop.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 38/45] test: enable <misc/tcall_loop.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 14:14 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 14:14 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1743 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <trace/>
> directory, includes it in <index>, and names the subtest.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/misc/tcall_loop.lua | 8 --------
> test/LuaJIT-tests/trace/index | 1 +
> test/LuaJIT-tests/trace/tcall_loop.lua | 10 ++++++++++
> 3 files changed, 11 insertions(+), 8 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/tcall_loop.lua
> create mode 100644 test/LuaJIT-tests/trace/tcall_loop.lua
>
> diff --git a/test/LuaJIT-tests/misc/tcall_loop.lua b/test/LuaJIT-tests/misc/tcall_loop.lua
> deleted file mode 100644
> index d3c6f1a6..00000000
> --- a/test/LuaJIT-tests/misc/tcall_loop.lua
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -local function f(i)
> - if i > 0 then return f(i-1) end
> - return 1
> -end
> -
> -local x = 0
> -for i=1,100 do x = x + f(1000) end
> -assert(x == 100)
> diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
> index 9de3b478..1b8fb8f4 100644
> --- a/test/LuaJIT-tests/trace/index
> +++ b/test/LuaJIT-tests/trace/index
> @@ -11,3 +11,4 @@ snap.lua
> stack_purge.lua
> stitch.lua
> tcall_base.lua
> +tcall_loop.lua
> diff --git a/test/LuaJIT-tests/trace/tcall_loop.lua b/test/LuaJIT-tests/trace/tcall_loop.lua
> new file mode 100644
> index 00000000..7d872644
> --- /dev/null
> +++ b/test/LuaJIT-tests/trace/tcall_loop.lua
> @@ -0,0 +1,10 @@
> +local function f(i)
> + if i > 0 then return f(i - 1) end
> + return 1
> +end
> +
> +do --- Recording tailcall with the loop for the tail recursion.
> + local x = 0
> + for _ = 1, 100 do x = x + f(1000) end
> + assert(x == 100)
> +end
[-- Attachment #2: Type: text/html, Size: 2335 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 38/45] test: enable <misc/tcall_loop.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 38/45] test: enable <misc/tcall_loop.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 14:14 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:19 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:19 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 39/45] test: enable <misc/tonumber_scan.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (37 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 38/45] test: enable <misc/tcall_loop.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 14:33 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:20 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 40/45] test: remove <misc/uclo.lua> " Sergey Kaplun via Tarantool-patches
` (7 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the
<lib/base> directory, includes it in <index>, and names the subtest.
Also, the NaN checks are skipped for parsing via `strtod()`, since
LuaJIT uses canonicalized NaNs, which are equal to -NaN
(0xfff8000000000000).
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lib/base/index | 1 +
.../{misc => lib/base}/tonumber_scan.lua | 58 ++++++++++++-------
2 files changed, 37 insertions(+), 22 deletions(-)
rename test/LuaJIT-tests/{misc => lib/base}/tonumber_scan.lua (93%)
diff --git a/test/LuaJIT-tests/lib/base/index b/test/LuaJIT-tests/lib/base/index
index 942c53c0..bef5dcb4 100644
--- a/test/LuaJIT-tests/lib/base/index
+++ b/test/LuaJIT-tests/lib/base/index
@@ -8,4 +8,5 @@ pairs.lua
pcall_jit.lua
select.lua
tonumber_tostring.lua
+tonumber_scan.lua +ffi
xpcall_jit.lua +compat5.2
diff --git a/test/LuaJIT-tests/misc/tonumber_scan.lua b/test/LuaJIT-tests/lib/base/tonumber_scan.lua
similarity index 93%
rename from test/LuaJIT-tests/misc/tonumber_scan.lua
rename to test/LuaJIT-tests/lib/base/tonumber_scan.lua
index 78e1ca3e..e2dcd4d0 100644
--- a/test/LuaJIT-tests/misc/tonumber_scan.lua
+++ b/test/LuaJIT-tests/lib/base/tonumber_scan.lua
@@ -150,31 +150,45 @@ local function tohex64(x)
return "0x"..bit.tohex(tonumber(x/2LL^32))..bit.tohex(tonumber(x%2LL^32)).."ULL"
end
-local conv = tonumber
+local e = ffi.new("char *[1]")
+local u = ffi.new("union { double d; uint64_t x; }")
-if arg and arg[1] == "strtod" then
- local e = ffi.new("char *[1]")
- function conv(s)
- local d = ffi.C.strtod(s, e)
- return (e[0][0] == 0 and #s ~= 0) and d or nil
+local function test_conv(conv, skip_nan)
+ for i = 1, #t, 2 do
+ local y, s = t[i], t[i + 1]
+ if s:lower():match('nan') and skip_nan then
+ -- LuaJIT uses canonicalized NaNs.
+ -- -NaN = 0xfff8000000000000.
+ -- Hence, `strtod()` yields a different value here.
+ goto continue
+ end
+ local d = conv(s)
+ local ok
+ if d == nil then
+ ok = (y == false)
+ else
+ u.d = d
+ ok = (y == u.x)
+ end
+ if not ok then
+ error(string.format(
+ "FAIL: '%s'\n\tGOT: %s\n\tOK: %s",
+ s,
+ d and tohex64(u.x) or "nil",
+ y and tohex64(y) or "nil", "\n\n"
+ ))
+ end
+ ::continue::
end
end
-local u = ffi.new("union { double d; uint64_t x; }")
-
-for i=1,#t,2 do
- local y, s = t[i], t[i+1]
- local d = conv(s)
- local ok
- if d == nil then
- ok = (y == false)
- else
- u.d = d
- ok = (y == u.x)
- end
- if not ok then
- io.write('FAIL: "', s, '"\n GOT: ', d and tohex64(u.x) or "nil", " OK: ", y and tohex64(y) or "nil", "\n\n")
--- print(" "..tohex64(u.x)..", \""..s.."\",")
- end
+do --- tonumber parsing
+ test_conv(tonumber)
end
+do --- strtod parsing
+ test_conv(function(s)
+ local d = ffi.C.strtod(s, e)
+ return (e[0][0] == 0 and #s ~= 0) and d or nil
+ end, true)
+end
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 39/45] test: enable <misc/tonumber_scan.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 39/45] test: enable <misc/tonumber_scan.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 14:33 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:20 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 14:33 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 3281 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the
> <lib/base> directory, includes it in <index>, and names the subtest.
>
> Also, the NaN checks are skipped for parsing via `strtod()`, since
> LuaJIT uses canonicalized NaNs, which are equal to -NaN
> (0xfff8000000000000).
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/lib/base/index | 1 +
> .../{misc => lib/base}/tonumber_scan.lua | 58 ++++++++++++-------
> 2 files changed, 37 insertions(+), 22 deletions(-)
> rename test/LuaJIT-tests/{misc => lib/base}/tonumber_scan.lua (93%)
>
> diff --git a/test/LuaJIT-tests/lib/base/index b/test/LuaJIT-tests/lib/base/index
> index 942c53c0..bef5dcb4 100644
> --- a/test/LuaJIT-tests/lib/base/index
> +++ b/test/LuaJIT-tests/lib/base/index
> @@ -8,4 +8,5 @@ pairs.lua
> pcall_jit.lua
> select.lua
> tonumber_tostring.lua
> +tonumber_scan.lua +ffi
> xpcall_jit.lua +compat5.2
> diff --git a/test/LuaJIT-tests/misc/tonumber_scan.lua b/test/LuaJIT-tests/lib/base/tonumber_scan.lua
> similarity index 93%
> rename from test/LuaJIT-tests/misc/tonumber_scan.lua
> rename to test/LuaJIT-tests/lib/base/tonumber_scan.lua
> index 78e1ca3e..e2dcd4d0 100644
> --- a/test/LuaJIT-tests/misc/tonumber_scan.lua
> +++ b/test/LuaJIT-tests/lib/base/tonumber_scan.lua
> @@ -150,31 +150,45 @@ local function tohex64(x)
> return "0x"..bit.tohex(tonumber(x/2LL^32))..bit.tohex(tonumber(x%2LL^32)).."ULL"
> end
>
> -local conv = tonumber
> +local e = ffi.new("char *[1]")
> +local u = ffi.new("union { double d; uint64_t x; }")
>
> -if arg and arg[1] == "strtod" then
> - local e = ffi.new("char *[1]")
> - function conv(s)
> - local d = ffi.C.strtod(s, e)
> - return (e[0][0] == 0 and #s ~= 0) and d or nil
> +local function test_conv(conv, skip_nan)
> + for i = 1, #t, 2 do
> + local y, s = t[i], t[i + 1]
> + if s:lower():match('nan') and skip_nan then
> + -- LuaJIT uses canonicalized NaNs.
> + -- -NaN = 0xfff8000000000000.
> + -- Hence, `strtod()` yields a different value here.
> + goto continue
> + end
> + local d = conv(s)
> + local ok
> + if d == nil then
> + ok = (y == false)
> + else
> + u.d = d
> + ok = (y == u.x)
> + end
> + if not ok then
> + error(string.format(
> + "FAIL: '%s'\n\tGOT: %s\n\tOK: %s",
> + s,
> + d and tohex64(u.x) or "nil",
> + y and tohex64(y) or "nil", "\n\n"
> + ))
> + end
> + ::continue::
> end
> end
>
> -local u = ffi.new("union { double d; uint64_t x; }")
> -
> -for i=1,#t,2 do
> - local y, s = t[i], t[i+1]
> - local d = conv(s)
> - local ok
> - if d == nil then
> - ok = (y == false)
> - else
> - u.d = d
> - ok = (y == u.x)
> - end
> - if not ok then
> - io.write('FAIL: "', s, '"\n GOT: ', d and tohex64(u.x) or "nil", " OK: ", y and tohex64(y) or "nil", "\n\n")
> --- print(" "..tohex64(u.x)..", \""..s.."\",")
> - end
> +do --- tonumber parsing
> + test_conv(tonumber)
> end
>
> +do --- strtod parsing
> + test_conv(function(s)
> + local d = ffi.C.strtod(s, e)
> + return (e[0][0] == 0 and #s ~= 0) and d or nil
> + end, true)
> +end
[-- Attachment #2: Type: text/html, Size: 3781 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 39/45] test: enable <misc/tonumber_scan.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 39/45] test: enable <misc/tonumber_scan.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 14:33 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:20 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:20 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 40/45] test: remove <misc/uclo.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (38 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 39/45] test: enable <misc/tonumber_scan.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 14:43 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:21 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 41/45] test: enable <misc/unordered_jit.lua> " Sergey Kaplun via Tarantool-patches
` (6 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch removes the aforementioned test since it is part of the
<lang/upvalue/closure.lua> test.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/uclo.lua | 91 ---------------------------------
1 file changed, 91 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/uclo.lua
diff --git a/test/LuaJIT-tests/misc/uclo.lua b/test/LuaJIT-tests/misc/uclo.lua
deleted file mode 100644
index bd9bd242..00000000
--- a/test/LuaJIT-tests/misc/uclo.lua
+++ /dev/null
@@ -1,91 +0,0 @@
-
-local function test_for()
- local z1, z2
- for i=1,10 do
- local function f() return i end
- if z1 then z2 = f else z1 = f end
- end
- assert(z1() == 1)
- assert(z2() == 10)
-end
-
-local function test_while()
- local z1, z2
- local i = 1
- while i <= 10 do
- local j = i
- local function f() return j end
- if z1 then z2 = f else z1 = f end
- i = i + 1
- end
- assert(z1() == 1)
- assert(z2() == 10)
-end
-
-local function test_repeat()
- local z1, z2
- local i = 1
- repeat
- local j = i
- local function f() return j end
- if z1 then z2 = f else z1 = f end
- i = i + 1
- until i > 10
- assert(z1() == 1)
- assert(z2() == 10)
-end
-
-local function test_func()
- local function ff(x)
- return function() return x end
- end
- local z1, z2
- for i=1,10 do
- local f = ff(i)
- if z1 then z2 = f else z1 = f end
- end
- assert(z1() == 1)
- assert(z2() == 10)
-end
-
-test_for()
-test_while()
-test_repeat()
-test_func()
-
-do
- local function f1(a)
- if a > 0 then
- local b = f1(a - 1)
- return function()
- if type(b) == "function" then
- return a + b()
- end
- return a + b
- end
- end
- return a
- end
-
- local function f2(a)
- return f1(a)()
- end
-
- for i = 1, 41 do
- local r = f2(4) + f2(4)
- end
-end
-
--- Don't mark upvalue as immutable if written to after prototype definition.
-do
- local x = 1
- local function f()
- local y = 0
- for i=1,100 do y=y+x end
- return y
- end
- assert(f() == 100)
- x = 2
- assert(f() == 200)
-end
-
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 40/45] test: remove <misc/uclo.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 40/45] test: remove <misc/uclo.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 14:43 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:21 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 14:43 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2347 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch removes the aforementioned test since it is part of the
> <lang/upvalue/closure.lua> test.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/misc/uclo.lua | 91 ---------------------------------
> 1 file changed, 91 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/uclo.lua
>
> diff --git a/test/LuaJIT-tests/misc/uclo.lua b/test/LuaJIT-tests/misc/uclo.lua
> deleted file mode 100644
> index bd9bd242..00000000
> --- a/test/LuaJIT-tests/misc/uclo.lua
> +++ /dev/null
> @@ -1,91 +0,0 @@
> -
> -local function test_for()
> - local z1, z2
> - for i=1,10 do
> - local function f() return i end
> - if z1 then z2 = f else z1 = f end
> - end
> - assert(z1() == 1)
> - assert(z2() == 10)
> -end
> -
> -local function test_while()
> - local z1, z2
> - local i = 1
> - while i <= 10 do
> - local j = i
> - local function f() return j end
> - if z1 then z2 = f else z1 = f end
> - i = i + 1
> - end
> - assert(z1() == 1)
> - assert(z2() == 10)
> -end
> -
> -local function test_repeat()
> - local z1, z2
> - local i = 1
> - repeat
> - local j = i
> - local function f() return j end
> - if z1 then z2 = f else z1 = f end
> - i = i + 1
> - until i > 10
> - assert(z1() == 1)
> - assert(z2() == 10)
> -end
> -
> -local function test_func()
> - local function ff(x)
> - return function() return x end
> - end
> - local z1, z2
> - for i=1,10 do
> - local f = ff(i)
> - if z1 then z2 = f else z1 = f end
> - end
> - assert(z1() == 1)
> - assert(z2() == 10)
> -end
> -
> -test_for()
> -test_while()
> -test_repeat()
> -test_func()
> -
> -do
> - local function f1(a)
> - if a > 0 then
> - local b = f1(a - 1)
> - return function()
> - if type(b) == "function" then
> - return a + b()
> - end
> - return a + b
> - end
> - end
> - return a
> - end
> -
> - local function f2(a)
> - return f1(a)()
> - end
> -
> - for i = 1, 41 do
> - local r = f2(4) + f2(4)
> - end
> -end
> -
> --- Don't mark upvalue as immutable if written to after prototype definition.
> -do
> - local x = 1
> - local function f()
> - local y = 0
> - for i=1,100 do y=y+x end
> - return y
> - end
> - assert(f() == 100)
> - x = 2
> - assert(f() == 200)
> -end
> -
[-- Attachment #2: Type: text/html, Size: 2826 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 40/45] test: remove <misc/uclo.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 40/45] test: remove <misc/uclo.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 14:43 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:21 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:21 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 41/45] test: enable <misc/unordered_jit.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (39 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 40/45] test: remove <misc/uclo.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 14:49 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:21 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 42/45] test: enable <misc/wbarrier.lua> " Sergey Kaplun via Tarantool-patches
` (5 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names the subtests.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/unordered_jit.lua | 96 ---------
test/LuaJIT-tests/trace/index | 1 +
test/LuaJIT-tests/trace/unordered_jit.lua | 240 ++++++++++++++++++++++
3 files changed, 241 insertions(+), 96 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/unordered_jit.lua
create mode 100644 test/LuaJIT-tests/trace/unordered_jit.lua
diff --git a/test/LuaJIT-tests/misc/unordered_jit.lua b/test/LuaJIT-tests/misc/unordered_jit.lua
deleted file mode 100644
index 5ff1a1ba..00000000
--- a/test/LuaJIT-tests/misc/unordered_jit.lua
+++ /dev/null
@@ -1,96 +0,0 @@
-
-local nan = 0/0
-local t = {}
-for i=1,100 do t[i] = i+0.5 end
-for i=101,200 do t[i] = nan end
-
-do
- local z = 0
- for i=1,200 do if t[i] > 1000 then z=i end end
- assert(z == 0)
-end
-
-do
- local z = 0
- for i=1,200 do if not (t[i] < 1000) then z=i end end
- assert(z == 200)
-end
-
-do
- local z = 0
- for i=1,200 do if t[i] <= 1000 then z=i end end
- assert(z == 100)
-end
-
-do
- local z = 0
- for i=1,200 do if not (t[i] >= 1000) then z=i end end
- assert(z == 200)
-end
-
-do
- local z = 0
- for i=1,200 do if t[i] > 0 then z=i end end
- assert(z == 100)
-end
-
-do
- local z = 0
- for i=1,200 do if not (t[i] < 0) then z=i end end
- assert(z == 200)
-end
-
-do
- local z = 0
- for i=1,200 do if t[i] <= 0 then z=i end end
- assert(z == 0)
-end
-
-do
- local z = 0
- for i=1,200 do if not (t[i] >= 0) then z=i end end
- assert(z == 200)
-end
-
-do local z; for i=1,100 do z = 0/0 end; assert(z ~= z) end
-
-do local z; for i=1,100 do z = nan == nan end; assert(z == false) end
-do local z; for i=1,100 do z = nan == 1 end; assert(z == false) end
-do local z; for i=1,100 do z = 1 == nan end; assert(z == false) end
-
-do local z; for i=1,100 do z = nan ~= nan end; assert(z == true) end
-do local z; for i=1,100 do z = nan ~= 1 end; assert(z == true) end
-do local z; for i=1,100 do z = 1 ~= nan end; assert(z == true) end
-
-do local z; for i=1,100 do z = nan < nan end; assert(z == false) end
-do local z; for i=1,100 do z = nan < 1 end; assert(z == false) end
-do local z; for i=1,100 do z = 1 < nan end; assert(z == false) end
-
-do local z; for i=1,100 do z = not (nan < nan) end; assert(z == true) end
-do local z; for i=1,100 do z = not (nan < 1) end; assert(z == true) end
-do local z; for i=1,100 do z = not (1 < nan) end; assert(z == true) end
-
-do local z; for i=1,100 do z = nan > nan end; assert(z == false) end
-do local z; for i=1,100 do z = nan > 1 end; assert(z == false) end
-do local z; for i=1,100 do z = 1 > nan end; assert(z == false) end
-
-do local z; for i=1,100 do z = not (nan > nan) end; assert(z == true) end
-do local z; for i=1,100 do z = not (nan > 1) end; assert(z == true) end
-do local z; for i=1,100 do z = not (1 > nan) end; assert(z == true) end
-
-do local z; for i=1,100 do z = nan <= nan end; assert(z == false) end
-do local z; for i=1,100 do z = nan <= 1 end; assert(z == false) end
-do local z; for i=1,100 do z = 1 <= nan end; assert(z == false) end
-
-do local z; for i=1,100 do z = not (nan <= nan) end; assert(z == true) end
-do local z; for i=1,100 do z = not (nan <= 1) end; assert(z == true) end
-do local z; for i=1,100 do z = not (1 <= nan) end; assert(z == true) end
-
-do local z; for i=1,100 do z = nan >= nan end; assert(z == false) end
-do local z; for i=1,100 do z = nan >= 1 end; assert(z == false) end
-do local z; for i=1,100 do z = 1 >= nan end; assert(z == false) end
-
-do local z; for i=1,100 do z = not (nan >= nan) end; assert(z == true) end
-do local z; for i=1,100 do z = not (nan >= 1) end; assert(z == true) end
-do local z; for i=1,100 do z = not (1 >= nan) end; assert(z == true) end
-
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index 1b8fb8f4..c7fbbe57 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -12,3 +12,4 @@ stack_purge.lua
stitch.lua
tcall_base.lua
tcall_loop.lua
+unordered_jit.lua
diff --git a/test/LuaJIT-tests/trace/unordered_jit.lua b/test/LuaJIT-tests/trace/unordered_jit.lua
new file mode 100644
index 00000000..0aa7bde3
--- /dev/null
+++ b/test/LuaJIT-tests/trace/unordered_jit.lua
@@ -0,0 +1,240 @@
+-- All cases below use constants on the trace.
+local nan = 0/0
+local t = {}
+for i = 1, 100 do t[i] = i + 0.5 end
+for i = 101, 200 do t[i] = nan end
+
+do --- Branch is never taken, NaN > 1000.
+ local z = 0
+ for i = 1, 200 do if t[i] > 1000 then z = i end end
+ assert(z == 0)
+end
+
+do --- Branch begins to be taken on the trace, not (NaN < 1000).
+ local z = 0
+ for i = 1, 200 do if not (t[i] < 1000) then z = i end end
+ assert(z == 200)
+end
+
+do --- Branch ends to be taken on the trace, NaN <= 1000.
+ local z = 0
+ for i = 1, 200 do if t[i] <= 1000 then z = i end end
+ assert(z == 100)
+end
+
+do --- Branch is always taken, not (NaN >= 1000).
+ local z = 0
+ for i = 1, 200 do if not (t[i] >= 1000) then z = i end end
+ assert(z == 200)
+end
+
+do --- Branch ends to be taken on the trace, NaN > 0.
+ local z = 0
+ for i = 1, 200 do if t[i] > 0 then z = i end end
+ assert(z == 100)
+end
+
+do --- Branch is always taken, not (NaN < 0).
+ local z = 0
+ for i = 1, 200 do if not (t[i] < 0) then z = i end end
+ assert(z == 200)
+end
+
+do --- Branch is never taken, NaN <= 0.
+ local z = 0
+ for i = 1, 200 do if t[i] <= 0 then z = i end end
+ assert(z == 0)
+end
+
+do --- Branch begins to be taken on the trace, not (NaN >= 0).
+ local z = 0
+ for i = 1, 200 do if not (t[i] >= 0) then z = i end end
+ assert(z == 200)
+end
+
+do --- NaN assign on trace.
+ local z
+ for _ = 1, 100 do z = 0/0 end
+ assert(z ~= z)
+end
+
+do --- Nan == NaN.
+ local z
+ for _ = 1, 100 do z = nan == nan end
+ assert(z == false)
+end
+
+do --- NaN == 1.
+ local z
+ for _ = 1, 100 do z = nan == 1 end
+ assert(z == false)
+end
+
+do --- 1 == NaN.
+ local z
+ local z
+ for _ = 1, 100 do z = 1 == nan end
+ assert(z == false)
+end
+
+do --- NaN ~= NaN.
+ local z
+ for _ = 1, 100 do z = nan ~= nan end
+ assert(z == true)
+end
+
+do --- NaN ~= 1.
+ local z
+ for _ = 1, 100 do z = nan ~= 1 end
+ assert(z == true)
+end
+
+do --- 1 ~= NaN.
+ local z
+ for _ = 1, 100 do z = 1 ~= nan end
+ assert(z == true)
+end
+
+do --- NaN < NaN.
+ local z
+ for _ = 1, 100 do z = nan < nan end
+ assert(z == false)
+end
+
+do --- NaN < 1.
+ local z
+ for _ = 1, 100 do z = nan < 1 end
+ assert(z == false)
+end
+
+do --- 1 < NaN.
+ local z
+ for _ = 1, 100 do z = 1 < nan end
+ assert(z == false)
+end
+
+do --- not (NaN < NaN).
+ local z
+ for _ = 1, 100 do z = not (nan < nan) end
+ assert(z == true)
+end
+
+do --- not (NaN < 1).
+ local z
+ for _ = 1, 100 do z = not (nan < 1) end
+ assert(z == true)
+end
+
+do --- not (1 < NaN).
+ local z
+ for _ = 1, 100 do z = not (1 < nan) end
+ assert(z == true)
+end
+
+do --- NaN > NaN.
+ local z
+ for _ = 1, 100 do z = nan > nan end
+ assert(z == false)
+end
+
+do --- NaN > 1.
+ local z
+ for _ = 1, 100 do z = nan > 1 end
+ assert(z == false)
+end
+
+do --- 1 > NaN.
+ local z
+ for _ = 1, 100 do z = 1 > nan end
+ assert(z == false)
+end
+
+do --- not (NaN > NaN).
+ local z
+ for _ = 1, 100 do z = not (nan > nan) end
+ assert(z == true)
+end
+
+do --- not (NaN > 1).
+ local z
+ for _ = 1, 100 do z = not (nan > 1) end
+ assert(z == true)
+end
+
+do --- not (1 > NaN).
+ local z
+ for _ = 1, 100 do z = not (1 > nan) end
+ assert(z == true)
+end
+
+do --- NaN <= NaN.
+ local z
+ for _ = 1, 100 do z = nan <= nan end
+ assert(z == false)
+end
+
+do --- NaN <= 1.
+ local z
+ for _ = 1, 100 do z = nan <= 1 end
+ assert(z == false)
+end
+
+do --- 1 <= NaN.
+ local z
+ for _ = 1, 100 do z = 1 <= nan end
+ assert(z == false)
+end
+
+do --- not (NaN <= NaN).
+ local z
+ for _ = 1, 100 do z = not (nan <= nan) end
+ assert(z == true)
+end
+
+do --- not (NaN <= 1).
+ local z
+ for _ = 1, 100 do z = not (nan <= 1) end
+ assert(z == true)
+end
+
+do --- not (1 <= NaN).
+ local z
+ for _ = 1, 100 do z = not (1 <= nan) end
+ assert(z == true)
+end
+
+do --- NaN >= NaN.
+ local z
+ for _ = 1, 100 do z = nan >= nan end
+ assert(z == false)
+end
+
+do --- NaN >= 1.
+ local z
+ for _ = 1, 100 do z = nan >= 1 end
+ assert(z == false)
+end
+
+do --- 1 >= NaN.
+ local z
+ for _ = 1, 100 do z = 1 >= nan end
+ assert(z == false)
+end
+
+do --- not (NaN >= NaN).
+ local z
+ for _ = 1, 100 do z = not (nan >= nan) end
+ assert(z == true)
+end
+
+do --- not (NaN >= 1).
+ local z
+ for _ = 1, 100 do z = not (nan >= 1) end
+ assert(z == true)
+end
+
+do --- not (1 >= NaN).
+ local z
+ for _ = 1, 100 do z = not (1 >= nan) end
+ assert(z == true)
+end
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 41/45] test: enable <misc/unordered_jit.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 41/45] test: enable <misc/unordered_jit.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 14:49 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:21 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 14:49 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 9676 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <trace/>
> directory, includes it in <index>, and names the subtests.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/misc/unordered_jit.lua | 96 ---------
> test/LuaJIT-tests/trace/index | 1 +
> test/LuaJIT-tests/trace/unordered_jit.lua | 240 ++++++++++++++++++++++
> 3 files changed, 241 insertions(+), 96 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/unordered_jit.lua
> create mode 100644 test/LuaJIT-tests/trace/unordered_jit.lua
>
> diff --git a/test/LuaJIT-tests/misc/unordered_jit.lua b/test/LuaJIT-tests/misc/unordered_jit.lua
> deleted file mode 100644
> index 5ff1a1ba..00000000
> --- a/test/LuaJIT-tests/misc/unordered_jit.lua
> +++ /dev/null
> @@ -1,96 +0,0 @@
> -
> -local nan = 0/0
> -local t = {}
> -for i=1,100 do t[i] = i+0.5 end
> -for i=101,200 do t[i] = nan end
> -
> -do
> - local z = 0
> - for i=1,200 do if t[i] > 1000 then z=i end end
> - assert(z == 0)
> -end
> -
> -do
> - local z = 0
> - for i=1,200 do if not (t[i] < 1000) then z=i end end
> - assert(z == 200)
> -end
> -
> -do
> - local z = 0
> - for i=1,200 do if t[i] <= 1000 then z=i end end
> - assert(z == 100)
> -end
> -
> -do
> - local z = 0
> - for i=1,200 do if not (t[i] >= 1000) then z=i end end
> - assert(z == 200)
> -end
> -
> -do
> - local z = 0
> - for i=1,200 do if t[i] > 0 then z=i end end
> - assert(z == 100)
> -end
> -
> -do
> - local z = 0
> - for i=1,200 do if not (t[i] < 0) then z=i end end
> - assert(z == 200)
> -end
> -
> -do
> - local z = 0
> - for i=1,200 do if t[i] <= 0 then z=i end end
> - assert(z == 0)
> -end
> -
> -do
> - local z = 0
> - for i=1,200 do if not (t[i] >= 0) then z=i end end
> - assert(z == 200)
> -end
> -
> -do local z; for i=1,100 do z = 0/0 end; assert(z ~= z) end
> -
> -do local z; for i=1,100 do z = nan == nan end; assert(z == false) end
> -do local z; for i=1,100 do z = nan == 1 end; assert(z == false) end
> -do local z; for i=1,100 do z = 1 == nan end; assert(z == false) end
> -
> -do local z; for i=1,100 do z = nan ~= nan end; assert(z == true) end
> -do local z; for i=1,100 do z = nan ~= 1 end; assert(z == true) end
> -do local z; for i=1,100 do z = 1 ~= nan end; assert(z == true) end
> -
> -do local z; for i=1,100 do z = nan < nan end; assert(z == false) end
> -do local z; for i=1,100 do z = nan < 1 end; assert(z == false) end
> -do local z; for i=1,100 do z = 1 < nan end; assert(z == false) end
> -
> -do local z; for i=1,100 do z = not (nan < nan) end; assert(z == true) end
> -do local z; for i=1,100 do z = not (nan < 1) end; assert(z == true) end
> -do local z; for i=1,100 do z = not (1 < nan) end; assert(z == true) end
> -
> -do local z; for i=1,100 do z = nan > nan end; assert(z == false) end
> -do local z; for i=1,100 do z = nan > 1 end; assert(z == false) end
> -do local z; for i=1,100 do z = 1 > nan end; assert(z == false) end
> -
> -do local z; for i=1,100 do z = not (nan > nan) end; assert(z == true) end
> -do local z; for i=1,100 do z = not (nan > 1) end; assert(z == true) end
> -do local z; for i=1,100 do z = not (1 > nan) end; assert(z == true) end
> -
> -do local z; for i=1,100 do z = nan <= nan end; assert(z == false) end
> -do local z; for i=1,100 do z = nan <= 1 end; assert(z == false) end
> -do local z; for i=1,100 do z = 1 <= nan end; assert(z == false) end
> -
> -do local z; for i=1,100 do z = not (nan <= nan) end; assert(z == true) end
> -do local z; for i=1,100 do z = not (nan <= 1) end; assert(z == true) end
> -do local z; for i=1,100 do z = not (1 <= nan) end; assert(z == true) end
> -
> -do local z; for i=1,100 do z = nan >= nan end; assert(z == false) end
> -do local z; for i=1,100 do z = nan >= 1 end; assert(z == false) end
> -do local z; for i=1,100 do z = 1 >= nan end; assert(z == false) end
> -
> -do local z; for i=1,100 do z = not (nan >= nan) end; assert(z == true) end
> -do local z; for i=1,100 do z = not (nan >= 1) end; assert(z == true) end
> -do local z; for i=1,100 do z = not (1 >= nan) end; assert(z == true) end
> -
> diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
> index 1b8fb8f4..c7fbbe57 100644
> --- a/test/LuaJIT-tests/trace/index
> +++ b/test/LuaJIT-tests/trace/index
> @@ -12,3 +12,4 @@ stack_purge.lua
> stitch.lua
> tcall_base.lua
> tcall_loop.lua
> +unordered_jit.lua
> diff --git a/test/LuaJIT-tests/trace/unordered_jit.lua b/test/LuaJIT-tests/trace/unordered_jit.lua
> new file mode 100644
> index 00000000..0aa7bde3
> --- /dev/null
> +++ b/test/LuaJIT-tests/trace/unordered_jit.lua
> @@ -0,0 +1,240 @@
> +-- All cases below use constants on the trace.
> +local nan = 0/0
> +local t = {}
> +for i = 1, 100 do t[i] = i + 0.5 end
> +for i = 101, 200 do t[i] = nan end
> +
> +do --- Branch is never taken, NaN > 1000.
> + local z = 0
> + for i = 1, 200 do if t[i] > 1000 then z = i end end
> + assert(z == 0)
> +end
> +
> +do --- Branch begins to be taken on the trace, not (NaN < 1000).
> + local z = 0
> + for i = 1, 200 do if not (t[i] < 1000) then z = i end end
> + assert(z == 200)
> +end
> +
> +do --- Branch ends to be taken on the trace, NaN <= 1000.
> + local z = 0
> + for i = 1, 200 do if t[i] <= 1000 then z = i end end
> + assert(z == 100)
> +end
> +
> +do --- Branch is always taken, not (NaN >= 1000).
> + local z = 0
> + for i = 1, 200 do if not (t[i] >= 1000) then z = i end end
> + assert(z == 200)
> +end
> +
> +do --- Branch ends to be taken on the trace, NaN > 0.
> + local z = 0
> + for i = 1, 200 do if t[i] > 0 then z = i end end
> + assert(z == 100)
> +end
> +
> +do --- Branch is always taken, not (NaN < 0).
> + local z = 0
> + for i = 1, 200 do if not (t[i] < 0) then z = i end end
> + assert(z == 200)
> +end
> +
> +do --- Branch is never taken, NaN <= 0.
> + local z = 0
> + for i = 1, 200 do if t[i] <= 0 then z = i end end
> + assert(z == 0)
> +end
> +
> +do --- Branch begins to be taken on the trace, not (NaN >= 0).
> + local z = 0
> + for i = 1, 200 do if not (t[i] >= 0) then z = i end end
> + assert(z == 200)
> +end
> +
> +do --- NaN assign on trace.
> + local z
> + for _ = 1, 100 do z = 0/0 end
> + assert(z ~= z)
> +end
> +
> +do --- Nan == NaN.
> + local z
> + for _ = 1, 100 do z = nan == nan end
> + assert(z == false)
> +end
> +
> +do --- NaN == 1.
> + local z
> + for _ = 1, 100 do z = nan == 1 end
> + assert(z == false)
> +end
> +
> +do --- 1 == NaN.
> + local z
> + local z
> + for _ = 1, 100 do z = 1 == nan end
> + assert(z == false)
> +end
> +
> +do --- NaN ~= NaN.
> + local z
> + for _ = 1, 100 do z = nan ~= nan end
> + assert(z == true)
> +end
> +
> +do --- NaN ~= 1.
> + local z
> + for _ = 1, 100 do z = nan ~= 1 end
> + assert(z == true)
> +end
> +
> +do --- 1 ~= NaN.
> + local z
> + for _ = 1, 100 do z = 1 ~= nan end
> + assert(z == true)
> +end
> +
> +do --- NaN < NaN.
> + local z
> + for _ = 1, 100 do z = nan < nan end
> + assert(z == false)
> +end
> +
> +do --- NaN < 1.
> + local z
> + for _ = 1, 100 do z = nan < 1 end
> + assert(z == false)
> +end
> +
> +do --- 1 < NaN.
> + local z
> + for _ = 1, 100 do z = 1 < nan end
> + assert(z == false)
> +end
> +
> +do --- not (NaN < NaN).
> + local z
> + for _ = 1, 100 do z = not (nan < nan) end
> + assert(z == true)
> +end
> +
> +do --- not (NaN < 1).
> + local z
> + for _ = 1, 100 do z = not (nan < 1) end
> + assert(z == true)
> +end
> +
> +do --- not (1 < NaN).
> + local z
> + for _ = 1, 100 do z = not (1 < nan) end
> + assert(z == true)
> +end
> +
> +do --- NaN > NaN.
> + local z
> + for _ = 1, 100 do z = nan > nan end
> + assert(z == false)
> +end
> +
> +do --- NaN > 1.
> + local z
> + for _ = 1, 100 do z = nan > 1 end
> + assert(z == false)
> +end
> +
> +do --- 1 > NaN.
> + local z
> + for _ = 1, 100 do z = 1 > nan end
> + assert(z == false)
> +end
> +
> +do --- not (NaN > NaN).
> + local z
> + for _ = 1, 100 do z = not (nan > nan) end
> + assert(z == true)
> +end
> +
> +do --- not (NaN > 1).
> + local z
> + for _ = 1, 100 do z = not (nan > 1) end
> + assert(z == true)
> +end
> +
> +do --- not (1 > NaN).
> + local z
> + for _ = 1, 100 do z = not (1 > nan) end
> + assert(z == true)
> +end
> +
> +do --- NaN <= NaN.
> + local z
> + for _ = 1, 100 do z = nan <= nan end
> + assert(z == false)
> +end
> +
> +do --- NaN <= 1.
> + local z
> + for _ = 1, 100 do z = nan <= 1 end
> + assert(z == false)
> +end
> +
> +do --- 1 <= NaN.
> + local z
> + for _ = 1, 100 do z = 1 <= nan end
> + assert(z == false)
> +end
> +
> +do --- not (NaN <= NaN).
> + local z
> + for _ = 1, 100 do z = not (nan <= nan) end
> + assert(z == true)
> +end
> +
> +do --- not (NaN <= 1).
> + local z
> + for _ = 1, 100 do z = not (nan <= 1) end
> + assert(z == true)
> +end
> +
> +do --- not (1 <= NaN).
> + local z
> + for _ = 1, 100 do z = not (1 <= nan) end
> + assert(z == true)
> +end
> +
> +do --- NaN >= NaN.
> + local z
> + for _ = 1, 100 do z = nan >= nan end
> + assert(z == false)
> +end
> +
> +do --- NaN >= 1.
> + local z
> + for _ = 1, 100 do z = nan >= 1 end
> + assert(z == false)
> +end
> +
> +do --- 1 >= NaN.
> + local z
> + for _ = 1, 100 do z = 1 >= nan end
> + assert(z == false)
> +end
> +
> +do --- not (NaN >= NaN).
> + local z
> + for _ = 1, 100 do z = not (nan >= nan) end
> + assert(z == true)
> +end
> +
> +do --- not (NaN >= 1).
> + local z
> + for _ = 1, 100 do z = not (nan >= 1) end
> + assert(z == true)
> +end
> +
> +do --- not (1 >= NaN).
> + local z
> + for _ = 1, 100 do z = not (1 >= nan) end
> + assert(z == true)
> +end
[-- Attachment #2: Type: text/html, Size: 9914 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 41/45] test: enable <misc/unordered_jit.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 41/45] test: enable <misc/unordered_jit.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 14:49 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:21 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:21 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 42/45] test: enable <misc/wbarrier.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (40 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 41/45] test: enable <misc/unordered_jit.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 14:51 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:21 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 43/45] test: enable <misc/wbarrier_jit.lua> " Sergey Kaplun via Tarantool-patches
` (4 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <lang/>
directory, includes it in <index>, and names the subtest.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/index | 1 +
test/LuaJIT-tests/lang/wbarrier.lua | 11 +++++++++++
test/LuaJIT-tests/misc/wbarrier.lua | 7 -------
3 files changed, 12 insertions(+), 7 deletions(-)
create mode 100644 test/LuaJIT-tests/lang/wbarrier.lua
delete mode 100644 test/LuaJIT-tests/misc/wbarrier.lua
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 8da748d0..ab4dc45d 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -32,3 +32,4 @@ gc_stack.lua
gc_step.lua
goto.lua +goto
meta
+wbarrier.lua
diff --git a/test/LuaJIT-tests/lang/wbarrier.lua b/test/LuaJIT-tests/lang/wbarrier.lua
new file mode 100644
index 00000000..3bee865e
--- /dev/null
+++ b/test/LuaJIT-tests/lang/wbarrier.lua
@@ -0,0 +1,11 @@
+do --- Check write barrier when insert strings.
+ local t = {}
+
+ for i = 1, 20000 do
+ t[i] = tostring(i)
+ end
+
+ for i = 1, #t do
+ assert(t[i] == tostring(i))
+ end
+end
diff --git a/test/LuaJIT-tests/misc/wbarrier.lua b/test/LuaJIT-tests/misc/wbarrier.lua
deleted file mode 100644
index 5536625a..00000000
--- a/test/LuaJIT-tests/misc/wbarrier.lua
+++ /dev/null
@@ -1,7 +0,0 @@
-local t={}
-for i=1,20000 do
- t[i] = tostring(i)
-end
-for i=1,#t do
- assert(t[i] == tostring(i))
-end
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 42/45] test: enable <misc/wbarrier.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 42/45] test: enable <misc/wbarrier.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 14:51 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:21 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 14:51 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1632 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <lang/>
> directory, includes it in <index>, and names the subtest.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/lang/index | 1 +
> test/LuaJIT-tests/lang/wbarrier.lua | 11 +++++++++++
> test/LuaJIT-tests/misc/wbarrier.lua | 7 -------
> 3 files changed, 12 insertions(+), 7 deletions(-)
> create mode 100644 test/LuaJIT-tests/lang/wbarrier.lua
> delete mode 100644 test/LuaJIT-tests/misc/wbarrier.lua
>
> diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
> index 8da748d0..ab4dc45d 100644
> --- a/test/LuaJIT-tests/lang/index
> +++ b/test/LuaJIT-tests/lang/index
> @@ -32,3 +32,4 @@ gc_stack.lua
> gc_step.lua
> goto.lua +goto
> meta
> +wbarrier.lua
> diff --git a/test/LuaJIT-tests/lang/wbarrier.lua b/test/LuaJIT-tests/lang/wbarrier.lua
> new file mode 100644
> index 00000000..3bee865e
> --- /dev/null
> +++ b/test/LuaJIT-tests/lang/wbarrier.lua
> @@ -0,0 +1,11 @@
> +do --- Check write barrier when insert strings.
> + local t = {}
> +
> + for i = 1, 20000 do
> + t[i] = tostring(i)
> + end
> +
> + for i = 1, #t do
> + assert(t[i] == tostring(i))
> + end
> +end
> diff --git a/test/LuaJIT-tests/misc/wbarrier.lua b/test/LuaJIT-tests/misc/wbarrier.lua
> deleted file mode 100644
> index 5536625a..00000000
> --- a/test/LuaJIT-tests/misc/wbarrier.lua
> +++ /dev/null
> @@ -1,7 +0,0 @@
> -local t={}
> -for i=1,20000 do
> - t[i] = tostring(i)
> -end
> -for i=1,#t do
> - assert(t[i] == tostring(i))
> -end
[-- Attachment #2: Type: text/html, Size: 2218 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 42/45] test: enable <misc/wbarrier.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 42/45] test: enable <misc/wbarrier.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 14:51 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:21 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:21 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 43/45] test: enable <misc/wbarrier_jit.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (41 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 42/45] test: enable <misc/wbarrier.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 14:52 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:21 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 44/45] test: enable <misc/wbarrier_obar.lua> " Sergey Kaplun via Tarantool-patches
` (3 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names the subtests.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/wbarrier_jit.lua | 18 ------------------
test/LuaJIT-tests/trace/index | 1 +
test/LuaJIT-tests/trace/wbarrier.lua | 16 ++++++++++++++++
3 files changed, 17 insertions(+), 18 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/wbarrier_jit.lua
create mode 100644 test/LuaJIT-tests/trace/wbarrier.lua
diff --git a/test/LuaJIT-tests/misc/wbarrier_jit.lua b/test/LuaJIT-tests/misc/wbarrier_jit.lua
deleted file mode 100644
index 2c8dd7fb..00000000
--- a/test/LuaJIT-tests/misc/wbarrier_jit.lua
+++ /dev/null
@@ -1,18 +0,0 @@
-
-do
- local t = {[0]={}}
- for i=1,1e5 do t[i] = {t[i-1]} end
- for i=1,1e5 do assert(t[i][1] == t[i-1]) end
-end
-
-do
- local f
- do
- local x = 0
- function f()
- for i=1,1e5 do x = {i} end
- end
- end
- f()
-end
-
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index c7fbbe57..5e1c4c2e 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -13,3 +13,4 @@ stitch.lua
tcall_base.lua
tcall_loop.lua
unordered_jit.lua
+wbarrier.lua
diff --git a/test/LuaJIT-tests/trace/wbarrier.lua b/test/LuaJIT-tests/trace/wbarrier.lua
new file mode 100644
index 00000000..625c0ff2
--- /dev/null
+++ b/test/LuaJIT-tests/trace/wbarrier.lua
@@ -0,0 +1,16 @@
+do --- TBAR for HSTORE.
+ local t = {[0]={}}
+ for i = 1, 1e5 do t[i] = {t[i - 1]} end
+ for i = 1, 1e5 do assert(t[i][1] == t[i - 1]) end
+end
+
+do --- OBAR for USTORE.
+ local f
+ do
+ local x = 0
+ function f()
+ for i = 1, 1e5 do x = {i} end
+ end
+ end
+ f()
+end
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 43/45] test: enable <misc/wbarrier_jit.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 43/45] test: enable <misc/wbarrier_jit.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 14:52 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:21 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 14:52 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1971 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test from the <misc> to the <trace/>
> directory, includes it in <index>, and names the subtests.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/misc/wbarrier_jit.lua | 18 ------------------
> test/LuaJIT-tests/trace/index | 1 +
> test/LuaJIT-tests/trace/wbarrier.lua | 16 ++++++++++++++++
> 3 files changed, 17 insertions(+), 18 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/wbarrier_jit.lua
> create mode 100644 test/LuaJIT-tests/trace/wbarrier.lua
>
> diff --git a/test/LuaJIT-tests/misc/wbarrier_jit.lua b/test/LuaJIT-tests/misc/wbarrier_jit.lua
> deleted file mode 100644
> index 2c8dd7fb..00000000
> --- a/test/LuaJIT-tests/misc/wbarrier_jit.lua
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -
> -do
> - local t = {[0]={}}
> - for i=1,1e5 do t[i] = {t[i-1]} end
> - for i=1,1e5 do assert(t[i][1] == t[i-1]) end
> -end
> -
> -do
> - local f
> - do
> - local x = 0
> - function f()
> - for i=1,1e5 do x = {i} end
> - end
> - end
> - f()
> -end
> -
> diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
> index c7fbbe57..5e1c4c2e 100644
> --- a/test/LuaJIT-tests/trace/index
> +++ b/test/LuaJIT-tests/trace/index
> @@ -13,3 +13,4 @@ stitch.lua
> tcall_base.lua
> tcall_loop.lua
> unordered_jit.lua
> +wbarrier.lua
> diff --git a/test/LuaJIT-tests/trace/wbarrier.lua b/test/LuaJIT-tests/trace/wbarrier.lua
> new file mode 100644
> index 00000000..625c0ff2
> --- /dev/null
> +++ b/test/LuaJIT-tests/trace/wbarrier.lua
> @@ -0,0 +1,16 @@
> +do --- TBAR for HSTORE.
> + local t = {[0]={}}
> + for i = 1, 1e5 do t[i] = {t[i - 1]} end
> + for i = 1, 1e5 do assert(t[i][1] == t[i - 1]) end
> +end
> +
> +do --- OBAR for USTORE.
> + local f
> + do
> + local x = 0
> + function f()
> + for i = 1, 1e5 do x = {i} end
> + end
> + end
> + f()
> +end
[-- Attachment #2: Type: text/html, Size: 2525 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 43/45] test: enable <misc/wbarrier_jit.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 43/45] test: enable <misc/wbarrier_jit.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 14:52 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:21 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:21 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 44/45] test: enable <misc/wbarrier_obar.lua> LuaJIT test
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (42 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 43/45] test: enable <misc/wbarrier_jit.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 15:17 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:22 ` Maxim Kokryashkin via Tarantool-patches
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 45/45] test: update <LuaJIT-tests/README.md> Sergey Kaplun via Tarantool-patches
` (2 subsequent siblings)
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves the aforementioned test to the <trace/wbarrier.lua>
test, with refactoring to restore the JIT engine and GC settings after
the test.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/misc/wbarrier_obar.lua | 22 -------------
test/LuaJIT-tests/trace/wbarrier.lua | 41 ++++++++++++++++++++++++
2 files changed, 41 insertions(+), 22 deletions(-)
delete mode 100644 test/LuaJIT-tests/misc/wbarrier_obar.lua
diff --git a/test/LuaJIT-tests/misc/wbarrier_obar.lua b/test/LuaJIT-tests/misc/wbarrier_obar.lua
deleted file mode 100644
index 258db215..00000000
--- a/test/LuaJIT-tests/misc/wbarrier_obar.lua
+++ /dev/null
@@ -1,22 +0,0 @@
--- DSE of USTORE must eliminate OBAR, too.
-
-if jit and jit.opt then pcall(jit.opt.start, "-sink") end
-
-local f
-do
- local x
- f = function()
- local y = 0
- for i=1,10000 do
- x = {1}
- if y > 0 then end
- x = 1
- end
- end
-end
-
-collectgarbage()
-collectgarbage("setstepmul", 1)
-collectgarbage("restart")
-f()
-
diff --git a/test/LuaJIT-tests/trace/wbarrier.lua b/test/LuaJIT-tests/trace/wbarrier.lua
index 625c0ff2..9c9c50af 100644
--- a/test/LuaJIT-tests/trace/wbarrier.lua
+++ b/test/LuaJIT-tests/trace/wbarrier.lua
@@ -1,3 +1,12 @@
+local function jit_opt_is_on(needed)
+ for _, opt in ipairs({jit.status()}) do
+ if opt == needed then
+ return true
+ end
+ end
+ return false
+end
+
do --- TBAR for HSTORE.
local t = {[0]={}}
for i = 1, 1e5 do t[i] = {t[i - 1]} end
@@ -14,3 +23,35 @@ do --- OBAR for USTORE.
end
f()
end
+
+do --- DSE of USTORE must eliminate OBAR too.
+ local need_restore_sink = false
+ if jit_opt_is_on("sink") then
+ need_restore_sink = true
+ jit.opt.start("-sink")
+ end
+
+ local f
+ do
+ local x
+ f = function()
+ local y = 0
+ for _ = 1, 10000 do
+ x = {1}
+ if y > 0 then end
+ x = 1
+ end
+ end
+ end
+
+ collectgarbage()
+ local oldstepmul = collectgarbage("setstepmul", 1)
+ collectgarbage("restart")
+
+ f()
+
+ collectgarbage("setstepmul", oldstepmul)
+ if need_restore_sink then
+ jit.opt.start("+sink")
+ end
+end
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 44/45] test: enable <misc/wbarrier_obar.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 44/45] test: enable <misc/wbarrier_obar.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-22 15:17 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:22 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 15:17 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2415 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch moves the aforementioned test to the <trace/wbarrier.lua>
> test, with refactoring to restore the JIT engine and GC settings after
> the test.
>
> Part of tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
> test/LuaJIT-tests/misc/wbarrier_obar.lua | 22 -------------
> test/LuaJIT-tests/trace/wbarrier.lua | 41 ++++++++++++++++++++++++
> 2 files changed, 41 insertions(+), 22 deletions(-)
> delete mode 100644 test/LuaJIT-tests/misc/wbarrier_obar.lua
>
> diff --git a/test/LuaJIT-tests/misc/wbarrier_obar.lua b/test/LuaJIT-tests/misc/wbarrier_obar.lua
> deleted file mode 100644
> index 258db215..00000000
> --- a/test/LuaJIT-tests/misc/wbarrier_obar.lua
> +++ /dev/null
> @@ -1,22 +0,0 @@
> --- DSE of USTORE must eliminate OBAR, too.
> -
> -if jit and jit.opt then pcall(jit.opt.start, "-sink") end
> -
> -local f
> -do
> - local x
> - f = function()
> - local y = 0
> - for i=1,10000 do
> - x = {1}
> - if y > 0 then end
> - x = 1
> - end
> - end
> -end
> -
> -collectgarbage()
> -collectgarbage("setstepmul", 1)
> -collectgarbage("restart")
> -f()
> -
> diff --git a/test/LuaJIT-tests/trace/wbarrier.lua b/test/LuaJIT-tests/trace/wbarrier.lua
> index 625c0ff2..9c9c50af 100644
> --- a/test/LuaJIT-tests/trace/wbarrier.lua
> +++ b/test/LuaJIT-tests/trace/wbarrier.lua
> @@ -1,3 +1,12 @@
> +local function jit_opt_is_on(needed)
> + for _, opt in ipairs({jit.status()}) do
> + if opt == needed then
> + return true
> + end
> + end
> + return false
> +end
> +
> do --- TBAR for HSTORE.
> local t = {[0]={}}
> for i = 1, 1e5 do t[i] = {t[i - 1]} end
> @@ -14,3 +23,35 @@ do --- OBAR for USTORE.
> end
> f()
> end
> +
> +do --- DSE of USTORE must eliminate OBAR too.
> + local need_restore_sink = false
> + if jit_opt_is_on("sink") then
> + need_restore_sink = true
> + jit.opt.start("-sink")
> + end
> +
> + local f
> + do
> + local x
> + f = function()
> + local y = 0
> + for _ = 1, 10000 do
> + x = {1}
> + if y > 0 then end
> + x = 1
> + end
> + end
> + end
> +
> + collectgarbage()
> + local oldstepmul = collectgarbage("setstepmul", 1)
> + collectgarbage("restart")
> +
> + f()
> +
> + collectgarbage("setstepmul", oldstepmul)
> + if need_restore_sink then
> + jit.opt.start("+sink")
> + end
> +end
[-- Attachment #2: Type: text/html, Size: 2912 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 44/45] test: enable <misc/wbarrier_obar.lua> LuaJIT test
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 44/45] test: enable <misc/wbarrier_obar.lua> " Sergey Kaplun via Tarantool-patches
2024-08-22 15:17 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:22 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:22 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 45/45] test: update <LuaJIT-tests/README.md>
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (43 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 44/45] test: enable <misc/wbarrier_obar.lua> " Sergey Kaplun via Tarantool-patches
@ 2024-08-21 8:58 ` Sergey Kaplun via Tarantool-patches
2024-08-22 15:17 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:22 ` Maxim Kokryashkin via Tarantool-patches
2024-08-23 15:55 ` [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Bronnikov via Tarantool-patches
2024-10-18 15:07 ` Sergey Kaplun via Tarantool-patches
46 siblings, 2 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-08-21 8:58 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch removes the mention of the <misc> directory since all files
in it are enabled and moved into the different directories.
Relates to tarantool/tarantool#9398
---
test/LuaJIT-tests/README.md | 2 --
1 file changed, 2 deletions(-)
diff --git a/test/LuaJIT-tests/README.md b/test/LuaJIT-tests/README.md
index 210ca232..ddc05087 100644
--- a/test/LuaJIT-tests/README.md
+++ b/test/LuaJIT-tests/README.md
@@ -109,8 +109,6 @@ Some files/directories in this directory need some thought:
* `common/ffi_util.inc` - Needs renaming and being made `require`-able.
* `lib/table/misc.lua` - Tests need organising and converting to structure
described in this document.
- * `misc` - Tests need organising and converting to structure described in
- this document.
* `src` - C/C++ source which needs to be compiled into a dynamic library and
loaded for certain tests.
* `sysdep` - Need to figure out a good way of handling these.
--
2.45.2
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 45/45] test: update <LuaJIT-tests/README.md>
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 45/45] test: update <LuaJIT-tests/README.md> Sergey Kaplun via Tarantool-patches
@ 2024-08-22 15:17 ` Sergey Bronnikov via Tarantool-patches
2024-09-04 23:22 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-22 15:17 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1117 bytes --]
Sergey,
thanks for the patch! LGTM
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch removes the mention of the <misc> directory since all files
> in it are enabled and moved into the different directories.
>
> Relates to tarantool/tarantool#9398
> ---
> test/LuaJIT-tests/README.md | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/test/LuaJIT-tests/README.md b/test/LuaJIT-tests/README.md
> index 210ca232..ddc05087 100644
> --- a/test/LuaJIT-tests/README.md
> +++ b/test/LuaJIT-tests/README.md
> @@ -109,8 +109,6 @@ Some files/directories in this directory need some thought:
> * `common/ffi_util.inc` - Needs renaming and being made `require`-able.
> * `lib/table/misc.lua` - Tests need organising and converting to structure
> described in this document.
> - * `misc` - Tests need organising and converting to structure described in
> - this document.
> * `src` - C/C++ source which needs to be compiled into a dynamic library and
> loaded for certain tests.
> * `sysdep` - Need to figure out a good way of handling these.
[-- Attachment #2: Type: text/html, Size: 1570 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 45/45] test: update <LuaJIT-tests/README.md>
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 45/45] test: update <LuaJIT-tests/README.md> Sergey Kaplun via Tarantool-patches
2024-08-22 15:17 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-04 23:22 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 157+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-09-04 23:22 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (44 preceding siblings ...)
2024-08-21 8:58 ` [Tarantool-patches] [PATCH v2 luajit 45/45] test: update <LuaJIT-tests/README.md> Sergey Kaplun via Tarantool-patches
@ 2024-08-23 15:55 ` Sergey Bronnikov via Tarantool-patches
2024-10-18 15:07 ` Sergey Kaplun via Tarantool-patches
46 siblings, 0 replies; 157+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-08-23 15:55 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 10151 bytes --]
Sergey,
On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch set handles all tests from the <misc/> directory: removes
> duplicates or enables them as a part of other categories.
>
> Changes in v2:
> * Separate refactoring of the enabled tests, where the original
> patch does not include the whole test due to its enabling and fixing
> the indentation (as discussed with Sergey Bronnikov).
> * Updated the <LuaJIT-tests/README.md> to make it up-to-date.
>
> Branch:https://github.com/tarantool/luajit/tree/skaplun/gh-9398-more-luajit-tests-p2
> Issue:https://github.com/tarantool/tarantool/issues/9398
Thanks for patches! LGTM
> Sergey Kaplun (45):
> test: don't run JIT-based LuaJIT tests without JIT
> test: actualize <LuaJIT-tests/README.md>
> test: enable <misc/alias_alloc.lua> LuaJIT test
> test: refactor <alias_alloc.lua> LuaJIT test
> test: refactor <lang/coroutine.lua> LuaJIT test
> test: remove <misc/coro_yield.lua> LuaJIT test
> test: enable <misc/debug_gc.lua> LuaJIT test
> test: enable <misc/dualnum.lua> LuaJIT test
> test: refactor <lang/dualnum.lua> LuaJIT test
> test: remove <misc/fori_coerce.lua> LuaJIT test
> test: remove <misc/fori_dir.lua> LuaJIT test
> test: remove <misc/gc_rechain.lua> LuaJIT test
> test: enable <misc/gc_trace.lua> LuaJIT test
> test: refactor <trace/gc.lua> LuaJIT test
> test: enable <misc/gcstep.lua> LuaJIT test
> test: enable <misc/hook_active.lua> LuaJIT test
> test: enable <misc/hook_line.lua> LuaJIT test
> test: enable <misc/hook_norecord.lua> LuaJIT test
> test: enable <misc/hook_record.lua> LuaJIT test
> test: enable <misc/hook_top.lua> LuaJIT test
> test: enable <misc/jit_flush.lua> LuaJIT test
> test: remove <misc/loop_unroll.lua> LuaJIT test
> test: enable <misc/parse_comp.lua> LuaJIT test
> test: enable <misc/parse_esc.lua> LuaJIT test
> test: enable <misc/parse_misc.lua> LuaJIT test
> test: enable <misc/phi_conv.lua> LuaJIT test
> test: refactor <trace/phi/conv.lua> LuaJIT test
> test: enable <misc/recurse_deep.lua> LuaJIT test
> test: remove <misc/recurse_tail.lua> LuaJIT test
> test: enable <misc/stack_gc.lua> LuaJIT test
> test: refactor <lang/gc_stack.lua> LuaJIT test
> test: enable <misc/stack_purge.lua> LuaJIT test
> test: refactor <trace/stack_purge.lua> LuaJIT test
> test: enable <misc/stackov.lua> LuaJIT test
> test: enable <misc/stackovc.lua> LuaJIT test
> test: enable <misc/tcall_base.lua> LuaJIT test
> test: refactor <trace/tcall_base.lua> LuaJIT test
> test: enable <misc/tcall_loop.lua> LuaJIT test
> test: enable <misc/tonumber_scan.lua> LuaJIT test
> test: remove <misc/uclo.lua> LuaJIT test
> test: enable <misc/unordered_jit.lua> LuaJIT test
> test: enable <misc/wbarrier.lua> LuaJIT test
> test: enable <misc/wbarrier_jit.lua> LuaJIT test
> test: enable <misc/wbarrier_obar.lua> LuaJIT test
> test: update <LuaJIT-tests/README.md>
>
> test/LuaJIT-tests/CMakeLists.txt | 10 +-
> test/LuaJIT-tests/README.md | 17 +-
> test/LuaJIT-tests/lang/coroutine.lua | 8 -
> .../deep_recursion.lua} | 8 +-
> test/LuaJIT-tests/{misc => lang}/dualnum.lua | 24 +-
> .../{misc/debug_gc.lua => lang/gc_debug.lua} | 31 ++-
> .../{misc/stack_gc.lua => lang/gc_stack.lua} | 6 +-
> test/LuaJIT-tests/lang/gc_step.lua | 39 +++
> test/LuaJIT-tests/lang/hook_active.lua | 102 ++++++++
> test/LuaJIT-tests/lang/hook_line.lua | 45 ++++
> test/LuaJIT-tests/lang/hook_top.lua | 59 +++++
> test/LuaJIT-tests/lang/index | 15 +-
> test/LuaJIT-tests/lang/parse_comp.lua | 12 +
> test/LuaJIT-tests/lang/parse_esc.lua | 10 +
> test/LuaJIT-tests/lang/parse_misc.lua | 31 +++
> test/LuaJIT-tests/lang/stackov.lua | 48 ++++
> test/LuaJIT-tests/lang/stackov_c.lua | 12 +
> test/LuaJIT-tests/lang/wbarrier.lua | 11 +
> test/LuaJIT-tests/lib/base/index | 1 +
> .../{misc => lib/base}/tonumber_scan.lua | 58 +++--
> test/LuaJIT-tests/lib/coroutine/index | 1 +
> test/LuaJIT-tests/lib/coroutine/traceback.lua | 14 +
> test/LuaJIT-tests/misc/coro_traceback.lua | 8 -
> test/LuaJIT-tests/misc/coro_yield.lua | 111 --------
> test/LuaJIT-tests/misc/for_dir.lua | 13 -
> test/LuaJIT-tests/misc/fori_coerce.lua | 33 ---
> test/LuaJIT-tests/misc/gc_rechain.lua | 32 ---
> test/LuaJIT-tests/misc/gcstep.lua | 33 ---
> test/LuaJIT-tests/misc/hook_active.lua | 95 -------
> test/LuaJIT-tests/misc/hook_line.lua | 41 ---
> test/LuaJIT-tests/misc/hook_norecord.lua | 12 -
> test/LuaJIT-tests/misc/hook_record.lua | 8 -
> test/LuaJIT-tests/misc/hook_top.lua | 55 ----
> test/LuaJIT-tests/misc/jit_flush.lua | 50 ----
> test/LuaJIT-tests/misc/loop_unroll.lua | 35 ---
> test/LuaJIT-tests/misc/parse_comp.lua | 13 -
> test/LuaJIT-tests/misc/parse_esc.lua | 7 -
> test/LuaJIT-tests/misc/parse_misc.lua | 31 ---
> test/LuaJIT-tests/misc/recurse_tail.lua | 22 --
> test/LuaJIT-tests/misc/stackov.lua | 40 ---
> test/LuaJIT-tests/misc/stackovc.lua | 4 -
> test/LuaJIT-tests/misc/tcall_loop.lua | 8 -
> test/LuaJIT-tests/misc/uclo.lua | 91 -------
> test/LuaJIT-tests/misc/unordered_jit.lua | 96 -------
> test/LuaJIT-tests/misc/wbarrier.lua | 7 -
> test/LuaJIT-tests/misc/wbarrier_jit.lua | 18 --
> test/LuaJIT-tests/misc/wbarrier_obar.lua | 22 --
> test/LuaJIT-tests/opt/index | 1 +
> .../{misc => opt/mem}/alias_alloc.lua | 30 +--
> test/LuaJIT-tests/opt/mem/index | 1 +
> .../{misc/gc_trace.lua => trace/gc.lua} | 32 ++-
> test/LuaJIT-tests/trace/hook_norecord.lua | 12 +
> test/LuaJIT-tests/trace/hook_record.lua | 7 +
> test/LuaJIT-tests/trace/index | 9 +
> test/LuaJIT-tests/trace/jit_flush.lua | 66 +++++
> .../{misc/phi_conv.lua => trace/phi/conv.lua} | 37 +--
> test/LuaJIT-tests/trace/phi/index | 1 +
> .../{misc => trace}/stack_purge.lua | 14 +-
> .../{misc => trace}/tcall_base.lua | 14 +-
> test/LuaJIT-tests/trace/tcall_loop.lua | 10 +
> test/LuaJIT-tests/trace/unordered_jit.lua | 240 ++++++++++++++++++
> test/LuaJIT-tests/trace/wbarrier.lua | 57 +++++
> 62 files changed, 959 insertions(+), 1019 deletions(-)
> delete mode 100644 test/LuaJIT-tests/lang/coroutine.lua
> rename test/LuaJIT-tests/{misc/recurse_deep.lua => lang/deep_recursion.lua} (84%)
> rename test/LuaJIT-tests/{misc => lang}/dualnum.lua (57%)
> rename test/LuaJIT-tests/{misc/debug_gc.lua => lang/gc_debug.lua} (63%)
> rename test/LuaJIT-tests/{misc/stack_gc.lua => lang/gc_stack.lua} (76%)
> create mode 100644 test/LuaJIT-tests/lang/gc_step.lua
> create mode 100644 test/LuaJIT-tests/lang/hook_active.lua
> create mode 100644 test/LuaJIT-tests/lang/hook_line.lua
> create mode 100644 test/LuaJIT-tests/lang/hook_top.lua
> create mode 100644 test/LuaJIT-tests/lang/parse_comp.lua
> create mode 100644 test/LuaJIT-tests/lang/parse_esc.lua
> create mode 100644 test/LuaJIT-tests/lang/parse_misc.lua
> create mode 100644 test/LuaJIT-tests/lang/stackov.lua
> create mode 100644 test/LuaJIT-tests/lang/stackov_c.lua
> create mode 100644 test/LuaJIT-tests/lang/wbarrier.lua
> rename test/LuaJIT-tests/{misc => lib/base}/tonumber_scan.lua (93%)
> create mode 100644 test/LuaJIT-tests/lib/coroutine/traceback.lua
> delete mode 100644 test/LuaJIT-tests/misc/coro_traceback.lua
> delete mode 100644 test/LuaJIT-tests/misc/coro_yield.lua
> delete mode 100644 test/LuaJIT-tests/misc/for_dir.lua
> delete mode 100644 test/LuaJIT-tests/misc/fori_coerce.lua
> delete mode 100644 test/LuaJIT-tests/misc/gc_rechain.lua
> delete mode 100644 test/LuaJIT-tests/misc/gcstep.lua
> delete mode 100644 test/LuaJIT-tests/misc/hook_active.lua
> delete mode 100644 test/LuaJIT-tests/misc/hook_line.lua
> delete mode 100644 test/LuaJIT-tests/misc/hook_norecord.lua
> delete mode 100644 test/LuaJIT-tests/misc/hook_record.lua
> delete mode 100644 test/LuaJIT-tests/misc/hook_top.lua
> delete mode 100644 test/LuaJIT-tests/misc/jit_flush.lua
> delete mode 100644 test/LuaJIT-tests/misc/loop_unroll.lua
> delete mode 100644 test/LuaJIT-tests/misc/parse_comp.lua
> delete mode 100644 test/LuaJIT-tests/misc/parse_esc.lua
> delete mode 100644 test/LuaJIT-tests/misc/parse_misc.lua
> delete mode 100644 test/LuaJIT-tests/misc/recurse_tail.lua
> delete mode 100644 test/LuaJIT-tests/misc/stackov.lua
> delete mode 100644 test/LuaJIT-tests/misc/stackovc.lua
> delete mode 100644 test/LuaJIT-tests/misc/tcall_loop.lua
> delete mode 100644 test/LuaJIT-tests/misc/uclo.lua
> delete mode 100644 test/LuaJIT-tests/misc/unordered_jit.lua
> delete mode 100644 test/LuaJIT-tests/misc/wbarrier.lua
> delete mode 100644 test/LuaJIT-tests/misc/wbarrier_jit.lua
> delete mode 100644 test/LuaJIT-tests/misc/wbarrier_obar.lua
> rename test/LuaJIT-tests/{misc => opt/mem}/alias_alloc.lua (53%)
> create mode 100644 test/LuaJIT-tests/opt/mem/index
> rename test/LuaJIT-tests/{misc/gc_trace.lua => trace/gc.lua} (54%)
> create mode 100644 test/LuaJIT-tests/trace/hook_norecord.lua
> create mode 100644 test/LuaJIT-tests/trace/hook_record.lua
> create mode 100644 test/LuaJIT-tests/trace/jit_flush.lua
> rename test/LuaJIT-tests/{misc/phi_conv.lua => trace/phi/conv.lua} (65%)
> rename test/LuaJIT-tests/{misc => trace}/stack_purge.lua (74%)
> rename test/LuaJIT-tests/{misc => trace}/tcall_base.lua (55%)
> create mode 100644 test/LuaJIT-tests/trace/tcall_loop.lua
> create mode 100644 test/LuaJIT-tests/trace/unordered_jit.lua
> create mode 100644 test/LuaJIT-tests/trace/wbarrier.lua
>
[-- Attachment #2: Type: text/html, Size: 10811 bytes --]
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests
2024-08-21 8:58 [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
` (45 preceding siblings ...)
2024-08-23 15:55 ` [Tarantool-patches] [PATCH v2 luajit 00/45] Rearrange LuaJIT misc tests Sergey Bronnikov via Tarantool-patches
@ 2024-10-18 15:07 ` Sergey Kaplun via Tarantool-patches
46 siblings, 0 replies; 157+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-10-18 15:07 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
I've checked the patchset into all long-term branches in
tarantool/luajit and bumped a new version in master [1], release/3.2 [2]
and release/2.11 [3].
[1]: https://github.com/tarantool/tarantool/pull/10712
[2]: https://github.com/tarantool/tarantool/pull/10713
[3]: https://github.com/tarantool/tarantool/pull/10714
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 157+ messages in thread