Skip to content

Commit 48aa900

Browse files
authored
Stockfish 16.1 (#36)
* Stockfish 16.1 * Update features and old Windows detection * Import code * Easier maintenance * Release notes
1 parent 5e9b550 commit 48aa900

File tree

17 files changed

+222
-55
lines changed

17 files changed

+222
-55
lines changed

assets/arm.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"files": [
3+
{
4+
"arch": "ARMv8 Dot Product",
5+
"file": "stockfish-android-armv8-dotprod.tar"
6+
},
7+
{
8+
"arch": "ARMv8",
9+
"file": "stockfish-android-armv8.tar",
10+
"tags": ["fast"]
11+
},
12+
{
13+
"arch": "ARMv7 NEON",
14+
"file": "stockfish-android-armv7-neon.tar"
15+
},
16+
{
17+
"arch": "ARMv7",
18+
"file": "stockfish-android-armv7.tar",
19+
"tags": ["compat"]
20+
}
21+
]
22+
}

assets/js/scripts.js

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,14 @@ menuTrigger.onclick = function() {
99
}
1010

1111
// https://stackoverflow.com/a/19176790
12-
function IsOldWindows() {
13-
// var os_name = "Unknown";
14-
// if (window.navigator.userAgent.indexOf("Windows NT 10.0")!= -1) os_name="Windows 10";
15-
if (window.navigator.userAgent.indexOf("Windows NT 6.") != -1) return true;
16-
// if (window.navigator.userAgent.indexOf("Windows NT 6.2") != -1) os_name="Windows 8";
17-
// if (window.navigator.userAgent.indexOf("Windows NT 6.1") != -1) os_name="Windows 7";
18-
// if (window.navigator.userAgent.indexOf("Windows NT 6.0") != -1) os_name="Windows Vista";
19-
if (window.navigator.userAgent.indexOf("Windows NT 5.") != -1) return true;
20-
// if (window.navigator.userAgent.indexOf("Windows NT 5.0") != -1) os_name="Windows 2000";
21-
// if (window.navigator.userAgent.indexOf("Mac") != -1) os_name="Mac/iOS";
22-
// if (window.navigator.userAgent.indexOf("X11") != -1) os_name="UNIX";
23-
// if (window.navigator.userAgent.indexOf("Linux") != -1) os_name="Linux";
24-
return false;
12+
function isOldWindows() {
13+
return /Windows NT [5-6]\./.test(navigator.userAgent);
2514
}
2615

27-
function GetFastAndSlow(json, old_windows) {
16+
function getFastAndSlow(json, old_windows) {
2817
let fast = {};
2918
let slow = {};
30-
// console.log(json.files);
3119
for (let obj of json.files) {
32-
// console.log(obj);
3320
if (obj.tags && obj.tags.includes( (old_windows ? 'lt_' : '') + 'win10_fast' )) {
3421
fast = obj;
3522
}
@@ -40,25 +27,39 @@ function GetFastAndSlow(json, old_windows) {
4027
return [fast, slow];
4128
}
4229

43-
const windows_table = document.getElementById('windows-table');
44-
if (windows_table) {
30+
const baseDownloadLink = "https://github.com/official-stockfish/Stockfish/releases/latest/download/";
31+
32+
const windowsTable = document.getElementById('windows-table');
33+
if (windowsTable) {
4534
fetch('/windows.json?a').then(response => response.json()).then(data => {
46-
// console.log(data);
47-
const fast_and_slow = GetFastAndSlow(data, IsOldWindows());
48-
// console.log(fast_and_slow);
49-
windows_table.querySelector('.fast').href = fast_and_slow[0].file;
50-
windows_table.querySelector('.fast span').textContent = fast_and_slow[0].arch;
51-
windows_table.querySelector('.compat').href = fast_and_slow[1].file;
52-
windows_table.querySelector('.compat span').textContent = fast_and_slow[1].arch;
35+
const fast_and_slow = getFastAndSlow(data, isOldWindows());
36+
windowsTable.querySelector('.fast').href = baseDownloadLink + fast_and_slow[0].file;
37+
windowsTable.querySelector('.fast span').textContent = fast_and_slow[0].arch;
38+
windowsTable.querySelector('.compat').href = baseDownloadLink + fast_and_slow[1].file;
39+
windowsTable.querySelector('.compat span').textContent = fast_and_slow[1].arch;
5340
})
5441
}
5542

56-
const linux_table = document.getElementById('linux-table');
57-
if (linux_table) {
43+
const linuxTable = document.getElementById('linux-table');
44+
if (linuxTable) {
5845
fetch('/linux.json?a').then(response => response.json()).then(data => {
59-
linux_table.querySelector('.fast').href = data.files[0].file;
60-
linux_table.querySelector('.fast span').textContent = data.files[0].arch;
61-
linux_table.querySelector('.compat').href = data.files[1].file;
62-
linux_table.querySelector('.compat span').textContent = data.files[1].arch;
46+
const fastFile = data.files.find(file => file.tags && file.tags.includes('fast'));
47+
const compatFile = data.files.find(file => file.tags && file.tags.includes('compat'));
48+
linuxTable.querySelector('.fast').href = fastFile ? baseDownloadLink + fastFile.file : '';
49+
linuxTable.querySelector('.fast span').textContent = fastFile ? fastFile.arch : '';
50+
linuxTable.querySelector('.compat').href = compatFile ? baseDownloadLink + compatFile.file : '';
51+
linuxTable.querySelector('.compat span').textContent = compatFile ? compatFile.arch : '';
52+
})
53+
}
54+
55+
const armTable = document.getElementById('arm-table');
56+
if (armTable) {
57+
fetch('/arm.json?a').then(response => response.json()).then(data => {
58+
const fastFile = data.files.find(file => file.tags && file.tags.includes('fast'));
59+
const compatFile = data.files.find(file => file.tags && file.tags.includes('compat'));
60+
armTable.querySelector('.fast').href = fastFile ? baseDownloadLink + fastFile.file : '';
61+
armTable.querySelector('.fast span').textContent = fastFile ? fastFile.arch : '';
62+
armTable.querySelector('.compat').href = compatFile ? baseDownloadLink + compatFile.file : '';
63+
armTable.querySelector('.compat span').textContent = compatFile ? compatFile.arch : '';
6364
})
6465
}

assets/linux.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
11
{
22
"files": [
3+
{
4+
"arch": "VNNI512",
5+
"wiki_url": "https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX-VNNI",
6+
"file": "stockfish-ubuntu-x86-64-vnni512.zip"
7+
},
8+
{
9+
"arch": "VNNI256",
10+
"wiki_url": "https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX-VNNI",
11+
"file": "stockfish-ubuntu-x86-64-vnni256.zip"
12+
},
13+
{
14+
"arch": "AVX512",
15+
"wiki_url": "https://en.wikipedia.org/wiki/AVX-512#CPUs_with_AVX-512",
16+
"file": "stockfish-ubuntu-x86-64-avx512.zip"
17+
},
18+
{
19+
"arch": "BMI2",
20+
"wiki_url": "https://en.wikipedia.org/wiki/X86_Bit_manipulation_instruction_set#Supporting_CPUs",
21+
"file": "stockfish-ubuntu-x86-64-bmi2.zip"
22+
},
323
{
424
"arch": "AVX2",
525
"wiki_url": "https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX2",
6-
"file": "https://github.com/official-stockfish/Stockfish/releases/download/sf_16/stockfish-ubuntu-x86-64-avx2.tar"
26+
"file": "stockfish-ubuntu-x86-64-avx2.tar",
27+
"tags": ["fast"]
728
},
829
{
930
"arch": "POPCNT",
1031
"wiki_url": "https://en.wikipedia.org/wiki/SSE4#Supporting_CPUs",
11-
"file": "https://github.com/official-stockfish/Stockfish/releases/download/sf_16/stockfish-ubuntu-x86-64-modern.tar"
32+
"file": "stockfish-ubuntu-x86-64-sse41-popcnt.tar",
33+
"tags": ["compat"]
1234
},
1335
{
1436
"arch": "64-bit",
15-
"file": "https://github.com/official-stockfish/Stockfish/releases/download/sf_16/stockfish-ubuntu-x86-64.tar"
37+
"file": "stockfish-ubuntu-x86-64.tar"
1638
}
1739
]
1840
}

assets/macos.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"files": [
3+
{
4+
"arch": "Apple Silicon",
5+
"wiki_url": "https://en.wikipedia.org/wiki/Apple_silicon#M_series",
6+
"file": "stockfish-macos-m1-apple-silicon.tar"
7+
},
8+
{
9+
"arch": "BMI2",
10+
"file": "stockfish-macos-x86-64-bmi2.tar"
11+
},
12+
{
13+
"arch": "AVX2",
14+
"file": "stockfish-macos-x86-64-avx2.tar"
15+
},
16+
{
17+
"arch": "POPCNT",
18+
"file": "stockfish-macos-x86-64-sse41-popcnt.tar"
19+
},
20+
{
21+
"arch": "64-bit",
22+
"file": "stockfish-macos-x86-64.tar"
23+
}
24+
]
25+
}

assets/scss/bootstrap/_code.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ code {
33
@include font-size($code-font-size);
44
color: $code-color;
55
word-wrap: break-word;
6+
background-color: $code-bg;
7+
border-radius: $code-border-radius;
8+
padding: $code-padding;
69

710
// Streamline the style when inside anchors to avoid broken underline and more
811
a > & {
@@ -32,12 +35,17 @@ pre {
3235
display: block;
3336
@include font-size($code-font-size);
3437
color: $pre-color;
38+
padding: $pre-padding;
39+
background-color: $code-bg;
40+
border-radius: $code-border-radius;
3541

3642
// Account for some code outputs that place code tags in pre tags
3743
code {
3844
@include font-size(inherit);
3945
color: inherit;
4046
word-break: normal;
47+
background-color: initial;
48+
padding: initial;
4149
}
4250
}
4351

assets/scss/bootstrap/_variables.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,18 +1116,22 @@ $close-text-shadow: 0 1px 0 $white !default;
11161116

11171117

11181118
// Code
1119+
$code-bg: rgba($green2, 0.4);
1120+
$code-border-radius: $border-radius;
11191121

1120-
$code-font-size: 87.5% !default;
1121-
$code-color: $pink !default;
1122+
$code-font-size: 85% !default;
1123+
$code-color: $white !default;
1124+
$code-padding: 0.2em;
11221125

11231126
$kbd-padding-y: .2rem !default;
11241127
$kbd-padding-x: .4rem !default;
11251128
$kbd-font-size: $code-font-size !default;
11261129
$kbd-color: $white !default;
11271130
$kbd-bg: $gray-900 !default;
11281131

1129-
$pre-color: $gray-900 !default;
1132+
$pre-color: $white !default;
11301133
$pre-scrollable-max-height: 340px !default;
1134+
$pre-padding: 1rem;
11311135

11321136

11331137
// Utilities

assets/scss/bootstrap/bootstrap-reboot.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
@import "variables";
1111
@import "mixins";
1212
@import "reboot";
13+
@import "code";

assets/scss/components/_content.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
}
8181
}
8282
tr:nth-child(even) {
83-
background-color: $green2;
83+
background-color: rgba($green2, 0.4);
8484
}
8585
thead th {
8686
vertical-align: bottom;

assets/windows.json

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,40 @@
11
{
22
"files": [
3+
{
4+
"arch": "VNNI512",
5+
"wiki_url": "https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX-VNNI",
6+
"file": "stockfish-windows-x86-64-vnni512.zip"
7+
},
8+
{
9+
"arch": "VNNI256",
10+
"wiki_url": "https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX-VNNI",
11+
"file": "stockfish-windows-x86-64-vnni256.zip"
12+
},
13+
{
14+
"arch": "AVX512",
15+
"wiki_url": "https://en.wikipedia.org/wiki/AVX-512#CPUs_with_AVX-512",
16+
"file": "stockfish-windows-x86-64-avx512.zip"
17+
},
18+
{
19+
"arch": "BMI2",
20+
"wiki_url": "https://en.wikipedia.org/wiki/X86_Bit_manipulation_instruction_set#Supporting_CPUs",
21+
"file": "stockfish-windows-x86-64-bmi2.zip"
22+
},
323
{
424
"arch": "AVX2",
525
"wiki_url": "https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX2",
6-
"file": "https://github.com/official-stockfish/Stockfish/releases/download/sf_16/stockfish-windows-x86-64-avx2.zip",
26+
"file": "stockfish-windows-x86-64-avx2.zip",
727
"tags": ["win10_fast"]
828
},
929
{
1030
"arch": "POPCNT",
1131
"wiki_url": "https://en.wikipedia.org/wiki/SSE4#Supporting_CPUs",
12-
"file": "https://github.com/official-stockfish/Stockfish/releases/download/sf_16/stockfish-windows-x86-64-modern.zip",
32+
"file": "stockfish-windows-x86-64-sse41-popcnt.zip",
1333
"tags": ["win10_compat", "lt_win10_fast"]
1434
},
1535
{
1636
"arch": "64-bit",
17-
"file": "https://github.com/official-stockfish/Stockfish/releases/download/sf_16/stockfish-windows-x86-64.zip",
37+
"file": "stockfish-windows-x86-64.zip",
1838
"tags": ["lt_win10_compat"]
1939
}
2040
]

content/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ title: "Stockfish - Open Source Chess Engine"
33
intro_image: "images/logo/icon_512x512@2x.png"
44
---
55

6-
# Stockfish 16
6+
# Stockfish 16.1
77

88
Strong open source chess engine

0 commit comments

Comments
 (0)