Compute the TooOld window in integer arithmetic (#99) #102

Open
weaselbot wants to merge 1 commits from weaselbot/conflict-set:weaselbot/issue-99 into main
pull from: weaselbot/conflict-set:weaselbot/issue-99
1 Commits
Author SHA1 Message Date
weaselbot ae5bd27d18 Compute the TooOld window in integer arithmetic
CI / test (arm64, -DCMAKE_BUILD_TYPE=Debug -DMSAN_TOOLCHAIN_PATH=/opt/msan, 22, https://minio.weaselab.dev/public/aarch64/msan-toolchain-22.1.8.tar.zst, debug-arm64, ubuntu-latest-arm64) (pull_request) Successful in 3m54s
CI / release (arm64, , ubuntu-latest-arm64) (pull_request) Successful in 4m26s
CI / pre-commit (pull_request) Successful in 2m14s
CI / test (amd64, -DCMAKE_BUILD_TYPE=Debug -DMSAN_TOOLCHAIN_PATH=/opt/msan, 21, https://minio.weaselab.dev/public/x86_64/msan-toolchain-21.1.8.tar.zst, debug, ubuntu-latest-amd64) (pull_request) Successful in 4m1s
CI / test (amd64, -DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 21, , 64-bit-versions, ubuntu-latest-amd64) (pull_request) Successful in 3m35s
CI / test (amd64, -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, 21, , gcc, ubuntu-latest-amd64) (pull_request) Successful in 3m31s
CI / test (amd64, -DUSE_SIMD_FALLBACK=ON, 21, , simd-fallback, ubuntu-latest-amd64) (pull_request) Successful in 3m36s
CI / release (amd64, -DMSAN_TOOLCHAIN_PATH=/opt/msan, ubuntu-latest-amd64) (pull_request) Successful in 6m0s
CI / coverage (pull_request) Successful in 4m1s
`newestVersion - 2e9` is evaluated in `double`, whose 53 bit mantissa
makes the `newestVersion - 2000000000` boundary off by up to 512 versions
once `newestVersion >= 2^53`. skip_list therefore reported `Commit` for
reads one version below the window, and `TooOld` for reads exactly at it.
`ReferenceImpl` in Internal.h had the same expression, so the differential
tests could not catch it.

Share a single integer `kNominalVersionWindow` via Internal.h, use it in
both places, and drop the duplicate (already integer) definition from
ConflictSet.cpp. Adds a regression test that bisimulates skip_list against
the radix tree above 2^53.

Closes #99
2026-11-10 15:20:45 -05:00