-
-
Notifications
You must be signed in to change notification settings - Fork 145
1562 lines (1480 loc) · 79.7 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: CI Build&Release
on:
push:
tags:
# 動作条件を変えたい場合、 workflow-syntax-for-github-actions#フィルタパターンのチートシート 参照。
# https://docs.github.com/ja/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
- "v*"
- "V*"
# ⇨ 先頭が"v"または"V"で始まるtagをつけてpushしたら、以下のjobが走って成果物が
# Releasesのところに生える。
# この方法で実行ファイルを公開する予定がないので、この.ymlは不要なのだが、
# 参考のため残してある。[2024/10/09]
jobs:
build-msys2-general:
# windows-latest = windows-2019 => windows-2022
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md
runs-on: windows-2022
strategy:
matrix:
target:
- normal
- tournament
- evallearn
archcpu:
- "ZEN3,ZEN2,ZEN1,AVX512VNNI,AVXVNNI,AVX512,AVX2,SSE42"
- "SSE41,SSSE3,SSE2,NO_SSE"
- "OTHER"
edition:
- "YANEURAOU_ENGINE_NNUE_HALFKP_1024X2_8_32,YANEURAOU_ENGINE_NNUE,YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32,YANEURAOU_ENGINE_NNUE_HALFKPE9,YANEURAOU_ENGINE_NNUE_KP256"
- "YANEURAOU_ENGINE_KPPT,YANEURAOU_ENGINE_KPP_KKPT"
- YANEURAOU_MATE_ENGINE
- TANUKI_MATE_ENGINE
- USER_ENGINE
compiler:
- clang++
- g++
exclude:
# Release target exclude: edition USER_ENGINE
- edition: USER_ENGINE
# Release target exclude: compiler g++ normal/tournament
- compiler: g++
target: normal
- compiler: g++
target: tournament
# Release target exclude: compiler clang++ evallearn
- compiler: clang++
target: evallearn
# Release target exclude: archcpu ZEN3,AVXVNNI,OTHER
# `-march=cascadelake`: LLVM8, GCC9 support (AVX512VNNI)
# `-march=alderlake` : LLVM12, GCC11 support (AVX-VNNI)
# `-march=znver3`: LLVM12, GCC11 support
- archcpu: "OTHER"
# Release target exclude: archcpu 'SSE41,SSSE3,SSE2,NO_SSE' and target 'tournament,evallearn'
- target: tournament
archcpu: "SSE41,SSSE3,SSE2,NO_SSE"
- target: evallearn
archcpu: "SSE41,SSSE3,SSE2,NO_SSE"
# 以下のエディションには機械学習の実装が存在しない
# There is no machine learning implementation for the following editions
- edition: YANEURAOU_MATE_ENGINE
target: evallearn
- edition: TANUKI_MATE_ENGINE
target: evallearn
- edition: USER_ENGINE
target: evallearn
# 以下のエディションは別途build
- edition: YANEURAOU_ENGINE_MATERIAL*
steps:
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: Install pkg
run: |
$ErrorActionPreference = 'Continue'
C:\msys64\usr\bin\bash.exe -lc 'pacman --needed --noconfirm -Syuu'
C:\msys64\usr\bin\bash.exe -lc 'pacman --needed --noconfirm -Syuu'
C:\msys64\usr\bin\bash.exe -lc 'pacman --needed --noconfirm -Syuu pactoys'
C:\msys64\usr\bin\bash.exe -lc 'pacboy --needed --noconfirm -Syuu clang:m lld:m openblas:x openmp:x toolchain:m base-devel:'
$ErrorActionPreference = 'Stop'
- name: make
run: |
$env:PATH+=';C:\msys64';
main\script\msys2_build.ps1 -Edition ${{ matrix.edition }} -Compiler ${{ matrix.compiler }} -Target ${{ matrix.target }} -Cpu ${{ matrix.archcpu }}
shell: pwsh
- uses: actions/upload-artifact@v4
with:
name: build-windows_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: main/build/**/*
build-msys2-material:
# windows-latest = windows-2019 => windows-2022
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md
runs-on: windows-2022
strategy:
matrix:
target:
- normal
- tournament
- evallearn
archcpu:
- ZEN3
- ZEN2
- ZEN1
- AVX2
- SSE42
- SSE2
- NO_SSE
edition:
- "YANEURAOU_ENGINE_MATERIAL,YANEURAOU_ENGINE_MATERIAL9"
compiler:
- clang++
- g++
exclude:
# Release target exclude: edition USER_ENGINE
- edition: USER_ENGINE
# Release target exclude: compiler g++ normal/tournament
- compiler: g++
target: normal
- compiler: g++
target: tournament
# Release target exclude: compiler clang++ evallearn
- compiler: clang++
target: evallearn
# Release target exclude: archcpu 'SSE2,NO_SSE' and target 'tournament,evallearn'
- target: tournament
archcpu: SSE2
- target: evallearn
archcpu: SSE2
- target: tournament
archcpu: NO_SSE
- target: evallearn
archcpu: NO_SSE
# 以下のエディションには機械学習の実装が存在しない
# There is no machine learning implementation for the following editions
- edition: YANEURAOU_MATE_ENGINE
target: evallearn
- edition: TANUKI_MATE_ENGINE
target: evallearn
- edition: USER_ENGINE
target: evallearn
steps:
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: Install pkg
run: |
$ErrorActionPreference = 'Continue'
C:\msys64\usr\bin\bash.exe -lc 'pacman --needed --noconfirm -Syuu'
C:\msys64\usr\bin\bash.exe -lc 'pacman --needed --noconfirm -Syuu'
C:\msys64\usr\bin\bash.exe -lc 'pacman --needed --noconfirm -Syuu pactoys'
C:\msys64\usr\bin\bash.exe -lc 'pacboy --needed --noconfirm -Syuu clang:m lld:m openblas:x openmp:x toolchain:m base-devel:'
$ErrorActionPreference = 'Stop'
- name: make
run: |
$env:PATH+=';C:\msys64';
main\script\msys2_build.ps1 -Edition ${{ matrix.edition }} -Compiler ${{ matrix.compiler }} -Target ${{ matrix.target }} -Cpu ${{ matrix.archcpu }}
shell: pwsh
- uses: actions/upload-artifact@v4
with:
name: build-windows-material_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: main/build/**/*
build-deep-windows:
# windows-latest = windows-2019 => windows-2022
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md
runs-on: windows-2022
steps:
- uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
- uses: microsoft/setup-msbuild@v1
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: Install pkg
run: nuget.exe restore YaneuraOu.sln
working-directory: main
- name: make
run: |
MSBuild.exe /t:build /p:Configuration=Release-Deep-ORT-CPU /p:Platform=x64
MSBuild.exe /t:build /p:Configuration=Release-Deep-ORT-DML /p:Platform=x64
MSBuild.exe /t:build /p:Configuration=Release-Deep-ORT-TRT /p:Platform=x64
working-directory: main
- uses: actions/upload-artifact@v4
with:
name: build-deep-windows_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: main/build/**/*
build-android-general:
# ubuntu-latest = ubuntu-20.04
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
runs-on: ubuntu-20.04
strategy:
matrix:
edition:
- YANEURAOU_ENGINE_NNUE
- YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32
- YANEURAOU_ENGINE_NNUE_HALFKPE9
- YANEURAOU_ENGINE_NNUE_KP256
- YANEURAOU_ENGINE_KPPT
- YANEURAOU_ENGINE_KPP_KKPT
- "YANEURAOU_ENGINE_MATERIAL,YANEURAOU_ENGINE_MATERIAL9"
- YANEURAOU_MATE_ENGINE
- TANUKI_MATE_ENGINE
- USER_ENGINE
exclude:
# Release target exclude: edition USER_ENGINE
- edition: USER_ENGINE
steps:
- name: Setup Android NDK r27
uses: nttld/setup-ndk@v1
with:
ndk-version: r27
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: ndk-build
run: main/script/android_build.sh -e ${{ matrix.edition }}
- uses: actions/upload-artifact@v4
with:
name: build-android_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: main/build/**/*
build-macos-general:
# macos-11
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md
runs-on: macos-11
strategy:
matrix:
edition:
- YANEURAOU_ENGINE_NNUE
- "YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32,YANEURAOU_ENGINE_NNUE_HALFKPE9,YANEURAOU_ENGINE_NNUE_KP256"
- "YANEURAOU_ENGINE_KPPT,YANEURAOU_ENGINE_KPP_KKPT"
- "YANEURAOU_ENGINE_MATERIAL,YANEURAOU_ENGINE_MATERIAL9"
- YANEURAOU_ENGINE_DEEP_COREML
- "YANEURAOU_MATE_ENGINE,TANUKI_MATE_ENGINE"
#- USER_ENGINE
compiler:
- clang++
#- g++-11
target:
- "normal,tournament"
archcpu:
- APPLEAVX2
- APPLESSE42
- APPLEM1
exclude:
# Mac向けは g++-11 ではビルドしない
- compiler: g++-11
archcpu: APPLEAVX2
- compiler: g++-11
archcpu: APPLESSE42
- compiler: g++-11
archcpu: APPLEM1
steps:
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: make
uses: actions/github-script@v5
env:
JOBS: '8'
EDITION: '${{ matrix.edition }}'
COMPILER: '${{ matrix.compiler }}'
TARGET: '${{ matrix.target }}'
CPU: '${{ matrix.archcpu }}'
OS: 'macos11'
with:
script: |
const fs = require('fs');
const {JOBS, EDITION, COMPILER, TARGET, CPU, OS, EXTRA} = process.env;
const editionh = {
"YANEURAOU_ENGINE_NNUE": "YANEURAOU_ENGINE_NNUE",
"YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32": "YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32",
"YANEURAOU_ENGINE_NNUE_HALFKPE9": "YANEURAOU_ENGINE_NNUE_HALFKPE9",
"YANEURAOU_ENGINE_NNUE_KP256": "YANEURAOU_ENGINE_NNUE_KP256",
"YANEURAOU_ENGINE_DEEP_TENSOR_RT": "YANEURAOU_ENGINE_DEEP_TENSOR_RT",
"YANEURAOU_ENGINE_KPPT": "YANEURAOU_ENGINE_KPPT",
"YANEURAOU_ENGINE_KPP_KKPT": "YANEURAOU_ENGINE_KPP_KKPT",
"YANEURAOU_ENGINE_MATERIAL": "YANEURAOU_ENGINE_MATERIAL",
"YANEURAOU_ENGINE_MATERIAL2": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=2",
"YANEURAOU_ENGINE_MATERIAL3": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=3",
"YANEURAOU_ENGINE_MATERIAL4": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=4",
"YANEURAOU_ENGINE_MATERIAL5": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=5",
"YANEURAOU_ENGINE_MATERIAL6": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=6",
"YANEURAOU_ENGINE_MATERIAL7": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=7",
"YANEURAOU_ENGINE_MATERIAL8": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=8",
"YANEURAOU_ENGINE_MATERIAL9": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=9",
"YANEURAOU_ENGINE_MATERIAL10": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=10",
"YANEURAOU_ENGINE_DEEP_COREML": "YANEURAOU_ENGINE_DEEP_COREML",
"YANEURAOU_MATE_ENGINE": "YANEURAOU_MATE_ENGINE",
"TANUKI_MATE_ENGINE": "TANUKI_MATE_ENGINE",
"USER_ENGINE": "USER_ENGINE",
};
const dirh = {
"YANEURAOU_ENGINE_NNUE": "NNUE",
"YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32": "NNUE_HALFKP_VM",
"YANEURAOU_ENGINE_NNUE_HALFKPE9": "NNUE_HALFKPE9",
"YANEURAOU_ENGINE_NNUE_KP256": "NNUE_KP256",
"YANEURAOU_ENGINE_DEEP_TENSOR_RT": "DEEP_TRT",
"YANEURAOU_ENGINE_KPPT": "KPPT",
"YANEURAOU_ENGINE_KPP_KKPT": "KPP_KKPT",
"YANEURAOU_ENGINE_MATERIAL": "MaterialLv1",
"YANEURAOU_ENGINE_MATERIAL2": "MaterialLv2",
"YANEURAOU_ENGINE_MATERIAL3": "MaterialLv3",
"YANEURAOU_ENGINE_MATERIAL4": "MaterialLv4",
"YANEURAOU_ENGINE_MATERIAL5": "MaterialLv5",
"YANEURAOU_ENGINE_MATERIAL6": "MaterialLv6",
"YANEURAOU_ENGINE_MATERIAL7": "MaterialLv7",
"YANEURAOU_ENGINE_MATERIAL8": "MaterialLv8",
"YANEURAOU_ENGINE_MATERIAL9": "MaterialLv9",
"YANEURAOU_ENGINE_MATERIAL10": "MaterialLv10",
"YANEURAOU_ENGINE_DEEP_COREML": "FukauraOu_CoreML",
"YANEURAOU_MATE_ENGINE": "YaneuraOu_MATE",
"TANUKI_MATE_ENGINE": "tanuki_MATE",
"USER_ENGINE": "USER",
};
const fileh = {
"YANEURAOU_ENGINE_NNUE": "YaneuraOu_NNUE",
"YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32": "YaneuraOu_NNUE_HALFKP_VM",
"YANEURAOU_ENGINE_NNUE_HALFKPE9": "YaneuraOu_NNUE_HalfKPE9",
"YANEURAOU_ENGINE_NNUE_KP256": "YaneuraOu_NNUE_KP256",
"YANEURAOU_ENGINE_DEEP_TENSOR_RT": "YaneuraOu_Deep_TRT",
"YANEURAOU_ENGINE_KPPT": "YaneuraOu_KPPT",
"YANEURAOU_ENGINE_KPP_KKPT": "YaneuraOu_KPP_KKPT",
"YANEURAOU_ENGINE_MATERIAL": "YaneuraOu_MaterialLv1",
"YANEURAOU_ENGINE_MATERIAL2": "YaneuraOu_MaterialLv2",
"YANEURAOU_ENGINE_MATERIAL3": "YaneuraOu_MaterialLv3",
"YANEURAOU_ENGINE_MATERIAL4": "YaneuraOu_MaterialLv4",
"YANEURAOU_ENGINE_MATERIAL5": "YaneuraOu_MaterialLv5",
"YANEURAOU_ENGINE_MATERIAL6": "YaneuraOu_MaterialLv6",
"YANEURAOU_ENGINE_MATERIAL7": "YaneuraOu_MaterialLv7",
"YANEURAOU_ENGINE_MATERIAL8": "YaneuraOu_MaterialLv8",
"YANEURAOU_ENGINE_MATERIAL9": "YaneuraOu_MaterialLv9",
"YANEURAOU_ENGINE_MATERIAL10": "YaneuraOu_MaterialLv10",
"YANEURAOU_ENGINE_DEEP_COREML": "FukauraOu_CoreML",
"YANEURAOU_MATE_ENGINE": "YaneuraOu_MATE",
"TANUKI_MATE_ENGINE": "tanuki_MATE",
"USER_ENGINE": "user",
};
for(let edition of EDITION.split(',')) {
for(let compiler of COMPILER.split(',')) {
for(let target of TARGET.split(',')) {
for(let cpu of CPU.split(',')) {
const builddir = `../build/${OS}/${dirh[edition]}`;
const filename = `${fileh[edition]}-${OS}-${compiler}-${target}-${cpu.toLowerCase()}`;
let log = '';
await io.mkdirP(`./main/source/${builddir}`);
await exec.exec('nice', `make -j${JOBS} ${target} TARGET_CPU=${cpu} YANEURAOU_EDITION=${editionh[edition]} COMPILER=${compiler} TARGET=${builddir}/${filename}`.split(' '), {
"cwd": "./main/source/",
listeners: {
stdout: (data) => { log += data.toString(); },
stderr: (data) => { log += data.toString(); },
}
});
await exec.exec(`make`, `clean TARGET_CPU=${cpu} YANEURAOU_EDITION=${edition}`.split(' '), {"cwd": "./main/source/"});
fs.writeFileSync(`./main/source/${builddir}/${filename}.log`, log);
}}}}
- uses: actions/upload-artifact@v4
with:
name: build-macos_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: main/build/**/**/*
build-msys2-suisho:
# windows-latest = windows-2019 => windows-2022
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md
runs-on: windows-2022
strategy:
matrix:
target:
- tournament
archcpu:
- "AVX2,ZEN2,SSE42"
edition:
- YANEURAOU_ENGINE_NNUE
compiler:
- clang++
steps:
- name: Set version
id: version
run: |
$GHREPOSITORY=('${{ github.repository }}' -replace '.*/','')
$GHVERSION=('${{ github.ref }}' -replace 'refs/tags/','')
"::set-output name=version::$GHVERSION"
"::set-output name=filename::$GHREPOSITORY-$GHVERSION"
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: Install pkg
run: |
$ErrorActionPreference = 'Continue'
C:\msys64\usr\bin\bash.exe -lc 'pacman --needed --noconfirm -Syuu'
C:\msys64\usr\bin\bash.exe -lc 'pacman --needed --noconfirm -Syuu'
C:\msys64\usr\bin\bash.exe -lc 'pacman --needed --noconfirm -Syuu pactoys'
C:\msys64\usr\bin\bash.exe -lc 'pacboy --needed --noconfirm -Syuu clang:m lld:m openblas:x openmp:x toolchain:m base-devel:'
$ErrorActionPreference = 'Stop'
- name: suisho5 embedded_nnue
run: |
curl.exe -LRo main/source/eval/nnue/embedded_nnue.cpp.gz https://github.com/mizar/YaneuraOu/releases/download/resource/suisho5_20211123.halfkp.nnue.cpp.gz;
gzip.exe -df main/source/eval/nnue/embedded_nnue.cpp.gz;
- name: make
run: |
$env:PATH+=';C:\msys64';
main\script\msys2_build.ps1 -Edition ${{ matrix.edition }} -Compiler ${{ matrix.compiler }} -Target ${{ matrix.target }} -Cpu ${{ matrix.archcpu }} -Extra 'EVAL_EMBEDDING=ON EXTRA_CPPFLAGS=''-DENGINE_OPTIONS=""\\""option=name=FV_SCALE=type=spin=default=24=min=1=max=128;option=name=BookFile=type=combo=default=no_book=var=no_book=var=standard_book.db=var=yaneura_book1.db=var=yaneura_book2.db=var=yaneura_book3.db=var=yaneura_book4.db=var=user_book1.db=var=user_book2.db=var=user_book3.db=var=book.bin\\""""''';
shell: pwsh
- name: add resource
run: |
echo 'Suisho5(20211123)-${{ steps.version.outputs.filename }}' > main/build/windows/NNUE/engine_name.txt;
echo 'yaneurao, tayayan' >> main/build/windows/NNUE/engine_name.txt;
- uses: actions/upload-artifact@v4
with:
name: build-windows-suisho_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: main/build/**/*
build-android-suisho:
# ubuntu-latest = ubuntu-20.04
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
runs-on: ubuntu-20.04
strategy:
matrix:
edition:
- YANEURAOU_ENGINE_NNUE
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
- name: Setup Android NDK r23b
uses: nttld/setup-ndk@v1
with:
ndk-version: r23b
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: suisho5 embedded_nnue
run: |
curl -LRo main/source/eval/nnue/embedded_nnue.cpp.gz https://github.com/mizar/YaneuraOu/releases/download/resource/suisho5_20211123.halfkp.nnue.cpp.gz;
gzip -df main/source/eval/nnue/embedded_nnue.cpp.gz;
- name: ndk-build
run: main/script/android_build.sh -e ${{ matrix.edition }} -x 'EVAL_EMBEDDING=ON EXTRA_CPPFLAGS=''-DENGINE_OPTIONS="\"option=name=FV_SCALE=type=spin=default=24=min=1=max=128;option=name=BookFile=type=combo=default=no_book=var=no_book=var=standard_book.db=var=yaneura_book1.db=var=yaneura_book2.db=var=yaneura_book3.db=var=yaneura_book4.db=var=user_book1.db=var=user_book2.db=var=user_book3.db=var=book.bin\""'''
- name: add resource
run: |
echo 'Suisho5(20211123)-${{ steps.version.outputs.filename }}' > main/build/android/NNUE/engine_name.txt;
echo 'yaneurao, tayayan' >> main/build/android/NNUE/engine_name.txt;
- uses: actions/upload-artifact@v4
with:
name: build-android-suisho_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: main/build/**/*
build-macos-suisho:
# macos-11
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md
runs-on: macos-11
strategy:
matrix:
edition:
- YANEURAOU_ENGINE_NNUE
compiler:
- clang++
#- g++-11
target:
#- normal
- tournament
archcpu:
#- AVX2
#- SSE42
- APPLEAVX2
- APPLESSE42
- APPLEM1
exclude:
# M1 Mac向けは g++-11 ではビルドしない
- compiler: g++-11
archcpu: APPLEAVX2
- compiler: g++-11
archcpu: APPLESSE42
- compiler: g++-11
archcpu: APPLEM1
steps:
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: suisho5 embedded_nnue
run: |
curl -LRo main/source/eval/nnue/embedded_nnue.cpp.gz https://github.com/mizar/YaneuraOu/releases/download/resource/suisho5_20211123.halfkp.nnue.cpp.gz;
gzip -df main/source/eval/nnue/embedded_nnue.cpp.gz;
- name: make
uses: actions/github-script@v5
env:
JOBS: '8'
EDITION: '${{ matrix.edition }}'
COMPILER: '${{ matrix.compiler }}'
TARGET: '${{ matrix.target }}'
CPU: '${{ matrix.archcpu }}'
OS: 'macos11'
with:
script: |
const fs = require('fs');
const {JOBS, EDITION, COMPILER, TARGET, CPU, OS, EXTRA} = process.env;
const editionh = {
"YANEURAOU_ENGINE_NNUE": "YANEURAOU_ENGINE_NNUE",
"YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32": "YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32",
"YANEURAOU_ENGINE_NNUE_HALFKPE9": "YANEURAOU_ENGINE_NNUE_HALFKPE9",
"YANEURAOU_ENGINE_NNUE_KP256": "YANEURAOU_ENGINE_NNUE_KP256",
};
const dirh = {
"YANEURAOU_ENGINE_NNUE": "NNUE",
"YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32": "NNUE_HALFKP_VM",
"YANEURAOU_ENGINE_NNUE_HALFKPE9": "NNUE_HALFKPE9",
"YANEURAOU_ENGINE_NNUE_KP256": "NNUE_KP256",
};
const fileh = {
"YANEURAOU_ENGINE_NNUE": "Suisho5_YaneuraOu",
"YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32": "YaneuraOu_NNUE_HALFKP_VM",
"YANEURAOU_ENGINE_NNUE_HALFKPE9": "YaneuraOu_NNUE_HalfKPE9",
"YANEURAOU_ENGINE_NNUE_KP256": "YaneuraOu_NNUE_KP256",
};
for(let edition of EDITION.split(',')) {
for(let compiler of COMPILER.split(',')) {
for(let target of TARGET.split(',')) {
for(let cpu of CPU.split(',')) {
const builddir = `../build/${OS}/${dirh[edition]}`;
const filename = `${fileh[edition]}-${OS}-${compiler}-${target}-${cpu.toLowerCase()}`;
let log = '';
await io.mkdirP(`./main/source/${builddir}`);
await exec.exec('nice', `make -j${JOBS} ${target} TARGET_CPU=${cpu} YANEURAOU_EDITION=${editionh[edition]} COMPILER=${compiler} TARGET=${builddir}/${filename} EVAL_EMBEDDING=ON EXTRA_CPPFLAGS='-DENGINE_OPTIONS=\\\\\"\\\"option=name=FV_SCALE=type=spin=default=24=min=1=max=128\\;option=name=BookFile=type=combo=default=no_book=var=no_book=var=standard_book.db=var=yaneura_book1.db=var=yaneura_book2.db=var=yaneura_book3.db=var=yaneura_book4.db=var=user_book1.db=var=user_book2.db=var=user_book3.db=var=book.bin\\\\\\\"\"'`.split(' '), {
"cwd": "./main/source/",
listeners: {
stdout: (data) => { log += data.toString(); },
stderr: (data) => { log += data.toString(); },
}
});
await exec.exec(`make`, `clean TARGET_CPU=${cpu} YANEURAOU_EDITION=${edition} EVAL_EMBEDDING=ON`.split(' '), {"cwd": "./main/source/"});
fs.writeFileSync(`./main/source/${builddir}/${filename}.log`, log);
}}}}
- name: add resource
run: |
echo 'Suisho5(20211123)-YaneuraOu' > main/build/macos11/NNUE/engine_name.txt;
echo 'yaneurao, tayayan' >> main/build/macos11/NNUE/engine_name.txt;
- uses: actions/upload-artifact@v4
with:
name: build-macos-suisho_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: main/build/**/**/*
build-wasm:
# ubuntu-latest = ubuntu-20.04
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
runs-on: ubuntu-20.04
strategy:
matrix:
edition:
- halfkp.noeval
- halfkpe9.noeval
- halfkpvm.noeval
- k-p.noeval
- material
- material9
- yaneuraou-mate
- tanuki-mate
steps:
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: docker pull
run: |
docker pull emscripten/emsdk:3.1.43
- name: build wasm
run: |
docker run --rm -v ${PWD}/main:/src emscripten/emsdk:3.1.43 node script/wasm_build.js ${{ matrix.edition }}
- uses: actions/upload-artifact@v4
with:
name: build-wasm_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: ./main/build/**/**/*
build-wasm-suisho:
# ubuntu-latest = ubuntu-20.04
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
runs-on: ubuntu-20.04
strategy:
matrix:
edition:
- halfkp
steps:
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: docker pull
run: |
docker pull emscripten/emsdk:3.1.43
- name: build wasm
run: |
docker run --rm -v ${PWD}/main:/src emscripten/emsdk:3.1.43 node script/wasm_build.js ${{ matrix.edition }}
- uses: actions/upload-artifact@v4
with:
name: build-wasm-suisho_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: ./main/build/**/**/*
build-wasm-suishopetite:
# ubuntu-latest = ubuntu-20.04
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
runs-on: ubuntu-20.04
strategy:
matrix:
edition:
- k-p
steps:
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: docker pull
run: |
docker pull emscripten/emsdk:3.1.43
- name: build wasm
run: |
docker run --rm -v ${PWD}/main:/src emscripten/emsdk:3.1.43 node script/wasm_build.js ${{ matrix.edition }}
- uses: actions/upload-artifact@v4
with:
name: build-wasm-suishopetite_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: ./main/build/**/**/*
archive-msys2-general:
runs-on: ubuntu-20.04
needs:
- build-msys2-general
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
- uses: actions/checkout@v2
with:
path: main
- name: Download artifact to get build-windows
uses: actions/download-artifact@v4.1.7
with:
name: build-windows_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: release
- name: copy docs
run: |
cp main/Copying.txt release/windows
cp -r main/docs release/windows
tar -Jcf release/windows/source.tar.xz -C main source
- name: Display structure of downloaded files
run: ls -R release
- name: make build-windows zip/7z
run: |
7z a -tzip build-windows.zip windows
7z a -t7z build-windows.7z windows
working-directory: release
- uses: actions/upload-artifact@v4
with:
name: archive-windows_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: |
release/*.zip
release/*.7z
archive-msys2-material:
runs-on: ubuntu-20.04
needs:
- build-msys2-material
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
- uses: actions/checkout@v2
with:
path: main
- name: Download artifact to get build-windows-material
uses: actions/download-artifact@v4.1.7
with:
name: build-windows-material_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: release
- name: copy docs
run: |
cp main/Copying.txt release/windows
cp -r main/docs release/windows
tar -Jcf release/windows/source.tar.xz -C main source
- name: Display structure of downloaded files
run: ls -R release
- name: make build-windows zip/7z
run: |
7z a -tzip build-windows-material.zip windows
7z a -t7z build-windows-material.7z windows
working-directory: release
- uses: actions/upload-artifact@v4
with:
name: archive-windows-material_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: |
release/*.zip
release/*.7z
archive-msys2-suisho:
runs-on: ubuntu-20.04
needs:
- build-msys2-suisho
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
- uses: actions/checkout@v2
with:
path: main
- name: Download artifact to get build-windows-suisho
uses: actions/download-artifact@v4.1.7
with:
name: build-windows-suisho_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: release
- name: copy docs
run: |
cp main/Copying.txt release/windows/NNUE
cp -r main/docs release/windows/NNUE
curl -LRo main/source/eval/nnue/embedded_nnue.cpp.gz https://github.com/mizar/YaneuraOu/releases/download/resource/suisho5_20211123.halfkp.nnue.cpp.gz;
gzip -df main/source/eval/nnue/embedded_nnue.cpp.gz;
tar -Jcf release/windows/NNUE/source.tar.xz -C main source
- name: Display structure of downloaded files
run: ls -R release
- name: make build-windows-suisho zip/7z
run: |
7z a -tzip ../../build-windows-suisho.zip *
7z a -t7z ../../build-windows-suisho.7z *
working-directory: release/windows/NNUE
- uses: actions/upload-artifact@v4
with:
name: archive-windows-suisho_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: |
release/*.zip
release/*.7z
archive-deep-windows:
runs-on: ubuntu-20.04
needs:
- build-deep-windows
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
- uses: actions/checkout@v2
with:
path: main
- name: Download artifact to get build-deep-windows
uses: actions/download-artifact@v4.1.7
with:
name: build-deep-windows_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: release
- name: copy docs
run: |
cp main/Copying.txt release
cp -r main/docs release
tar -Jcf release/source.tar.xz -C main source
- name: Display structure of downloaded files
run: ls -R release
- name: make build-deep-windows zip/7z
run: |
7z a -tzip build-deep-windows.zip *
7z a -t7z build-deep-windows.7z *
working-directory: release
- uses: actions/upload-artifact@v4
with:
name: archive-deep-windows_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: |
release/*.zip
release/*.7z
archive-android-general:
runs-on: ubuntu-20.04
needs:
- build-android-general
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
- uses: actions/checkout@v2
with:
path: main
- name: Download artifact to get build-android
uses: actions/download-artifact@v4.1.7
with:
name: build-android_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: release
- name: copy docs
run: |
cp main/Copying.txt release/android
cp -r main/docs release/android
tar -Jcf release/android/source.tar.xz -C main source
- name: Display structure of downloaded files
run: ls -R release
- name: make build-android zip/7z
run: |
7z a -tzip build-android.zip android
7z a -t7z build-android.7z android
working-directory: release
- uses: actions/upload-artifact@v4
with:
name: archive-android_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: |
release/*.zip
release/*.7z
archive-android-suisho:
runs-on: ubuntu-20.04
needs:
- build-android-suisho
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
- uses: actions/checkout@v2
with:
path: main
- name: Download artifact to get build-android-suisho
uses: actions/download-artifact@v4.1.7
with:
name: build-android-suisho_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: release
- name: copy docs
run: |
cp main/Copying.txt release/android/NNUE
cp -r main/docs release/android/NNUE
curl -LRo main/source/eval/nnue/embedded_nnue.cpp.gz https://github.com/mizar/YaneuraOu/releases/download/resource/suisho5_20211123.halfkp.nnue.cpp.gz;
gzip -df main/source/eval/nnue/embedded_nnue.cpp.gz;
tar -Jcf release/android/NNUE/source.tar.xz -C main source
- name: Display structure of downloaded files
run: ls -R release
- name: make build-android-suisho zip/7z
run: |
7z a -tzip ../../build-android-suisho.zip *
7z a -t7z ../../build-android-suisho.7z *
working-directory: release/android/NNUE
- uses: actions/upload-artifact@v4
with:
name: archive-android-suisho_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: |
release/*.zip
release/*.7z
archive-macos-general:
runs-on: macos-11
needs:
- build-macos-general
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
- uses: actions/checkout@v2
with:
path: main
- name: Download artifact to get build-macos
uses: actions/download-artifact@v4.1.7
with:
name: build-macos_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: release
- name: set executable
run: |
find release|grep ++|grep -v \.log|xargs -I _file_ chmod +x _file_
- name: copy docs
run: |
cp main/Copying.txt release/macos11
cp -r main/docs release/macos11
tar -Jcf release/macos11/source.tar.xz -C main source
- name: Display structure of downloaded files
run: ls -R release
- name: make build-macos .tar.xz
run: |
tar -Jcf build-macos.tar.xz macos11
working-directory: release
- uses: actions/upload-artifact@v4
with:
name: archive-macos_${{ github.run_number }}_${{ github.job }}_${{ github.run_id }}_${{ github.sha }}
path: |
release/*.tar.xz
archive-macos-suisho:
runs-on: macos-11
needs:
- build-macos-suisho
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
- uses: actions/checkout@v2
with:
path: main