Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Maxim Kokryashkin <m.kokryashkin@tarantool.org>,
	Sergey Bronnikov <sergeyb@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH luajit 0/5] Fix pow inconsistencies and improve asserts
Date: Tue, 15 Aug 2023 12:36:26 +0300	[thread overview]
Message-ID: <cover.1692089298.git.skaplun@tarantool.org> (raw)

This patchset fix `^` operator insconsistencies. Since the last 2
commits are based on the patch "Improve assertions." (*) it is backported as
well (it's about time).

(*) Be aware that assertions in <src/luajit.c> aren't replaced in the
upstream too.
The following functions/modules contains our own code with assertions,
so we can discuss some better namings for them:
* `lj_fullhash()` in <src/lj_str.c>
* `lua_hashstring()` in <src/lj_api.c>
* <src/lib_misc.c>
* <src/lj_mapi.c>
* <src/lj_memprof.c>
* <src/lj_sysprof.c>
* <src/lj_utils_leb128.c>
* <src/lj_wbuf.c>

P.S. Unfortunately, I can't find any reproducer for dropping
optimization of 2 ^ i => ldexp(1.0, i). Please, guide me, if you may
found any.

Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-9-pow-inconsistencies
PR: https://github.com/tarantool/tarantool/pull/8985
Related issues:
* https://github.com/tarantool/tarantool/issues/8825
* https://github.com/LuaJIT/LuaJIT/issues/9
* https://github.com/LuaJIT/LuaJIT/issues/684
* https://github.com/LuaJIT/LuaJIT/issues/817


Mike Pall (4):
  Remove pow() splitting and cleanup backends.
  Improve assertions.
  Fix pow() optimization inconsistencies.
  Revert to trival pow() optimizations to prevent inaccuracies.

Sergey Kaplun (1):
  test: introduce `samevalues()` TAP checker

 src/CMakeLists.txt                            |   1 +
 src/Makefile.dep.original                     |  13 +-
 src/Makefile.original                         |   4 +-
 src/lib_io.c                                  |   6 +-
 src/lib_jit.c                                 |   4 +-
 src/lib_misc.c                                |  12 +-
 src/lib_string.c                              |   6 +-
 src/lj_api.c                                  | 140 ++++++-----
 src/lj_arch.h                                 |   3 -
 src/lj_asm.c                                  | 230 +++++++++++-------
 src/lj_asm_arm.h                              | 129 +++++-----
 src/lj_asm_arm64.h                            | 134 +++++-----
 src/lj_asm_mips.h                             | 189 +++++++-------
 src/lj_asm_ppc.h                              | 122 ++++++----
 src/lj_asm_x86.h                              | 211 +++++++---------
 src/lj_assert.c                               |  28 +++
 src/lj_bcread.c                               |  20 +-
 src/lj_bcwrite.c                              |  24 +-
 src/lj_buf.c                                  |   4 +-
 src/lj_carith.c                               |  10 +-
 src/lj_ccall.c                                |  19 +-
 src/lj_ccallback.c                            |  42 ++--
 src/lj_cconv.c                                |  57 +++--
 src/lj_cconv.h                                |   5 +-
 src/lj_cdata.c                                |  27 +-
 src/lj_cdata.h                                |   7 +-
 src/lj_clib.c                                 |   6 +-
 src/lj_cparse.c                               |  25 +-
 src/lj_crecord.c                              |  19 +-
 src/lj_ctype.c                                |  13 +-
 src/lj_ctype.h                                |  14 +-
 src/lj_debug.c                                |  18 +-
 src/lj_def.h                                  |  26 +-
 src/lj_dispatch.c                             |  11 +-
 src/lj_emit_arm.h                             |  50 ++--
 src/lj_emit_arm64.h                           |  21 +-
 src/lj_emit_mips.h                            |  22 +-
 src/lj_emit_ppc.h                             |  12 +-
 src/lj_emit_x86.h                             |  22 +-
 src/lj_err.c                                  |  40 +--
 src/lj_ffrecord.c                             |   4 +-
 src/lj_func.c                                 |  18 +-
 src/lj_gc.c                                   |  78 +++---
 src/lj_gc.h                                   |   6 +-
 src/lj_gdbjit.c                               |   5 +-
 src/lj_ir.c                                   |  31 +--
 src/lj_ir.h                                   |   7 +-
 src/lj_ircall.h                               |   2 -
 src/lj_iropt.h                                |   1 -
 src/lj_jit.h                                  |   6 +
 src/lj_lex.c                                  |  14 +-
 src/lj_lex.h                                  |   6 +
 src/lj_load.c                                 |   2 +-
 src/lj_mapi.c                                 |   2 +-
 src/lj_mcode.c                                |   2 +-
 src/lj_memprof.c                              |  35 +--
 src/lj_meta.c                                 |   6 +-
 src/lj_obj.h                                  |  35 ++-
 src/lj_opt_fold.c                             | 144 +++++------
 src/lj_opt_loop.c                             |   5 +-
 src/lj_opt_mem.c                              |  15 +-
 src/lj_opt_narrow.c                           |  55 +----
 src/lj_opt_split.c                            |  45 +---
 src/lj_parse.c                                | 114 +++++----
 src/lj_record.c                               | 164 ++++++++-----
 src/lj_snap.c                                 | 100 +++++---
 src/lj_snap.h                                 |   3 +-
 src/lj_state.c                                |  18 +-
 src/lj_str.c                                  |   7 +-
 src/lj_strfmt.c                               |   4 +-
 src/lj_strfmt.h                               |   3 +-
 src/lj_strfmt_num.c                           |   6 +-
 src/lj_strscan.c                              |   9 +-
 src/lj_symtab.c                               |  11 +-
 src/lj_sysprof.c                              |  31 +--
 src/lj_tab.c                                  |  20 +-
 src/lj_target.h                               |   3 +-
 src/lj_trace.c                                |  57 +++--
 src/lj_utils_leb128.c                         |   5 +-
 src/lj_vm.h                                   |   9 -
 src/lj_vmmath.c                               |  51 +---
 src/lj_wbuf.c                                 |   3 +-
 src/ljamalg.c                                 |   1 +
 src/luaconf.h                                 |   2 +-
 src/vm_x64.dasc                               |  35 ---
 src/vm_x86.dasc                               |  35 ---
 test/tarantool-tests/gh-6163-min-max.test.lua |  52 ++--
 .../lj-684-pow-inconsistencies.test.lua       | 106 ++++++++
 .../lj-9-pow-inconsistencies.test.lua         |  65 +++++
 test/tarantool-tests/tap.lua                  |  14 ++
 90 files changed, 1729 insertions(+), 1469 deletions(-)
 create mode 100644 src/lj_assert.c
 create mode 100644 test/tarantool-tests/lj-684-pow-inconsistencies.test.lua
 create mode 100644 test/tarantool-tests/lj-9-pow-inconsistencies.test.lua

-- 
2.41.0


             reply	other threads:[~2023-08-15  9:41 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15  9:36 Sergey Kaplun via Tarantool-patches [this message]
2023-08-15  9:36 ` [Tarantool-patches] [PATCH luajit 1/5] test: introduce `samevalues()` TAP checker Sergey Kaplun via Tarantool-patches
2023-08-17 14:03   ` Maxim Kokryashkin via Tarantool-patches
2023-08-17 15:03     ` Sergey Kaplun via Tarantool-patches
2023-08-18 10:43   ` Sergey Bronnikov via Tarantool-patches
2023-08-18 10:58     ` Sergey Kaplun via Tarantool-patches
2023-08-18 11:12       ` Sergey Bronnikov via Tarantool-patches
2023-08-21 10:47         ` Igor Munkin via Tarantool-patches
2023-08-24  7:44           ` Sergey Bronnikov via Tarantool-patches
2023-08-15  9:36 ` [Tarantool-patches] [PATCH luajit 2/5] Remove pow() splitting and cleanup backends Sergey Kaplun via Tarantool-patches
2023-08-17 14:52   ` Maxim Kokryashkin via Tarantool-patches
2023-08-17 15:33     ` Sergey Kaplun via Tarantool-patches
2023-08-20  9:48       ` Maxim Kokryashkin via Tarantool-patches
2023-08-18 11:08   ` Sergey Bronnikov via Tarantool-patches
2023-08-15  9:36 ` [Tarantool-patches] [PATCH luajit 3/5] Improve assertions Sergey Kaplun via Tarantool-patches
2023-08-17 14:58   ` Maxim Kokryashkin via Tarantool-patches
2023-08-18  7:56     ` Sergey Kaplun via Tarantool-patches
2023-08-18 11:20   ` Sergey Bronnikov via Tarantool-patches
2023-08-15  9:36 ` [Tarantool-patches] [PATCH luajit 4/5] Fix pow() optimization inconsistencies Sergey Kaplun via Tarantool-patches
2023-08-18 12:45   ` Sergey Bronnikov via Tarantool-patches
2023-08-21  8:07     ` Sergey Kaplun via Tarantool-patches
2023-08-20  9:26   ` Maxim Kokryashkin via Tarantool-patches
2023-08-21  8:06     ` Sergey Kaplun via Tarantool-patches
2023-08-21  9:00       ` Maxim Kokryashkin via Tarantool-patches
2023-08-21  9:31         ` Sergey Kaplun via Tarantool-patches
2023-08-15  9:36 ` [Tarantool-patches] [PATCH luajit 5/5] Revert to trival pow() optimizations to prevent inaccuracies Sergey Kaplun via Tarantool-patches
2023-08-18 12:49   ` Sergey Bronnikov via Tarantool-patches
2023-08-21  8:16     ` Sergey Kaplun via Tarantool-patches
2023-08-20  9:37   ` Maxim Kokryashkin via Tarantool-patches
2023-08-21  8:15     ` Sergey Kaplun via Tarantool-patches
2023-08-21  9:06       ` Maxim Kokryashkin via Tarantool-patches
2023-08-21  9:36         ` Sergey Kaplun via Tarantool-patches
2023-08-24  7:47 ` [Tarantool-patches] [PATCH luajit 0/5] Fix pow inconsistencies and improve asserts Sergey Bronnikov via Tarantool-patches
2023-08-31 15:18 ` Igor Munkin via Tarantool-patches

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=cover.1692089298.git.skaplun@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=m.kokryashkin@tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 0/5] Fix pow inconsistencies and improve asserts' \
    /path/to/YOUR_REPLY

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

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

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