Skip to content

Commit 2dcfba6

Browse files
authored
Merge branch 'main' into jit-docs
2 parents 8c66acb + fa1f93c commit 2dcfba6

46 files changed

Lines changed: 4154 additions & 1651 deletions

Some content is hidden

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

.github/workflows/mypy.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ jobs:
2222

2323
- name: Install uv
2424
uses: astral-sh/setup-uv@v6
25-
with:
26-
version: "0.5.30"
2725

2826
- name: sync uv
2927
run: |
28+
uv venv --seed
3029
uv sync
3130
3231

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,6 @@ WARP.MD
259259
.mcp.json
260260
.tessl/
261261
tessl.json
262+
263+
# Tessl auto-generates AGENTS.md on install; ignore to avoid cluttering git status
264+
AGENTS.md

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ else:
8888
- Commit message body should be concise (1-2 sentences max)
8989
- PR titles should also use conventional format
9090

91+
<!-- Section below is auto-generated by `tessl install` - do not edit manually -->
92+
9193
# Agent Rules <!-- tessl-managed -->
9294

9395
@.tessl/RULES.md follow the [instructions](.tessl/RULES.md)
96+
97+
@AGENTS.md

codeflash/LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Business Source License 1.1
33
Parameters
44

55
Licensor: CodeFlash Inc.
6-
Licensed Work: Codeflash Client version 0.19.x
6+
Licensed Work: Codeflash Client version 0.20.x
77
The Licensed Work is (c) 2024 CodeFlash Inc.
88

99
Additional Use Grant: None. Production use of the Licensed Work is only permitted
@@ -13,7 +13,7 @@ Additional Use Grant: None. Production use of the Licensed Work is only permitte
1313
Platform. Please visit codeflash.ai for further
1414
information.
1515

16-
Change Date: 2029-12-21
16+
Change Date: 2030-01-26
1717

1818
Change License: MIT
1919

codeflash/api/aiservice.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def get_jit_rewritten_code( # noqa: D417
224224
logger.info("!lsp|Rewriting as a JIT function…")
225225
console.rule()
226226
try:
227-
response = self.make_ai_service_request("/rewrite_jit", payload=payload, timeout=60)
227+
response = self.make_ai_service_request("/rewrite_jit", payload=payload, timeout=self.timeout)
228228
except requests.exceptions.RequestException as e:
229229
logger.exception(f"Error generating jit rewritten candidate: {e}")
230230
ph("cli-jit-rewrite-error-caught", {"error": str(e)})
@@ -460,6 +460,10 @@ def get_new_explanation( # noqa: D417
460460
optimized_throughput: str | None = None,
461461
throughput_improvement: str | None = None,
462462
function_references: str | None = None,
463+
acceptance_reason: str | None = None,
464+
original_concurrency_ratio: str | None = None,
465+
optimized_concurrency_ratio: str | None = None,
466+
concurrency_improvement: str | None = None,
463467
codeflash_version: str = codeflash_version,
464468
) -> str:
465469
"""Optimize the given python code for performance by making a request to the Django endpoint.
@@ -480,8 +484,12 @@ def get_new_explanation( # noqa: D417
480484
- original_throughput: str | None - throughput for the baseline code (operations per second)
481485
- optimized_throughput: str | None - throughput for the optimized code (operations per second)
482486
- throughput_improvement: str | None - throughput improvement percentage
483-
- current codeflash version
484487
- function_references: str | None - where the function is called in the codebase
488+
- acceptance_reason: str | None - why the optimization was accepted (runtime, throughput, or concurrency)
489+
- original_concurrency_ratio: str | None - concurrency ratio for the baseline code
490+
- optimized_concurrency_ratio: str | None - concurrency ratio for the optimized code
491+
- concurrency_improvement: str | None - concurrency improvement percentage
492+
- codeflash_version: str - current codeflash version
485493
486494
Returns
487495
-------
@@ -505,6 +513,10 @@ def get_new_explanation( # noqa: D417
505513
"optimized_throughput": optimized_throughput,
506514
"throughput_improvement": throughput_improvement,
507515
"function_references": function_references,
516+
"acceptance_reason": acceptance_reason,
517+
"original_concurrency_ratio": original_concurrency_ratio,
518+
"optimized_concurrency_ratio": optimized_concurrency_ratio,
519+
"concurrency_improvement": concurrency_improvement,
508520
"codeflash_version": codeflash_version,
509521
"call_sequence": self.get_next_sequence(),
510522
}

codeflash/cli_cmds/cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ def parse_args() -> Namespace:
8484
parser.add_argument(
8585
"--no-gen-tests", action="store_true", help="Do not generate tests, use only existing tests for optimization."
8686
)
87+
parser.add_argument(
88+
"--no-jit-opts", action="store_true", help="Do not generate JIT-compiled optimizations for numerical code."
89+
)
8790
parser.add_argument("--staging-review", action="store_true", help="Upload optimizations to staging for review")
8891
parser.add_argument(
8992
"--verify-setup",

0 commit comments

Comments
 (0)