Cryolite / kanachan

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

annotationの使用中に問題が発生しました #62

Closed motoiro closed 10 months ago

motoiro commented 11 months ago

いくつかのファイルに注釈を付けるとエラーが発生します。 C:\Users\kuroki>docker run -v C:/Users/kuroki/Downloads/测试:/data:ro --rm cryolite/kanachan.annotate:2023.12.10 - > C:/Users/kuroki/Downloads/测试/out.txt 200101-0a6443c0-5f2a-44cd-93ee-af9d17ce92e1: 南3局0本場: 69 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&): 0,4,8,12,24,28,64,72,76,96,100,104,144 146 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# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 4# _start in build/src/annotation/annotate

C:\Users\kuroki>docker run -v C:/Users/kuroki/Downloads/测试:/data:ro --rm cryolite/kanachan.annotate:2023.12.10 - > C:/Users/kuroki/Downloads/测试/out.txt 200102-10bf3b9e-5a01-4acb-8f57-0ed0a27df2fb: 東3局1本場: 69 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&): 36,48,60,64,72,76,92,104,108,112,136 138 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# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 4# _start in build/src/annotation/annotate

C:\Users\kuroki>docker run -v C:/Users/kuroki/Downloads/测试:/data:ro --rm cryolite/kanachan.annotate:2023.12.10 - > C:/Users/kuroki/Downloads/测试/out.txt 200108-dc1bfc86-12fa-45f1-ba3e-e8997b86aa2a: 東3局0本場: 69 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&): 12,16,28,36,44,56,80,88,104,108,116,120,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# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 4# _start in build/src/annotation/annotate

通常の注釈はこうです。 C:\Users\kuroki>docker run -v C:/Users/kuroki/Downloads/测试:/data:ro --rm cryolite/kanachan.annotate:2023.12.10 - > C:/Users/kuroki/Downloads/测试/out.txt std::terminate' is called after throwing an instance of boost::exception_detail::error_info_injector<std::runtime_error>'. /opt/kanachan/src/annotation/main.cpp:113: void {anonymous}::convert(const std::filesystem::__cxx11::path&): "/data/out.txt": category = 0 Backtrace: 0# (anonymous namespace)::convert(std::filesystem::__cxx11::path const&) in build/src/annotation/annotate 1# main in build/src/annotation/annotate 2# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 3# _start in build/src/annotation/annotate

最後にファイルをアップロードしました。何が問題なのか見てください。

websocktdata.zip 200108-dc1bfc86-12fa-45f1-ba3e-e8997b86aa2a.txt 200102-10bf3b9e-5a01-4acb-8f57-0ed0a27df2fb.txt 200101-0a6443c0-5f2a-44cd-93ee-af9d17ce92e1.txt 200119-a788b0b4-b14e-4367-863d-ee1e9a8858ab.txt

Cryolite commented 11 months ago

I have also been able to reproduce the bug on my end. It seems that annotation fails with very old game records.

The current specification of the game records and the logic of annotation are such that the dealer's hand at the very beginning of a round consists of 14 tiles and the first self-drawn tile is not specified. Therefore, the dealer's first discard is always a discard from the hand and not the discard of the self-drawn tile. However, in very old game records (until some point in the first half of 2020), if the dealer's first discard was the tile on the far right, it seems to have been recorded in the game record as the discard of the self-drawn tile. This specification of very old game records is quite unnatural, and while it can be handled on the annotation side, only a workaround-like implementation is possible.

Personally, unless there is a very strong demand for annotations on these very old game records, I would like to not address this bug. So, please execute the annotation excluding these very old game records where this bug occurs.

For your information, the UUID of game records is in the format YYMMDD-....., where YY represents the last two digits of the year when the game record was made, MM represents the month, and DD represents the day, so you can use the first 6 characters of the UUIDs to filter out very old game records.

Cryolite commented 11 months ago

The failure of annotation on the last game record, named out.txt, is because this record is not from a ranked match. The current implementation of annotation only supports game records of ranked matches. If you wish for annotation on friendly matches or other types of game records, please create a separate issue.

motoiro commented 11 months ago

ご回答ありがとうございます。初期のデータの一部を除外して、今は問題なくannotateを使って処理できました。