cdclkit 0.1.6__tar.gz → 0.1.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {cdclkit-0.1.6 → cdclkit-0.1.7}/PKG-INFO +3 -3
  2. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/__init__.py +1 -1
  3. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit.egg-info/PKG-INFO +3 -3
  4. cdclkit-0.1.7/cdclkit.egg-info/requires.txt +4 -0
  5. {cdclkit-0.1.6 → cdclkit-0.1.7}/pyproject.toml +3 -3
  6. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_target_scaling.py +21 -12
  7. cdclkit-0.1.6/cdclkit.egg-info/requires.txt +0 -4
  8. {cdclkit-0.1.6 → cdclkit-0.1.7}/LICENSE +0 -0
  9. {cdclkit-0.1.6 → cdclkit-0.1.7}/README.md +0 -0
  10. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/__main__.py +0 -0
  11. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/brute.py +0 -0
  12. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/cli.py +0 -0
  13. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/encodings.py +0 -0
  14. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/heap.py +0 -0
  15. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/model.py +0 -0
  16. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/mus.py +0 -0
  17. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/native.py +0 -0
  18. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/pipeline.py +0 -0
  19. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/portfolio.py +0 -0
  20. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/preprocess.py +0 -0
  21. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/py.typed +0 -0
  22. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/pyeq.py +0 -0
  23. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit/solver.py +0 -0
  24. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit.egg-info/SOURCES.txt +0 -0
  25. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit.egg-info/dependency_links.txt +0 -0
  26. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit.egg-info/entry_points.txt +0 -0
  27. {cdclkit-0.1.6 → cdclkit-0.1.7}/cdclkit.egg-info/top_level.txt +0 -0
  28. {cdclkit-0.1.6 → cdclkit-0.1.7}/setup.cfg +0 -0
  29. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_adaptive_proof.py +0 -0
  30. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_agent_docs.py +0 -0
  31. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_brute.py +0 -0
  32. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_cli_defaults.py +0 -0
  33. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_core.py +0 -0
  34. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_encodings.py +0 -0
  35. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_integration.py +0 -0
  36. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_mus.py +0 -0
  37. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_native.py +0 -0
  38. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_native_solver.py +0 -0
  39. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_packaging.py +0 -0
  40. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_pipeline.py +0 -0
  41. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_portfolio.py +0 -0
  42. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_preprocess.py +0 -0
  43. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_proof.py +0 -0
  44. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_pyeq.py +0 -0
  45. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_readme.py +0 -0
  46. {cdclkit-0.1.6 → cdclkit-0.1.7}/tests/test_solver.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdclkit
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: A CDCL SAT solver, preprocessor, encoding library and modelling layer, written from scratch in readable Python. Every answer comes with a certificate.
5
5
  Author: Carlo Perassi
6
6
  License-Expression: Apache-2.0
@@ -23,9 +23,9 @@ Classifier: Topic :: Scientific/Engineering :: Mathematics
23
23
  Requires-Python: >=3.10
24
24
  Description-Content-Type: text/markdown
25
25
  License-File: LICENSE
26
- Requires-Dist: dratify>=0.1.7
26
+ Requires-Dist: dratify>=0.1.9
27
27
  Provides-Extra: native
28
- Requires-Dist: cdclkit-native==0.1.6; extra == "native"
28
+ Requires-Dist: cdclkit-native==0.1.7; extra == "native"
29
29
  Dynamic: license-file
30
30
 
31
31
  # cdclkit
@@ -52,7 +52,7 @@ from .preprocess import Preprocessor, preprocess
52
52
  from dratify.proof import DRATChecker, MemoryProof, ProofWriter, check_proof
53
53
  from .solver import Config, SAT, Solver, Stats, UNKNOWN, UNSAT
54
54
 
55
- __version__ = "0.1.6"
55
+ __version__ = "0.1.7"
56
56
 
57
57
  __all__ = [
58
58
  "CNF",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdclkit
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: A CDCL SAT solver, preprocessor, encoding library and modelling layer, written from scratch in readable Python. Every answer comes with a certificate.
5
5
  Author: Carlo Perassi
6
6
  License-Expression: Apache-2.0
@@ -23,9 +23,9 @@ Classifier: Topic :: Scientific/Engineering :: Mathematics
23
23
  Requires-Python: >=3.10
24
24
  Description-Content-Type: text/markdown
25
25
  License-File: LICENSE
26
- Requires-Dist: dratify>=0.1.7
26
+ Requires-Dist: dratify>=0.1.9
27
27
  Provides-Extra: native
28
- Requires-Dist: cdclkit-native==0.1.6; extra == "native"
28
+ Requires-Dist: cdclkit-native==0.1.7; extra == "native"
29
29
  Dynamic: license-file
30
30
 
31
31
  # cdclkit
@@ -0,0 +1,4 @@
1
+ dratify>=0.1.9
2
+
3
+ [native]
4
+ cdclkit-native==0.1.7
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cdclkit"
7
- version = "0.1.6"
7
+ version = "0.1.7"
8
8
  description = "A CDCL SAT solver, preprocessor, encoding library and modelling layer, written from scratch in readable Python. Every answer comes with a certificate."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -30,13 +30,13 @@ classifiers = [
30
30
  # The only dependency is the proof checker, which itself has none. The solver
31
31
  # uses it to check its own refutations, so the checker is exercised by every
32
32
  # test run here as well as by its own suite.
33
- dependencies = ["dratify>=0.1.7"]
33
+ dependencies = ["dratify>=0.1.9"]
34
34
 
35
35
  [project.optional-dependencies]
36
36
  # The Rust accelerator, as abi3 wheels for Linux and macOS. Pinned exactly:
37
37
  # the two are bit-exact by construction and a mismatched pair is a divergence
38
38
  # nobody would look for. tests/test_packaging.py enforces the pin.
39
- native = ["cdclkit-native==0.1.6"]
39
+ native = ["cdclkit-native==0.1.7"]
40
40
 
41
41
  [project.scripts]
42
42
  cdclkit = "cdclkit.__main__:main"
@@ -15,9 +15,16 @@ take 0.11 s. Since dratify 0.1.7 a header may declare up to 2^20 variables
15
15
  from a file of any length, so a 22-byte file cost hours of CPU.
16
16
 
17
17
  The test compares scaling rather than absolute time, which shared CI runners
18
- cannot be trusted with: quadrupling the variables should cost about 4x when
19
- the search is linear and about 16x when it is quadratic. The threshold sits
20
- between them, and each size takes the best of three runs to damp noise.
18
+ cannot be trusted with. Multiplying the variables by 16 costs about 20x when
19
+ the search is linear (measured 19-23x on both engines; arrays outgrowing the
20
+ cache add a little) and about 256x when it is quadratic. The limit, 64, sits
21
+ between them with room on both sides. The first version stepped by 4 with a
22
+ limit of 8: linear is 4.5x there, and a macOS runner measured 8.3x on native
23
+ runs of 4 and 32 ms, so the margin was too thin. Each size takes the best of
24
+ five runs to damp noise.
25
+
26
+ Run against cdclkit 0.1.4, from before the fix, this test measures 252x on
27
+ native and 218x on Python, so it still fails where it should.
21
28
  """
22
29
 
23
30
  from __future__ import annotations
@@ -41,7 +48,7 @@ def _solve(nvars: int, engine: str) -> bool:
41
48
 
42
49
  def _seconds(nvars: int, engine: str) -> float:
43
50
  best = float("inf")
44
- for _ in range(3):
51
+ for _ in range(5):
45
52
  t0 = time.perf_counter()
46
53
  sat = _solve(nvars, engine)
47
54
  best = min(best, time.perf_counter() - t0)
@@ -50,27 +57,29 @@ def _seconds(nvars: int, engine: str) -> float:
50
57
 
51
58
 
52
59
  class TestUnusedVariablesCostLinearTime(unittest.TestCase):
53
- #: quadrupling: ~4x if linear, ~16x if quadratic
54
- LIMIT = 8.0
60
+ #: 16x the variables: ~20x if linear, ~256x if quadratic
61
+ FACTOR = 16
62
+ LIMIT = 64.0
55
63
 
56
64
  def _check(self, engine: str, small: int):
57
65
  t_small = _seconds(small, engine)
58
- t_large = _seconds(4 * small, engine)
66
+ t_large = _seconds(self.FACTOR * small, engine)
59
67
  ratio = t_large / max(t_small, 1e-4)
60
68
  self.assertLess(
61
69
  ratio, self.LIMIT,
62
70
  f"{engine}: {small:,} vars took {t_small:.3f}s and "
63
- f"{4 * small:,} took {t_large:.3f}s, a {ratio:.1f}x increase for "
64
- f"4x the variables. Linear is ~4x; this is closer to quadratic.")
71
+ f"{self.FACTOR * small:,} took {t_large:.3f}s, a {ratio:.1f}x "
72
+ f"increase for {self.FACTOR}x the variables. Linear is ~20x; "
73
+ f"quadratic is ~256x.")
65
74
 
66
75
  def test_python_engine(self):
67
- self._check("python", 4096)
76
+ self._check("python", 1024)
68
77
 
69
78
  @unittest.skipUnless(native.available(),
70
79
  "native engine not built for this interpreter")
71
80
  def test_native_engine(self):
72
- # Rust is fast enough that the quadratic term only dominates at
73
- # larger sizes.
81
+ # Rust is fast enough that smaller sizes finish in under a millisecond,
82
+ # which is timer noise rather than a measurement.
74
83
  self._check("native", 32768)
75
84
 
76
85
 
@@ -1,4 +0,0 @@
1
- dratify>=0.1.7
2
-
3
- [native]
4
- cdclkit-native==0.1.6
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes