TokenBender commited on
Commit
b9709f0
·
verified ·
1 Parent(s): 166bf0b

Add dummy PIE C++ oracle seed dataset

Browse files
.DS_Store ADDED
Binary file (10.2 kB). View file
 
ORACLE_WRITER_INSTRUCTIONS.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Oracle Writer Instructions
2
+
3
+ You are given rows from `data/oracle_seed.jsonl`.
4
+
5
+ For each row:
6
+
7
+ 1. Read `messages` as the exact chat input. `prompt` is only a flattened fallback for non-chat tooling.
8
+ 2. Produce an optimized C++20 program that preserves exactly the same stdin/stdout behavior as `source_code`.
9
+ 3. Return the original input `messages` unchanged, then append exactly one assistant message with:
10
+ - one `<reasoning>...</reasoning>` block;
11
+ - one fenced `cpp` code block;
12
+ - no extra text before, between, or after those two parts.
13
+ 4. Compile the generated program with the row's `compile.command`.
14
+ 5. Run all visible tests from `visible_tests`.
15
+ 6. Fill the `verification` object truthfully.
16
+
17
+ Do not return partial-credit rows for training. If a solution does not compile or does not pass tests, mark it as failed and do not call it oracle data.
18
+
19
+ The expected output JSONL shape is shown in `data/oracle_return_example.jsonl`.
README.md ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - text-generation
5
+ - reinforcement-learning
6
+ language:
7
+ - en
8
+ - code
9
+ pretty_name: Dummy PIE C++ Oracle Seed
10
+ size_categories:
11
+ - n<1K
12
+ configs:
13
+ - config_name: default
14
+ data_files:
15
+ - split: oracle_seed
16
+ path: data/oracle_seed.jsonl
17
+ ---
18
+
19
+ # Dummy PIE C++ Oracle Seed
20
+
21
+ This is a tiny 5-row Hugging Face dataset skeleton for generating oracle SFT data for a PIE-style C++ optimization task.
22
+
23
+ The rows are intentionally synthetic. They define the exact shape we want for real PIE C++ tasks without exposing or depending on private prepared artifacts.
24
+
25
+ ## What The Oracle Writer Receives
26
+
27
+ Each row is a prompt-only optimization task. The canonical input is `messages`, not `prompt`.
28
+
29
+ - `task_id`: stable row identifier.
30
+ - `messages`: the exact chat input to give the model or oracle writer.
31
+ - `prompt_template_id`: which input style this row uses.
32
+ - `prompt`: flattened fallback for loaders that do not support chat messages.
33
+ - `source_code`: the unoptimized but correct C++20 program.
34
+ - `visible_tests`: public tests included in the prompt.
35
+ - `public_checker`: how visible outputs should be compared.
36
+ - `compile`: expected compiler command and timeout.
37
+ - `run`: expected runtime and memory limits.
38
+ - `constraints`: required assistant output contract.
39
+ - `metadata`: problem notes and expected optimization direction.
40
+
41
+ ## Required Oracle Return Format
42
+
43
+ The 5 seed rows intentionally vary the input style so the model does not overfit to one prompt wording:
44
+
45
+ - system message with output contract, user message with task;
46
+ - user-only full instruction;
47
+ - system role instruction, brief user request;
48
+ - structured user spec with a system contract;
49
+ - natural user request with inline answer-format instruction.
50
+
51
+ For each input row, return one SFT-ready chat row. Copy the input `messages` exactly, then append the assistant answer:
52
+
53
+ ```json
54
+ {
55
+ "task_id": "dummy_pie_cpp_0001_sum_even",
56
+ "messages": [
57
+ {
58
+ "role": "system",
59
+ "content": "same system message from the seed row, if present"
60
+ },
61
+ {
62
+ "role": "user",
63
+ "content": "same user message from the seed row"
64
+ },
65
+ {
66
+ "role": "assistant",
67
+ "content": "<reasoning>Short optimization explanation.</reasoning>\n```cpp\n// optimized C++20 code\n```"
68
+ }
69
+ ],
70
+ "verification": {
71
+ "compile_ok": true,
72
+ "all_visible_tests_pass": true,
73
+ "all_hidden_tests_pass": null,
74
+ "score": 1.0,
75
+ "runtime_ms": null,
76
+ "notes": "Verified locally by oracle writer."
77
+ }
78
+ }
79
+ ```
80
+
81
+ The assistant message must contain exactly:
82
+
83
+ 1. One `<reasoning>...</reasoning>` block.
84
+ 2. One fenced C++ block starting with ```` ```cpp ````.
85
+ 3. No extra prose outside those two parts.
86
+
87
+ The output format is intentionally fixed. Only the input prompt style varies.
88
+
89
+ ## Validation Rule For Real Training
90
+
91
+ Returned oracle rows should not be used for SFT until our local verifier confirms:
92
+
93
+ - output format is valid;
94
+ - generated C++ compiles;
95
+ - visible tests pass;
96
+ - hidden/generated tests pass when available;
97
+ - reward or grade is full mark.
98
+
99
+ ## Loading Locally
100
+
101
+ ```python
102
+ from datasets import load_dataset
103
+
104
+ ds = load_dataset("json", data_files="data/oracle_seed.jsonl", split="train")
105
+ print(ds[0])
106
+ ```
data/oracle_return_example.jsonl ADDED
@@ -0,0 +1 @@
 
 
1
+ {"task_id": "dummy_pie_cpp_0001_sum_even", "messages": [{"role": "system", "content": "You are an expert C++20 performance optimizer. Preserve stdin/stdout behavior exactly. Prefer simple, readable algorithmic improvements over micro-optimizations. Return exactly one <reasoning>...</reasoning> block followed by exactly one fenced ```cpp code block containing an optimized C++20 program. Do not include any other text."}, {"role": "user", "content": "Task: optimize this correct but intentionally inefficient C++20 program. Keep the same input and output behavior.\n\nOriginal program:\n```cpp\n#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin>>n;vector<long long>a(n);for(int i=0;i<n;i++)cin>>a[i];long long ans=0;for(int i=0;i<n;i++){for(int j=0;j<=i;j++){if(i==j && a[j]%2==0) ans+=a[j];}}cout<<ans<<\"\\n\";}\n```\n\nVisible tests:\nsample_1 stdin:\n```text\n5\n1 2 3 4 6\n```\nExpected stdout:\n```text\n12\n```"}, {"role": "assistant", "content": "<reasoning>The nested loop only contributes when i equals j, so the program is just summing even elements once. Replace the quadratic loop with one linear pass over the array while preserving the same input and output format.</reasoning>\n```cpp\n#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){\n ios::sync_with_stdio(false);\n cin.tie(nullptr);\n int n;\n cin >> n;\n long long ans = 0;\n for(int i = 0; i < n; ++i){\n long long x;\n cin >> x;\n if(x % 2 == 0) ans += x;\n }\n cout << ans << '\\n';\n return 0;\n}\n```"}], "verification": {"compile_ok": true, "all_visible_tests_pass": true, "all_hidden_tests_pass": null, "score": 1.0, "runtime_ms": null, "notes": "Example return row. Real rows should include actual verifier evidence if available."}}
data/oracle_seed.jsonl ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {"task_id": "dummy_pie_cpp_0001_sum_even", "source": "dummy_pie_cpp", "split": "oracle_seed", "language": "cpp20", "prompt_template_id": "system_contract_user_problem", "source_code": "#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin>>n;vector<long long>a(n);for(int i=0;i<n;i++)cin>>a[i];long long ans=0;for(int i=0;i<n;i++){for(int j=0;j<=i;j++){if(i==j && a[j]%2==0) ans+=a[j];}}cout<<ans<<\"\\n\";}", "visible_tests": [{"name": "sample_1", "stdin": "5\n1 2 3 4 6\n", "stdout": "12\n"}], "public_checker": {"type": "exact_stdout", "strip_trailing_whitespace": true}, "compile": {"command": "g++ -std=c++20 -O2 -pipe main.cpp -o main", "timeout_sec": 20}, "run": {"timeout_sec": 2, "memory_mb": 512}, "constraints": {"assistant_format": "one_reasoning_block_then_one_cpp_fence", "must_preserve_io": true, "must_compile": true, "must_pass_visible_tests": true, "target": "optimize runtime without changing outputs"}, "metadata": {"problem_id": "dummy_sum_even", "baseline_complexity": "O(n^2) due to redundant nested loop", "expected_better_complexity": "O(n)", "hidden_tests_policy": "not_in_seed", "oracle_acceptance": "full mark only"}, "messages": [{"role": "system", "content": "You are an expert C++20 performance optimizer. Preserve stdin/stdout behavior exactly. Prefer simple, readable algorithmic improvements over micro-optimizations. Return exactly one <reasoning>...</reasoning> block followed by exactly one fenced ```cpp code block containing an optimized C++20 program. Do not include any other text."}, {"role": "user", "content": "Task: optimize this correct but intentionally inefficient C++20 program. Keep the same input and output behavior.\n\nOriginal program:\n```cpp\n#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin>>n;vector<long long>a(n);for(int i=0;i<n;i++)cin>>a[i];long long ans=0;for(int i=0;i<n;i++){for(int j=0;j<=i;j++){if(i==j && a[j]%2==0) ans+=a[j];}}cout<<ans<<\"\\n\";}\n```\n\nVisible tests:\nsample_1 stdin:\n```text\n5\n1 2 3 4 6\n```\nExpected stdout:\n```text\n12\n```"}], "prompt": "SYSTEM: You are an expert C++20 performance optimizer. Preserve stdin/stdout behavior exactly. Prefer simple, readable algorithmic improvements over micro-optimizations. Return exactly one <reasoning>...</reasoning> block followed by exactly one fenced ```cpp code block containing an optimized C++20 program. Do not include any other text.\n\nUSER: Task: optimize this correct but intentionally inefficient C++20 program. Keep the same input and output behavior.\n\nOriginal program:\n```cpp\n#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin>>n;vector<long long>a(n);for(int i=0;i<n;i++)cin>>a[i];long long ans=0;for(int i=0;i<n;i++){for(int j=0;j<=i;j++){if(i==j && a[j]%2==0) ans+=a[j];}}cout<<ans<<\"\\n\";}\n```\n\nVisible tests:\nsample_1 stdin:\n```text\n5\n1 2 3 4 6\n```\nExpected stdout:\n```text\n12\n```"}
2
+ {"task_id": "dummy_pie_cpp_0002_prefix_queries", "source": "dummy_pie_cpp", "split": "oracle_seed", "language": "cpp20", "prompt_template_id": "user_only_full_instruction", "source_code": "#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n,q;cin>>n>>q;vector<long long>a(n+1);for(int i=1;i<=n;i++)cin>>a[i];while(q--){int l,r;cin>>l>>r;long long s=0;for(int i=1;i<=n;i++){if(l<=i && i<=r)s+=a[i];}cout<<s<<\"\\n\";}}", "visible_tests": [{"name": "sample_1", "stdin": "5 3\n2 4 6 8 10\n1 3\n2 5\n4 4\n", "stdout": "12\n28\n8\n"}], "public_checker": {"type": "exact_stdout", "strip_trailing_whitespace": true}, "compile": {"command": "g++ -std=c++20 -O2 -pipe main.cpp -o main", "timeout_sec": 20}, "run": {"timeout_sec": 2, "memory_mb": 512}, "constraints": {"assistant_format": "one_reasoning_block_then_one_cpp_fence", "must_preserve_io": true, "must_compile": true, "must_pass_visible_tests": true, "target": "optimize runtime without changing outputs"}, "metadata": {"problem_id": "dummy_prefix_queries", "baseline_complexity": "O(nq) range sums", "expected_better_complexity": "O(n+q) with prefix sums", "hidden_tests_policy": "not_in_seed", "oracle_acceptance": "full mark only"}, "messages": [{"role": "user", "content": "Return exactly one <reasoning>...</reasoning> block followed by exactly one fenced ```cpp code block containing an optimized C++20 program. Do not include any other text.\n\nTask: optimize this correct but intentionally inefficient C++20 program. Keep the same input and output behavior.\n\nOriginal program:\n```cpp\n#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n,q;cin>>n>>q;vector<long long>a(n+1);for(int i=1;i<=n;i++)cin>>a[i];while(q--){int l,r;cin>>l>>r;long long s=0;for(int i=1;i<=n;i++){if(l<=i && i<=r)s+=a[i];}cout<<s<<\"\\n\";}}\n```\n\nVisible tests:\nsample_1 stdin:\n```text\n5 3\n2 4 6 8 10\n1 3\n2 5\n4 4\n```\nExpected stdout:\n```text\n12\n28\n8\n```"}], "prompt": "USER: Return exactly one <reasoning>...</reasoning> block followed by exactly one fenced ```cpp code block containing an optimized C++20 program. Do not include any other text.\n\nTask: optimize this correct but intentionally inefficient C++20 program. Keep the same input and output behavior.\n\nOriginal program:\n```cpp\n#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n,q;cin>>n>>q;vector<long long>a(n+1);for(int i=1;i<=n;i++)cin>>a[i];while(q--){int l,r;cin>>l>>r;long long s=0;for(int i=1;i<=n;i++){if(l<=i && i<=r)s+=a[i];}cout<<s<<\"\\n\";}}\n```\n\nVisible tests:\nsample_1 stdin:\n```text\n5 3\n2 4 6 8 10\n1 3\n2 5\n4 4\n```\nExpected stdout:\n```text\n12\n28\n8\n```"}
3
+ {"task_id": "dummy_pie_cpp_0003_count_pairs", "source": "dummy_pie_cpp", "split": "oracle_seed", "language": "cpp20", "prompt_template_id": "system_role_user_brief", "source_code": "#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n,k;cin>>n>>k;vector<int>a(n);for(int&i:a)cin>>i;long long ans=0;for(int i=0;i<n;i++){for(int j=0;j<n;j++){if(i<j && a[i]+a[j]==k)ans++;}}cout<<ans<<\"\\n\";}", "visible_tests": [{"name": "sample_1", "stdin": "6 7\n1 6 2 5 3 4\n", "stdout": "3\n"}], "public_checker": {"type": "exact_stdout", "strip_trailing_whitespace": true}, "compile": {"command": "g++ -std=c++20 -O2 -pipe main.cpp -o main", "timeout_sec": 20}, "run": {"timeout_sec": 2, "memory_mb": 512}, "constraints": {"assistant_format": "one_reasoning_block_then_one_cpp_fence", "must_preserve_io": true, "must_compile": true, "must_pass_visible_tests": true, "target": "optimize runtime without changing outputs"}, "metadata": {"problem_id": "dummy_count_pairs", "baseline_complexity": "O(n^2) pair enumeration", "expected_better_complexity": "O(n) average with hash map or O(n log n) with sorting", "hidden_tests_policy": "not_in_seed", "oracle_acceptance": "full mark only"}, "messages": [{"role": "system", "content": "You are an expert C++20 performance optimizer. Preserve stdin/stdout behavior exactly. Prefer simple, readable algorithmic improvements over micro-optimizations. Return exactly one <reasoning>...</reasoning> block followed by exactly one fenced ```cpp code block containing an optimized C++20 program. Do not include any other text."}, {"role": "user", "content": "Make the following C++20 solution asymptotically faster if possible, while preserving the exact interface and outputs.\n\nTask: optimize this correct but intentionally inefficient C++20 program. Keep the same input and output behavior.\n\nOriginal program:\n```cpp\n#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n,k;cin>>n>>k;vector<int>a(n);for(int&i:a)cin>>i;long long ans=0;for(int i=0;i<n;i++){for(int j=0;j<n;j++){if(i<j && a[i]+a[j]==k)ans++;}}cout<<ans<<\"\\n\";}\n```\n\nVisible tests:\nsample_1 stdin:\n```text\n6 7\n1 6 2 5 3 4\n```\nExpected stdout:\n```text\n3\n```"}], "prompt": "SYSTEM: You are an expert C++20 performance optimizer. Preserve stdin/stdout behavior exactly. Prefer simple, readable algorithmic improvements over micro-optimizations. Return exactly one <reasoning>...</reasoning> block followed by exactly one fenced ```cpp code block containing an optimized C++20 program. Do not include any other text.\n\nUSER: Make the following C++20 solution asymptotically faster if possible, while preserving the exact interface and outputs.\n\nTask: optimize this correct but intentionally inefficient C++20 program. Keep the same input and output behavior.\n\nOriginal program:\n```cpp\n#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n,k;cin>>n>>k;vector<int>a(n);for(int&i:a)cin>>i;long long ans=0;for(int i=0;i<n;i++){for(int j=0;j<n;j++){if(i<j && a[i]+a[j]==k)ans++;}}cout<<ans<<\"\\n\";}\n```\n\nVisible tests:\nsample_1 stdin:\n```text\n6 7\n1 6 2 5 3 4\n```\nExpected stdout:\n```text\n3\n```"}
4
+ {"task_id": "dummy_pie_cpp_0004_first_repeated", "source": "dummy_pie_cpp", "split": "oracle_seed", "language": "cpp20", "prompt_template_id": "system_contract_structured_user_spec", "source_code": "#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin>>n;vector<string>s(n);for(auto&x:s)cin>>x;string ans=\"NONE\";for(int i=0;i<n;i++){bool seen=false;for(int j=0;j<i;j++){if(s[j]==s[i])seen=true;}if(seen){ans=s[i];break;}}cout<<ans<<\"\\n\";}", "visible_tests": [{"name": "sample_1", "stdin": "6\nred blue green blue red yellow\n", "stdout": "blue\n"}], "public_checker": {"type": "exact_stdout", "strip_trailing_whitespace": true}, "compile": {"command": "g++ -std=c++20 -O2 -pipe main.cpp -o main", "timeout_sec": 20}, "run": {"timeout_sec": 2, "memory_mb": 512}, "constraints": {"assistant_format": "one_reasoning_block_then_one_cpp_fence", "must_preserve_io": true, "must_compile": true, "must_pass_visible_tests": true, "target": "optimize runtime without changing outputs"}, "metadata": {"problem_id": "dummy_first_repeated", "baseline_complexity": "O(n^2) previous-item scan", "expected_better_complexity": "O(n) average with unordered_set", "hidden_tests_policy": "not_in_seed", "oracle_acceptance": "full mark only"}, "messages": [{"role": "system", "content": "Return exactly one <reasoning>...</reasoning> block followed by exactly one fenced ```cpp code block containing an optimized C++20 program. Do not include any other text."}, {"role": "user", "content": "optimization_request:\n language: C++20\n objective: reduce runtime while preserving behavior\n checker: exact stdout after trimming trailing whitespace\n task_id: dummy_pie_cpp_0004_first_repeated\n\nsource_code:\n```cpp\n#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin>>n;vector<string>s(n);for(auto&x:s)cin>>x;string ans=\"NONE\";for(int i=0;i<n;i++){bool seen=false;for(int j=0;j<i;j++){if(s[j]==s[i])seen=true;}if(seen){ans=s[i];break;}}cout<<ans<<\"\\n\";}\n```\n\nvisible_tests:\nsample_1 stdin:\n```text\n6\nred blue green blue red yellow\n```\nExpected stdout:\n```text\nblue\n```"}], "prompt": "SYSTEM: Return exactly one <reasoning>...</reasoning> block followed by exactly one fenced ```cpp code block containing an optimized C++20 program. Do not include any other text.\n\nUSER: optimization_request:\n language: C++20\n objective: reduce runtime while preserving behavior\n checker: exact stdout after trimming trailing whitespace\n task_id: dummy_pie_cpp_0004_first_repeated\n\nsource_code:\n```cpp\n#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin>>n;vector<string>s(n);for(auto&x:s)cin>>x;string ans=\"NONE\";for(int i=0;i<n;i++){bool seen=false;for(int j=0;j<i;j++){if(s[j]==s[i])seen=true;}if(seen){ans=s[i];break;}}cout<<ans<<\"\\n\";}\n```\n\nvisible_tests:\nsample_1 stdin:\n```text\n6\nred blue green blue red yellow\n```\nExpected stdout:\n```text\nblue\n```"}
5
+ {"task_id": "dummy_pie_cpp_0005_matrix_row_max", "source": "dummy_pie_cpp", "split": "oracle_seed", "language": "cpp20", "prompt_template_id": "user_natural_language_with_inline_contract", "source_code": "#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n,m;cin>>n>>m;vector<vector<int>>a(n,vector<int>(m));for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>a[i][j];for(int i=0;i<n;i++){int best=INT_MIN;for(int j=0;j<m;j++){for(int k=0;k<m;k++){if(k==j)best=max(best,a[i][k]);}}cout<<best<<(i+1==n?'\\n':' ');} }", "visible_tests": [{"name": "sample_1", "stdin": "3 4\n1 9 2 3\n4 5 6 7\n-3 -8 -1 -2\n", "stdout": "9 7 -1\n"}], "public_checker": {"type": "exact_stdout", "strip_trailing_whitespace": true}, "compile": {"command": "g++ -std=c++20 -O2 -pipe main.cpp -o main", "timeout_sec": 20}, "run": {"timeout_sec": 2, "memory_mb": 512}, "constraints": {"assistant_format": "one_reasoning_block_then_one_cpp_fence", "must_preserve_io": true, "must_compile": true, "must_pass_visible_tests": true, "target": "optimize runtime without changing outputs"}, "metadata": {"problem_id": "dummy_matrix_row_max", "baseline_complexity": "O(nm^2) redundant row maximum scan", "expected_better_complexity": "O(nm)", "hidden_tests_policy": "not_in_seed", "oracle_acceptance": "full mark only"}, "messages": [{"role": "user", "content": "Can you make this C++ program faster without changing what it reads or prints? Please keep it C++20.\n\nProgram:\n```cpp\n#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n,m;cin>>n>>m;vector<vector<int>>a(n,vector<int>(m));for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>a[i][j];for(int i=0;i<n;i++){int best=INT_MIN;for(int j=0;j<m;j++){for(int k=0;k<m;k++){if(k==j)best=max(best,a[i][k]);}}cout<<best<<(i+1==n?'\\n':' ');} }\n```\n\nTry it on this visible test before returning it:\nsample_1 stdin:\n```text\n3 4\n1 9 2 3\n4 5 6 7\n-3 -8 -1 -2\n```\nExpected stdout:\n```text\n9 7 -1\n```\n\nAnswer format: Return exactly one <reasoning>...</reasoning> block followed by exactly one fenced ```cpp code block containing an optimized C++20 program. Do not include any other text."}], "prompt": "USER: Can you make this C++ program faster without changing what it reads or prints? Please keep it C++20.\n\nProgram:\n```cpp\n#include <iostream>\n#include <vector>\n#include <string>\n#include <unordered_set>\n#include <unordered_map>\n#include <climits>\n#include <algorithm>\nusing namespace std;\nint main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n,m;cin>>n>>m;vector<vector<int>>a(n,vector<int>(m));for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>a[i][j];for(int i=0;i<n;i++){int best=INT_MIN;for(int j=0;j<m;j++){for(int k=0;k<m;k++){if(k==j)best=max(best,a[i][k]);}}cout<<best<<(i+1==n?'\\n':' ');} }\n```\n\nTry it on this visible test before returning it:\nsample_1 stdin:\n```text\n3 4\n1 9 2 3\n4 5 6 7\n-3 -8 -1 -2\n```\nExpected stdout:\n```text\n9 7 -1\n```\n\nAnswer format: Return exactly one <reasoning>...</reasoning> block followed by exactly one fenced ```cpp code block containing an optimized C++20 program. Do not include any other text."}
schema/oracle_return.schema.json ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Dummy PIE C++ Oracle Return Row",
4
+ "type": "object",
5
+ "required": [
6
+ "task_id",
7
+ "messages",
8
+ "verification"
9
+ ],
10
+ "properties": {
11
+ "task_id": {
12
+ "type": "string"
13
+ },
14
+ "messages": {
15
+ "type": "array",
16
+ "minItems": 2,
17
+ "items": {
18
+ "type": "object",
19
+ "required": [
20
+ "role",
21
+ "content"
22
+ ],
23
+ "properties": {
24
+ "role": {
25
+ "type": "string",
26
+ "enum": [
27
+ "system",
28
+ "user",
29
+ "assistant"
30
+ ]
31
+ },
32
+ "content": {
33
+ "type": "string"
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ }
38
+ },
39
+ "verification": {
40
+ "type": "object",
41
+ "required": [
42
+ "compile_ok",
43
+ "all_visible_tests_pass",
44
+ "all_hidden_tests_pass",
45
+ "score",
46
+ "runtime_ms",
47
+ "notes"
48
+ ],
49
+ "properties": {
50
+ "compile_ok": {
51
+ "type": "boolean"
52
+ },
53
+ "all_visible_tests_pass": {
54
+ "type": "boolean"
55
+ },
56
+ "all_hidden_tests_pass": {
57
+ "type": [
58
+ "boolean",
59
+ "null"
60
+ ]
61
+ },
62
+ "score": {
63
+ "type": "number"
64
+ },
65
+ "runtime_ms": {
66
+ "type": [
67
+ "number",
68
+ "null"
69
+ ]
70
+ },
71
+ "notes": {
72
+ "type": "string"
73
+ }
74
+ },
75
+ "additionalProperties": false
76
+ }
77
+ },
78
+ "additionalProperties": false
79
+ }
schema/oracle_seed.schema.json ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Dummy PIE C++ Oracle Seed Row",
4
+ "type": "object",
5
+ "required": [
6
+ "task_id",
7
+ "source",
8
+ "split",
9
+ "language",
10
+ "prompt_template_id",
11
+ "messages",
12
+ "prompt",
13
+ "source_code",
14
+ "visible_tests",
15
+ "public_checker",
16
+ "compile",
17
+ "run",
18
+ "constraints",
19
+ "metadata"
20
+ ],
21
+ "properties": {
22
+ "task_id": {
23
+ "type": "string"
24
+ },
25
+ "source": {
26
+ "type": "string"
27
+ },
28
+ "split": {
29
+ "type": "string",
30
+ "const": "oracle_seed"
31
+ },
32
+ "language": {
33
+ "type": "string",
34
+ "const": "cpp20"
35
+ },
36
+ "prompt_template_id": {
37
+ "type": "string"
38
+ },
39
+ "messages": {
40
+ "type": "array",
41
+ "minItems": 1,
42
+ "items": {
43
+ "type": "object",
44
+ "required": [
45
+ "role",
46
+ "content"
47
+ ],
48
+ "properties": {
49
+ "role": {
50
+ "type": "string",
51
+ "enum": [
52
+ "system",
53
+ "user"
54
+ ]
55
+ },
56
+ "content": {
57
+ "type": "string"
58
+ }
59
+ },
60
+ "additionalProperties": false
61
+ }
62
+ },
63
+ "prompt": {
64
+ "type": "string"
65
+ },
66
+ "source_code": {
67
+ "type": "string"
68
+ },
69
+ "visible_tests": {
70
+ "type": "array",
71
+ "minItems": 1,
72
+ "items": {
73
+ "type": "object",
74
+ "required": [
75
+ "name",
76
+ "stdin",
77
+ "stdout"
78
+ ],
79
+ "properties": {
80
+ "name": {
81
+ "type": "string"
82
+ },
83
+ "stdin": {
84
+ "type": "string"
85
+ },
86
+ "stdout": {
87
+ "type": "string"
88
+ }
89
+ },
90
+ "additionalProperties": false
91
+ }
92
+ },
93
+ "public_checker": {
94
+ "type": "object",
95
+ "required": [
96
+ "type",
97
+ "strip_trailing_whitespace"
98
+ ],
99
+ "properties": {
100
+ "type": {
101
+ "type": "string",
102
+ "const": "exact_stdout"
103
+ },
104
+ "strip_trailing_whitespace": {
105
+ "type": "boolean"
106
+ }
107
+ },
108
+ "additionalProperties": false
109
+ },
110
+ "compile": {
111
+ "type": "object",
112
+ "required": [
113
+ "command",
114
+ "timeout_sec"
115
+ ],
116
+ "properties": {
117
+ "command": {
118
+ "type": "string"
119
+ },
120
+ "timeout_sec": {
121
+ "type": "number"
122
+ }
123
+ },
124
+ "additionalProperties": false
125
+ },
126
+ "run": {
127
+ "type": "object",
128
+ "required": [
129
+ "timeout_sec",
130
+ "memory_mb"
131
+ ],
132
+ "properties": {
133
+ "timeout_sec": {
134
+ "type": "number"
135
+ },
136
+ "memory_mb": {
137
+ "type": "number"
138
+ }
139
+ },
140
+ "additionalProperties": false
141
+ },
142
+ "constraints": {
143
+ "type": "object",
144
+ "required": [
145
+ "assistant_format",
146
+ "must_preserve_io",
147
+ "must_compile",
148
+ "must_pass_visible_tests",
149
+ "target"
150
+ ],
151
+ "properties": {
152
+ "assistant_format": {
153
+ "type": "string",
154
+ "const": "one_reasoning_block_then_one_cpp_fence"
155
+ },
156
+ "must_preserve_io": {
157
+ "type": "boolean"
158
+ },
159
+ "must_compile": {
160
+ "type": "boolean"
161
+ },
162
+ "must_pass_visible_tests": {
163
+ "type": "boolean"
164
+ },
165
+ "target": {
166
+ "type": "string"
167
+ }
168
+ },
169
+ "additionalProperties": false
170
+ },
171
+ "metadata": {
172
+ "type": "object"
173
+ }
174
+ },
175
+ "additionalProperties": false
176
+ }