Cryolite / kanachan

A Japanese (Riichi) Mahjong AI Framework
284 stars 40 forks source link

an error was encountered when using annotation #18

Open constellation39 opened 1 year ago

constellation39 commented 1 year ago

an error was encountered when using annotation

`std::terminate' is called after throwing an instance of `boost::exception_detail::error_info_injector<std::logic_error>'.
/opt/kanachan/src/annotation/annotation.cpp:472: Kanachan::Annotation::Annotation(uint_fast8_t, const std::array<Kanachan::PlayerState, 4>&, const Kanachan::RoundProgress&, const std::vector<lq::OptionalOperation>&, const lq::RecordDiscardTile&): 4,8,52,60,68,76,80,108,116,120,132,140       142
Backtrace:
 0# Kanachan::Annotation::Annotation(unsigned char, std::array<Kanachan::PlayerState, 4ul> const&, Kanachan::RoundProgress const&, std::vector<lq::OptionalOperation, std::allocator<lq::OptionalOperation> > const&, lq::RecordDiscardTile const&) in build/src/annotation/annotate
 1# (anonymous namespace)::convert(std::filesystem::__cxx11::path const&) in build/src/annotation/annotate
 2# main in build/src/annotation/annotate
 3# 0x00007F6CFD767D90 in /lib/x86_64-linux-gnu/libc.so.6
 4# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
 5# _start in build/src/annotation/annotate

I put /kanachan/src/annotation/annotation.cpp:456 std::uint_fast16_t const moqie = 1; when the moqie value is set to 0, the error disappears, but should I do this?

used game records : 191218-b60ab11a-e2f1-406e-8b20-f94c25aec469

Cryolite commented 1 year ago

Thank you for the bug report.

I have confirmed that an exception is thrown on my side as well. However, the error on my side seems to be different from yours. I guess that you may have modified the source code locally and built the cryolite/kanachan.annotate image. If so, please remove the local cryolite/kanachan.annotate image and try docker run without building anything.

The most likely cause of the error is that an old format of game records is not supported. There are three formats of game records in Mahjong Soul: the oldest format up to 2019/12/31, the old format from 2020/01/01 up to 2021/07/28, and the current format from 2021/07/28 up to now. Currently, kanachan does not support the oldest format up to 2019/12/31. Since the game record you are trying is one on 2019/12/18, it is very likely that this is the cause of the error.

I will add support for the oldest format as soon as possible. As a workaround for the time being, please use only game records after 2020/01/01.

By the way, I have very few game records before 2019/12/31, so if you have other game records before 2019/12/31, a list of their IDs would be greatly appreciated.

constellation39 commented 1 year ago

Thanks for your answer.

yes, i modified the local program, and i apologize for not mentioning it before.

i have tried the following modifications https://github.com/constellation39/kanachan/commit/dd129771962dde338cbcc4ee3845b61918f95b26 changes in src/annotation/utility.hpp may be the reason for the different errors.

but it's worth noting that the earliest records I can find is 2019/12/01.

I uploaded some records from 2019/12/01, hope this can help.

Finally, thank you for your work on this.

constellation39 commented 1 year ago

records.zip

Cryolite commented 1 year ago

Thank you! This list will be very helpful in implementing and testing for the oldest format!