Module py2rs

Module py2rs 

Source
Expand description

Python to Rust Single-Shot Compile Benchmark (10 Levels)

Canonical benchmark for code translation model evaluation. Measures success rate by turn and finds smallest model meeting thresholds.

§Levels

  1. Hello World
  2. Variables & Arithmetic
  3. Functions & Ownership
  4. Collections & Iterators
  5. Control Flow & Borrowing
  6. Error Handling (Result)
  7. OOP → Traits
  8. Concurrency (async/rayon)
  9. FFI/Unsafe
  10. Metaprogramming (proc macros)

Structs§

LevelResult
Result for a single level
Py2RsScore
Score for Python→Rust benchmark

Enums§

Py2RsLevel
Python→Rust benchmark level (1-10)

Functions§

compare_models
Compare multiple models on Py2Rs benchmark
format_comparison_table
Format comparison as table
generate_canonical_examples
Generate canonical Py2Rs examples
run_benchmark
Run Py2Rs benchmark on a model (mock implementation)