Open v01dXYZ opened 5 months ago
When compiling obsequi with
obsequi
cc *.c -o obsequi -DCOUNTBITS16 -DLASTBIT16 -DCOUNTMOVES_TABLE -DTWO_STAGE_GENERATION -DHASHCODEBITS=23 -Wno-implicit-int
To generate the output from the test input:
cat input | ./obsequi
The output is different between debian (glibc) (same as Obsequi.reference_output) and alpine (musl) (both with clang 16 and 17).
debian (glibc)
Obsequi.reference_output
alpine (musl)
$ cat /etc/alpine-release 3.20.0 $ clang --version Alpine clang version 17.0.6 Target: x86_64-alpine-linux-musl Thread model: posix InstalledDir: /usr/bin Configuration file: /etc/clang17/x86_64-alpine-linux-musl.cfg $ clang-16 --version Alpine clang version 16.0.6 Target: x86_64-alpine-linux-musl Thread model: posix InstalledDir: /usr/bin Configuration file: /etc/clang16/x86_64-alpine-linux-musl.cfg
root@12754302fc9c:/# cat /etc/debian_version trixie/sid root@12754302fc9c:/# clang --version Debian clang version 16.0.6 (27) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin
I suspect the cause israndom in initialize_solver.
random
initialize_solver
I confirm replacing random() by a Linear Congruential Generator solves the issue.
random()
When compiling
obsequi
withTo generate the output from the test input:
The output is different between
debian (glibc)
(same asObsequi.reference_output
) andalpine (musl)
(both with clang 16 and 17).