egglog 11.3.0__tar.gz → 11.4.0__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.

Potentially problematic release.


This version of egglog might be problematic. Click here for more details.

Files changed (150) hide show
  1. {egglog-11.3.0 → egglog-11.4.0}/.github/workflows/CI.yml +2 -1
  2. {egglog-11.3.0 → egglog-11.4.0}/Cargo.lock +76 -132
  3. egglog-11.4.0/Cargo.toml +44 -0
  4. {egglog-11.3.0 → egglog-11.4.0}/Makefile +1 -1
  5. {egglog-11.3.0 → egglog-11.4.0}/PKG-INFO +1 -1
  6. {egglog-11.3.0 → egglog-11.4.0}/docs/changelog.md +3 -0
  7. {egglog-11.3.0 → egglog-11.4.0}/docs/reference/contributing.md +1 -1
  8. {egglog-11.3.0 → egglog-11.4.0}/docs/reference/egglog-translation.md +2 -0
  9. {egglog-11.3.0 → egglog-11.4.0}/docs/reference/python-integration.md +30 -0
  10. {egglog-11.3.0 → egglog-11.4.0}/pyproject.toml +1 -1
  11. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/bindings.pyi +62 -1
  12. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/builtins.py +6 -0
  13. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/declarations.py +20 -3
  14. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/deconstruct.py +9 -7
  15. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/egraph.py +318 -21
  16. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/egraph_state.py +154 -6
  17. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/exp/array_api_jit.py +2 -2
  18. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/pretty.py +8 -3
  19. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/runtime.py +11 -5
  20. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/type_constraint_solver.py +2 -2
  21. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_array_api.py +2 -2
  22. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_bindings.py +154 -0
  23. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_high_level.py +125 -1
  24. {egglog-11.3.0 → egglog-11.4.0}/src/conversions.rs +12 -12
  25. egglog-11.4.0/src/egraph.rs +253 -0
  26. egglog-11.4.0/src/extract.rs +260 -0
  27. {egglog-11.3.0 → egglog-11.4.0}/src/lib.rs +4 -0
  28. {egglog-11.3.0 → egglog-11.4.0}/src/py_object_sort.rs +2 -2
  29. {egglog-11.3.0 → egglog-11.4.0}/src/termdag.rs +14 -42
  30. egglog-11.3.0/Cargo.toml +0 -39
  31. egglog-11.3.0/src/egraph.rs +0 -124
  32. {egglog-11.3.0 → egglog-11.4.0}/.cargo/config.toml +0 -0
  33. {egglog-11.3.0 → egglog-11.4.0}/.github/dependabot.yml +0 -0
  34. {egglog-11.3.0 → egglog-11.4.0}/.github/workflows/update-changelog.yml +0 -0
  35. {egglog-11.3.0 → egglog-11.4.0}/.github/workflows/version.yml +0 -0
  36. {egglog-11.3.0 → egglog-11.4.0}/.gitignore +0 -0
  37. {egglog-11.3.0 → egglog-11.4.0}/.pre-commit-config.yaml +0 -0
  38. {egglog-11.3.0 → egglog-11.4.0}/.python-version +0 -0
  39. {egglog-11.3.0 → egglog-11.4.0}/.readthedocs.yaml +0 -0
  40. {egglog-11.3.0 → egglog-11.4.0}/CITATION.cff +0 -0
  41. {egglog-11.3.0 → egglog-11.4.0}/LICENSE +0 -0
  42. {egglog-11.3.0 → egglog-11.4.0}/README.md +0 -0
  43. {egglog-11.3.0 → egglog-11.4.0}/conftest.py +0 -0
  44. {egglog-11.3.0 → egglog-11.4.0}/docs/.gitignore +0 -0
  45. {egglog-11.3.0 → egglog-11.4.0}/docs/_templates/comments.html +0 -0
  46. {egglog-11.3.0 → egglog-11.4.0}/docs/conf.py +0 -0
  47. {egglog-11.3.0 → egglog-11.4.0}/docs/environment.yml +0 -0
  48. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/.gitignore +0 -0
  49. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/2023_07_presentation.ipynb +0 -0
  50. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/2023_11_09_portland_state.ipynb +0 -0
  51. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/2023_11_17_pytensor.ipynb +0 -0
  52. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/2023_11_pydata_lightning_talk.ipynb +0 -0
  53. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/2023_12_02_congruence_closure-1.png +0 -0
  54. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/2023_12_02_congruence_closure-2.png +0 -0
  55. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/2023_12_02_congruence_closure.md +0 -0
  56. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/2024_03_17_community_talk.ipynb +0 -0
  57. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/2024_03_17_map.svg +0 -0
  58. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/big_graph.svg +0 -0
  59. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/define_and_define.md +0 -0
  60. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/ecosystem-graph.png +0 -0
  61. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/egg.png +0 -0
  62. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/indexing_pushdown.ipynb +0 -0
  63. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/moa.png +0 -0
  64. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/optional_values.md +0 -0
  65. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation/pldi_2023_presentation.ipynb +0 -0
  66. {egglog-11.3.0 → egglog-11.4.0}/docs/explanation.md +0 -0
  67. {egglog-11.3.0 → egglog-11.4.0}/docs/how-to-guides.md +0 -0
  68. {egglog-11.3.0 → egglog-11.4.0}/docs/index.md +0 -0
  69. {egglog-11.3.0 → egglog-11.4.0}/docs/reference/bindings.md +0 -0
  70. {egglog-11.3.0 → egglog-11.4.0}/docs/reference/high-level.md +0 -0
  71. {egglog-11.3.0 → egglog-11.4.0}/docs/reference/usage.md +0 -0
  72. {egglog-11.3.0 → egglog-11.4.0}/docs/reference.md +0 -0
  73. {egglog-11.3.0 → egglog-11.4.0}/docs/tutorials/__init__.py +0 -0
  74. {egglog-11.3.0 → egglog-11.4.0}/docs/tutorials/getting-started.ipynb +0 -0
  75. {egglog-11.3.0 → egglog-11.4.0}/docs/tutorials/screenshot-1.png +0 -0
  76. {egglog-11.3.0 → egglog-11.4.0}/docs/tutorials/screenshot-2.png +0 -0
  77. {egglog-11.3.0 → egglog-11.4.0}/docs/tutorials/sklearn.ipynb +0 -0
  78. {egglog-11.3.0 → egglog-11.4.0}/docs/tutorials/tut_1_basics.py +0 -0
  79. {egglog-11.3.0 → egglog-11.4.0}/docs/tutorials/tut_2_datalog.py +0 -0
  80. {egglog-11.3.0 → egglog-11.4.0}/docs/tutorials/tut_3_analysis.py +0 -0
  81. {egglog-11.3.0 → egglog-11.4.0}/docs/tutorials/tut_4_scheduling.py +0 -0
  82. {egglog-11.3.0 → egglog-11.4.0}/docs/tutorials/tut_5_extraction.py +0 -0
  83. {egglog-11.3.0 → egglog-11.4.0}/docs/tutorials.md +0 -0
  84. {egglog-11.3.0 → egglog-11.4.0}/modify_changelog.py +0 -0
  85. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/__init__.py +0 -0
  86. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/config.py +0 -0
  87. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/conversion.py +0 -0
  88. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/README.rst +0 -0
  89. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/__init__.py +0 -0
  90. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/bignum.py +0 -0
  91. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/bool.py +0 -0
  92. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/eqsat_basic.py +0 -0
  93. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/fib.py +0 -0
  94. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/higher_order_functions.py +0 -0
  95. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/jointree.py +0 -0
  96. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/lambda_.py +0 -0
  97. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/matrix.py +0 -0
  98. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/multiset.py +0 -0
  99. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/ndarrays.py +0 -0
  100. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/resolution.py +0 -0
  101. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/examples/schedule_demo.py +0 -0
  102. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/exp/__init__.py +0 -0
  103. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/exp/array_api.py +0 -0
  104. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/exp/array_api_loopnest.py +0 -0
  105. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/exp/array_api_numba.py +0 -0
  106. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/exp/array_api_program_gen.py +0 -0
  107. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/exp/program_gen.py +0 -0
  108. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/exp/siu_examples.py +0 -0
  109. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/ipython_magic.py +0 -0
  110. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/py.typed +0 -0
  111. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/thunk.py +0 -0
  112. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/version_compat.py +0 -0
  113. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/visualizer.css +0 -0
  114. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/visualizer.js +0 -0
  115. {egglog-11.3.0 → egglog-11.4.0}/python/egglog/visualizer_widget.py +0 -0
  116. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/TestLoopNest.test_index_codegen[code].py +0 -0
  117. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/TestLoopNest.test_index_codegen[expr].py +0 -0
  118. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/test_jit[add][code].py +0 -0
  119. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/test_jit[add][expr].py +0 -0
  120. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/test_jit[add][initial_expr].py +0 -0
  121. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/test_jit[lda][code].py +0 -0
  122. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/test_jit[lda][expr].py +0 -0
  123. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/test_jit[lda][initial_expr].py +0 -0
  124. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/test_jit[tuple][code].py +0 -0
  125. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/test_jit[tuple][expr].py +0 -0
  126. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/test_jit[tuple][initial_expr].py +0 -0
  127. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/test_program_compile[tuple][code].py +0 -0
  128. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_array_api/test_program_compile[tuple][expr].py +0 -0
  129. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_bindings/TestEGraph.test_parse_program.py +0 -0
  130. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_program_gen/test_to_string.py +0 -0
  131. {egglog-11.3.0 → egglog-11.4.0}/python/tests/__snapshots__/test_program_gen/test_to_string_function_three.py +0 -0
  132. {egglog-11.3.0 → egglog-11.4.0}/python/tests/conftest.py +0 -0
  133. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_convert.py +0 -0
  134. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_deconstruct.py +0 -0
  135. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_modify_changelog.py +0 -0
  136. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_no_import_star.py +0 -0
  137. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_pretty.py +0 -0
  138. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_program_gen.py +0 -0
  139. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_py_object_sort.py +0 -0
  140. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_runtime.py +0 -0
  141. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_type_constraint_solver.py +0 -0
  142. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_typing.py +0 -0
  143. {egglog-11.3.0 → egglog-11.4.0}/python/tests/test_unstable_fn.py +0 -0
  144. {egglog-11.3.0 → egglog-11.4.0}/rust-toolchain.toml +0 -0
  145. {egglog-11.3.0 → egglog-11.4.0}/src/error.rs +0 -0
  146. {egglog-11.3.0 → egglog-11.4.0}/src/serialize.rs +0 -0
  147. {egglog-11.3.0 → egglog-11.4.0}/src/utils.rs +0 -0
  148. {egglog-11.3.0 → egglog-11.4.0}/stubtest_allow +0 -0
  149. {egglog-11.3.0 → egglog-11.4.0}/test-data/unit/check-high-level.test +0 -0
  150. {egglog-11.3.0 → egglog-11.4.0}/uv.lock +0 -0
@@ -68,11 +68,12 @@ jobs:
68
68
  - run: |
69
69
  export UV_PROJECT_ENVIRONMENT="${pythonLocation}"
70
70
  uv sync --extra test --locked
71
- - uses: CodSpeedHQ/action@v3.8.1
71
+ - uses: CodSpeedHQ/action@v4.0.1
72
72
  with:
73
73
  token: ${{ secrets.CODSPEED_TOKEN }}
74
74
  # allow updating snapshots due to indeterministic benchmarks
75
75
  run: pytest -vvv --snapshot-update --durations=10
76
+ mode: "instrumentation"
76
77
 
77
78
  docs:
78
79
  runs-on: ubuntu-latest
@@ -19,9 +19,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
19
19
 
20
20
  [[package]]
21
21
  name = "anyhow"
22
- version = "1.0.99"
22
+ version = "1.0.100"
23
23
  source = "registry+https://github.com/rust-lang/crates.io-index"
24
- checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100"
24
+ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
25
25
 
26
26
  [[package]]
27
27
  name = "arc-swap"
@@ -215,14 +215,14 @@ checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
215
215
  [[package]]
216
216
  name = "egglog"
217
217
  version = "1.0.0"
218
- source = "git+https://github.com/egraphs-good//egglog.git?branch=main#1f0b6ecfc2eda306945a6869ddea838e9c309ec6"
218
+ source = "git+https://github.com/saulshanabrook/egg-smol.git?branch=clone-cost#2b6de8034d8fd7af0dc8143f0a8ade5734c34f8c"
219
219
  dependencies = [
220
220
  "csv",
221
221
  "dyn-clone",
222
222
  "egglog-add-primitive",
223
- "egglog-bridge 1.0.0 (git+https://github.com/egraphs-good//egglog.git?branch=main)",
224
- "egglog-core-relations 1.0.0 (git+https://github.com/egraphs-good//egglog.git?branch=main)",
225
- "egglog-numeric-id 1.0.0 (git+https://github.com/egraphs-good//egglog.git?branch=main)",
223
+ "egglog-bridge",
224
+ "egglog-core-relations",
225
+ "egglog-numeric-id",
226
226
  "egraph-serialize",
227
227
  "hashbrown 0.15.5",
228
228
  "im-rc",
@@ -240,7 +240,7 @@ dependencies = [
240
240
  [[package]]
241
241
  name = "egglog-add-primitive"
242
242
  version = "1.0.0"
243
- source = "git+https://github.com/egraphs-good//egglog.git?branch=main#1f0b6ecfc2eda306945a6869ddea838e9c309ec6"
243
+ source = "git+https://github.com/saulshanabrook/egg-smol.git?branch=clone-cost#2b6de8034d8fd7af0dc8143f0a8ade5734c34f8c"
244
244
  dependencies = [
245
245
  "quote",
246
246
  "syn 2.0.106",
@@ -249,35 +249,13 @@ dependencies = [
249
249
  [[package]]
250
250
  name = "egglog-bridge"
251
251
  version = "1.0.0"
252
- source = "git+https://github.com/egraphs-good//egglog.git?branch=main#1f0b6ecfc2eda306945a6869ddea838e9c309ec6"
252
+ source = "git+https://github.com/saulshanabrook/egg-smol.git?branch=clone-cost#2b6de8034d8fd7af0dc8143f0a8ade5734c34f8c"
253
253
  dependencies = [
254
254
  "anyhow",
255
255
  "dyn-clone",
256
- "egglog-core-relations 1.0.0 (git+https://github.com/egraphs-good//egglog.git?branch=main)",
257
- "egglog-numeric-id 1.0.0 (git+https://github.com/egraphs-good//egglog.git?branch=main)",
258
- "egglog-union-find 1.0.0 (git+https://github.com/egraphs-good//egglog.git?branch=main)",
259
- "hashbrown 0.15.5",
260
- "indexmap",
261
- "log",
262
- "num-rational",
263
- "once_cell",
264
- "petgraph",
265
- "rayon",
266
- "smallvec",
267
- "thiserror",
268
- "web-time",
269
- ]
270
-
271
- [[package]]
272
- name = "egglog-bridge"
273
- version = "1.0.0"
274
- source = "git+https://github.com/egraphs-good/egglog.git?branch=main#1f0b6ecfc2eda306945a6869ddea838e9c309ec6"
275
- dependencies = [
276
- "anyhow",
277
- "dyn-clone",
278
- "egglog-core-relations 1.0.0 (git+https://github.com/egraphs-good/egglog.git?branch=main)",
279
- "egglog-numeric-id 1.0.0 (git+https://github.com/egraphs-good/egglog.git?branch=main)",
280
- "egglog-union-find 1.0.0 (git+https://github.com/egraphs-good/egglog.git?branch=main)",
256
+ "egglog-core-relations",
257
+ "egglog-numeric-id",
258
+ "egglog-union-find",
281
259
  "hashbrown 0.15.5",
282
260
  "indexmap",
283
261
  "log",
@@ -293,63 +271,25 @@ dependencies = [
293
271
  [[package]]
294
272
  name = "egglog-concurrency"
295
273
  version = "1.0.0"
296
- source = "git+https://github.com/egraphs-good//egglog.git?branch=main#1f0b6ecfc2eda306945a6869ddea838e9c309ec6"
274
+ source = "git+https://github.com/saulshanabrook/egg-smol.git?branch=clone-cost#2b6de8034d8fd7af0dc8143f0a8ade5734c34f8c"
297
275
  dependencies = [
298
276
  "arc-swap",
299
277
  "rayon",
300
278
  ]
301
279
 
302
- [[package]]
303
- name = "egglog-concurrency"
304
- version = "1.0.0"
305
- source = "git+https://github.com/egraphs-good/egglog.git?branch=main#1f0b6ecfc2eda306945a6869ddea838e9c309ec6"
306
- dependencies = [
307
- "arc-swap",
308
- "rayon",
309
- ]
310
-
311
- [[package]]
312
- name = "egglog-core-relations"
313
- version = "1.0.0"
314
- source = "git+https://github.com/egraphs-good//egglog.git?branch=main#1f0b6ecfc2eda306945a6869ddea838e9c309ec6"
315
- dependencies = [
316
- "anyhow",
317
- "bumpalo",
318
- "crossbeam-queue",
319
- "dashmap",
320
- "dyn-clone",
321
- "egglog-concurrency 1.0.0 (git+https://github.com/egraphs-good//egglog.git?branch=main)",
322
- "egglog-numeric-id 1.0.0 (git+https://github.com/egraphs-good//egglog.git?branch=main)",
323
- "egglog-union-find 1.0.0 (git+https://github.com/egraphs-good//egglog.git?branch=main)",
324
- "fixedbitset 0.5.7",
325
- "hashbrown 0.15.5",
326
- "indexmap",
327
- "lazy_static",
328
- "log",
329
- "num",
330
- "once_cell",
331
- "petgraph",
332
- "rand 0.9.2",
333
- "rayon",
334
- "rustc-hash",
335
- "smallvec",
336
- "thiserror",
337
- "web-time",
338
- ]
339
-
340
280
  [[package]]
341
281
  name = "egglog-core-relations"
342
282
  version = "1.0.0"
343
- source = "git+https://github.com/egraphs-good/egglog.git?branch=main#1f0b6ecfc2eda306945a6869ddea838e9c309ec6"
283
+ source = "git+https://github.com/saulshanabrook/egg-smol.git?branch=clone-cost#2b6de8034d8fd7af0dc8143f0a8ade5734c34f8c"
344
284
  dependencies = [
345
285
  "anyhow",
346
286
  "bumpalo",
347
287
  "crossbeam-queue",
348
288
  "dashmap",
349
289
  "dyn-clone",
350
- "egglog-concurrency 1.0.0 (git+https://github.com/egraphs-good/egglog.git?branch=main)",
351
- "egglog-numeric-id 1.0.0 (git+https://github.com/egraphs-good/egglog.git?branch=main)",
352
- "egglog-union-find 1.0.0 (git+https://github.com/egraphs-good/egglog.git?branch=main)",
290
+ "egglog-concurrency",
291
+ "egglog-numeric-id",
292
+ "egglog-union-find",
353
293
  "fixedbitset 0.5.7",
354
294
  "hashbrown 0.15.5",
355
295
  "indexmap",
@@ -380,16 +320,7 @@ dependencies = [
380
320
  [[package]]
381
321
  name = "egglog-numeric-id"
382
322
  version = "1.0.0"
383
- source = "git+https://github.com/egraphs-good//egglog.git?branch=main#1f0b6ecfc2eda306945a6869ddea838e9c309ec6"
384
- dependencies = [
385
- "lazy_static",
386
- "rayon",
387
- ]
388
-
389
- [[package]]
390
- name = "egglog-numeric-id"
391
- version = "1.0.0"
392
- source = "git+https://github.com/egraphs-good/egglog.git?branch=main#1f0b6ecfc2eda306945a6869ddea838e9c309ec6"
323
+ source = "git+https://github.com/saulshanabrook/egg-smol.git?branch=clone-cost#2b6de8034d8fd7af0dc8143f0a8ade5734c34f8c"
393
324
  dependencies = [
394
325
  "lazy_static",
395
326
  "rayon",
@@ -398,34 +329,26 @@ dependencies = [
398
329
  [[package]]
399
330
  name = "egglog-union-find"
400
331
  version = "1.0.0"
401
- source = "git+https://github.com/egraphs-good//egglog.git?branch=main#1f0b6ecfc2eda306945a6869ddea838e9c309ec6"
332
+ source = "git+https://github.com/saulshanabrook/egg-smol.git?branch=clone-cost#2b6de8034d8fd7af0dc8143f0a8ade5734c34f8c"
402
333
  dependencies = [
403
334
  "crossbeam",
404
- "egglog-concurrency 1.0.0 (git+https://github.com/egraphs-good//egglog.git?branch=main)",
405
- "egglog-numeric-id 1.0.0 (git+https://github.com/egraphs-good//egglog.git?branch=main)",
406
- ]
407
-
408
- [[package]]
409
- name = "egglog-union-find"
410
- version = "1.0.0"
411
- source = "git+https://github.com/egraphs-good/egglog.git?branch=main#1f0b6ecfc2eda306945a6869ddea838e9c309ec6"
412
- dependencies = [
413
- "crossbeam",
414
- "egglog-concurrency 1.0.0 (git+https://github.com/egraphs-good/egglog.git?branch=main)",
415
- "egglog-numeric-id 1.0.0 (git+https://github.com/egraphs-good/egglog.git?branch=main)",
335
+ "egglog-concurrency",
336
+ "egglog-numeric-id",
416
337
  ]
417
338
 
418
339
  [[package]]
419
340
  name = "egglog_python"
420
- version = "11.3.0"
341
+ version = "11.4.0"
421
342
  dependencies = [
422
343
  "egglog",
423
- "egglog-bridge 1.0.0 (git+https://github.com/egraphs-good/egglog.git?branch=main)",
424
- "egglog-core-relations 1.0.0 (git+https://github.com/egraphs-good/egglog.git?branch=main)",
344
+ "egglog-bridge",
345
+ "egglog-core-relations",
425
346
  "egglog-experimental",
426
347
  "egraph-serialize",
427
348
  "lalrpop-util",
428
349
  "log",
350
+ "num-bigint",
351
+ "num-rational",
429
352
  "ordered-float",
430
353
  "pyo3",
431
354
  "pyo3-log",
@@ -524,7 +447,7 @@ dependencies = [
524
447
  "cfg-if",
525
448
  "libc",
526
449
  "r-efi",
527
- "wasi 0.14.5+wasi-0.2.4",
450
+ "wasi 0.14.7+wasi-0.2.4",
528
451
  ]
529
452
 
530
453
  [[package]]
@@ -560,6 +483,12 @@ dependencies = [
560
483
  "foldhash",
561
484
  ]
562
485
 
486
+ [[package]]
487
+ name = "hashbrown"
488
+ version = "0.16.0"
489
+ source = "registry+https://github.com/rust-lang/crates.io-index"
490
+ checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"
491
+
563
492
  [[package]]
564
493
  name = "heck"
565
494
  version = "0.5.0"
@@ -582,13 +511,14 @@ dependencies = [
582
511
 
583
512
  [[package]]
584
513
  name = "indexmap"
585
- version = "2.11.1"
514
+ version = "2.11.4"
586
515
  source = "registry+https://github.com/rust-lang/crates.io-index"
587
- checksum = "206a8042aec68fa4a62e8d3f7aa4ceb508177d9324faf261e1959e495b7a1921"
516
+ checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
588
517
  dependencies = [
589
518
  "equivalent",
590
- "hashbrown 0.15.5",
519
+ "hashbrown 0.16.0",
591
520
  "serde",
521
+ "serde_core",
592
522
  ]
593
523
 
594
524
  [[package]]
@@ -627,9 +557,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
627
557
 
628
558
  [[package]]
629
559
  name = "js-sys"
630
- version = "0.3.78"
560
+ version = "0.3.80"
631
561
  source = "registry+https://github.com/rust-lang/crates.io-index"
632
- checksum = "0c0b063578492ceec17683ef2f8c5e89121fbd0b172cbc280635ab7567db2738"
562
+ checksum = "852f13bec5eba4ba9afbeb93fd7c13fe56147f055939ae21c43a29a0ecb2702e"
633
563
  dependencies = [
634
564
  "once_cell",
635
565
  "wasm-bindgen",
@@ -884,6 +814,8 @@ dependencies = [
884
814
  "indoc",
885
815
  "libc",
886
816
  "memoffset",
817
+ "num-bigint",
818
+ "num-rational",
887
819
  "once_cell",
888
820
  "portable-atomic",
889
821
  "pyo3-build-config",
@@ -913,8 +845,9 @@ dependencies = [
913
845
 
914
846
  [[package]]
915
847
  name = "pyo3-log"
916
- version = "0.12.4"
917
- source = "git+https://github.com/alex/pyo3-log.git?branch=pyo3-bump#3193bba54809be49338815beb363a43252ff7843"
848
+ version = "0.13.0"
849
+ source = "registry+https://github.com/rust-lang/crates.io-index"
850
+ checksum = "833e6fdc21553e9938d9443050ed3c7787ac3c1a1aefccbd03dfae0c7a4be529"
918
851
  dependencies = [
919
852
  "arc-swap",
920
853
  "log",
@@ -1116,18 +1049,28 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
1116
1049
 
1117
1050
  [[package]]
1118
1051
  name = "serde"
1119
- version = "1.0.219"
1052
+ version = "1.0.225"
1053
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1054
+ checksum = "fd6c24dee235d0da097043389623fb913daddf92c76e9f5a1db88607a0bcbd1d"
1055
+ dependencies = [
1056
+ "serde_core",
1057
+ "serde_derive",
1058
+ ]
1059
+
1060
+ [[package]]
1061
+ name = "serde_core"
1062
+ version = "1.0.225"
1120
1063
  source = "registry+https://github.com/rust-lang/crates.io-index"
1121
- checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
1064
+ checksum = "659356f9a0cb1e529b24c01e43ad2bdf520ec4ceaf83047b83ddcc2251f96383"
1122
1065
  dependencies = [
1123
1066
  "serde_derive",
1124
1067
  ]
1125
1068
 
1126
1069
  [[package]]
1127
1070
  name = "serde_derive"
1128
- version = "1.0.219"
1071
+ version = "1.0.225"
1129
1072
  source = "registry+https://github.com/rust-lang/crates.io-index"
1130
- checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
1073
+ checksum = "0ea936adf78b1f766949a4977b91d2f5595825bd6ec079aa9543ad2685fc4516"
1131
1074
  dependencies = [
1132
1075
  "proc-macro2",
1133
1076
  "quote",
@@ -1136,15 +1079,16 @@ dependencies = [
1136
1079
 
1137
1080
  [[package]]
1138
1081
  name = "serde_json"
1139
- version = "1.0.143"
1082
+ version = "1.0.145"
1140
1083
  source = "registry+https://github.com/rust-lang/crates.io-index"
1141
- checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
1084
+ checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
1142
1085
  dependencies = [
1143
1086
  "indexmap",
1144
1087
  "itoa",
1145
1088
  "memchr",
1146
1089
  "ryu",
1147
1090
  "serde",
1091
+ "serde_core",
1148
1092
  ]
1149
1093
 
1150
1094
  [[package]]
@@ -1284,27 +1228,27 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
1284
1228
 
1285
1229
  [[package]]
1286
1230
  name = "wasi"
1287
- version = "0.14.5+wasi-0.2.4"
1231
+ version = "0.14.7+wasi-0.2.4"
1288
1232
  source = "registry+https://github.com/rust-lang/crates.io-index"
1289
- checksum = "a4494f6290a82f5fe584817a676a34b9d6763e8d9d18204009fb31dceca98fd4"
1233
+ checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c"
1290
1234
  dependencies = [
1291
1235
  "wasip2",
1292
1236
  ]
1293
1237
 
1294
1238
  [[package]]
1295
1239
  name = "wasip2"
1296
- version = "1.0.0+wasi-0.2.4"
1240
+ version = "1.0.1+wasi-0.2.4"
1297
1241
  source = "registry+https://github.com/rust-lang/crates.io-index"
1298
- checksum = "03fa2761397e5bd52002cd7e73110c71af2109aca4e521a9f40473fe685b0a24"
1242
+ checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7"
1299
1243
  dependencies = [
1300
1244
  "wit-bindgen",
1301
1245
  ]
1302
1246
 
1303
1247
  [[package]]
1304
1248
  name = "wasm-bindgen"
1305
- version = "0.2.101"
1249
+ version = "0.2.103"
1306
1250
  source = "registry+https://github.com/rust-lang/crates.io-index"
1307
- checksum = "7e14915cadd45b529bb8d1f343c4ed0ac1de926144b746e2710f9cd05df6603b"
1251
+ checksum = "ab10a69fbd0a177f5f649ad4d8d3305499c42bab9aef2f7ff592d0ec8f833819"
1308
1252
  dependencies = [
1309
1253
  "cfg-if",
1310
1254
  "once_cell",
@@ -1315,9 +1259,9 @@ dependencies = [
1315
1259
 
1316
1260
  [[package]]
1317
1261
  name = "wasm-bindgen-backend"
1318
- version = "0.2.101"
1262
+ version = "0.2.103"
1319
1263
  source = "registry+https://github.com/rust-lang/crates.io-index"
1320
- checksum = "e28d1ba982ca7923fd01448d5c30c6864d0a14109560296a162f80f305fb93bb"
1264
+ checksum = "0bb702423545a6007bbc368fde243ba47ca275e549c8a28617f56f6ba53b1d1c"
1321
1265
  dependencies = [
1322
1266
  "bumpalo",
1323
1267
  "log",
@@ -1329,9 +1273,9 @@ dependencies = [
1329
1273
 
1330
1274
  [[package]]
1331
1275
  name = "wasm-bindgen-macro"
1332
- version = "0.2.101"
1276
+ version = "0.2.103"
1333
1277
  source = "registry+https://github.com/rust-lang/crates.io-index"
1334
- checksum = "7c3d463ae3eff775b0c45df9da45d68837702ac35af998361e2c84e7c5ec1b0d"
1278
+ checksum = "fc65f4f411d91494355917b605e1480033152658d71f722a90647f56a70c88a0"
1335
1279
  dependencies = [
1336
1280
  "quote",
1337
1281
  "wasm-bindgen-macro-support",
@@ -1339,9 +1283,9 @@ dependencies = [
1339
1283
 
1340
1284
  [[package]]
1341
1285
  name = "wasm-bindgen-macro-support"
1342
- version = "0.2.101"
1286
+ version = "0.2.103"
1343
1287
  source = "registry+https://github.com/rust-lang/crates.io-index"
1344
- checksum = "7bb4ce89b08211f923caf51d527662b75bdc9c9c7aab40f86dcb9fb85ac552aa"
1288
+ checksum = "ffc003a991398a8ee604a401e194b6b3a39677b3173d6e74495eb51b82e99a32"
1345
1289
  dependencies = [
1346
1290
  "proc-macro2",
1347
1291
  "quote",
@@ -1352,9 +1296,9 @@ dependencies = [
1352
1296
 
1353
1297
  [[package]]
1354
1298
  name = "wasm-bindgen-shared"
1355
- version = "0.2.101"
1299
+ version = "0.2.103"
1356
1300
  source = "registry+https://github.com/rust-lang/crates.io-index"
1357
- checksum = "f143854a3b13752c6950862c906306adb27c7e839f7414cec8fea35beab624c1"
1301
+ checksum = "293c37f4efa430ca14db3721dfbe48d8c33308096bd44d80ebaa775ab71ba1cf"
1358
1302
  dependencies = [
1359
1303
  "unicode-ident",
1360
1304
  ]
@@ -1450,9 +1394,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
1450
1394
 
1451
1395
  [[package]]
1452
1396
  name = "wit-bindgen"
1453
- version = "0.45.1"
1397
+ version = "0.46.0"
1454
1398
  source = "registry+https://github.com/rust-lang/crates.io-index"
1455
- checksum = "5c573471f125075647d03df72e026074b7203790d41351cd6edc96f46bcccd36"
1399
+ checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
1456
1400
 
1457
1401
  [[package]]
1458
1402
  name = "zerocopy"
@@ -0,0 +1,44 @@
1
+ [package]
2
+ name = "egglog_python"
3
+ version = "11.4.0"
4
+ edition = "2024"
5
+ readme = "README.md"
6
+
7
+
8
+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
9
+ [lib]
10
+ name = "egglog"
11
+ crate-type = ["cdylib"]
12
+
13
+ [dependencies]
14
+ pyo3 = { version = "0.26", features = ["extension-module", "num-bigint", "num-rational"] }
15
+ num-bigint = "*"
16
+ num-rational = "*"
17
+ # egglog = { git = "https://github.com/egraphs-good/egglog.git", branch = "main", default-features = false }
18
+ # egglog-bridge = { git = "https://github.com/egraphs-good/egglog.git", branch = "main" }
19
+ # egglog-core-relations = { git = "https://github.com/egraphs-good/egglog.git", branch = "main" }
20
+ egglog = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "clone-cost", default-features = false }
21
+ egglog-bridge = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "clone-cost" }
22
+ egglog-core-relations = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "clone-cost" }
23
+ egglog-experimental = { git = "https://github.com/egraphs-good/egglog-experimental", branch = "cli", default-features = false }
24
+ egraph-serialize = { version = "0.2", features = ["serde", "graphviz"] }
25
+ serde_json = "1"
26
+ pyo3-log = "0.13"
27
+ log = "0.4"
28
+ lalrpop-util = { version = "0.22", features = ["lexer"] }
29
+ ordered-float = "3.7"
30
+ uuid = { version = "1.18", features = ["v4"] }
31
+ rayon = "1.11"
32
+
33
+ # Use patched version of egglog in experimental
34
+ [patch.'https://github.com/egraphs-good/egglog']
35
+ # egglog = { git = "https://github.com/egraphs-good//egglog.git", branch = "main" }
36
+ egglog = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "clone-cost" }
37
+ egglog-bridge = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "clone-cost" }
38
+ egglog-core-relations = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "clone-cost" }
39
+ # egglog = { path = "../egg-smol" }
40
+ # egglog = { git = "https://github.com/egraphs-good//egglog.git", rev = "5542549" }
41
+
42
+ # enable debug symbols for easier profiling
43
+ [profile.release]
44
+ debug = true
@@ -31,7 +31,7 @@ from-local:
31
31
  # remove once https://github.com/astral-sh/uv/issues/5903
32
32
 
33
33
  mypy:
34
- uv run dmypy run -- python/
34
+ uv run dmypy run -- python/ docs/
35
35
 
36
36
  stubtest:
37
37
  uv run python -m mypy.stubtest egglog.bindings --allowlist stubtest_allow
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: egglog
3
- Version: 11.3.0
3
+ Version: 11.4.0
4
4
  Classifier: Environment :: MacOS X
5
5
  Classifier: Environment :: Win32 (MS Windows)
6
6
  Classifier: Intended Audience :: Developers
@@ -4,6 +4,9 @@ _This project uses semantic versioning_
4
4
 
5
5
  ## UNRELEASED
6
6
 
7
+ ## 11.4.0 (2025-10-02)
8
+
9
+ - Add ability to create custom model and pass them in to extract [#357](https://github.com/egraphs-good/egglog-python/pull/357)
7
10
  ## 11.3.0 (2025-09-12)
8
11
 
9
12
  - Add egglog tutorials, change display to not inline by default, and fix bug looking up binary methods [#352](https://github.com/egraphs-good/egglog-python/pull/352)
@@ -83,7 +83,7 @@ Debug symbols are turned on by default.
83
83
  If there is a performance sensitive piece of code, you could isolate it in a file and profile it locally with:
84
84
 
85
85
  ```bash
86
- uv run py-spy record --format speedscope -- python tmp.py
86
+ uv run py-spy record --format speedscope -- python -O tmp.py
87
87
  ```
88
88
 
89
89
  ### Making changes
@@ -285,6 +285,8 @@ It does this by creating a new table for each function you set the cost for that
285
285
  _Note: Unlike in egglog, where you have to declare which functions support custom costs, in Python all functions
286
286
  are automatically registered to create a custom cost table when they are constructed_
287
287
 
288
+ You can also get the cost of a function with `get_cost`, which will return an `i64` if one has already been set.
289
+
288
290
  ## Defining Rules
289
291
 
290
292
  To define rules in Python, we create a rule with the `rule(*facts).then(*actions) (rule ...)` command in egglog.
@@ -635,3 +635,33 @@ r = ruleset(
635
635
  )
636
636
  egraph.saturate(r)
637
637
  ```
638
+
639
+ ## Custom Cost Models
640
+
641
+ By default, when extracting from the e-graph, we use a simple cost model, that looks at the costs assigned to each
642
+ function and any custom costs set with `set_cost`, and finds the lowest cost expression looking at the total tree size.
643
+
644
+ Custom cost models are also supported, which can be passed into `extract` as the `cost_model` keyword argument. They
645
+ are defined as functions followed the `CostModel` protocol, that take in an e-graph, an expression, and the costs of the children, and return the total cost of that expression. Costs don't have to be integers, they can be any type that supports comparison.
646
+
647
+ There are a few builtin cost models:
648
+
649
+ - `default_cost_model`: The default cost model, which uses integer costs and sums them up.
650
+ - `greedy_dag_cost_model(inner_cost_model=default_cost_model)`: A cost model which uses a greedy DAG algorithm to find the lowest cost expression, allowing for shared sub-expressions. It takes in another cost model to use for the base costs of each expression.
651
+
652
+ Note that when passed into your cost model, the expression won't be a full tree. Instead, only the top level call be present, and all of it's arguments will be opaque "value" expressions, representing e-classes in the e-graph. You can't do much with them except use them to construct other expression to pass into `egraph.lookup_function_value` to get the resulting value of a call with those arguments. The only exception is all builtin types, like ints, vecs, strings, etc. will be fully evaluated recursively, so they can be matched against.
653
+
654
+ For example, here is a cost model that has a boolean cost if the value is even or not:
655
+
656
+ ```{code-cell} python
657
+ def is_even_cost_model(egraph: EGraph, expr: Expr, children_costs: list[bool]) -> bool:
658
+ from egglog import i64 # noqa: PLC0415
659
+
660
+ match expr:
661
+ case i64(i):
662
+ return i % 2 == 0
663
+ return False
664
+ assert EGraph().extract(i64(10), include_cost=True, cost_model=is_even_cost_model) == (i64(10), True)
665
+
666
+ assert EGraph().extract(i64(5), include_cost=True, cost_model=is_even_cost_model) == (i64(5), False)
667
+ ```
@@ -54,7 +54,7 @@ test = [
54
54
  "egglog[array]",
55
55
  "pytest-codspeed",
56
56
  "pytest-benchmark",
57
- "pytest-xdist",
57
+ "pytest-xdist"
58
58
  ]
59
59
 
60
60
  docs = [