BitContradiction filtering improvements.

This commit is contained in:
Marek Lemańczyk committed 2026-02-13 21:49:39 +01:00
1 parent 0eb511aaff
commit db7fe14208
1 file changed
+69 -3
@@ -234,7 +234,7 @@ internal static class BitContradictionSolverWithAMultiplier
{
Atomic.Add(ref counter, 1UL);
_pruneStatsConsoleCounter++;
if (true || _pruneStatsConsoleCounter < PerfectNumberConstants.ConsoleInterval)
if (_pruneStatsConsoleCounter < PerfectNumberConstants.ConsoleInterval)
{
return;
}
@@ -2392,7 +2392,8 @@ internal static class BitContradictionSolverWithAMultiplier
bool hadPositiveCarry = false;
int upperOffsetExclusive = 1;
int totalCarry6Count = 0,
int totalCarry2Count = 0,
totalCarry6Count = 0,
totalCarry7Count = 0,
totalCarry8Count = 0,
totalCarry9Count = 0,
@@ -2574,6 +2575,10 @@ internal static class BitContradictionSolverWithAMultiplier
if (carryOut <= 4)
{
totalCarry01234Count++;
if (carryOut == 2)
{
totalCarry2Count++;
}
}
if (carryOut >= 14)
@@ -2735,7 +2740,64 @@ internal static class BitContradictionSolverWithAMultiplier
return true;
}
if (reached10 && reached5 == 0 && !reachedBelow5 && totalTransitionsOver10 < 35)
if (reached10 && !reachedBelow5 &&
(
(
reached5 == 0 &&
(
totalTransitionsOver10 < 35 ||
(
lastStreakBelow10 <= 89 &&
(
zeroCount > 4 ||
lastStreakBelow10 > 0 ||
first10 < 34 ||
totalCarry2Count < 7 ||
totalCarry11Count < 156 ||
totalCarry10Count > totalCarry11Count
/* || longestStreakBelow10 < 34*/
)
) ||
(
totalTransitionsOver10 > 100 &&
lastStreakBelow10 > 100
)
)
) ||
(
reached5 >= 8 &&
totalTransitionsOver10 > 35 &&
(
lastStreakBelow10 >= 5 ||
lastStreakBelow10 == 0 ||
(lastStreakBelow10 < 5 && totalTransitionsOver10 > 100) ||
(lastStreakBelow10 < 5 && totalCarryBelow10 < 186) ||
(totalTransitionsOver10 < 100)
)
) ||
(
reached5 <= 2 &&
totalTransitionsOver10 > 35 &&
(lastStreakBelow10 <= 28 || lastStreakBelow10 > 35 || longestStreakBelow10 < 49 || totalCarryBelow10 > 500)
) ||
(
reached5 >= 3 && reached5 <= 7 &&
(
totalTransitionsOver10 > 50 ||
(totalTransitionsOver10 < 50 && first10 < 33)
) &&
(
first10 < 58 ||
first10 > 100 ||
totalTransitionsOver10 > 150 ||
(totalTransitionsOver10 > 100 && longestStreakBelow10 < 49) ||
(totalTransitionsOver10 > 100 && lastStreakBelow10 > 0) ||
(totalTransitionsOver10 > 100 && totalCarryBelow10 > 400 && zeroCount < 5) ||
(totalCarryBelow10 < 320)
)
)
)
)
{
pruneReason = CarryDropPruneReason.DominanceReached10AndStayedAbove5;
#if WITH_PRUNE_STATS
@@ -2743,6 +2805,10 @@ internal static class BitContradictionSolverWithAMultiplier
#endif
return true;
}
else if (reached10 && !reachedBelow5 && reached5 > 0)
{
Console.WriteLine($"Something excluded this filter for p={pLong}, q={qExact}, reached5={reached5}, totalTransitionsOver10={totalTransitionsOver10}, lastStreakBelow10={lastStreakBelow10}, longestStreakBelow10={longestStreakBelow10}, zeroCount={zeroCount}, first10={first10}, totalCarryBelow10={totalCarryBelow10}, totalCarry2={totalCarry2Count}");
}
return false;
}