Document divisor invariants and refresh pow2 tests

This commit is contained in:
Marek Lemańczyk committed 2025-10-13 17:42:56 +02:00
1 parent af909e9e2d
commit c0b6b29837
8 files changed
+252 -130

No files matched your search

+1 -11
View File
@@ -82,8 +82,7 @@ public sealed class DivisorCycleCache
ulong cached = snapshot[divisor];
if (cached == 0UL)
{
missingBuffer[missingCount++] = i;
continue;
throw new InvalidDataException($"Divisor cycle is missing for {divisor}");
}
cycles[i] = cached;
@@ -106,15 +105,6 @@ public sealed class DivisorCycleCache
ComputeCyclesCpu(divisors, cycles, missingIndices);
}
for (int j = 0; j < missingCount; j++)
{
int target = missingIndices[j];
ulong divisor = divisors[target];
if (divisor < (ulong)snapshot.Length)
{
snapshot[divisor] = cycles[target];
}
}
}
if (rentedMissing is not null)