Equim-chan / mjai-reviewer

🔍🀄️ Review mahjong game log with mjai-compatible mahjong AI.
https://mjai.ekyu.moe
Apache License 2.0
1.03k stars 119 forks source link

Error: failed to review log #39

Closed Fillianore closed 2 years ago

Fillianore commented 2 years ago

I was running akochan-reviewer to review Mahjong Soul Logs by following your instruction (https://github.com/Equim-chan/akochan-reviewer/blob/master/mjsoul.adoc) on Windows and failed.

running log:

➤ ./akochan-reviewer.exe -i 2021_12_6_Gold_Room_South.json -a 2 23:12:36.474591 src\main.rs:506 converting to mjai events... 23:12:36.475222 src\main.rs:600 players: 风条语顺, 钻石水果糖, Retr0MKII, 〓のなめ〓 23:12:36.475253 src\main.rs:601 target: Retr0MKII 23:12:36.475279 src\main.rs:602 review has started, this may take several minutes... 23:12:36.555729 src\review.rs:219 reviewing kyoku=0 honba=0 junme=0 (0.32%) 23:12:36.613702 src\review.rs:219 reviewing kyoku=0 honba=0 junme=0 (0.54%) 23:12:36.662356 src\review.rs:219 reviewing kyoku=0 honba=0 junme=1 (0.65%) 23:12:36.709961 src\review.rs:361 review entry created: Agree (0/0/1, 100.000) 23:12:36.710043 src\review.rs:219 reviewing kyoku=0 honba=0 junme=1 (0.97%) 23:12:36.759089 src\review.rs:219 reviewing kyoku=0 honba=0 junme=1 (1.18%) 23:12:36.806939 src\review.rs:219 reviewing kyoku=0 honba=0 junme=1 (1.40%) 23:12:36.855841 src\review.rs:219 reviewing kyoku=0 honba=0 junme=2 (1.51%) Error: failed to review log

Caused by: failed to read from akochan: unexpected EOF

I tried on both ver 0.7.1 and 0.6.0 and both failed, however I run it on another PC(Windows) and it works. Maybe I miss some enviroment or something on my first PC?

Thanks for your patience. Have a nice day!

Fillianore commented 2 years ago

{ "ver": "2.3", "ref": "211206-ac68cfcd-94ae-4116-b649-e34275441240", "log": [ [ [ 0, 0, 0 ], [ 25000, 25000, 25000, 25000 ], [ 12 ], [ 46 ], [ 13, 14, 14, 15, 19, 21, 24, 31, 35, 38, 41, 44, 45 ], [ 46, 15, 15, 33, 28, "c121314", 12, 35, 34, 24, 28 ], [ 21, 19, 31, 44, 41, 46, 45, 38, 35, 28, 60 ], [ 11, 17, 19, 22, 23, 52, 25, 27, 29, 33, 35, 38, 39 ], [ 41, 21, 47, 26, 29, 26, 18, 45, "29p2929", 14, "c282627", 32 ], [ 39, 41, 60, 38, 11, 17, 60, 60, 19, 60, 33, 60 ], [ 13, 16, 16, 17, 19, 19, 22, 53, 36, 42, 43, 44, 46 ], [ 21, 34, 21, 11, 33, 45, 42, 24, 13, 47, 31 ], [ 44, 43, 42, 46, 21, 60, 60, 21, 11, 60, 36 ], [ 12, 17, 18, 23, 24, 28, 28, 29, 31, 34, 36, 38, 43 ], [ 31, 33, 13, 36, 12, 16, 29, 37, 23, 25, 18 ], [ 43, 12, 60, 31, 60, 31, 29, 29, 36, "r23", 60 ], [ "和了", [ 0, -3900, 0, 4900 ], [ 3, 1, 3, "30符3飜3900点", "All Simples(1飜)", "Pinfu(1飜)", "Riichi(1飜)", "Ura Dora(0飜)" ] ] ], [ [ 1, 0, 0 ], [ 25000, 21100, 25000, 28900 ], [ 29, 37 ], [], [ 11, 13, 14, 23, 26, 31, 31, 36, 43, 45, 45, 46, 47 ], [ 38, 27, 17, "45p4545", 26, 37, 45, 21, 35, 27, 44, 11, "2727p27", 28, 32, 51 ], [ 43, 11, 23, 46, 47, 17, "45k454545", 60, 60, 14, 13, 44, 11, 60, 60, 60 ], [ 12, 12, 16, 22, 26, 27, 29, 32, 33, 33, 39, 42, 42 ], [ 43, 33, 46, 34, 27, 16, 12, 13, 19, 25, 17, 21, 17, 18, 22 ], [ 60, 39, 29, 46, 42, 42, 22, 34, 60, 32, 27, 60, "r13", 60, 60 ], [ 15, 15, 18, 23, 31, 37, 38, 39, 43, 44, 45, 47, 47 ], [ 42, 13, 14, 31, 44, "47p4747", 37, 41, 24, 38, 13, 16, 44, 34 ], [ 43, 44, 42, 45, 60, 15, 18, 60, 37, 60, 60, 13, 60, 60 ], [ 17, 19, 21, 22, 25, 26, 28, 28, 32, 36, 39, 42, 47 ], [ 41, 24, 46, 39, 46, 14, 23, 21, 29, 53, 43, 15, "c345336" ], [ 39, 42, 32, 60, 17, 19, 46, 46, 14, 47, 41, 43, 29 ], [ "和了", [ 0, -2000, 3000, 0 ], [ 2, 1, 2, "30符2飜2000点", "Red Dragon(1飜)", "Dora(1飜)" ] ] ], [ [ 2, 0, 0 ], [ 25000, 18100, 28000, 28900 ], [ 34, 33, 27 ], [], [ 11, 16, 19, 23, 25, 28, 29, 34, 37, 43, 43, 43, 45 ], [ 16, 34, 47, 15, 43, 28, 47, 11, 14, 22, 25, 15 ], [ 11, 19, 60, 37, 45, 29, 60, "434343a43", 11, 16, 28, 28 ], [ 13, 18, 18, 21, 24, 28, 31, 31, 35, 37, 39, 42, 44 ], [ 13, 21, 34, 41, 18, 27, 14, 53, 29, 24 ], [ 21, 42, 44, 21, 41, 24, 39, 31, 31, 60 ], [ 12, 12, 13, 18, 22, 27, 31, 33, 36, 37, 39, 39, 42 ], [ 44, 29, 41, 36, 46, 38, 27, 37, 36, 35 ], [ 60, 42, 60, 31, 60, 29, 18, 22, 33, 13 ], [ 13, 14, 17, 23, 26, 29, 32, 35, 38, 41, 45, 45, 46 ], [ 44, 12, 25, 17, 22, "4545p45", 26, 22, 47, 21, 45, 38 ], [ 29, 44, 38, 41, 46, 32, 35, 22, 60, 26, "4545k4545", 60 ], [ "和了", [ 0, -1300, 0, 1300 ], [ 3, 1, 3, "40符1飜1300点", "White Dragon(1飜)" ] ] ], [ [ 3, 0, 0 ], [ 25000, 16800, 28000, 30200 ], [ 31, 36 ], [], [ 15, 19, 21, 23, 23, 26, 27, 33, 37, 38, 43, 43, 44 ], [ 18, 53, 17, 34, 24, 13, 15, 52, 24, 44 ], [ 21, 44, 43, 43, 15, 60, 60, "r24", 60, 60 ], [ 12, 14, 17, 28, 29, 32, 33, 37, 38, 39, 42, 45, 47 ], [ 18, 31, 35, 21, 38, 41, 13, 13, 27, 22 ], [ 42, 45, 47, 35, 60, 60, 21, 60, 17, 60 ], [ 12, 16, 16, 25, 33, 35, 36, 36, 37, 41, 43, 46, 46 ], [ 15, 47, 17, "4646p46", "c353637", 46, 31, 16, 31, 13, 42, 34 ], [ 43, 60, 41, 12, 33, "4646k4646", 60, 25, 60, 60, 60 ], [ 11, 19, 21, 22, 23, 26, 27, 28, 29, 34, 36, 39, 44 ], [ 46, 21, 37, 12, 14, 12, 44, 25, 29, 45, 22 ], [ 44, 39, 19, 46, 11, 21, 34, 44, 60, 60, 60 ], [ "和了", [ -700, -700, 3700, -1300 ], [ 2, 2, 2, "40符2飜700-1300点", "Green Dragon(1飜)", "Dora(1飜)" ] ] ], [ [ 4, 0, 0 ], [ 23300, 16100, 31700, 28900 ], [ 14 ], [], [ 11, 16, 18, 18, 24, 29, 32, 33, 35, 38, 39, 44, 46 ], [ 46, 23, 17, 34, 26, 47, 47, 21, 28, 44, 47, 38, 42, 45, 11, 39 ], [ 44, 11, 29, 18, 35, 60, 60, 60, 39, 60, 60, 28, 26, 42, 60, 60 ], [ 12, 14, 15, 16, 19, 19, 23, 27, 33, 35, 37, 42, 44 ], [ 51, 28, 15, 19, 53, 25, 17, 46, 46, 21, 45, 17, 12, 25, 43 ], [ 44, 42, 23, 37, 12, 60, 28, 27, 33, 60, 60, 35, 53, 60, 60 ], [ 12, 13, 13, 16, 22, 24, 27, 29, 29, 36, 39, 41, 45 ], [ 45, 42, "29p2929", "c232224", 11, 23, 34, 43, 38, 23, 24, "p454545", 13, 16, 41 ], [ 41, 60, 39, 27, 16, 60, 60, 36, 60, 60, 60, 13, 60, 60, 60 ], [ 12, 13, 17, 21, 21, 52, 26, 28, 31, 32, 33, 35, 43 ], [ 36, 44, 29, 31, 31, 14, 19, 18, 11, 22, 39, 26, 41, 37, 37 ], [ 43, 60, 60, 28, 17, 31, 31, 60, 19, 60, 60, 11, 26, 41, 60 ], [ "和了", [ 0, -1300, 1300, 0 ], [ 2, 1, 2, "40符1飜1300点", "White Dragon(1飜)" ] ] ], [ [ 5, 0, 0 ], [ 23300, 14800, 33000, 28900 ], [ 52 ], [], [ 11, 13, 15, 24, 25, 26, 28, 31, 34, 37, 43, 44, 47 ], [ 33, 46, 41, 15, 23, "c141315", 46, 31, 39, 12, 27, 27, 19, 17, 46 ], [ 11, 31, 43, 41, 46, 47, 44, 46, 31, 39, 12, 60, 60, 37, 60 ], [ 12, 13, 51, 16, 16, 22, 24, 24, 28, 32, 32, 36, 41 ], [ 41, 27, 53, 24, "p414141", 29, 45, 43, 18, 36, 38, 19, 37, 23, 21 ], [ 22, 36, 12, 13, 28, 60, 60, 60, 27, 18, 60, 60, 16, 60, 60 ], [ 21, 22, 22, 29, 33, 37, 39, 41, 44, 44, 45, 45, 47 ], [ 45, 18, 42, 46, 42, 11, 11, "44p4444", 21, 13, 17, 47, 26, 43, "c232122", 25 ], [ 39, 37, 33, 18, 29, 60, 60, 21, 47, 60, 60, 60, 46, 41, 43, 22 ], [ 14, 16, 23, 26, 28, 31, 32, 33, 36, 37, 38, 42, 47 ], [ 16, 28, 39, 17, 12, 34, 27, 44, 34, 19, 23, 25, 34, 36, 12, 14 ], [ 23, 42, 47, 28, 17, 14, 12, 60, 34, 60, 60, 28, 60, 60, 60, 60 ], [ "和了", [ 0, 5800, 0, -5800 ], [ 1, 3, 1, "30符3飜5800点", "Seat Wind(1飜)", "Red Five(2飜)" ] ] ], [ [ 5, 1, 0 ], [ 23300, 20600, 33000, 23100 ], [ 25 ], [], [ 12, 16, 17, 19, 19, 22, 22, 26, 29, 32, 39, 45, 47 ], [ 36, 33, 51, 19, 38, 11 ], [ 29, 39, 12, 45, 47, 60 ], [ 12, 16, 16, 17, 23, 24, 24, 27, 27, 32, 35, 39, 44 ], [ 45, 12, 23, "p121212", 16, 36, 44 ], [ 44, 39, 32, 17, 45, 60, 35 ], [ 13, 14, 29, 32, 32, 33, 37, 41, 41, 43, 44, 46, 46 ], [ 42, 42, 11, 33, "4141p41", 31, "4646p46", 45, 15 ], [ 29, 44, 60, 13, 14, 43, 37, 60, 60 ], [ 11, 14, 17, 21, 25, 25, 29, 31, 34, 38, 39, 43, 45 ], [ 46, 41, 33, 52, 24, 34, 18, 41, 39 ], [ 21, 29, 11, 41, 45, 46, 14, 60, 31 ], [ "和了", [ 0, 0, 8300, -8300 ], [ 2, 3, 2, "Mangan 8000点", "Half Outside Hand(1飜)", "Half Flush(2飜)", "Green Dragon(1飜)" ] ] ], [ [ 6, 0, 0 ], [ 23300, 20600, 41300, 14800 ], [ 53 ], [], [ 18, 22, 22, 24, 25, 27, 27, 28, 32, 41, 41, 43, 45 ], [ 21, "4141p41", 34, 46, 25, 38, 15, 43, 44, "p434343", 26 ], [ 18, 32, 45, 34, 46, 60, 60, 21, 60, 28, 25 ], [ 51, 27, 28, 33, 35, 37, 37, 39, 41, 42, 46, 46, 47 ], [ 21, 23, "46p4646", 18, "c343335", 13, 11, 37, 45, 42, 31, 22 ], [ 41, 42, 39, 47, 18, 21, 23, 11, 60, 60, 60, 60 ], [ 14, 15, 19, 23, 23, 24, 28, 29, 31, 33, 38, 44, 45 ], [ 47, 17, 14, 44, 36, 28, 11, 36, 32, 35, 36 ], [ 44, 47, 45, 60, 31, 33, 60, 38, 60, 60, 15 ], [ 14, 16, 18, 18, 25, 26, 27, 29, 29, 32, 34, 36, 45 ], [ 21, 46, 44, 17, 31, 47, 15, 17, 12, 43, 19 ], [ 60, 60, 45, 44, 60, 60, 32, 36, 34, 60, "r12" ], [ "和了", [ 4900, -3900, 0, 0 ], [ 0, 1, 0, "30符3飜3900点", "Half Flush(2飜)", "Seat Wind(1飜)" ] ] ], [ [ 7, 0, 0 ], [ 28200, 16700, 41300, 13800 ], [ 11 ], [], [ 11, 17, 18, 18, 22, 26, 26, 34, 35, 37, 39, 41, 44 ], [ 45, 19, 44, 16, 17, 27, 22, "c161718", 28, 13, 31, 43, 42, 41 ], [ 11, 44, 41, 45, 19, 22, 39, 22, 44, 26, 60, 60, 37, 60 ], [ 12, 14, 15, 17, 18, 23, 52, 26, 26, 28, 32, 53, 38 ], [ 43, 39, 29, 19, 34, 41, 24, 27, 19, 33, 24, 38, 51 ], [ 60, 32, 39, 38, 29, 60, 28, 12, 60, "r27", 60, 60, 60 ], [ 11, 13, 21, 23, 25, 34, 36, 36, 37, 43, 44, 44, 47 ], [ 33, "44p4444", "c323334", 46, 45, 33, 47, 32, "c121113", 37, 15, "c242325", 35 ], [ 43, 47, 37, 60, 60, 60, 60, 60, 21, 60, 36, 36, 60 ], [ 11, 13, 13, 16, 19, 21, 21, 23, 24, 29, 41, 42, 46 ], [ 47, 12, 32, 22, 46, 25, 31, 14, 27, 35, 12, 29, 43, 27 ], [ 29, 19, 47, 41, 42, 32, 60, 16, 60, 60, "r21", 60, 60, 60 ], [ "和了", [ 0, -3900, 5900, 0 ], [ 2, 1, 2, "30符3飜3900点", "Seat Wind(1飜)", "Dora(1飜)", "Red Five(1飜)" ] ] ] ], "ratingc": "PF4", "rule": { "disp": "Gold Room South", "aka53": 1, "aka52": 1, "aka51": 1 }, "lobby": 0, "dan": [ "Expert I", "Expert I", "Expert I", "Expert III" ], "rate": [ 484, 879, 699, 1417 ], "sx": [ "F", "F", "F", "F" ], "name": [ "风条语顺", "钻石水果糖", "Retr0MKII", "〓のなめ〓" ], "sc": [ 28200, 8.2, 11800, -28.2, 47200, 37.2, 12800, -17.2 ], "title": [ "Gold Room South", "2021/12/6 下午10:57:21" ] }

And here is the Mahjong Soul Logs I want to reivew

Equim-chan commented 2 years ago

I can't reproduce it. Have you tried setting env OMP_NUM_THREADS=8? Are you using Windows 10?

Fillianore commented 2 years ago

I've tried setting env OMP_NUM_THREADS=8 and both my two PCs are using win10. The PC that runs successfully can run normally without setting up the environment

Equim-chan commented 2 years ago
$ ./akochan-reviewer --no-review --mjai-out mjai.json -i test.json
$ ./akochan/system.exe pipe tactics.json 2 < mjai.json

Try this?

Fillianore commented 2 years ago
./akochan/system.exe pipe tactics.json 2 < mjai.json
read_parameters file_not_found:params/rank_prob/ako/para1_9000.txt
Asserread_parameters file_not_found:params/rank_prob/ako/para0_9000.txt
tion failed: falsread_parameters file_not_found:params/rank_prob/ako/para1_9000.txt
e,read_parameters file_not_found:params/rank_prob/ako/para1_9000.txt
 file share/include.cpp, line 6
Assertion

I tried your suggestion and here is the result. It seems the parameters can't be read normally.

Equim-chan commented 2 years ago

Oh my bad, you need to cd to akochan then ./system.exe

Fillianore commented 2 years ago

and the result is

./system.exe pipe ../tactics.json 2 < ../mjai.json [{"actor": 2, "type": "none"}] [{"actor": 2, "type": "none"}] [{"actor": 2, "pai": "S", "tsumogiri": false, "type": "dahai"}] [{"actor": 2, "type": "none"}] [{"actor": 2, "type": "none"}] [{"actor": 2, "type": "none"}] Segmentation fault

Equim-chan commented 2 years ago

Interesting, one possible cause is I may have forgotten to remove -march=native when building the distribution package, but in that case it's more likely to get "Illegal instruction" error instead.

Equim-chan commented 2 years ago

Maybe you can try building akochan natively on that machine?

Fillianore commented 2 years ago

Ok I'll try. Once I got problems or results, I will feedback in this issue, thanks for your suggestion.

Fillianore commented 2 years ago

You mentiond in readme: Set up correct path for boost and some other options like -march=native of your choice. While I was building Akochan, and the error is

C:/msys64/mingw64/include/boost/bind.hpp:36:1: note: '#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.'
     36 | BOOST_PRAGMA_MESSAGE(
        | ^~~~~~~~~~~~~~~~~~~~
C:\msys64\tmp\ccGwzggr.s: Assembler messages:
C:\msys64\tmp\ccGwzggr.s:3102: Error: value of 00000000f0844e6b too large for field of 4 bytes at 0000000000000643
C:\msys64\tmp\ccGwzggr.s:116849: Error: value of 00000000f08448c3 too large for field of 4 bytes at 000000000000009b
make: *** [Makefile:34: obj/selector.o] Error 1

I guess this is because I didnt setup correct path for boost. However I have no idea how to edit Makefile to set up path for boost. Could you please give me more detail on that. Thanks!

Equim-chan commented 2 years ago

Looks like you did set up boost correctly, but the actual error is likely about akochan's abuse of big arrays. I am not too familiar with this...

Fillianore commented 2 years ago

And finally it works under MSYS2 bash, but under cmd, powershell or other terminal it doesn't work. I guess I wrongly set OMP_NUM_THREADS on cmd and powershell. So the problem was not solved at that time

Your readme doesn't mention the following,

Error: failed to review log

Caused by:
    failed to read from akochan: unexpected EOF

so I thought this error had nothing to do with OMP_NUM_THREADS, but in fact it really fix my problem, maybe you can mention it in your readme now.

Thanks a lot for your patience!

WinterHoon commented 2 years ago

Is reviewing Mahjong Soul Logs only working on Windows?

I built akochan-reviewer on my MacOS locally, then followed the instruction (https://github.com/Equim-chan/akochan-reviewer/blob/master/mjsoul.adoc) but failed.

here are the logs:

(base) winterhoon@WinterHoondeMacBook-Air akochan % akochan-reviewer -i 2022_2_19_Gold_Room_South.json -a 1
14:48:15.201011 src/main.rs:506 converting to mjai events...
Error: failed to canonicalize tactics_config path "tactics.json"

Caused by:
    No such file or directory (os error 2)
Equim-chan commented 2 years ago

@WinterHoon You need to have the file tactics.json under ./akochan

wrptc commented 2 years ago

Same error while using an AMD cpu, I tried with another Intel cpu, everything goes well.

newalter commented 2 years ago

And finally it works under MSYS2 bash, but under cmd, powershell or other terminal it doesn't work. I guess I wrongly set OMP_NUM_THREADS on cmd and powershell. So the problem was not solved at that time

Your readme doesn't mention the following,

Error: failed to review log

Caused by:
    failed to read from akochan: unexpected EOF

so I thought this error had nothing to do with OMP_NUM_THREADS, but in fact it really fix my problem, maybe you can mention it in your readme now.

Thanks a lot for your patience!

Just to provide another sample. I encounter the same problem using cmd (Windows 10, AMD cpu). But there is no problem when I use the terminal of Anaconda.

csyJoy commented 2 years ago

Is reviewing Mahjong Soul Logs only working on Windows?

I built akochan-reviewer on my MacOS locally, then followed the instruction (https://github.com/Equim-chan/akochan-reviewer/blob/master/mjsoul.adoc) but failed.

here are the logs:

(base) winterhoon@WinterHoondeMacBook-Air akochan % akochan-reviewer -i 2022_2_19_Gold_Room_South.json -a 1
14:48:15.201011 src/main.rs:506   converting to mjai events...
Error: failed to canonicalize tactics_config path "tactics.json"

Caused by:
    No such file or directory (os error 2)

the file is in akochan-reviewer,you can use -c to specify it