Commit graph

238 commits

Author SHA1 Message Date
Kevin Turcios
ec14860d29 Move benchmarks to .codeflash/benchmarks/ and auto-discover
Move codeflash's own benchmarks to .codeflash/benchmarks/. Add
auto-discovery of .codeflash/benchmarks/ in codeflash compare and
benchmark mode -- when benchmarks-root is not explicitly configured,
the CLI checks for .codeflash/benchmarks/ before erroring.

Backwards compatible: users with existing benchmarks-root config
are unaffected. Docs continue to show tests/benchmarks as the
example path.
2026-04-10 08:39:15 -05:00
Kevin Turcios
279a8fcb29 feat: add --memory flag to codeflash compare for peak memory profiling
Adds a second profiling phase using pytest-memray that runs after timing
benchmarks. Memory tables are suppressed when the delta is <1%.
2026-04-02 10:29:31 -05:00
Kevin Turcios
fb8c542874 feat: add markdown output with progress bars for compare command
Replace PNG export with GitHub-flavored markdown tables. Add unicode
progress bars for improvement and share-of-time columns, remove image
dependencies (pillow, cairosvg, svglib, reportlab).
2026-03-27 18:30:11 -05:00
Kevin Turcios
7e9b4477be feat: replace --svg with --png output for compare command
Use cairosvg to convert Rich SVG output to PNG at 144 DPI.
Renames the CLI flag from --svg to --png across all touchpoints.
2026-03-27 18:05:10 -05:00
Kevin Turcios
93dd88124e chore: remove src/codeflash_core package
Remove the unused codeflash_core package and clean up the sdist include in pyproject.toml.
2026-03-27 04:03:16 -05:00
Kevin Turcios
be90440fdd Register codeflash_core in pyproject.toml and add missing deps
Add attrs and requests to dependencies. Include src/codeflash_core
in the sdist build target.
2026-03-24 02:03:38 -05:00
HeshamHM28
2a35716864
Merge branch 'main' into feat/gradle-executor-from-java 2026-03-18 06:14:47 +02:00
Kevin Turcios
a0a2a85020
Merge pull request #1660 from codeflash-ai/unstructured-inference
feat: improve function ranking with reference graph and test-based boosting
2026-03-16 23:05:28 -06:00
misrasaurabh1
e565b5f49c revert 2026-03-16 16:58:57 -07:00
HeshamHM28
16b3c2f5e5 Merge branch 'main' into feat/gradle-executor-from-java 2026-03-16 23:45:14 +02:00
Kevin Turcios
6688b4c3af perf: apply Codeflash optimizations for file_to_path and basename matching
- Use try/except KeyError instead of .get() in file_to_path cache
  (faster on hot path when key is usually present)
- Use os.path.basename() instead of Path().name in get_optimized_code_for_module
  to avoid constructing Path objects from strings
- Disable PTH119 ruff rule to allow os.path.basename for performance
2026-03-14 21:07:45 -06:00
HeshamHM28
73b3eec4c6 refactor: use tree-sitter for Gradle build file dependency injection
Replace fragile brace-counting string manipulation with tree-sitter
Groovy/Kotlin parsers to find the top-level dependencies block. This
correctly ignores nested blocks inside buildscript, subprojects, etc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 09:15:59 +02:00
Mohamed Ashraf
6e8cf410f2 feat: resolve codeflash-runtime from Maven Central
Maven Central is now the primary resolution path for the codeflash-runtime
JAR. Falls back to local dev build install for development workflows.
Excludes the bundled JAR from the PyPI wheel to save ~15MB.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 23:12:26 +00:00
Mohamed Ashraf
b6acd6b7ce chore: clean up premature download logic, add MVN_CENTRAL_TODO markers
Remove download_jar_to_cache() and related constants (MAVEN_CENTRAL_RUNTIME_URL,
CODEFLASH_JAR_CACHE_DIR) — the JAR isn't published to Maven Central yet so this
code always fails silently. The working path today is the bundled JAR in resources/.

Simplify _find_runtime_jar() from 5 steps to 3: ~/.m2 → bundled → dev build.

Add searchable MVN_CENTRAL_TODO markers at all 4 locations that need to change
once the JAR is published to Maven Central:
  1. build_tools.py — uncomment resolve_from_maven_central()
  2. test_runner.py _find_runtime_jar() — adjust resolution chain
  3. test_runner.py _ensure_codeflash_runtime() — uncomment Maven Central call
  4. pyproject.toml — exclude runtime JAR from wheel (~15MB savings)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 00:58:09 +00:00
Kevin Turcios
2dfa74da84 chore: sync pyproject.toml from main and add tree-sitter-java dependency
Takes main's pyproject.toml and adds tree-sitter-java for Java language
support. Regenerates uv.lock.
2026-03-02 15:31:48 -05:00
Kevin Turcios
c74782757b Merge commit '6346c740' into sync-main-batch-4
# Conflicts:
#	.github/workflows/windows-unit-tests.yml
#	codeflash/code_utils/config_consts.py
#	codeflash/code_utils/instrument_existing_tests.py
#	codeflash/languages/python/context/unused_definition_remover.py
#	codeflash/languages/python/static_analysis/code_replacer.py
#	codeflash/optimization/function_optimizer.py
#	codeflash/optimization/optimizer.py
#	pyproject.toml
2026-02-19 21:26:23 -05:00
Kevin Turcios
85d1d4fbf6 Merge commit '6020c4fa' into sync-main-batch-3 2026-02-19 20:33:09 -05:00
Kevin Turcios
c66953d110 Merge commit 'd578d996' into sync-main-batch-2
# Conflicts:
#	codeflash/github/PrComment.py
#	codeflash/optimization/function_optimizer.py
#	codeflash/tracer.py
#	codeflash/verification/parse_test_output.py
#	codeflash/verification/verification_utils.py
2026-02-19 20:27:14 -05:00
Kevin Turcios
7d7a2a21c0 Merge commit '3dd19c62' into sync-main-batch-1
# Conflicts:
#	codeflash/optimization/function_optimizer.py
#	codeflash/verification/verification_utils.py
#	codeflash/version.py
2026-02-19 20:10:05 -05:00
Kevin Turcios
3e282ee293 fix: address security vulnerabilities while maintaining Python 3.9 support
Resolve 12 Dependabot security alerts by constraining vulnerable packages
to Python 3.10+ where patches are available:

Python dependencies:
- filelock: Pin <3.20.3 for Python 3.9, >=3.20.3 for Python 3.10+
  (fixes TOCTOU symlink vulnerabilities CVE-2024-XXXXX)
- tensorflow: Only install on Python 3.10+ (brings keras >=3.12.1, pillow >=12.1.1)
  (fixes 8 high-severity keras vulnerabilities including arbitrary code execution,
   directory traversal, and 1 high-severity pillow out-of-bounds write)

JavaScript dependencies:
- vitest: Update to latest (4.0.18) in test fixture directory
  (fixes moderate-severity esbuild SSRF vulnerability GHSA-67mh-4wv8-2f99)

Python 3.9 notes:
- filelock 3.19.1 has known TOCTOU vulnerabilities (medium severity)
- tensorflow/keras/pillow excluded from Python 3.9 test dependencies
- Python 3.9 reached EOL in October 2025, vulnerabilities are expected

All high-severity vulnerabilities are resolved for Python 3.10+.
Python 3.9 users should upgrade to 3.10+ for full security patches.
2026-02-19 01:26:37 -05:00
Kevin Turcios
dc9c60a061 perf: remove remaining redundant .resolve() calls on pre-resolved paths
Drop .resolve() from ImportResolver, TestsCache, init_javascript,
create_pr, and filter_functions where callers already pass resolved
paths via CLI init or TestConfig.__post_init__. Also exclude test
and fixture dirs from mypy to match ruff/ty config.
2026-02-18 23:05:04 -05:00
Kevin Turcios
ee3737a036 chore: exclude test and fixture dirs from ty type checking 2026-02-18 21:18:24 -05:00
Kevin Turcios
5aa115a523 feat: make crosshair-tool optional for Python 3.15+
crosshair-tool doesn't support Python 3.15 yet. The dependency is now
conditional on python_version < 3.15, with a runtime guard that skips
concolic test generation when the package is absent.
2026-02-18 17:56:59 -05:00
KRRT7
fa452f2f31 fix: update license format to use license-files
Replace deprecated license table format with modern license-files array
in both main package and codeflash-benchmark subpackage. This resolves
the setuptools deprecation warning about TOML table license format.

Changes:
- Use license-files = ["LICENSE"] instead of license = {text = "BSL-1.1"}
- Add LICENSE file to root directory
- Add LICENSE and README.md to codeflash-benchmark/
2026-02-17 05:54:21 +00:00
Kevin Turcios
6de75e7bab chore: disable ruff B009 globally to avoid conflict with mypy [misc] 2026-02-13 09:48:18 -05:00
Kevin Turcios
fb5ee232a5
Merge branch 'main' into pyarrow-comparator 2026-02-10 20:52:42 -05:00
Kevin Turcios
476682c303 fix: lower pytest-asyncio minimum version to 0.18.0 2026-02-09 12:49:13 -05:00
aseembits93
2b66d15c06 feat: add PyArrow support to comparator
Add comparison support for PyArrow types including Table, RecordBatch,
Array, ChunkedArray, Scalar, Schema, Field, and DataType.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 10:40:56 -08:00
Kevin Turcios
95cc60397d
Merge branch 'main' into omni-java 2026-02-04 03:22:37 -05:00
claude[bot]
c0e8a98ca5 chore: disable FURB110 lint rule that enforces 'or' pattern
The codebase prefers explicit 'a if a else b' over 'a or b' pattern.
Disabled FURB110 (if-exp-instead-of-or-operator) rule to prevent
automatic conversion by the linter.

Co-authored-by: Kevin Turcios <KRRT7@users.noreply.github.com>
2026-02-04 04:39:20 +00:00
Kevin Turcios
9f4776eb2e chore: migrate from pre-commit to prek
Replace pre-commit with prek (faster Rust-based alternative) for linting.
- Add prek to dev dependencies
- Replace pre-commit workflow with prek workflow using setup-uv@v6
- Update Claude workflow allowed tools to use prek
2026-02-03 19:56:58 -05:00
Kevin Turcios
65d77548a3 update versions 2026-02-03 17:17:57 -05:00
misrasaurabh1
29f266ee63 wip java support 2026-01-30 00:37:24 -08:00
Kevin Turcios
84d0b1cf09 Merge branch 'main' into multi-language 2026-01-29 13:05:22 -05:00
Kevin Turcios
1d3aeb997d wrapped 2026-01-29 12:35:53 -05:00
Kevin Turcios
47a3778ff7 ignore s110 2026-01-29 12:07:47 -05:00
Kevin Turcios
c2316692c5 revert 2026-01-29 12:00:03 -05:00
Sarthak Agarwal
72d9a9eafc remove ignored linting issues 2026-01-29 21:39:07 +05:30
Sarthak Agarwal
d295ff39c4 fix directory for skipped tests 2026-01-29 20:20:48 +05:30
Sarthak Agarwal
d29b139c62 fix: lint issues in experiments folder and format fixes 2026-01-29 19:29:12 +05:30
Kevin Turcios
6612be4a8c silence these for now 2026-01-29 07:13:02 -05:00
misrasaurabh1
74c4035595 WIP JS support 2026-01-14 20:55:41 -08:00
misrasaurabh1
4e1b5cf57a Initial attempt at phase 1 2026-01-14 18:56:06 -08:00
Aseem Saxena
a76adafbf9 add numba and tensorflow in test dependency group 2026-01-09 11:08:24 -08:00
Kevin Turcios
2e34d83c52
remove test_framework from pyproject.toml (#955)
* follow up

* remove requirement

* Delete uv.lock

* refresh uv-lock

* first pass

* cleanup test_framework here

* cleanup

* code_review

* cleanup tests

* fix for E2E

* fix tests dir missing

* one more cleanup

* cancel-in-progress

* Revert "cancel-in-progress"

This reverts commit f4bb9079cb.

* not needed here

* lower threshold and cleanup comments

* debug

* temp

* debug

Revert "debug"

This reverts commit fc3655149486c8b980e245e97b8304232086f08d.

fix(discover): Fix pytest discovery for futurehouse structure

Revert "fix(discover): Fix pytest discovery for futurehouse structure"

This reverts commit 40c48882b7413f5876af0e2e08d8f17a65bab091.

Reapply "debug"

This reverts commit c8297e57fbdca2462a8ca1199657748b8bc225e9.

Revert "not needed here"

This reverts commit dd2c5cdf76.

Revert "lower threshold and cleanup comments"

This reverts commit 0e2f57e292.

Reapply "lower threshold and cleanup comments"

This reverts commit e3b24f4a2967551eca8a19f96bf6647b23acdbbc.

Reapply "not needed here"

This reverts commit aec32103c931ff6d57dfa0d012113c2cec5d37a7.

Revert "Reapply "debug""

This reverts commit 77ab9f34f858a17fb29764c544769a0eb72ce7f0.

Reapply "fix(discover): Fix pytest discovery for futurehouse structure"

This reverts commit 506b94ab4fe17a7c8e0d458253812758cced3f22.

feat(futurehouse): Make futurehouse structure pytest compatible

* Revert "debug"

This reverts commit 271c5a37ec.

* Revert "temp"

This reverts commit b363acda1c.

* Revert "debug"

This reverts commit ac29b6beb3.

* just for now
2025-12-09 02:53:08 -08:00
Kevin Turcios
33437d39e3
use pytest as the execution engine for all tests (#951)
* first pass

restore

restore this too

Revert "first pass"

This reverts commit b507770b2c79cc948b33222d8877fb784bfe108a.

* continue

* Update uv.lock

* refresh lockfile

* bugfix

* temp

* fix these

* pytest changes

* formatting

* set up test env properly here too

* ruff

* make ruff happy

* Update e2e-bubblesort-unittest.yaml

* with pytest

* bugfix

* oops
2025-12-06 22:40:25 -06:00
Kevin Turcios
321640cb60
CF-900 allow async optimizations by default (#938)
* remove --async

* include it by default

* don't crash for --async

* pre-commit
2025-11-23 16:36:13 -05:00
Codeflash Bot
fd8c73a152 add eval_type_backport 2025-11-04 00:38:58 -08:00
ali
5280484ce8
migrate pygls to v2 2025-10-21 04:27:46 +03:00
Kevin Turcios
77155a8e00
Merge branch 'main' into 3.14-in-CI 2025-10-14 18:44:11 +00:00