Skip to content

Commit 3737d53

Browse files
committed
Gemini5
1 parent b76067f commit 3737d53

File tree

1 file changed

+21
-39
lines changed

1 file changed

+21
-39
lines changed

src/nnue/features/half_ka_v2_hm.h

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -179,57 +179,39 @@ class HalfKAv2_hm {
179179
v[us_rook][opp_rook][us_knight_cannon][opp_knight_cannon] = [&] {
180180
if (us_rook == opp_rook)
181181
{
182-
// === 均势车力局面 (8个桶) ===
183-
int minor_adv = static_cast<int>(us_knight_cannon)
184-
- static_cast<int>(opp_knight_cannon);
182+
// === 均势车力局面 (10个桶) ===
183+
bool is_complex = (us_knight_cannon + opp_knight_cannon >= 4);
184+
bool is_equal = (us_knight_cannon == opp_knight_cannon);
185185

186-
if (us_rook == 2) // 双方双车,最复杂,值得细分优势 (4个桶)
186+
if (us_rook == 0) // 双方无车 (2个桶)
187187
{
188-
if (minor_adv == 0)
189-
return 0; // 均势
190-
if (minor_adv == 1)
191-
return 1; // 我方稍优
192-
if (minor_adv == -1)
193-
return 2; // 对方稍优
194-
return 3; // 其他不平衡
188+
return is_equal ? 0 : 1;
195189
}
196-
else if (us_rook == 1) // 双方单车,只分平衡与否 (2个桶)
190+
else // 双方有车 (8个桶)
197191
{
198-
return (minor_adv == 0) ? 4 : 5;
199-
}
200-
else // 双方无车,只分平衡与否 (2个桶)
201-
{
202-
return (minor_adv == 0) ? 6 : 7;
192+
// 逻辑与基线相同,但桶号需要偏移
193+
// us_rook=1 -> group 1 (桶 2-5)
194+
// us_rook=2 -> group 2 (桶 6-9)
195+
uint8_t sub_bucket = is_complex * 2 + is_equal;
196+
return (us_rook - 1) * 4 + 2 + sub_bucket;
203197
}
204198
}
205199
else
206200
{
207-
// === 非均势车力局面 (8个桶) ===
208-
// 与我第一次给出的方案一的这部分逻辑相同,但现在它是一个混合模型的一部分
201+
// === 非均势车力局面 (6个桶) ===
202+
// 每个组合一个桶,桶号从10开始
209203
if (us_rook == 2 && opp_rook == 1)
210-
{
211-
return (us_knight_cannon >= opp_knight_cannon) ? 8 : 9;
212-
}
213-
else if (us_rook == 1 && opp_rook == 2)
214-
{
215-
return (us_knight_cannon <= opp_knight_cannon) ? 10 : 11;
216-
}
217-
else if (us_rook == 2 && opp_rook == 0)
218-
{
204+
return 10;
205+
if (us_rook == 1 && opp_rook == 2)
206+
return 11;
207+
if (us_rook == 2 && opp_rook == 0)
219208
return 12;
220-
}
221-
else if (us_rook == 0 && opp_rook == 2)
222-
{
209+
if (us_rook == 0 && opp_rook == 2)
223210
return 13;
224-
}
225-
else if (us_rook == 1 && opp_rook == 0)
226-
{
211+
if (us_rook == 1 && opp_rook == 0)
227212
return 14;
228-
}
229-
else // us_rook == 0 && opp_rook == 1
230-
{
231-
return 15;
232-
}
213+
// else us_rook == 0 && opp_rook == 1
214+
return 15;
233215
}
234216
}();
235217
return v;

0 commit comments

Comments
 (0)