Skip to content

Commit 95fcea5

Browse files
noahgiftclaude
andcommitted
chore: Release v3.22.0
Hero Example Achievement: - data_analysis_combined.py compiles AND runs - Complex data science scripts now work end-to-end Bug Fixes: - DEPYLER-1168: Call-site clone insertion for reused variables - DEPYLER-1169: List index assignment (vec[i]=x not vec.insert()) Metrics: - Compile rate: 40.6% (130/320) - Hero runtime: <10s Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 123f2f8 commit 95fcea5

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,49 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [3.22.0] - 2025-01-18
6+
7+
### 🎯 Hero Example Achievement
8+
9+
**data_analysis_combined.py now compiles AND runs!**
10+
11+
This release marks a significant milestone: complex Python data science scripts
12+
with multiple function calls, statistical calculations, and data transformations
13+
now transpile to working Rust binaries.
14+
15+
### 🔧 Bug Fixes
16+
17+
#### DEPYLER-1168: Call-Site Borrowing Heuristic
18+
**Impact**: Fixes E0382 "use of moved value" errors
19+
**Root Cause**: When a variable was passed to a function that takes ownership,
20+
but the variable was used again later in the same scope, Rust would error.
21+
22+
**Solution**: Added look-ahead analysis during code generation:
23+
- Track variables used after current statement (`vars_used_later`)
24+
- When function takes ownership and variable is reused, insert `.clone()`
25+
- Example: `normalize_data(dataset.clone())` preserves `dataset` for later use
26+
27+
**Files Changed**:
28+
- `context.rs`: Added `vars_used_later: HashSet<String>`
29+
- `func_gen.rs`: Populate `vars_used_later` during statement iteration
30+
- `expr_gen.rs`: Insert `.clone()` at call site when variable is reused
31+
32+
#### DEPYLER-1169: List Index Assignment
33+
**Impact**: Fixes infinite loop/hang in bubble sort implementations
34+
**Root Cause**: `list[i] = x` was generating `vec.insert(i, x)` instead of `vec[i] = x`
35+
36+
**Python semantics**: `list[i] = x` replaces element at index i
37+
**Wrong Rust**: `vec.insert(i, x)` inserts NEW element, shifts others (O(n))
38+
**Correct Rust**: `vec[i] = x` replaces element at index i (O(1))
39+
40+
**File Changed**: `stmt_gen.rs` line 4831
41+
42+
### 📊 Metrics
43+
44+
- **Compile Rate**: 40.6% (130/320 files)
45+
- **Hero Example Runtime**: < 10 seconds
46+
- **Top Remaining Blocker**: E0308 type mismatches (334 errors)
47+
548
## [Unreleased]
649

750
### 🔧 Code Organization & Refactoring (2025-01-06)

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ max_cyclomatic_complexity = 15
3636
required_documentation_coverage = 100.0
3737

3838
[workspace.package]
39-
version = "3.21.0"
39+
version = "3.22.0"
4040
edition = "2021"
4141
authors = ["Depyler Contributors"]
4242
license = "MIT OR Apache-2.0"

crates/depyler-ruchy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "depyler-ruchy"
3-
version = "3.21.0"
3+
version = "3.22.0"
44
edition = "2021"
55
authors = ["Depyler Contributors"]
66
description = "Ruchy script format backend for Depyler Python-to-Rust transpiler"

crates/depyler/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ depyler-verify = { version = "3.19.18", path = "../depyler-verify" }
3131
depyler-mcp = { version = "3.19.18", path = "../depyler-mcp" }
3232
depyler-annotations = { version = "3.19.18", path = "../depyler-annotations" }
3333
depyler-quality = { version = "3.19.18", path = "../depyler-quality" }
34-
depyler-oracle = { version = "3.21.0", path = "../depyler-oracle" }
34+
depyler-oracle = { version = "3.22.0", path = "../depyler-oracle" }
3535
entrenar = "0.4.0"
3636
alimentar = { version = "0.2.2", default-features = false, features = ["local"] }
3737
arrow = { version = "54", default-features = false, features = ["json"] }

0 commit comments

Comments
 (0)