orbita2d / admete

2 stars 0 forks source link

Some tests fail #22

Open shitpoet opened 1 year ago

shitpoet commented 1 year ago

Some tests fail when compiling in Debian GNU/Linux 12 (bookworm) 64-bit amd64 architecture.

[ RUN      ] Search.MateInThree
./test/search.cpp:52: Failure
Expected equality of these values:
  Search::search(board, depth, line)
    Which is: 171
  score
    Which is: 32761
./test/search.cpp:52: Failure
Expected equality of these values:
  Search::search(board, depth, line)
    Which is: 181
  score
    Which is: 32761
./test/search.cpp:52: Failure
Expected equality of these values:
  Search::search(board, depth, line)
    Which is: 1358
  score
    Which is: 32761
[  FAILED  ] Search.MateInThree (591 ms)
[ RUN      ] Search.MateInFour
.../test/search.cpp:70: Failure
Expected equality of these values:
  Search::search(board, depth, line)
    Which is: -327
  score
    Which is: 32759
[  FAILED  ] Search.MateInFour (121 ms)

Rust version:

$ rustc --version
rustc 1.63.0

CPU info:

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 58
model name      : Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz
stepping        : 9
microcode       : 0x15
cpu MHz         : 2505.676
cache size      : 3072 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm cpuid_fault epb pti tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts
vmx flags       : vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds mmio_unknown
bogomips        : 3591.84
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 58
model name      : Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz
stepping        : 9
microcode       : 0x15
cpu MHz         : 2499.490
cache size      : 3072 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm cpuid_fault epb pti tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts
vmx flags       : vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds mmio_unknown
bogomips        : 3591.84
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 58
model name      : Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz
stepping        : 9
microcode       : 0x15
cpu MHz         : 2494.422
cache size      : 3072 KB
physical id     : 0
siblings        : 4
core id         : 1
cpu cores       : 2
apicid          : 2
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm cpuid_fault epb pti tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts
vmx flags       : vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds mmio_unknown
bogomips        : 3591.84
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 58
model name      : Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz
stepping        : 9
microcode       : 0x15
cpu MHz         : 2494.287
cache size      : 3072 KB
physical id     : 0
siblings        : 4
core id         : 1
cpu cores       : 2
apicid          : 3
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm cpuid_fault epb pti tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts
vmx flags       : vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds mmio_unknown
bogomips        : 3591.84
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

Note: compilation was failing because my distribution seems to not have std::clamp, so I added this code right into two files where clamp was used:

template<class T>
const T& clamp(const T& x, const T& upper, const T& lower) {
    return std::min(upper, std::max(x, lower));
}

But it should not be a problem as far as I understand.

orbita2d commented 1 year ago

Bizarre.

shitpoet commented 1 year ago

I don't remember now, but it was either master or the last tag 1.5.0.

Anyway, I cloned the master branch again (into a new separate folder) and tried compilation and testing again, with that "fixing" of missing std::clamp in search.cpp and uci.cpp, and... result is the same:

/home/ors/tmp/admete/test/search.cpp:52: Failure
Expected equality of these values:
  Search::search(board, depth, line)
    Which is: 171
  score
    Which is: 32761
/home/ors/tmp/admete/test/search.cpp:52: Failure
Expected equality of these values:
  Search::search(board, depth, line)
    Which is: 181
  score
    Which is: 32761
/home/ors/tmp/admete/test/search.cpp:52: Failure
Expected equality of these values:
  Search::search(board, depth, line)
    Which is: 1358
  score
    Which is: 32761
[  FAILED  ] Search.MateInThree (515 ms)
/home/ors/tmp/admete/test/search.cpp:70: Failure
Expected equality of these values:
  Search::search(board, depth, line)
    Which is: -327
  score
    Which is: 32759
[  FAILED  ] Search.MateInFour (131 ms)
[----------] Global test environment tear-down
[==========] 40 tests from 9 test suites ran. (5274 ms total)
[  PASSED  ] 38 tests.
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] Search.MateInThree
[  FAILED  ] Search.MateInFour

 2 FAILED TESTS

Unfortunately, I don't know how to compile C++ code with rustc, and at least a very quick google search didn't answer for me that question. But if you know how can I try to compile the project using rustc, I would try.