Skip to content

Commit 2b7e004

Browse files
committed
postprocess: switch from gemini-3-pro-preview to gemini-3-flash-preview for the default
`flash` is cheaper and faster and seems to still be sufficiently capable. I did have to adjust the prompt slightly to explicitly say to include the surrounding Rust Markdown code block. This isn't actually used right now, but is in #1534, so it seems worth preserving.
1 parent 65ca2b9 commit 2b7e004

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

c2rust-postprocess/postprocess/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def build_arg_parser() -> argparse.ArgumentParser:
5252
"--model-id",
5353
type=str,
5454
required=False,
55-
default="gemini-3-pro-preview",
55+
default="gemini-3-flash-preview",
5656
help="ID of the LLM model to use (default: gemini-3-pro-preview)",
5757
)
5858

c2rust-postprocess/postprocess/transforms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ def transfer_comments(
107107
Transfer the comments from the following C function to the corresponding Rust function.
108108
Do not add any comments that are not present in the C function.
109109
Use Rust doc comment syntax (///) where appropriate (e.g., for function documentation).
110-
Respond with the Rust function definition with the transferred comments; say nothing else.
110+
Respond with the Rust function definition with the transferred comments
111+
in a Rust Markdown code block; say nothing else.
111112
""" # noqa: E501
112113
prompt_text = dedent(prompt_text).strip()
113114

c2rust-postprocess/tests/llm-cache/CommentTransfer/partition/bf27c23abbb2f5c2d7dba1891b748252983959f5dc232f35146250b6d2d1fb29/metadata.toml renamed to c2rust-postprocess/tests/llm-cache/CommentTransfer/partition/9c5f0dcfa75e9295565171e257b58573c8967fb1004cc8b0a527e70b4982ea59/metadata.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
transform = "CommentTransfer"
22
identifier = "partition"
3-
model = "gemini-3-pro-preview"
3+
model = "gemini-3-flash-preview"
44
response = """```rust
55
/// Lomuto Partition Scheme:
66
/// Partitions the array so that elements < pivot are on the left,
@@ -40,7 +40,8 @@ role = "user"
4040
content = """Transfer the comments from the following C function to the corresponding Rust function.
4141
Do not add any comments that are not present in the C function.
4242
Use Rust doc comment syntax (///) where appropriate (e.g., for function documentation).
43-
Respond with the Rust function definition with the transferred comments; say nothing else.
43+
Respond with the Rust function definition with the transferred comments
44+
in a Rust Markdown code block; say nothing else.
4445
4546
C function:
4647
```c

c2rust-postprocess/tests/llm-cache/CommentTransfer/partition/bf27c23abbb2f5c2d7dba1891b748252983959f5dc232f35146250b6d2d1fb29/response.txt renamed to c2rust-postprocess/tests/llm-cache/CommentTransfer/partition/9c5f0dcfa75e9295565171e257b58573c8967fb1004cc8b0a527e70b4982ea59/response.txt

File renamed without changes.

c2rust-postprocess/tests/llm-cache/CommentTransfer/quickSort/d124abd1fe6752700e122e17288aac1b78606f3ffefcb6dc2c59e103933d1411/metadata.toml renamed to c2rust-postprocess/tests/llm-cache/CommentTransfer/quickSort/c0abc7f56ddcdfd63311bc07471096bbf48a40e8a0e0a658b64d847c39cbb7f4/metadata.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
transform = "CommentTransfer"
22
identifier = "quickSort"
3-
model = "gemini-3-pro-preview"
3+
model = "gemini-3-flash-preview"
44
response = """```rust
55
#[no_mangle]
66
pub unsafe extern "C" fn quickSort(
@@ -24,7 +24,8 @@ role = "user"
2424
content = """Transfer the comments from the following C function to the corresponding Rust function.
2525
Do not add any comments that are not present in the C function.
2626
Use Rust doc comment syntax (///) where appropriate (e.g., for function documentation).
27-
Respond with the Rust function definition with the transferred comments; say nothing else.
27+
Respond with the Rust function definition with the transferred comments
28+
in a Rust Markdown code block; say nothing else.
2829
2930
C function:
3031
```c

c2rust-postprocess/tests/llm-cache/CommentTransfer/quickSort/d124abd1fe6752700e122e17288aac1b78606f3ffefcb6dc2c59e103933d1411/response.txt renamed to c2rust-postprocess/tests/llm-cache/CommentTransfer/quickSort/c0abc7f56ddcdfd63311bc07471096bbf48a40e8a0e0a658b64d847c39cbb7f4/response.txt

File renamed without changes.

0 commit comments

Comments
 (0)