Skip to content

Commit d731fec

Browse files
Merge pull request #397 from egraphs-good/polynomials
Add polynomials example
2 parents 27f70d1 + 60eb9db commit d731fec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+6862
-1878
lines changed

.github/AGENTS.md

Lines changed: 0 additions & 205 deletions
This file was deleted.

.github/workflows/CI.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,22 @@ jobs:
5858
- name: Set up Python
5959
uses: actions/setup-python@v6
6060
with:
61-
python-version-file: ".python-version"
61+
# Work around import-time SciPy/sklearn segfaults on the codspeed ARM64 Python 3.13 runner.
62+
python-version: "3.12"
6263
- uses: astral-sh/setup-uv@v7
6364
with:
6465
enable-cache: true
66+
python-version: "3.12"
6567
- uses: dtolnay/rust-toolchain@1.79.0
6668
- uses: Swatinem/rust-cache@v2
6769
- run: |
6870
export UV_PROJECT_ENVIRONMENT="${pythonLocation}"
69-
uv sync --extra test --locked
70-
- uses: CodSpeedHQ/action@v4.3.1
71+
uv sync --extra test --locked --python 3.12
72+
- uses: CodSpeedHQ/action@v4.11.1
7173
with:
7274
token: ${{ secrets.CODSPEED_TOKEN }}
7375
# allow updating snapshots due to indeterministic benchmarks
74-
run: pytest -vvv --snapshot-update --durations=10
76+
run: pytest -vvv --snapshot-update --durations=10 --codspeed-max-rounds=10 python/tests/test_array_api.py -k "test_jit or test_run_lda"
7577
mode: ${{ matrix.runner == 'ubuntu-latest' && 'instrumentation' || 'walltime' }}
7678

7779
docs:

AGENTS.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Repo Guidance
2+
3+
## Overview
4+
5+
- This repo combines the high-level Python bindings in `python/egglog/`, the Rust extension in `src/`, and the Sphinx docs in `docs/`.
6+
- Public Python APIs are exported from `python/egglog/__init__.py`.
7+
- The compiled `python/egglog/bindings.cpython-*.so` artifact is generated and should not be edited directly.
8+
9+
## Common Commands
10+
11+
- `uv sync --all-extras` installs the full dev environment.
12+
- `uv sync --reinstall-package egglog --all-extras` rebuilds the Rust extension after changes in `src/`.
13+
- `uv run pytest --benchmark-disable -q` runs the Python tests without benchmark calibration.
14+
- `make mypy` runs the type checker.
15+
- `make stubtest` checks the runtime against the type stubs.
16+
- `make docs` builds the docs.
17+
18+
## Docs
19+
20+
- Use the Context7 MCP server for egglog documentation instead of copying external doc summaries into this file.
21+
- Keep general workflows in the how-to guides, and keep Python-specific runtime/reference examples in `docs/reference/python-integration.md`.
22+
- If a PR adds or updates a changelog entry in `docs/changelog.md`, keep it aligned with the final code changes.
23+
- For a clean docs rebuild, clear `docs/_build/`; the MyST-NB execution cache lives in `docs/_build/.jupyter_cache`.
24+
25+
## Python bindings
26+
27+
- Prefer relative imports inside `python/egglog`.
28+
- When changing public high-level APIs, update the public docs, stubs, and pretty/freeze round-trip expectations together.
29+
- Higher-order callable type probing should stay isolated from the live ruleset: copy declarations and run with no current ruleset so inference does not register temporary unnamed functions or rewrites.
30+
31+
## Array API
32+
33+
- Start with `python/egglog/exp/array_api.py` and `python/tests/test_array_api.py`.
34+
- `Vec[...]` is a primitive sort; avoid rewrites or unions that merge distinct vec values.
35+
- Guard vector indexing rewrites with explicit bounds checks.
36+
37+
## CI
38+
39+
- When debugging GitHub Actions logs, prefer the private `$github-actions-rest-logs` skill or the equivalent REST API flow with `GITHUB_PAT_TOKEN`.
40+
41+
## Verification
42+
43+
- Prefer the minimal code change and the minimal diff that solves the task; only broaden the change if the smaller fix is not sufficient.
44+
- Run `make mypy` for typing changes.
45+
- Run targeted pytest for touched modules.
46+
- Run `make docs` for docs or public API changes.

0 commit comments

Comments
 (0)