Skip to content

Integral 7.0 and latest dev crash on macOS 15 (arm64) #224

@twoplan

Description

@twoplan

Integral 7.0 and the latest dev version crash with bus error after some seconds of calculating on apple silicon mac.

How to reproduce on my M4 mac?

  • compile with "make native"
  • start integral and type "go"
  • wait until depth 32 is reached

$ make native

Building with native optimizations...
Configuring CMake with BUILD_TYPE=BUILD_NATIVE...
-- The C compiler identification is AppleClang 17.0.0.17000013
-- The CXX compiler identification is AppleClang 17.0.0.17000013
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- dialga-v2.nnue not found. Downloading from https://github.com/aronpetko/integral-networks/releases/download/dialga-v2/dialga-v2.nnue...
..
..
..
1 warning generated.
[100%] Linking CXX executable integral
/Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/integral.dir/link.txt --verbose=1
/usr/bin/clang++  -march=native -DBUILD_NATIVE -pthread -O3 -funroll-loops -DNDEBUG -flto=thin -arch arm64 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/integral.dir/src/chess/board.cc.o CMakeFiles/integral.dir/src/chess/fen.cc.o CMakeFiles/integral.dir/src/chess/move.cc.o CMakeFiles/integral.dir/src/chess/move_gen.cc.o CMakeFiles/integral.dir/src/data_gen/data_gen.cc.o CMakeFiles/integral.dir/src/engine/evaluation/evaluation.cc.o CMakeFiles/integral.dir/src/engine/evaluation/nnue/nnue.cc.o CMakeFiles/integral.dir/src/engine/search/cuckoo.cc.o CMakeFiles/integral.dir/src/engine/search/move_picker.cc.o CMakeFiles/integral.dir/src/engine/search/search.cc.o CMakeFiles/integral.dir/src/engine/search/syzygy/syzygy.cc.o CMakeFiles/integral.dir/src/engine/search/time_mgmt.cc.o CMakeFiles/integral.dir/src/engine/search/transpo.cc.o CMakeFiles/integral.dir/src/engine/uci/uci.cc.o CMakeFiles/integral.dir/src/magics/attacks.cc.o CMakeFiles/integral.dir/src/magics/magic_finder.cc.o CMakeFiles/integral.dir/src/main.cc.o CMakeFiles/integral.dir/src/tests/bench_test.cc.o CMakeFiles/integral.dir/src/tests/perft_test.cc.o CMakeFiles/integral.dir/src/tests/see_test.cc.o "CMakeFiles/integral.dir/third-party/fathom/tbprobe.c.o" -o integral
[100%] Built target integral
/Applications/CMake.app/Contents/bin/cmake -E cmake_progress_start ~/Downloads/integral-7/build/CMakeFiles 0
Copying executable...

$ ./integral bench

2400942 nodes 908071 nps

$ ./integral


                   πππ
                  ππ ππ
                 ππ
                ππ
               ππ
           ππ ππ
            πππ

    Integral v7.0.0 by Aron Petkovski

uci
id name Integral v7.0.0
id author Aron Petkovski
option name Hash type spin default 64 min 1 max 1048576
option name Minimal type check default false
option name MoveOverhead type spin default 10 min 0 max 10000
option name MultiPV type spin default 1 min 1 max 6
option name SyzygyPath type string default <empty>
option name SyzygyProbeDepth type spin default 1 min 1 max 100
option name Threads type spin default 1 min 1 max 256
uciok
go
info depth 1 seldepth 1 multipv 1 score cp 43 nodes 20 time 3 nps 6666 hashfull 0 pv e2e4
info depth 2 seldepth 2 multipv 1 score cp 65 nodes 24 time 3 nps 8000 hashfull 0 pv e2e4
info depth 3 seldepth 3 multipv 1 score cp 78 nodes 83 time 4 nps 20750 hashfull 0 pv d2d4 a7a6
info depth 4 seldepth 5 multipv 1 score cp 74 nodes 184 time 4 nps 46000 hashfull 0 pv d2d4 d7d5 c2c4 d5c4
..
..
info depth 31 seldepth 47 multipv 1 score cp 30 nodes 11416138 time 13536 nps 843390 hashfull 877 pv e2e4 e7e5 g1f3 b8c6 f1b5 g8f6 e1g1 f6e4 f1e1 e4d6 f3e5 f8e7 b5f1 c6e5 e1e5 e8g8 d2d4 e7f6 e5e1 f8e8 c1f4 e8e1 d1e1 d6e8 c2c3 d7d5 a2a4 a7a5 f1d3 c7c6 b1d2 c8e6 d2f3 f6e7 f3e5 e7d6
info depth 32 seldepth 50 multipv 1 score cp 35 nodes 12588718 time 14971 nps 840873 hashfull 904 pv e2e4 e7e5 g1f3 b8c6 f1b5 g8f6 e1g1 f6e4 f1e1 e4d6 f3e5 f8e7 b5f1 c6e5 e1e5 e8g8 d2d4 e7f6 e5e1 f8e8 c1f4 e8e1 d1e1 d6e8 c2c3 d7d5 a2a4 a7a5 f1d3 h7h6 b1d2 f6e7 h2h3 e7d6 f4e5 c7c6 d2b3 c8e6 e5d6 e8d6
zsh: bus error  ./Integral-7

$ lldb ./integral

(lldb) target create "./integral"
Current executable set to 'Downloads/integral-7/integral' (arm64).
(lldb) run
Process 5614 launched: 'Downloads/integral-7/integral' (arm64)

                   πππ
                  ππ ππ
                 ππ
                ππ
               ππ
           ππ ππ
            πππ

    Integral v7.0.0 by Aron Petkovski

uci
id name Integral v7.0.0
id author Aron Petkovski
option name Hash type spin default 64 min 1 max 1048576
option name Minimal type check default false
option name MoveOverhead type spin default 10 min 0 max 10000
option name MultiPV type spin default 1 min 1 max 6
option name SyzygyPath type string default <empty>
option name SyzygyProbeDepth type spin default 1 min 1 max 100
option name Threads type spin default 1 min 1 max 256
uciok
go
info depth 1 seldepth 1 multipv 1 score cp 43 nodes 20 time 3 nps 6666 hashfull 0 pv e2e4
info depth 2 seldepth 2 multipv 1 score cp 65 nodes 24 time 3 nps 8000 hashfull 0 pv e2e4
info depth 3 seldepth 3 multipv 1 score cp 78 nodes 83 time 3 nps 27666 hashfull 0 pv d2d4 a7a6
info depth 4 seldepth 5 multipv 1 score cp 74 nodes 184 time 4 nps 46000 hashfull 0 pv d2d4 d7d5 c2c4 d5c4
..
..
info depth 31 seldepth 47 multipv 1 score cp 30 nodes 11416138 time 13558 nps 842022 hashfull 877 pv e2e4 e7e5 g1f3 b8c6 f1b5 g8f6 e1g1 f6e4 f1e1 e4d6 f3e5 f8e7 b5f1 c6e5 e1e5 e8g8 d2d4 e7f6 e5e1 f8e8 c1f4 e8e1 d1e1 d6e8 c2c3 d7d5 a2a4 a7a5 f1d3 c7c6 b1d2 c8e6 d2f3 f6e7 f3e5 e7d6
info depth 32 seldepth 50 multipv 1 score cp 35 nodes 12588718 time 15006 nps 838912 hashfull 904 pv e2e4 e7e5 g1f3 b8c6 f1b5 g8f6 e1g1 f6e4 f1e1 e4d6 f3e5 f8e7 b5f1 c6e5 e1e5 e8g8 d2d4 e7f6 e5e1 f8e8 c1f4 e8e1 d1e1 d6e8 c2c3 d7d5 a2a4 a7a5 f1d3 h7h6 b1d2 f6e7 h2h3 e7d6 f4e5 c7c6 d2b3 c8e6 e5d6 e8d6
Process 5614 stopped
* thread #2, stop reason = EXC_BAD_ACCESS (code=2, address=0x16fe03ff8)
    frame #0: 0x000000019a196bc0 libsystem_pthread.dylib`___chkstk_darwin + 60
libsystem_pthread.dylib`___chkstk_darwin:
->  0x19a196bc0 <+60>: ldur   x11, [x11, #-0x8]
    0x19a196bc4 <+64>: mov    x10, sp
    0x19a196bc8 <+68>: cmp    x9, #0x1, lsl #12 ; =0x1000 
    0x19a196bcc <+72>: b.lo   0x19a196be4    ; <+96>
Target 0: (integral) stopped.
(lldb) 

With latest dev version also EXC_BAD_ACCESS, but at depth 30/44:

$ ./integral bench
1836807 nodes 847235 nps

$ lldb integral

(lldb) target create "integral"
Current executable set to 'Downloads/integral/integral' (arm64).
(lldb) run
Process 5733 launched: 'Downloads/integral/integral' (arm64)

                   πππ
                  ππ ππ
                 ππ
                ππ
               ππ
           ππ ππ
            πππ

    Integral v7.0.0-dev by Aron Petkovski

go
   1/1       2 ms            20 nodes   0.01m nps    0% hash  +0.21  d2d4 
   2/2       2 ms            24 nodes   0.01m nps    0% hash  +0.39  d2d4 
   3/3       2 ms            76 nodes   0.04m nps    0% hash  +0.42  c2c4 e7e6 d2d4 
   4/4       3 ms           124 nodes   0.04m nps    0% hash  +0.55  c2c4 a7a5 
   5/5       4 ms           424 nodes   0.11m nps    0% hash  +0.21  g1f3 g8f6 c2c4 c7c5 
..
..
 29/45    6828 ms     5,174,166 nodes   0.76m nps   50% hash  +0.19  e2e4 e7e6 d2d4 d7d5 b1c3 g8f6 e4e5 f6d7 f2f4 c7c5 g1f3 b8c6 c1e3 a7a6 d1d2 b7b5 a2a3 d8a5 a1b1 b5b4 a3b4 a5b4 f1e2 c6d4 f3d4 c5d4 e3d4 f8c5 d4c5 b4c5 
 30/44    7822 ms     5,898,986 nodes   0.75m nps   55% hash  +0.28  e2e4 e7e6 d2d4 d7d5 b1c3 g8f6 e4e5 f6d7 f2f4 c7c5 g1f3 b8c6 c1e3 a7a6 d1d2 b7b5 h2h4 f8e7 h4h5 e8g8 d4c5 d8a5 h5h6 g7g6 f1d3 d7c5 c3e2 a5b4 d2b4 c6b4 
Process 5733 stopped
* thread #2, stop reason = EXC_BAD_ACCESS (code=2, address=0x16fe03d50)
    frame #0: 0x000000010002712c integral`nnue::PerspectiveAccumulator::ApplyChange(nnue::PerspectiveAccumulator const&, nnue::AccumulatorChange const&, Color, Square) + 4
integral`nnue::PerspectiveAccumulator::ApplyChange:
->  0x10002712c <+4>:  stp    x28, x27, [sp, #0x10]
    0x100027130 <+8>:  stp    x26, x25, [sp, #0x20]
    0x100027134 <+12>: stp    x24, x23, [sp, #0x30]
    0x100027138 <+16>: stp    x22, x21, [sp, #0x40]
Target 0: (integral) stopped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions