Commit ·
18e9a33
0
Parent(s):
Duplicate from Gugu8/Coding-Corpus-Bench
Browse files- .gitattributes +60 -0
- Coding-Corpus-Bench-dataset.jsonl +100 -0
- LICENSE +134 -0
- README.md +242 -0
.gitattributes
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.avro filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.mds filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
# Audio files - uncompressed
|
| 40 |
+
*.pcm filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
*.sam filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
*.raw filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
# Audio files - compressed
|
| 44 |
+
*.aac filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 49 |
+
# Image files - uncompressed
|
| 50 |
+
*.bmp filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
*.tiff filter=lfs diff=lfs merge=lfs -text
|
| 54 |
+
# Image files - compressed
|
| 55 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 58 |
+
# Video files - compressed
|
| 59 |
+
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
*.webm filter=lfs diff=lfs merge=lfs -text
|
Coding-Corpus-Bench-dataset.jsonl
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id_aa":"rust_001","title":"GAT higher-ranked implied static","category":"Rust","prompt":"Assume stable Rust 1.85.0, edition 2021. Does the following program compile? Give the decisive lifetime diagnosis, including what the higher-ranked bound implies for `data`.\n```rust\nuse std::fmt::Debug;\ntrait L { type Item<'a> where Self:'a; fn next<'a>(&'a mut self)->Option<Self::Item<'a>>; }\nstruct W<'x>{ s:&'x mut [i32] }\nimpl<'x> L for W<'x>{ type Item<'a>=&'a mut [i32] where Self:'a; fn next<'a>(&'a mut self)->Option<Self::Item<'a>>{None} }\nfn all<I:L>(mut x:I) where for<'a> I::Item<'a>:Debug { while let Some(v)=x.next(){println!(\"{v:?}\")} }\nfn main(){let mut data=[1,2]; all(W{s:&mut data});}\n```","system_prompt":"You are a Rust language-semantics expert. Answer only under the stated toolchain and explain the decisive rule.","rubric":"compilation_conclusion: Correct compilation result under Rust 1.85.0.\n 0 — Says the program compiles, or gives no definite conclusion.\n 1 — Says it fails to compile because the higher-ranked associated-type bound effectively requires the borrow backing `W` to be valid for `'static` under the current borrow checker's implied-`'static` limitation.\n\nlifetime_reasoning: Explains the quantification and its consequence.\n 0 — Attributes failure to `Debug`, the loop, or ordinary mutable aliasing without explaining the universal lifetime requirement.\n 1 — Explains that `for<'a> I::Item<'a>: Debug` must hold for every `'a`; with this GAT pattern the compiler infers an effectively `'static` requirement, but local `data` cannot be borrowed for `'static`.","expected_deliverables":"","reference_files":""}
|
| 2 |
+
{"id_aa":"rust_002","title":"Underscore pattern and drop timing","category":"Rust","prompt":"Assume stable Rust 1.85.0, edition 2021. What exact text is printed?\n```rust\nstruct P(&'static str);\nimpl Drop for P { fn drop(&mut self){ print!(\"{}\",self.0); } }\nfn main(){\n let x=P(\"x\");\n let y=P(\"y\");\n let _=x;\n print!(\"A\");\n drop(y);\n print!(\"B\");\n}\n```\nExplain whether `let _ = x` moves or drops `x`, and when each destructor runs.","system_prompt":"You are a Rust language-semantics expert. Give the exact output and decisive reasoning.","rubric":"exact_output: The exact character sequence.\n 0 — Gives any output other than `AyBx`.\n 1 — Gives exactly `AyBx`.\n\ndrop_semantics: Correctly accounts for the wildcard pattern and scopes.\n 0 — Claims `let _ = x` moves or immediately drops `x`, or otherwise gives destructor timing inconsistent with the output.\n 1 — States that a wildcard pattern does not bind or move `x`; `y` is explicitly dropped after `A`, then `B` prints, and `x` drops at the end of `main`.","expected_deliverables":"","reference_files":""}
|
| 3 |
+
{"id_aa":"rust_003","title":"Autoref method resolution to double reference","category":"Rust","prompt":"Assume stable Rust 1.85.0. Does this compile? If so, explain the receiver adjustment that makes the implementation applicable.\n```rust\ntrait T { fn f(self); }\nimpl T for &&i32 { fn f(self) {} }\nfn main(){ let x=0; (&x).f(); }\n```","system_prompt":"Apply Rust method-call receiver candidate construction precisely.","rubric":"resolution_result: Compilation result and selected implementation.\n 0 — Says no method applies to receiver `&i32`.\n 1 — States that the program compiles and selects the `T for &&i32` implementation.\n\ncandidate_reasoning: Required implicit receiver adjustment.\n 0 — Claims the compiler dereferences `&x` to `i32` and calls the same implementation without borrowing.\n 1 — Explains that method-call candidate construction includes an autoref of the receiver: the expression of type `&i32` can be borrowed as `&&i32`, matching the implementation's by-value `self` type.","expected_deliverables":"","reference_files":""}
|
| 4 |
+
{"id_aa":"rust_004","title":"Move closure capture and outer copy","category":"Rust","prompt":"Assume stable Rust 1.85.0. What exact text is printed, and why is the closure callable twice?\n```rust\nfn main(){\n let mut n=0;\n let mut c=move || { n+=1; print!(\"{n}\"); };\n c(); c();\n print!(\"-{n}\");\n}\n```","system_prompt":"Give exact output and closure-trait/capture reasoning.","rubric":"exact_output: Exact standard output.\n 0 — Gives anything other than `12-0`.\n 1 — Gives exactly `12-0`.\n\ncapture_and_trait: Explains the independent captured state.\n 0 — Claims the outer `n` becomes 2, or that the closure is `FnOnce` merely because it is `move`.\n 1 — Explains that `i32` is copied into the move closure, mutation makes the closure `FnMut`, and each call mutates the captured copy while outer `n` remains 0.","expected_deliverables":"","reference_files":""}
|
| 5 |
+
{"id_aa":"rust_005","title":"Two-phase borrow in method arguments","category":"Rust","prompt":"Assume stable Rust 1.85.0. Is this program accepted? Explain the interaction between two-phase borrowing and argument evaluation.\n```rust\nfn main(){\n let mut v=vec![10,20];\n v.push(v.len());\n println!(\"{v:?}\");\n}\n```","system_prompt":"Answer under stable Rust and distinguish reservation from activation.","rubric":"result: Compilation and output.\n 0 — Says borrow checking rejects it or gives output other than `[10, 20, 2]`.\n 1 — States that it compiles and prints `[10, 20, 2]`.\n\ntwo_phase_reasoning: Explains why the immutable length read is permitted.\n 0 — Says mutable and immutable borrows freely overlap in general or omits the ordering mechanism.\n 1 — Explains that the implicit mutable receiver borrow is reserved before argument evaluation and activated for the call only after `v.len()` has completed, so the shared borrow occurs during the reservation phase.","expected_deliverables":"","reference_files":""}
|
| 6 |
+
{"id_aa":"rust_006","title":"Overlapping conditional blanket impls","category":"Rust","prompt":"Assume stable Rust 1.85.0. Does this compile? Give the precise coherence reason.\n```rust\ntrait X {}\nimpl<T> X for T where T: Iterator {}\nimpl<T> X for T where T: IntoIterator {}\nfn main(){}\n```","system_prompt":"Analyze Rust coherence, including possible types rather than currently named standard types.","rubric":"coherence_result: Whether the impl set is accepted.\n 0 — Says it compiles because `Iterator` and `IntoIterator` are different traits.\n 1 — States that the two blanket implementations conflict and the crate is rejected.\n\noverlap_reasoning: Explains existential overlap.\n 0 — Bases the answer only on whether a particular current standard-library type implements both traits.\n 1 — Explains that some type may satisfy both bounds (and iterator types commonly can), making both impls applicable to the same `T`; where-clauses do not make these impls disjoint.","expected_deliverables":"","reference_files":""}
|
| 7 |
+
{"id_aa":"rust_007","title":"ManuallyDrop inside array","category":"Rust","prompt":"Assume stable Rust 1.85.0. What exact output is guaranteed?\n```rust\nuse std::mem::ManuallyDrop;\nstruct D(u8);\nimpl Drop for D { fn drop(&mut self){print!(\"{}\",self.0)} }\nfn main(){\n let mut a=[ManuallyDrop::new(D(1)),ManuallyDrop::new(D(2))];\n unsafe { ManuallyDrop::drop(&mut a[0]); }\n print!(\"X\");\n}\n```\nAccount for every destructor.","system_prompt":"Give exact output and distinguish dropping the wrapper from its payload.","rubric":"exact_output: Exact destructor and print sequence.\n 0 — Gives anything other than `1X`.\n 1 — Gives exactly `1X`.\n\ndestructor_accounting: Why the second payload is not dropped.\n 0 — Claims array scope exit automatically drops `D(2)` or double-drops `D(1)`.\n 1 — Explains that the explicit unsafe call drops only the first payload; `ManuallyDrop<T>` suppresses automatic destruction of both wrapped payloads at array scope exit, so `D(2)` leaks.","expected_deliverables":"","reference_files":""}
|
| 8 |
+
{"id_aa":"rust_008","title":"Invalid bool representation","category":"Rust","prompt":"Assume stable Rust 1.85.0. Is the marked unsafe read defined under Rust's validity requirements?\n```rust\nfn main(){\n let b: bool = unsafe { std::mem::transmute::<u8,bool>(2) };\n println!(\"{b}\"); // marked use\n}\n```\nDo not predict a particular optimized output; classify the program and identify the violated invariant.","system_prompt":"Classify unsafe-code validity precisely; do not treat observed output as specification.","rubric":"validity_classification: Correct semantic classification.\n 0 — Calls it defined, implementation-defined, or merely unspecified.\n 1 — Classifies constructing/using the invalid `bool` value as undefined behavior; no output is guaranteed.\n\ninvariant: Names the invalid representation.\n 0 — Claims every nonzero byte is a valid Rust `bool` representation.\n 1 — States that a valid Rust `bool` must have a valid bit pattern corresponding to false or true (0 or 1); byte value 2 violates the type's validity invariant.","expected_deliverables":"","reference_files":""}
|
| 9 |
+
{"id_aa":"rust_009","title":"Supertrait method disambiguation","category":"Rust","prompt":"Assume stable Rust 1.85.0. What exact output does this produce?\n```rust\ntrait A { fn f(&self){print!(\"A\")} }\ntrait B: A { fn f(&self){print!(\"B\")} }\nstruct S;\nimpl A for S {}\nimpl B for S {}\nfn main(){\n let x:&dyn B=&S;\n B::f(x);\n A::f(x);\n}\n```","system_prompt":"Apply trait-object coercion and fully qualified trait calls.","rubric":"exact_output: Exact text or compilation diagnosis.\n 0 — Says it fails or gives output other than `BA`.\n 1 — States that it compiles and prints exactly `BA`.\n\ndispatch_reasoning: Explains the two explicitly selected defaults.\n 0 — Treats the same-named supertrait method as an override or says `B::f` dynamically replaces `A::f`.\n 1 — Explains that the fully qualified calls select distinct trait methods: `B::f` prints `B`; `&dyn B` supports its `A` supertrait method and `A::f` prints `A`.","expected_deliverables":"","reference_files":""}
|
| 10 |
+
{"id_aa":"rust_010","title":"Sized generic method on trait object","category":"Rust","prompt":"Assume stable Rust 1.85.0. Does this compile? Explain object safety/dyn compatibility at the coercion.\n```rust\ntrait Q {\n fn make<T>(&self, x:T) where Self:Sized;\n fn n(&self)->i32 {3}\n}\nstruct S;\nimpl Q for S { fn make<T>(&self,_:T){} }\nfn main(){ let q:&dyn Q=&S; println!(\"{}\",q.n()); }\n```","system_prompt":"Analyze dyn compatibility method by method.","rubric":"compilation_and_output: Correct result.\n 0 — Says the generic method makes the trait non-dyn-compatible, or gives output other than `3`.\n 1 — States that it compiles and prints `3`.\n\ndyn_reasoning: Effect of the `Self: Sized` restriction.\n 0 — Claims generic methods are always callable through trait objects.\n 1 — Explains that the generic `make` is excluded from the trait object's callable interface by `where Self: Sized`, so it does not prevent `Q` from being used as `dyn Q`; `n` remains callable.","expected_deliverables":"","reference_files":""}
|
| 11 |
+
{"id_aa":"go_001","title":"Select operand evaluation","category":"Go","prompt":"Assume Go 1.23. What exact text is printed? Explain expression evaluation on entry to `select` and why the selected case wins.\n```go\npackage main\nimport \"fmt\"\nfunc ch(s string,c chan int) chan int { fmt.Print(s); return c }\nfunc val(s string) int { fmt.Print(s); return 7 }\nfunc main(){\n var nilc chan int; c:=make(chan int); close(c)\n select{\n case ch(\"A\",nilc)<-val(\"a\"): fmt.Print(\"X\")\n case v:=<-ch(\"B\",c): fmt.Print(\"Y\",v)\n default: fmt.Print(\"D\")\n }\n}\n```","system_prompt":"Apply the Go 1.23 specification and give exact output.","rubric":"exact_output: Exact emitted text.\n 0 — Gives anything other than `AaBY0`.\n 1 — Gives exactly `AaBY0`.\n\nselect_reasoning: Evaluation and selection rules.\n 0 — Says only the chosen case operands are evaluated, or that default runs.\n 1 — Explains that channel operands and send RHS expressions for all cases are evaluated once in source order (`A`, `a`, `B`); the nil-channel send cannot proceed, receiving from the closed channel can proceed immediately and yields zero, so that case prints `Y0`.","expected_deliverables":"","reference_files":""}
|
| 12 |
+
{"id_aa":"go_002","title":"Typed nil inside interface","category":"Go","prompt":"Assume Go 1.23. Does this program panic, and what exact line is printed before termination?\n```go\npackage main\nimport \"fmt\"\ntype E struct{}\nfunc (*E) Error() string { return \"e\" }\nfunc f() error { var p *E=nil; return p }\nfunc main(){ e:=f(); fmt.Printf(\"%t %T\\n\",e==nil,e); fmt.Println(e.Error()) }\n```","system_prompt":"Distinguish a nil interface from an interface containing a typed nil pointer.","rubric":"observable_result: Printed line and panic status.\n 0 — Says `e == nil`, gives a different first line, or says no panic occurs.\n 1 — States the first line is `false *main.E`, then the call panics due to dereferencing the nil `*E` receiver while evaluating `return \"e\"`? \n 2 — States the first line is `false *main.E` and, crucially, that no panic occurs: `Error` does not dereference its nil receiver and prints `e` on the next line.\n\ninterface_reasoning: Dynamic type/value explanation.\n 0 — Treats the interface as nil because its dynamic pointer value is nil.\n 1 — Explains that the interface has dynamic type `*main.E` and dynamic value nil, so the interface itself is non-nil; invoking a method with a nil pointer receiver is allowed unless its body dereferences the receiver.","expected_deliverables":"","reference_files":""}
|
| 13 |
+
{"id_aa":"go_003","title":"Range slice header snapshot","category":"Go","prompt":"Assume Go 1.23. What exact text is printed?\n```go\npackage main\nimport \"fmt\"\nfunc main(){\n s:=[]int{1,2,3}\n for i,v:=range s {\n fmt.Print(i,v,\";\")\n if i==0 { s=append(s,4,5); s[1]=9 }\n }\n fmt.Print(\"|\",s)\n}\n```\nExplain which length and backing values the range loop observes.","system_prompt":"Give exact output under the language specification.","rubric":"exact_output: Exact output including separators.\n 0 — Gives anything other than `01;12;23;|[1 9 3 4 5]`.\n 1 — Gives exactly `01;12;23;|[1 9 3 4 5]`.\n\nrange_reasoning: Why the mutation is not seen by loop values.\n 0 — Claims the loop grows to five iterations or must print 9 for index 1.\n 1 — Explains that the range expression's slice header/length is fixed before iteration; the append reallocates because the original literal has capacity 3, so the loop continues over the old three-element backing array while `s` names the new array.","expected_deliverables":"","reference_files":""}
|
| 14 |
+
{"id_aa":"go_004","title":"Generic operator over type set","category":"Go","prompt":"Assume Go 1.23. Does this generic function compile? Give the precise reason.\n```go\npackage p\ntype N interface{ ~int | ~string }\nfunc F[T N](a,b T) T { return a+b }\n```","system_prompt":"Apply operator validity across every type in the constraint's type set.","rubric":"compilation: Whether `+` is permitted for all types in the type set.\n 0 — Says it is rejected because int addition and string concatenation are different operations.\n 1 — States that it compiles.\n\ntype_set_reasoning: Common operation and result type.\n 0 — Claims a type switch or conversion is required.\n 1 — Explains that every type in the set supports binary `+` on two operands of that same type and produces that type; the operation need not have identical machine semantics across all members.","expected_deliverables":"","reference_files":""}
|
| 15 |
+
{"id_aa":"go_005","title":"Named result, return, and defer arguments","category":"Go","prompt":"Assume Go 1.23. What exact text is printed?\n```go\npackage main\nimport \"fmt\"\nfunc f() (r int) {\n defer func(x int){ fmt.Print(x,r); r++ }(r)\n r=5\n return 7\n}\nfunc main(){fmt.Print(\"|\",f())}\n```","system_prompt":"Track defer argument evaluation and named-result assignment exactly.","rubric":"exact_output: Exact output order.\n 0 — Gives anything other than `07|8`.\n 1 — Gives exactly `07|8`.\n\ndefer_reasoning: Distinguishes argument capture from closure access.\n 0 — Says deferred argument `x` is evaluated at function return or misses the final increment.\n 1 — Explains that `x` captures initial `r=0` when defer is registered; the return expression assigns 7 to named `r`; defer prints `0` and `7`, increments `r` to 8, and only then does `main` print `|8`.","expected_deliverables":"","reference_files":""}
|
| 16 |
+
{"id_aa":"go_006","title":"Close-receive happens-before","category":"Go","prompt":"Assume Go 1.23. Is the final value of `x` guaranteed to be 1, guaranteed to be 2, or not constrained to either? Explain using channel close synchronization.\n```go\npackage main\nvar x int\nfunc main(){\n c:=make(chan struct{})\n go func(){ x=1; close(c) }()\n <-c\n x=2\n println(x)\n}\n```","system_prompt":"Use the Go memory model, not scheduling intuition.","rubric":"value: Guaranteed printed integer.\n 0 — Says 1, unconstrained, or race-dependent.\n 1 — States it is guaranteed to print 2.\n\nmemory_order: Happens-before chain and race status.\n 0 — Claims the read/write of `x` race or that close provides no synchronization.\n 1 — Explains that closing `c` is synchronized before the receive that observes closure; therefore the goroutine's `x=1` happens before the receive, and the sequenced later `x=2` happens before `println`, with no conflicting unordered access.","expected_deliverables":"","reference_files":""}
|
| 17 |
+
{"id_aa":"go_007","title":"Map elements and method sets","category":"Go","prompt":"Assume Go 1.23. What exact text is printed?\n```go\npackage main\nimport \"fmt\"\ntype I interface{ M() }\ntype S struct{ n int }\nfunc (s S) M(){fmt.Print(\"V\",s.n)}\nfunc (s *S) P(){fmt.Print(\"P\",s.n)}\nfunc main(){\n m:=map[int]S{0:{3}}\n m[0].M()\n var i I=m[0]; i.M()\n}\n```","system_prompt":"Analyze addressability and value-receiver method sets.","rubric":"result: Compilation and output.\n 0 — Says map elements cannot be used for any method call, or gives output other than `V3V3`.\n 1 — States that it compiles and prints `V3V3`.\n\nmethod_set_reasoning: Why `M` works despite non-addressability.\n 0 — Relies on implicit addressing of `m[0]`.\n 1 — Explains that `S` itself has the value-receiver method `M`, so neither call needs the non-addressable map element to be implicitly addressed; `S` also implements `I`. A call to pointer-receiver `P` on `m[0]` would fail.","expected_deliverables":"","reference_files":""}
|
| 18 |
+
{"id_aa":"go_008","title":"Buffered send synchronization","category":"Go","prompt":"Assume Go 1.23 and that `GOMAXPROCS` may be any positive value. Is this program data-race-free? Is it guaranteed to print `1`?\n```go\npackage main\nvar x int\nfunc main(){\n done:=make(chan bool,1)\n go func(){ x=1; done<-true }()\n <-done\n println(x)\n}\n```","system_prompt":"Use the formal channel synchronization rule.","rubric":"conclusion: Race freedom and value.\n 0 — Calls it racy or says the print may be 0.\n 1 — States that it is data-race-free and guaranteed to print 1.\n\nhappens_before: Correct synchronization edge for the buffered channel.\n 0 — Claims buffered sends never synchronize until the buffer is reused.\n 1 — Explains that a send on a channel is synchronized before completion of the corresponding receive, even when buffered; program order places `x=1` before the send and the read after the receive.","expected_deliverables":"","reference_files":""}
|
| 19 |
+
{"id_aa":"go_009","title":"Overlapping append within slice","category":"Go","prompt":"Assume Go 1.23. What exact text is printed?\n```go\npackage main\nimport \"fmt\"\nfunc main(){\n a:=[]int{1,2,3}\n b:=append(a[:1],a[2:]...)\n fmt.Print(a,\"|\",b)\n}\n```\nAccount for overlapping source and destination and the shared backing array.","system_prompt":"Apply append's overlap behavior and capacity rules.","rubric":"exact_output: Exact slice values.\n 0 — Gives anything other than `[1 3 3]|[1 3]`.\n 1 — Gives exactly `[1 3 3]|[1 3]`.\n\nbacking_array_reasoning: Why mutation occurs in place.\n 0 — Claims overlap is undefined or that allocation is required.\n 1 — Explains that `a[:1]` has sufficient capacity, append may reuse the same backing array, and appending the overlapping `a[2:]` is defined like copying; element 3 is written into index 1, leaving index 2 unchanged.","expected_deliverables":"","reference_files":""}
|
| 20 |
+
{"id_aa":"go_010","title":"Constraint-only comparable interface","category":"Go","prompt":"Assume Go 1.23. Does this declaration compile? Explain why `comparable` does or does not satisfy the ordinary interface use.\n```go\npackage p\nvar x interface{ comparable }\n```","system_prompt":"Distinguish basic interfaces from constraint-only non-basic interfaces.","rubric":"compilation: Use outside a type constraint.\n 0 — Says it declares an interface value accepting all comparable dynamic values.\n 1 — States that it does not compile because `interface{ comparable }` may only be used as a type constraint, not as the type of an ordinary variable.\n\ninterface_reasoning: Nature of the interface.\n 0 — Confuses the predeclared constraint with the empty interface or runtime comparability checks.\n 1 — Explains that embedding `comparable` creates a non-basic interface representing a type set for constraints; it is not an ordinary runtime interface type.","expected_deliverables":"","reference_files":""}
|
| 21 |
+
{"id_aa":"c_001","title":"C17 release sequence through relaxed RMW","category":"C","prompt":"Assume ISO C17. `data` and `flag` are initialized to zero before three threads begin. B's successful compare-exchange reads A's `1`, and C's terminating acquire load reads B's `2`.\n```c\n#include <stdatomic.h>\natomic_int data,flag;\nvoid A(void){atomic_store_explicit(&data,1,memory_order_relaxed);atomic_store_explicit(&flag,1,memory_order_release);}\nvoid B(void){int e=1;while(!atomic_compare_exchange_weak_explicit(&flag,&e,2,memory_order_relaxed,memory_order_relaxed))e=1;}\nint C(void){while(atomic_load_explicit(&flag,memory_order_acquire)!=2){} return atomic_load_explicit(&data,memory_order_relaxed);}\n```\nMay C return 0? Then answer again if B's successful RMW is replaced by a relaxed store of 2 that C reads. Distinguish forbidden from not guaranteed.","system_prompt":"Give a formal C17 memory-model argument.","rubric":"two_conclusions: Correct result for RMW and store variants.\n 0 — Gets both variants wrong or gives no distinction.\n 1 — Correctly says the RMW variant forbids 0, but does not correctly classify the store variant.\n 2 — Says the RMW variant cannot return 0; with B's relaxed store, 1 is not guaranteed and C may return 0.\n\nmemory_model_proof: Release-sequence and synchronization reasoning.\n 0 — Claims a relaxed operation itself is acquire/release or relies only on coherence.\n 1 — Explains that B's RMW is in the release sequence headed by A's release store, so C's acquire reading 2 synchronizes with A and sees prior `data=1`; a later relaxed plain store by another thread is not in that release sequence, so no such happens-before edge exists.","expected_deliverables":"","reference_files":""}
|
| 22 |
+
{"id_aa":"c_002","title":"Object representation copied twice","category":"C","prompt":"Assume ISO C17 and a conforming hosted implementation where `unsigned char` has no padding bits. Is this function defined for every `float x`? If defined, what semantic property does it test?\n```c\n#include <string.h>\nint f(float x){ unsigned char a[sizeof x],b[sizeof x]; memcpy(a,&x,sizeof x); memcpy(b,&x,sizeof x); return memcmp(a,b,sizeof x)==0; }\n```","system_prompt":"Separate value semantics, padding, and indeterminate representations.","rubric":"classification: Whether the operations are defined.\n 0 — Calls it undefined merely because `float` may contain padding or NaNs.\n 1 — States it is defined and always returns 1 for the two copies taken from the same unchanged object.\n\nrepresentation_reasoning: What `memcpy` and `memcmp` compare.\n 0 — Claims it compares floating-point numerical equality.\n 1 — Explains that character arrays may inspect object representations; both arrays receive the same bytes, including any padding representation copied from the same object, so bytewise comparison is equal. It is not a general numerical-equality test between two floats.","expected_deliverables":"","reference_files":""}
|
| 23 |
+
{"id_aa":"c_003","title":"Effective type versus common initial sequence","category":"C","prompt":"Assume ISO C17. Classify the marked access.\n```c\n#include <stdlib.h>\nstruct A{int x;}; struct B{int x;};\nint main(void){\n void *p=malloc(sizeof(struct A));\n ((struct A*)p)->x=42;\n int y=((struct B*)p)->x; /* marked */\n free(p); return y;\n}\n```\nIs common initial sequence relevant?","system_prompt":"Apply C17 effective-type and union common-initial-sequence rules.","rubric":"classification: Definedness of the lvalue access.\n 0 — Calls the read defined because both structs begin with `int x`.\n 1 — Classifies the read through `struct B *` as undefined behavior.\n\nalias_reasoning: Effective type and inapplicable exception.\n 0 — Invokes the common-initial-sequence permission outside a union.\n 1 — Explains that the store through `struct A *` gives allocated storage effective type `struct A`; accessing it as incompatible `struct B` violates the effective-type aliasing rule, and the common-initial-sequence rule applies to union members, not arbitrary separately declared structs.","expected_deliverables":"","reference_files":""}
|
| 24 |
+
{"id_aa":"c_004","title":"Unsequenced scalar modifications","category":"C","prompt":"Assume ISO C17. Is the result of `f(5)` defined, unspecified, implementation-defined, or undefined?\n```c\nint f(int i){ return i++ + i++; }\n``` \nDo not give a numeric result unless the standard guarantees one.","system_prompt":"Use C17 sequencing terminology precisely.","rubric":"classification: Correct standard category.\n 0 — Calls the result 11, 12, unspecified, or implementation-defined.\n 1 — Classifies the expression as undefined behavior.\n\nsequencing_reason: The conflicting evaluations.\n 0 — Attributes it merely to unspecified operand evaluation order.\n 1 — States that the two side effects modifying `i` are unsequenced relative to each other within the full expression; unsequenced modifications of the same scalar object cause undefined behavior.","expected_deliverables":"","reference_files":""}
|
| 25 |
+
{"id_aa":"c_005","title":"Unsequenced pointer increments","category":"C","prompt":"Assume ISO C17. What does `g()` return?\n```c\nint g(void){\n int a[3]={10,20,30};\n int *p=&a[0];\n return *p++ + *p++;\n}\n```\nClassify the expression before attempting arithmetic.","system_prompt":"Do not infer an execution order where the standard supplies none.","rubric":"classification: Whether a return value is defined.\n 0 — Gives 30, 40, or any fixed value.\n 1 — States that behavior is undefined, so no return value is guaranteed.\n\nreason: Why distinct pointees do not save it.\n 0 — Says it is safe because the dereferences can refer to different array elements.\n 1 — Explains that both operands unsequencedly modify the same scalar object `p`; the rule concerns `p`, regardless of which array elements the dereferences might reach.","expected_deliverables":"","reference_files":""}
|
| 26 |
+
{"id_aa":"c_006","title":"Byte buffer cast to uint32_t","category":"C","prompt":"Assume ISO C17, `CHAR_BIT==8`, and `uint32_t` exists. Is `h` strictly defined on every implementation satisfying those assumptions?\n```c\n#include <stdint.h>\nuint32_t h(unsigned char *p){ return *(uint32_t*)p; }\n```\nThe caller guarantees only that `p` points to the first element of an array of four `unsigned char` objects containing initialized bytes.","system_prompt":"Account separately for alignment and effective type.","rubric":"classification: Portability and UB.\n 0 — Calls it strictly defined because character arrays may alias any type.\n 1 — States it is not strictly defined and may have undefined behavior.\n\ntwo_hazards: Required independent reasons.\n 0 — Mentions only endianness or value differences.\n 1 — Identifies at least one of insufficient alignment or accessing `unsigned char` array objects through an incompatible `uint32_t` lvalue.\n 2 — Identifies both potential misalignment and effective-type/incompatible-lvalue access; endianness would affect value only after those validity issues were avoided.","expected_deliverables":"","reference_files":""}
|
| 27 |
+
{"id_aa":"c_007","title":"String literal exactly fills character array","category":"C","prompt":"Assume ISO C17. Is this initializer a constraint violation, and if accepted what is `sizeof s`?\n```c\nchar s[3] = \"abc\";\n```","system_prompt":"Distinguish ordinary string storage from the character-array initialization exception.","rubric":"answer: Validity and size.\n 0 — Says it is invalid because no null terminator fits, or gives a size other than 3.\n 1 — States it is valid and `sizeof s` is 3.\n\ninitialization_rule: Terminator omission exception.\n 0 — Claims the array nevertheless contains four bytes or an implicit terminator out of bounds.\n 1 — Explains that when an array of character type is initialized by a string literal, successive characters including the terminating null initialize the array only if there is room or the array size is unknown; here the three non-null characters fit and the terminator is omitted.","expected_deliverables":"","reference_files":""}
|
| 28 |
+
{"id_aa":"c_008","title":"One-past pointer equality across objects","category":"C","prompt":"Assume ISO C17. Is `p == q` guaranteed true, guaranteed false, or unspecified after these declarations?\n```c\nint a[1], b[1];\nint *p = a + 1;\nint *q = b;\n```\nAssume the implementation may place the arrays adjacently.","system_prompt":"Apply pointer equality rules, not relational comparison rules.","rubric":"classification: Allowed equality result.\n 0 — Says it is guaranteed false solely because the pointers derive from different arrays, or guaranteed true.\n 1 — States that the comparison can be true if the one-past address of `a` equals the address of `b`, and otherwise false; placement is implementation-dependent, so the given facts do not guarantee either result.\n\nequality_reasoning: Distinguishes pointer equality from provenance folklore.\n 0 — Calls the comparison itself undefined.\n 1 — Explains that equality comparison of these pointers is defined; a pointer one past one array may compare equal to a pointer to a different object located immediately after it.","expected_deliverables":"","reference_files":""}
|
| 29 |
+
{"id_aa":"c_009","title":"Dereferencing malloc zero result","category":"C","prompt":"Assume ISO C17. Does this function have defined behavior for `n==0`?\n```c\n#include <stdlib.h>\nvoid f(size_t n){ int *p=malloc(n*sizeof *p); if(!p) return; p[0]=1; free(p); }\n```\nAccount for every permitted result of `malloc(0)`.","system_prompt":"Quantify over all conforming `malloc(0)` behaviors.","rubric":"classification: Definedness at zero size.\n 0 — Calls it always safe because the null check succeeds or returns.\n 1 — States that it is not guaranteed defined: `malloc(0)` may return a non-null pointer that cannot be used to access an object, and `p[0]=1` then has undefined behavior.\n\nmalloc_zero_cases: Both allowed outcomes.\n 0 — Claims `malloc(0)` must return null.\n 1 — Explains that `malloc(0)` may return null, in which case the function returns, or a unique/non-null pointer value that may be passed to `free` but does not provide storage for an `int`; the null test does not establish dereferenceability.","expected_deliverables":"","reference_files":""}
|
| 30 |
+
{"id_aa":"c_010","title":"Flexible array member sizeof","category":"C","prompt":"Assume ISO C17 and `sizeof(int)==4`. What is the value of `sizeof(struct S)`?\n```c\nstruct S { char c; int a[]; };\n```\nIs 8 the only conforming answer? Explain the flexible-array sizing rule and trailing padding.","system_prompt":"Do not assume a particular ABI beyond the stated integer size.","rubric":"portability_conclusion: Whether one numeric size follows.\n 0 — States that the standard guarantees 8.\n 1 — States that the standard does not determine a unique numeric size from `sizeof(int)==4`; 8 is possible but not the only conforming answer.\n\nlayout_reasoning: Rule for flexible member omission and padding.\n 0 — Counts one actual `int` element in the flexible member.\n 1 — Explains that the flexible array member contributes no elements to `sizeof`; the structure may have padding and its size is as if the flexible member were omitted except for permitted trailing padding/alignment effects, which the standard does not fix from `sizeof(int)` alone.","expected_deliverables":"","reference_files":""}
|
| 31 |
+
{"id_aa":"cpp_001","title":"Replacing a base subobject in place","category":"C++","prompt":"Assume ISO C++20. Is the marked call defined?\n```cpp\n#include <new>\nstruct B{virtual ~B()=default;virtual int f()const{return 1;}};\nstruct D:B{int f()const override{return 2;}};\nvoid replace(B* p){p->~B();::new((void*)p) B; int n=p->f(); /* marked */}\nint main(){alignas(D) unsigned char s[sizeof(D)];D*d=::new((void*)s)D;replace(d);}\n```\nAccount for transparent replaceability and give the smallest placement-new change that makes the call valid without `std::launder`.","system_prompt":"Apply ISO C++20 lifetime and transparent-replaceability rules.","rubric":"classification: Definedness of the marked use.\n 0 — Calls the use defined because the address is unchanged.\n 1 — States that using `p` directly for the call is not valid via transparent replacement when the old object was a base-class subobject.\n\nminimal_fix: Correct local placement-new target.\n 0 — Suggests only casting differently or reconstructing `B` again.\n 1 — Changes the placement new to construct `D` (for example `::new ((void*)p) D`), so the old complete `D` is transparently replaced and the existing pointer can denote the new corresponding object without laundering.","expected_deliverables":"","reference_files":""}
|
| 32 |
+
{"id_aa":"cpp_002","title":"List initialization constructor priority","category":"C++","prompt":"Assume ISO C++20. What exact text is printed?\n```cpp\n#include <iostream>\nstruct X{X(){std::cout<<\"D\";} X(int){std::cout<<\"I\";} X(std::initializer_list<int>){std::cout<<\"L\";}};\nint main(){X a; X b{}; X c{1}; X d(1);}\n```","system_prompt":"Give exact output using C++20 initialization rules.","rubric":"exact_output: Constructor sequence.\n 0 — Gives anything other than `DDLI`.\n 1 — Gives exactly `DDLI`.\n\ninitialization_reasoning: Constructor selected for each declaration.\n 0 — Claims empty braces prefer the initializer-list constructor.\n 1 — Explains that default- and empty-list-initialization select the default constructor here; nonempty list-initialization gives initializer-list constructors first priority; parentheses with `1` select `X(int)`.","expected_deliverables":"","reference_files":""}
|
| 33 |
+
{"id_aa":"cpp_003","title":"Auto forwarding-reference deduction","category":"C++","prompt":"Assume ISO C++20. Does this declaration compile, and what type is deduced for `x`?\n```cpp\nconst int a=1;\nauto&& x=a;\n```","system_prompt":"State the exact deduced declared type including cv/ref qualifiers.","rubric":"deduced_type: Exact type.\n 0 — Gives `int&&`, `const int&&`, or `int&`.\n 1 — States that it compiles and `x` has type `const int&`.\n\ndeduction_reason: Reference collapsing and lvalue deduction.\n 0 — Treats `auto&&` as always an rvalue reference.\n 1 — Explains that because the initializer is an lvalue, `auto` deduces as `const int&`; reference collapsing turns `const int& &&` into `const int&`.","expected_deliverables":"","reference_files":""}
|
| 34 |
+
{"id_aa":"cpp_004","title":"Discarded constexpr-if statement","category":"C++","prompt":"Assume ISO C++20. Is the program well-formed?\n```cpp\ntemplate<class T> void f(T){static_assert(sizeof(T)==0);}\nint main(){ if constexpr(false) f(0); }\n```\nExplain whether the function template specialization is instantiated.","system_prompt":"Apply template instantiation rules to a non-template enclosing function.","rubric":"well_formedness: Compilation result.\n 0 — Says `f<int>` is instantiated and the assertion fails.\n 1 — States that the program is well-formed.\n\ninstantiation_reasoning: Effect of the discarded statement.\n 0 — Claims discarded statements are not parsed or need not be syntactically valid.\n 1 — Explains that the false `if constexpr` substatement is discarded and the call does not cause `f<int>` to be instantiated; the dependent `static_assert` therefore is not evaluated. The discarded code must still satisfy applicable parsing/non-dependent checks.","expected_deliverables":"","reference_files":""}
|
| 35 |
+
{"id_aa":"cpp_005","title":"Virtual dispatch with static default argument","category":"C++","prompt":"Assume ISO C++20. What exact text is printed?\n```cpp\n#include <iostream>\nstruct A{virtual void f(int x=1){std::cout<<\"A\"<<x;}};\nstruct B:A{void f(int x=2)override{std::cout<<\"B\"<<x;}};\nint main(){B b; A* p=&b; p->f();}\n```","system_prompt":"Separate virtual function selection from default-argument binding.","rubric":"exact_output: Exact output.\n 0 — Gives anything other than `B1`.\n 1 — Gives exactly `B1`.\n\ndispatch_reason: Two different static/dynamic decisions.\n 0 — Uses B's default 2 because B's override runs.\n 1 — Explains that virtual dispatch selects `B::f`, while default arguments are bound from the static type of the call expression (`A*`), supplying 1.","expected_deliverables":"","reference_files":""}
|
| 36 |
+
{"id_aa":"cpp_006","title":"Exception unwinding destructor order","category":"C++","prompt":"Assume ISO C++20. What exact text is printed?\n```cpp\n#include <iostream>\nstruct X{~X(){std::cout<<\"X\";}};\nint main(){try{X x; throw 1;}catch(int){std::cout<<\"C\";}std::cout<<\"E\";}\n```","system_prompt":"Give exact observable order.","rubric":"exact_output: Destructor, handler, continuation sequence.\n 0 — Gives anything other than `XCE`.\n 1 — Gives exactly `XCE`.\n\nunwinding_reason: Why destruction precedes handler body.\n 0 — Places destruction after the catch or at end of main.\n 1 — Explains that stack unwinding destroys automatic `x` before control enters the matching handler; the catch prints `C`, then execution continues after the handler and prints `E`.","expected_deliverables":"","reference_files":""}
|
| 37 |
+
{"id_aa":"cpp_007","title":"Transparent replacement with const member","category":"C++","prompt":"Assume ISO C++20. Is `p` usable after the placement new without laundering?\n```cpp\n#include <new>\nstruct X{const int n;};\nint main(){X x{1}; X* p=&x; x.~X(); ::new((void*)&x) X{2}; return p->n;}\n```\nIf not, state the required expression and resulting return value.","system_prompt":"Apply C++20 transparent replacement; do not apply obsolete pre-C++20 folklore.","rubric":"answer: Pointer usability and returned value.\n 0 — Says `std::launder(p)` is required solely because `X` has a const data member.\n 1 — States that in C++20 the complete object is transparently replaced, `p` automatically denotes the new `X`, and the program returns 2 without laundering.\n\nlifetime_reason: Applicability of transparent replacement.\n 0 — Claims const subobjects categorically prevent transparent replacement in C++20.\n 1 — Explains that old and new objects are complete objects of the same type, overlay exactly, and satisfy C++20's transparent-replaceability conditions; the const member does not itself defeat replacement.","expected_deliverables":"","reference_files":""}
|
| 38 |
+
{"id_aa":"cpp_008","title":"Inactive union member read","category":"C++","prompt":"Assume ISO C++20. Is the read defined?\n```cpp\nunion U{int i; float f;};\nint main(){U u;u.i=0;return u.f==0.0f;}\n```","system_prompt":"Classify under ISO C++20, independent of compiler extensions.","rubric":"classification: Definedness of reading `u.f`.\n 0 — Calls it a defined bit reinterpretation yielding floating zero.\n 1 — States that reading the inactive `float` member is undefined behavior under ISO C++20.\n\nunion_reason: Active member and exceptions.\n 0 — Invokes C-style type punning as a general C++ permission.\n 1 — Explains that assignment makes `i` active; `f` is inactive, and no common-initial-sequence exception applies to scalar members. Compiler extensions do not change the ISO answer.","expected_deliverables":"","reference_files":""}
|
| 39 |
+
{"id_aa":"cpp_009","title":"Named forwarding reference value category","category":"C++","prompt":"Assume ISO C++20. Which overload is called?\n```cpp\n#include <iostream>\nvoid f(int&){std::cout<<\"L\";} void f(const int&){std::cout<<\"C\";} void f(int&&){std::cout<<\"R\";}\ntemplate<class T> void g(T&& x){f(x);f(static_cast<T&&>(x));}\nint main(){g(1);}\n```","system_prompt":"Give exact output and deduction/value-category reasoning.","rubric":"exact_output: Overload sequence.\n 0 — Gives anything other than `LR`.\n 1 — Gives exactly `LR`.\n\nforwarding_reason: Named variable and cast categories.\n 0 — Treats named `x` as an xvalue merely because its type is `int&&`.\n 1 — Explains that `T` is `int`; named expression `x` is an lvalue and calls `f(int&)`, while `static_cast<T&&>(x)` is an xvalue and calls `f(int&&)`.","expected_deliverables":"","reference_files":""}
|
| 40 |
+
{"id_aa":"cpp_010","title":"Explicit constructor in braced argument","category":"C++","prompt":"Assume ISO C++20. Does this compile?\n```cpp\nstruct X{explicit X(int){}};\nvoid f(X){}\nint main(){f({1});}\n```\nDistinguish direct-list-initialization from copy-list-initialization of a parameter.","system_prompt":"Apply copy-list-initialization rules precisely.","rubric":"compilation: Whether the call is well-formed.\n 0 — Says braces directly initialize `X` and therefore allow the explicit constructor.\n 1 — States that the call is ill-formed.\n\ninitialization_reason: Why explicit is disallowed.\n 0 — Attributes rejection to narrowing or missing conversion.\n 1 — Explains that the braced argument copy-list-initializes the `X` parameter; if overload resolution selects an explicit constructor in copy-list-initialization, the initialization is ill-formed.","expected_deliverables":"","reference_files":""}
|
| 41 |
+
{"id_aa":"zig_001","title":"Slice aliases array storage","category":"Zig","prompt":"Assume Zig 0.13.0 in Debug mode. What exact text is printed?\n```zig\nconst std=@import(\"std\");\npub fn main() !void {\n var a:[3]u8=.{1,2,3};\n const s=a[0..];\n a[1]=9;\n std.debug.print(\"{d}-{d}\\n\",.{s[1],s.len});\n}\n```","system_prompt":"Answer for Zig 0.13.0 exactly.","rubric":"exact_output: Exact printed line.\n 0 — Gives anything other than `9-3`.\n 1 — Gives exactly `9-3`.\n\nalias_reason: Slice representation and mutation.\n 0 — Claims slicing copies the array.\n 1 — Explains that `s` is a slice referencing `a`'s storage with length 3, so the later write to `a[1]` is observed through `s[1]`.","expected_deliverables":"","reference_files":""}
|
| 42 |
+
{"id_aa":"zig_002","title":"Runtime value passed to comptime parameter","category":"Zig","prompt":"Assume Zig 0.13.0. Does this compile?\n```zig\nconst std=@import(\"std\");\nfn f(comptime n:usize) usize { return n+1; }\npub fn main() void { var x:usize=3; std.debug.print(\"{}\",.{f(x)}); }\n```\nExplain the stage mismatch, if any.","system_prompt":"Distinguish compile-time-known from runtime values in Zig 0.13.0.","rubric":"compilation: Whether the call is legal.\n 0 — Says the compiler evaluates `f` at runtime.\n 1 — States that it fails to compile because `x` is runtime-known and cannot satisfy a `comptime` parameter.\n\nstage_reason: What `comptime` requires.\n 0 — Claims `var` values are always compile-time-known when initialized by literals.\n 1 — Explains that a `comptime` parameter requires its argument value at compile time; declaring mutable runtime storage prevents using `x` as such an argument, despite literal initialization.","expected_deliverables":"","reference_files":""}
|
| 43 |
+
{"id_aa":"zig_003","title":"defer and errdefer ordering","category":"Zig","prompt":"Assume Zig 0.13.0. What exact text is printed?\n```zig\nconst std=@import(\"std\");\nfn f() !u8 { errdefer std.debug.print(\"E\",.{}); defer std.debug.print(\"D\",.{}); return error.Bad; }\npub fn main() void { _=f() catch |e| {std.debug.print(\"C:{s}\",.{@errorName(e)}); return;}; }\n```","system_prompt":"Track scope exit and error return order.","rubric":"exact_output: Exact text.\n 0 — Gives anything other than `DEC:Bad`.\n 1 — Gives exactly `DEC:Bad`.\n\ncleanup_reason: LIFO cleanup and catch.\n 0 — Places the catch before cleanup or omits one cleanup.\n 1 — Explains that returning an error runs both deferred actions in reverse registration order: ordinary `defer` prints `D`, then `errdefer` prints `E`; the caller's catch then prints `C:Bad`.","expected_deliverables":"","reference_files":""}
|
| 44 |
+
{"id_aa":"zig_004","title":"Checked versus wrapping integer addition","category":"Zig","prompt":"Assume Zig 0.13.0 in Debug mode. What happens?\n```zig\nconst std=@import(\"std\");\npub fn main() void { var x:u8=255; x+=1; std.debug.print(\"{}\",.{x}); }\n```\nThen state how the behavior differs if `x +%= 1` replaces `x += 1`.","system_prompt":"Answer by build-mode arithmetic semantics.","rubric":"two_results: Checked and wrapping forms.\n 0 — Says both forms wrap to zero.\n 1 — States that `+=` overflows and traps/panics in Debug mode, while `+%=` performs wrapping addition and prints `0`.\n\noperator_reason: Explicit wrapping operator distinction.\n 0 — Attributes the difference to unspecified machine behavior.\n 1 — Explains that ordinary integer arithmetic is safety-checked in Debug mode, whereas `%` arithmetic operators explicitly wrap modulo 2^8.","expected_deliverables":"","reference_files":""}
|
| 45 |
+
{"id_aa":"zig_005","title":"Catch expression type and fallback","category":"Zig","prompt":"Assume Zig 0.13.0. Does this compile?\n```zig\nfn f(x:anyerror!u8) u8 { return x catch 7; }\npub fn main() void { const a:u8=f(error.Bad); _=a; }\n```\nState the value assigned to `a`.","system_prompt":"Apply Zig error-union and catch-expression semantics.","rubric":"result: Compilation and assigned value.\n 0 — Says the error propagates from `f` or the program fails to compile.\n 1 — States that it compiles and `a` is 7.\n\ncatch_reason: Error-union unwrapping.\n 0 — Treats `catch` as executing only after a panic.\n 1 — Explains that `catch` unwraps a success payload or evaluates its fallback on an error; `error.Bad` selects the `u8` fallback 7, making `f` return an ordinary `u8`.","expected_deliverables":"","reference_files":""}
|
| 46 |
+
{"id_aa":"zig_006","title":"Pointer to local variable escape","category":"Zig","prompt":"Assume Zig 0.13.0. Is the pointer returned by `f` valid to dereference in the caller?\n```zig\nfn f() *const u8 { var x:u8=3; return &x; }\n```\nGive the compilation or lifetime diagnosis; do not assume an optimizer extension.","system_prompt":"Apply Zig's compile-time escape analysis and lifetime rules.","rubric":"diagnosis: Validity of escaping local address.\n 0 — Says the pointer safely refers to heap-promoted storage.\n 1 — States that returning a pointer to the local runtime variable is invalid and is rejected/diagnosed because the pointee's lifetime ends when `f` returns.\n\nlifetime_reason: Storage duration.\n 0 — Claims Zig automatically heap-allocates escaping locals.\n 1 — Explains that `x` has function-local storage and Zig does not implicitly heap-promote it; a caller dereference would outlive the object.","expected_deliverables":"","reference_files":""}
|
| 47 |
+
{"id_aa":"zig_007","title":"Packed struct bit size","category":"Zig","prompt":"Assume Zig 0.13.0. What is `@sizeOf(T)`?\n```zig\nconst T=packed struct { a:u3, b:u5, c:u8 };\n``` \nGive the answer in bytes and explain why ordinary field alignment does not add padding.","system_prompt":"Use Zig packed-struct layout rules.","rubric":"size: Exact byte size.\n 0 — Gives anything other than 2 bytes.\n 1 — States `@sizeOf(T) == 2`.\n\nlayout_reason: Bit accounting.\n 0 — Adds ordinary struct padding between fields.\n 1 — Explains that the packed fields occupy 3+5+8=16 bits contiguously, yielding two bytes, without ordinary per-field alignment padding.","expected_deliverables":"","reference_files":""}
|
| 48 |
+
{"id_aa":"zig_008","title":"Exhaustive enum switch","category":"Zig","prompt":"Assume Zig 0.13.0. Does this switch compile?\n```zig\nconst E=enum{a,b,c};\nfn f(e:E)u8{return switch(e){.a=>1,.b=>2};}\n```\nGive the decisive semantic requirement.","system_prompt":"Apply Zig switch exhaustiveness rules.","rubric":"compilation: Switch validity.\n 0 — Says unmatched `.c` implicitly traps or yields zero.\n 1 — States that compilation fails because `.c` is not handled and there is no `else`.\n\nexhaustiveness: Required coverage.\n 0 — Treats enum switches as non-exhaustive statement constructs.\n 1 — Explains that a Zig `switch` must cover all possible values of the enum (or include an appropriate `else`), especially because it is an expression producing `u8`.","expected_deliverables":"","reference_files":""}
|
| 49 |
+
{"id_aa":"zig_009","title":"Optional orelse payload","category":"Zig","prompt":"Assume Zig 0.13.0. What exact text is printed?\n```zig\nconst std=@import(\"std\");\npub fn main() void {\n const x:?u8=null;\n const y=x orelse 9;\n std.debug.print(\"{}\",.{y});\n}\n```","system_prompt":"Give exact output and resulting type.","rubric":"result: Output and value.\n 0 — Gives anything other than `9`.\n 1 — States that it prints `9` and `y` is an ordinary `u8`.\n\noptional_reason: Fallback selection.\n 0 — Claims `y` remains null or has type `?u8` necessarily.\n 1 — Explains that `orelse` unwraps a present optional payload or evaluates the fallback for null; here null selects 9.","expected_deliverables":"","reference_files":""}
|
| 50 |
+
{"id_aa":"zig_010","title":"Comptime type parameter and literal coercion","category":"Zig","prompt":"Assume Zig 0.13.0. Does this compile?\n```zig\nfn f(comptime T:type,x:T)T{return x;}\npub fn main()void{const x=f(u16,3);_ = x;}\n```\nState the inferred type and value of `x`.","system_prompt":"Apply peer/type-context coercion for comptime integer literals.","rubric":"result: Compilation, type, and value.\n 0 — Says the integer literal's default type forces `comptime_int` or `i32`.\n 1 — States that it compiles; `x` has type `u16` and value 3.\n\ncoercion_reason: Parameter context.\n 0 — Claims generic parameters cannot supply a coercion context.\n 1 — Explains that `T` is fixed at compile time as `u16`, so parameter `x:T` provides the context that coerces the comptime integer literal 3 to `u16`.","expected_deliverables":"","reference_files":""}
|
| 51 |
+
{"id_aa":"v_001","title":"V array assignment cloning","category":"V","prompt":"Assume V 0.4.10. What exact text is printed?\n```v\nfn main(){ mut a := [1,2,3]; b := a; a[0]=9; println('${a[0]} ${b[0]}') }\n```\nExplain V array assignment semantics.","system_prompt":"Answer for V 0.4.10 language semantics.","rubric":"exact_output: Exact line.\n 0 — Gives anything other than `9 1`.\n 1 — Gives exactly `9 1`.\n\ncopy_reason: Value semantics of arrays.\n 0 — Claims `b` necessarily aliases `a`'s mutable elements.\n 1 — Explains that ordinary V array assignment produces an independent array value/copy for this case, so mutating `a[0]` does not change `b[0]`.","expected_deliverables":"","reference_files":""}
|
| 52 |
+
{"id_aa":"v_002","title":"No implicit string-to-int conversion","category":"V","prompt":"Assume V 0.4.10. Does this compile?\n```v\nfn f(x int) int { return x+1 }\nfn main(){ println(f('3')) }\n```\nState whether V performs the requested implicit conversion.","system_prompt":"Use V's strict typing rules.","rubric":"compilation: Argument type compatibility.\n 0 — Says the string is implicitly parsed as integer 3.\n 1 — States that it does not compile because a string cannot be passed where `int` is required without explicit conversion/parsing.\n\ntyping_reason: No implicit coercion.\n 0 — Predicts runtime parse failure.\n 1 — Explains that V checks the mismatch statically and does not provide an implicit string-to-integer conversion at the call.","expected_deliverables":"","reference_files":""}
|
| 53 |
+
{"id_aa":"v_003","title":"Option fallback block","category":"V","prompt":"Assume V 0.4.10. What exact text is printed?\n```v\nfn f() ?int { return none }\nfn main(){ x := f() or { 7 }; println(x) }\n```","system_prompt":"Apply V option propagation/fallback semantics.","rubric":"result: Exact output.\n 0 — Gives anything other than `7` or says an unhandled option aborts.\n 1 — States that it prints `7`.\n\noption_reason: Role of the `or` block.\n 0 — Says `none` is converted to integer zero.\n 1 — Explains that `f` returns no value, so the `or` block supplies 7, which becomes the unwrapped integer assigned to `x`.","expected_deliverables":"","reference_files":""}
|
| 54 |
+
{"id_aa":"v_004","title":"Immutable array append","category":"V","prompt":"Assume V 0.4.10. Does this compile?\n```v\nfn main(){ a := [1,2,3]; a << 4 }\n```\nExplain the mutability requirement.","system_prompt":"Apply V variable mutability rules.","rubric":"compilation: Whether append is allowed.\n 0 — Says arrays are mutable regardless of binding.\n 1 — States that it fails to compile because `a` was not declared `mut`.\n\nmutability_reason: Mutation of bound value.\n 0 — Treats `<<` as producing a new array without modifying `a`.\n 1 — Explains that `a << 4` mutates/appends to the array and therefore requires `mut a := ...`.","expected_deliverables":"","reference_files":""}
|
| 55 |
+
{"id_aa":"v_005","title":"V value receiver method","category":"V","prompt":"Assume V 0.4.10. What exact text is printed?\n```v\nstruct S { x int }\nfn (s S) val() int { return s.x }\nfn main(){ s:=S{x:4}; println(s.val()) }\n```","system_prompt":"Give exact output and receiver interpretation.","rubric":"output: Exact output.\n 0 — Gives anything other than `4`.\n 1 — States that it prints `4`.\n\nreceiver_reason: Method receiver value access.\n 0 — Claims a mutable or pointer receiver is required merely to read a field.\n 1 — Explains that `(s S)` is a value receiver and may read the immutable field `x`; no mutation or pointer receiver is needed.","expected_deliverables":"","reference_files":""}
|
| 56 |
+
{"id_aa":"v_006","title":"Generic type inference","category":"V","prompt":"Assume V 0.4.10. Does this compile?\n```v\nfn id[T](x T) T { return x }\nfn main(){ x:=id(3); println(x) }\n```\nState the inferred type and output.","system_prompt":"Apply V generic call inference for the stated version.","rubric":"result: Compilation, type, output.\n 0 — Says explicit `[int]` is mandatory or gives a non-integer result.\n 1 — States that it compiles, infers `T` as `int`, and prints `3`.\n\ninference_reason: Inference from argument.\n 0 — Claims the return context alone supplies an unrelated type.\n 1 — Explains that the integer argument determines generic parameter `T=int`, so the return type is also `int`.","expected_deliverables":"","reference_files":""}
|
| 57 |
+
{"id_aa":"v_007","title":"Map missing-key fallback","category":"V","prompt":"Assume V 0.4.10. What exact text is printed?\n```v\nfn main(){ m:={'a':1}; println(m['b'] or { 9 }) }\n```","system_prompt":"Apply V map indexing with an `or` fallback.","rubric":"output: Exact line.\n 0 — Gives zero, an abort, or anything other than `9`.\n 1 — States that it prints `9`.\n\nmap_reason: Missing-key handling.\n 0 — Claims every missing integer map key silently returns zero even with `or`.\n 1 — Explains that key `b` is absent and the attached `or` block supplies the fallback value 9.","expected_deliverables":"","reference_files":""}
|
| 58 |
+
{"id_aa":"v_008","title":"Implicit interface satisfaction","category":"V","prompt":"Assume V 0.4.10. Does this compile?\n```v\ninterface Speaker { speak() string }\nstruct Dog {}\nfn (Dog) speak() string { return 'woof' }\nfn say(s Speaker){println(s.speak())}\nfn main(){say(Dog{})}\n```\nState the output and whether an explicit declaration of conformance is needed.","system_prompt":"Apply V interface satisfaction rules.","rubric":"result: Compilation and output.\n 0 — Says `Dog` must explicitly declare `implements Speaker`.\n 1 — States that it compiles and prints `woof`.\n\ninterface_reason: Structural conformance.\n 0 — Treats V interfaces as requiring nominal inheritance.\n 1 — Explains that `Dog` implicitly satisfies `Speaker` by providing a compatible `speak() string` method; no explicit conformance declaration is required.","expected_deliverables":"","reference_files":""}
|
| 59 |
+
{"id_aa":"v_009","title":"Block-scope defer captures variable","category":"V","prompt":"Assume V 0.4.10. What exact text is printed?\n```v\nfn main(){ mut x:=1; { defer { println(x) }; x=4 } }\n```\nState when the deferred block runs and what value it observes.","system_prompt":"Track V defer execution at scope exit.","rubric":"output: Exact output.\n 0 — Gives `1` or says defer waits until process exit.\n 1 — States that it prints `4`.\n\ndefer_reason: Scope and observed state.\n 0 — Claims the value is copied when `defer` is registered.\n 1 — Explains that the deferred block runs when the enclosing inner scope exits, after `x=4`, and observes the current variable value 4.","expected_deliverables":"","reference_files":""}
|
| 60 |
+
{"id_aa":"v_010","title":"Immutable-by-default local","category":"V","prompt":"Assume V 0.4.10. Does this compile?\n```v\nfn main(){ x:=3; x=4 }\n```\nIf not, identify the exact declaration change needed.","system_prompt":"Apply V local variable mutability syntax.","rubric":"compilation: Assignment legality.\n 0 — Says ordinary locals are mutable by default.\n 1 — States that it fails because `x` is immutable.\n\nfix: Minimal declaration change.\n 0 — Proposes changing the type or using a pointer.\n 1 — Identifies `mut x := 3` as the needed declaration for the later assignment.","expected_deliverables":"","reference_files":""}
|
| 61 |
+
{"id_aa":"cuda_001","title":"Cross-warp communication with syncwarp","category":"CUDA","prompt":"Assume CUDA 12.x, compute capability 8.0, launch `k<<<1,64>>>(out)`. Is the claimed cross-warp result guaranteed?\n```cpp\n__global__ void k(int*out){__shared__ int s[2];unsigned t=threadIdx.x,w=t>>5,l=t&31;if(l==0)s[w]=100+w;__syncwarp();out[t]=s[w^1];}\n```\nExplain visibility, conflicting accesses, and the minimal collective replacement.","system_prompt":"Use CUDA's synchronization and memory-order rules, not likely scheduling.","rubric":"guarantee: Correctness of cross-warp reads.\n 0 — Says `__syncwarp()` guarantees the exchange across both warps.\n 1 — States that the result is not guaranteed and the accesses form unsynchronized cross-warp read/write races.\n\nfix: Minimal synchronization primitive.\n 0 — Suggests another `__syncwarp()` with the same per-warp scope.\n 1 — Replaces `__syncwarp()` with `__syncthreads()`, which synchronizes all 64 threads in the block and makes preceding shared writes visible before the reads.","expected_deliverables":"","reference_files":""}
|
| 62 |
+
{"id_aa":"cuda_002","title":"Warp ballot population count","category":"CUDA","prompt":"Assume CUDA 12.x and launch `k<<<1,32>>>(out)`. What value is guaranteed in `out[0]`?\n```cpp\n__global__ void k(int*out){unsigned m=__ballot_sync(0xffffffff,threadIdx.x%3==0);if(threadIdx.x==0)out[0]=__popc(m);}\n```","system_prompt":"Compute the active-lane predicate exactly.","rubric":"value: Exact population count.\n 0 — Gives anything other than 11.\n 1 — States that `out[0]` is 11.\n\nlane_count: Predicate accounting.\n 0 — Counts only ten multiples or includes lane 32.\n 1 — Enumerates or correctly counts lanes 0,3,6,...,30: eleven active lanes whose ballot bits are set, and `__popc` returns 11.","expected_deliverables":"","reference_files":""}
|
| 63 |
+
{"id_aa":"cuda_003","title":"Divergent block barrier","category":"CUDA","prompt":"Assume CUDA 12.x, compute capability 8.0, launch `k<<<1,64>>>`. Is this barrier use valid?\n```cpp\n__global__ void k(){if(threadIdx.x<32){__syncthreads();}}\n```\nState the precise consequence.","system_prompt":"Apply collective barrier participation requirements.","rubric":"classification: Validity of conditional barrier.\n 0 — Says the first warp may synchronize independently at `__syncthreads()`.\n 1 — States that the barrier is invalid because not all non-exited threads in the block reach it; behavior is undefined and may deadlock.\n\nscope_reason: Block-wide nature.\n 0 — Treats `__syncthreads` as warp-scoped.\n 1 — Explains that `__syncthreads()` is a block-wide collective; the branch is non-uniform across the 64-thread block, so 32 threads wait for participants that never arrive.","expected_deliverables":"","reference_files":""}
|
| 64 |
+
{"id_aa":"cuda_004","title":"Shuffle XOR partner lane","category":"CUDA","prompt":"Assume CUDA 12.x and launch `k<<<1,32>>>(out)`. What exact permutation is written?\n```cpp\n__global__ void k(int*out){unsigned x=threadIdx.x;out[x]=__shfl_xor_sync(0xffffffff,x,1);}\n```\nGive a formula for every lane.","system_prompt":"State the exact lane mapping.","rubric":"permutation: Exact value per lane.\n 0 — Gives a rotation or any mapping other than adjacent-pair exchange.\n 1 — States `out[x] = x ^ 1` for lanes 0 through 31: 0/1, 2/3, ..., 30/31 exchange values.\n\nshuffle_reason: Meaning of XOR lane mask.\n 0 — Claims the operation XORs the data value with 1.\n 1 — Explains that lane mask 1 XORs the caller's lane index to choose the source lane; all lanes named in the full mask participate.","expected_deliverables":"","reference_files":""}
|
| 65 |
+
{"id_aa":"cuda_005","title":"Atomic increment final value and ordering","category":"CUDA","prompt":"Assume CUDA 12.x. A kernel performs `atomicAdd(&counter,1)` on a global-memory `unsigned int counter` from each of exactly 1,000 threads, with no other counter accesses during the kernel. `counter` is initialized to 0 and does not overflow. After the kernel has completed and the host synchronizes, what value is guaranteed? Does atomicity guarantee any ordering among threads beyond that result?","system_prompt":"Separate atomic modification order from execution ordering.","rubric":"final_value: Exact synchronized result.\n 0 — Gives any value other than 1000 or calls the final count nondeterministic.\n 1 — States the final value is guaranteed to be 1000.\n\nordering_scope: What atomicity does not imply.\n 0 — Claims the atomics impose a deterministic thread execution order or a block/global barrier.\n 1 — Explains that each read-modify-write is atomic and contributes once to the counter's modification order, but this does not establish a deterministic order of participating threads or act as a general barrier for unrelated accesses.","expected_deliverables":"","reference_files":""}
|
| 66 |
+
{"id_aa":"cuda_006","title":"CUDA built-in dimensions arithmetic","category":"CUDA","prompt":"Assume CUDA 12.x, launch `k<<<2,32>>>`, and `out` has two integers initialized to zero.\n```cpp\n__global__ void k(int*out){if(threadIdx.x==0)out[blockIdx.x]=gridDim.x*blockDim.x+blockIdx.x;}\n```\nAfter synchronization, what are `out[0]` and `out[1]`?","system_prompt":"Compute exact built-in values for the launch.","rubric":"values: Both exact values.\n 0 — Gives neither value correctly.\n 1 — Gives one of `out[0]=64` or `out[1]=65` correctly.\n 2 — States `out[0]=64` and `out[1]=65`.\n\nlaunch_reason: Built-in variable substitution.\n 0 — Uses total threads as 32 or confuses block and thread indices.\n 1 — Explains `gridDim.x=2`, `blockDim.x=32`, and only thread 0 in each block writes, yielding 64 plus the block index.","expected_deliverables":"","reference_files":""}
|
| 67 |
+
{"id_aa":"cuda_007","title":"Threadfence block visibility scope","category":"CUDA","prompt":"Assume CUDA 12.x, compute capability 8.0. Is `__threadfence_block()` by thread 0 sufficient to make its preceding global-memory write visible to thread 0 of a different block that subsequently reads the location, absent any other synchronization?","system_prompt":"Distinguish ordering scope from inter-block synchronization.","rubric":"answer: Cross-block guarantee.\n 0 — Says the fence guarantees visibility to every block.\n 1 — States that no cross-block visibility/order guarantee follows; the reader may observe the old value and the unsynchronized accesses can race.\n\nscope_reason: Fence scope and missing handshake.\n 0 — Treats any fence as a grid-wide barrier.\n 1 — Explains that `__threadfence_block()` orders the calling thread's memory operations only with respect to threads in its own block; it neither synchronizes blocks nor provides a communication handshake to the other block.","expected_deliverables":"","reference_files":""}
|
| 68 |
+
{"id_aa":"cuda_008","title":"Warp shuffle reduction","category":"CUDA","prompt":"Assume CUDA 12.x, launch `k<<<1,32>>>(out)`. What value does lane 0 write?\n```cpp\n__global__ void k(int*out){unsigned x=threadIdx.x+1;for(int d=16;d>0;d>>=1)x+=__shfl_down_sync(0xffffffff,x,d);if(threadIdx.x==0)out[0]=x;}\n```","system_prompt":"Compute the warp reduction exactly.","rubric":"value: Exact reduction.\n 0 — Gives anything other than 528.\n 1 — States lane 0 writes 528.\n\nreduction_reason: Sum represented by the shuffle stages.\n 0 — Sums lane indices 0 through 31 to 496 or ignores the +1.\n 1 — Explains that the shuffle-down tree accumulates initial values 1 through 32 in lane 0, whose sum is 32*33/2 = 528.","expected_deliverables":"","reference_files":""}
|
| 69 |
+
{"id_aa":"cuda_009","title":"UVA versus pageable host accessibility","category":"CUDA","prompt":"Assume CUDA 12.x. May a kernel directly dereference ordinary pageable host memory obtained by `malloc` merely because unified virtual addressing is enabled? Give the portable answer and distinguish address unification from memory accessibility.","system_prompt":"Answer for portable CUDA behavior, not a platform-specific extension.","rubric":"answer: Whether malloc memory is device-accessible.\n 0 — Says UVA makes every host pointer directly dereferenceable by a kernel.\n 1 — States that ordinary pageable `malloc` memory is not thereby device-accessible; direct kernel dereference is not portably valid.\n\nuva_reason: Address-space naming versus allocation properties.\n 0 — Equates one virtual address with automatic residency/mapping.\n 1 — Explains that UVA unifies pointer/address identification but does not register, pin, map, or migrate arbitrary pageable allocations; mapped pinned host memory or managed memory requires the corresponding CUDA allocation/registration support.","expected_deliverables":"","reference_files":""}
|
| 70 |
+
{"id_aa":"cuda_010","title":"Global index and grid stride","category":"CUDA","prompt":"Assume CUDA 12.x and a one-dimensional launch. Give the canonical expression for the unique global linear thread index and the canonical grid-stride-loop increment. Then evaluate both for `blockIdx.x=3`, `blockDim.x=128`, `threadIdx.x=5`, `gridDim.x=20`.","system_prompt":"Give formulas and exact evaluated integers.","rubric":"index: Formula and value.\n 0 — Does not give `blockIdx.x * blockDim.x + threadIdx.x` or gives a value other than 389.\n 1 — Gives global index `blockIdx.x * blockDim.x + threadIdx.x = 389`.\n\nstride: Formula and value.\n 0 — Does not give `blockDim.x * gridDim.x` or gives a value other than 2560.\n 1 — Gives grid stride `blockDim.x * gridDim.x = 2560`.","expected_deliverables":"","reference_files":""}
|
| 71 |
+
{"id_aa":"rust_011","title":"Mutable reborrow ending at last use","category":"Rust","prompt":"Assume stable Rust 1.85.0. Does this compile, and why?\n```rust\nfn main(){let mut x=0;let r=&mut x;let s=&mut *r;*s=1;*r=2;println!(\"{x}\");}\n```","system_prompt":"Apply non-lexical lifetimes and reborrowing.","rubric":"result_and_reason: Compilation, output, and reborrow lifetime.\n 0 — Says overlapping mutable references necessarily reject the program or gives output other than 2.\n 1 — States that it compiles and prints 2; `s` is a reborrow of `r`, and its borrow ends after `*s=1`, allowing `r` to be used again under non-lexical lifetimes.","expected_deliverables":"","reference_files":""}
|
| 72 |
+
{"id_aa":"rust_012","title":"Ref pattern avoids partial move","category":"Rust","prompt":"Assume stable Rust 1.85.0. What exact output is printed?\n```rust\nfn main(){let x=Some(String::from(\"a\"));match x{Some(ref s)=>print!(\"{s}\"),None=>{}}print!(\"{}\",x.is_some());}\n```","system_prompt":"Track match binding mode and ownership.","rubric":"answer: Exact output and ownership reason.\n 0 — Says `x` is moved or gives output other than `atrue`.\n 1 — States it prints `atrue`; `ref s` borrows the inner String rather than moving it, so `x` remains usable after the match.","expected_deliverables":"","reference_files":""}
|
| 73 |
+
{"id_aa":"rust_013","title":"Block constant evaluation","category":"Rust","prompt":"Assume stable Rust 1.85.0. Is this accepted?\n```rust\nconst X:usize={let a=[1,2,3];a.len()};\nfn main(){println!(\"{X}\");}\n```\nGive the output and explain constant evaluation.","system_prompt":"Apply stable const-evaluation rules.","rubric":"answer: Compilation and output.\n 0 — Says local bindings are forbidden in const blocks or gives output other than 3.\n 1 — States it compiles and prints 3; the const initializer block is evaluated at compile time and array `len` is const-evaluable.","expected_deliverables":"","reference_files":""}
|
| 74 |
+
{"id_aa":"rust_014","title":"Impl Trait Copy bound","category":"Rust","prompt":"Assume stable Rust 1.85.0. Does this compile?\n```rust\nfn f(_:impl Copy){}\nfn main(){let s=String::from(\"x\");f(s);}\n```\nName the unsatisfied bound.","system_prompt":"Give the concrete trait-bound diagnosis.","rubric":"diagnosis: Exact bound failure.\n 0 — Says it compiles because arguments are moved by value.\n 1 — States it fails because `String` does not implement `Copy`; moving `s` is allowed in general but cannot satisfy the explicit `impl Copy` parameter bound.","expected_deliverables":"","reference_files":""}
|
| 75 |
+
{"id_aa":"rust_015","title":"Rest pattern in fixed array","category":"Rust","prompt":"Assume stable Rust 1.85.0. What exact output is printed?\n```rust\nfn main(){let a=[10,20,30];let [x,..,y]=a;print!(\"{x}-{y}\");}\n```","system_prompt":"Apply array pattern binding semantics.","rubric":"answer: Exact output and bindings.\n 0 — Gives anything other than `10-30`.\n 1 — States it prints `10-30`; `x` binds the first and `y` the last element, while `..` ignores the middle.","expected_deliverables":"","reference_files":""}
|
| 76 |
+
{"id_aa":"go_011","title":"Deferred arguments versus closure capture","category":"Go","prompt":"Assume Go 1.23. What exact text is printed?\n```go\npackage main\nimport \"fmt\"\nfunc main(){x:=1;defer fmt.Print(x);x=2;defer func(){fmt.Print(x)}()}\n```","system_prompt":"Track defer evaluation and LIFO order.","rubric":"answer: Exact output and mechanism.\n 0 — Gives anything other than `21`.\n 1 — States it prints `21`: deferred calls run LIFO; the closure reads current `x=2`, while the earlier `fmt.Print` argument captured value 1 when deferred.","expected_deliverables":"","reference_files":""}
|
| 77 |
+
{"id_aa":"go_012","title":"Append within capacity","category":"Go","prompt":"Assume Go 1.23. Is `len(s)` guaranteed to be 0 or 1 after this code?\n```go\ns:=make([]int,0,1);s=append(s,7)\n```\nAlso state `cap(s)`.","system_prompt":"Give exact slice length and capacity.","rubric":"answer: Exact slice metadata.\n 0 — Gives length or capacity other than 1.\n 1 — States `len(s)==1` and `cap(s)==1`; append uses the available slot and returns a slice header with length increased by one.","expected_deliverables":"","reference_files":""}
|
| 78 |
+
{"id_aa":"go_013","title":"Approximation element in constraint","category":"Go","prompt":"Assume Go 1.23. Does this compile?\n```go\npackage p\ntype MyInt int\nfunc f[T ~int](x T) int{return int(x)}\nvar _=f(MyInt(3))\n```","system_prompt":"Apply type-set approximation syntax.","rubric":"answer: Constraint satisfaction and result.\n 0 — Says only the predeclared type `int` satisfies `~int`.\n 1 — States it compiles and produces 3; `~int` includes defined types whose underlying type is `int`, including `MyInt`.","expected_deliverables":"","reference_files":""}
|
| 79 |
+
{"id_aa":"go_014","title":"Buffered values after channel close","category":"Go","prompt":"Assume Go 1.23. What exact text is printed?\n```go\npackage main\nimport \"fmt\"\nfunc main(){c:=make(chan int,1);c<-5;close(c);a,ok1:=<-c;b,ok2:=<-c;fmt.Print(a,ok1,b,ok2)}\n```","system_prompt":"Track receives from a closed buffered channel.","rubric":"answer: Exact output and receive states.\n 0 — Gives anything other than `5true0false`.\n 1 — States it prints `5true0false`: closing preserves the queued 5 for the first receive; after the buffer drains, receive yields the zero value and `ok=false`.","expected_deliverables":"","reference_files":""}
|
| 80 |
+
{"id_aa":"go_015","title":"Untyped constant overflow at assignment","category":"Go","prompt":"Assume Go 1.23. Does this compile?\n```go\npackage main\nfunc main(){const n=1<<100;var x int=n;_ = x}\n```\nExplain representability.","system_prompt":"Apply arbitrary-precision constant and assignment representability rules.","rubric":"diagnosis: Compilation and overflow point.\n 0 — Says the shift itself overflows or silently truncates.\n 1 — States it fails at conversion/assignment to `int`: the untyped constant `1<<100` can be represented as a constant, but is not representable by the implementation's `int` type on any permitted Go target.","expected_deliverables":"","reference_files":""}
|
| 81 |
+
{"id_aa":"c_011","title":"C byte size versus bit width","category":"C","prompt":"Assume ISO C17. What is guaranteed about `sizeof(char)`, `sizeof(unsigned char)`, and `CHAR_BIT`? Is `CHAR_BIT==8` required?","system_prompt":"Use ISO C terminology for bytes and bits.","rubric":"answer: Exact size and bit-width guarantees.\n 0 — Says `sizeof(char)` may differ from 1 or that C requires 8-bit bytes.\n 1 — States `sizeof(char)==sizeof(unsigned char)==1`; `CHAR_BIT` is the number of bits in a byte and is at least 8, but need not equal 8.","expected_deliverables":"","reference_files":""}
|
| 82 |
+
{"id_aa":"c_012","title":"Relational comparison of unrelated pointers","category":"C","prompt":"Assume ISO C17. Is this comparison defined, and is either result guaranteed?\n```c\nint a,b; int r=&a < &b;\n```","system_prompt":"Distinguish pointer equality and relational operators.","rubric":"classification: Relational comparison category.\n 0 — Calls it undefined behavior or gives a guaranteed boolean.\n 1 — States the comparison has an unspecified result for pointers to unrelated objects; neither true nor false is guaranteed, but evaluating it is not thereby undefined behavior.","expected_deliverables":"","reference_files":""}
|
| 83 |
+
{"id_aa":"c_013","title":"Unsigned char increment wrap","category":"C","prompt":"Assume ISO C17. What exact integer does `f()` return?\n```c\nint f(void){unsigned char x=255;return ++x;}\n```","system_prompt":"Apply integer promotions and conversion back on compound update.","rubric":"answer: Exact return and arithmetic reason.\n 0 — Calls it signed overflow or gives 256.\n 1 — States it returns 0: `x` is promoted for addition, then the value 256 is converted back to `unsigned char`, wrapping modulo 256 under the stated 8-bit-value range implied by initial max 255.","expected_deliverables":"","reference_files":""}
|
| 84 |
+
{"id_aa":"c_014","title":"Pointer representation across object pointer types","category":"C","prompt":"Assume ISO C17. Is `sizeof(int (*)[10])` required to equal `sizeof(int*)`? Give the portable conclusion.","system_prompt":"Do not assume a flat ABI.","rubric":"answer: Portable size relationship.\n 0 — Says all object pointer types are required to have the same size.\n 1 — States that C17 does not require a pointer to an array of 10 int to have the same size/representation as `int*`; equality is common but not portable.","expected_deliverables":"","reference_files":""}
|
| 85 |
+
{"id_aa":"cpp_011","title":"Mutable lambda value capture","category":"C++","prompt":"Assume ISO C++20. What exact output is printed?\n```cpp\n#include <iostream>\nint main(){int x=1;auto y=[x]()mutable{return ++x;};std::cout<<y()<<y()<<x;}\n```","system_prompt":"Track captured and outer state.","rubric":"answer: Exact output and state separation.\n 0 — Gives anything other than `231`.\n 1 — States it prints `231`: the mutable closure increments its private captured copy from 1 to 2 then 3; outer `x` remains 1.","expected_deliverables":"","reference_files":""}
|
| 86 |
+
{"id_aa":"cpp_012","title":"Guaranteed copy elision with deleted copy","category":"C++","prompt":"Assume ISO C++20. Does this compile?\n```cpp\nstruct A{A()=default;A(const A&)=delete;};\nA f(){return A{};}\nint main(){A a=f();}\n```","system_prompt":"Apply mandatory prvalue materialization rules.","rubric":"answer: Compilation and copy-elision rule.\n 0 — Says the deleted copy constructor makes either return or initialization ill-formed.\n 1 — States it compiles: the prvalue `A{}` initializes the function result directly, and `f()` initializes `a` directly under guaranteed copy elision, so no copy constructor is odr-used.","expected_deliverables":"","reference_files":""}
|
| 87 |
+
{"id_aa":"cpp_013","title":"Competing standard conversions","category":"C++","prompt":"Assume ISO C++20. Which overload is selected?\n```cpp\nvoid f(long);void f(double);\nint main(){f(1);}\n```","system_prompt":"Apply overload conversion ranking.","rubric":"answer: Overload resolution result.\n 0 — Selects either overload as uniquely better.\n 1 — States the call is ambiguous: `int` to `long` and `int` to `double` are both standard conversion sequences of conversion rank, with neither better.","expected_deliverables":"","reference_files":""}
|
| 88 |
+
{"id_aa":"cpp_014","title":"Character literal type in C++","category":"C++","prompt":"Assume ISO C++20. What does `sizeof('a')` equal, in units of bytes? Contrast this with C.","system_prompt":"Answer for C++20 and note the requested C contrast.","rubric":"answer: C++ value and C distinction.\n 0 — Says C++ ordinary character literals have type `int`.\n 1 — States `sizeof('a') == 1` in C++ because `'a'` has type `char`; in C an ordinary character constant has type `int`, so its size is `sizeof(int)`.","expected_deliverables":"","reference_files":""}
|
| 89 |
+
{"id_aa":"zig_011","title":"Zig bit size versus ABI size","category":"Zig","prompt":"Assume Zig 0.13.0. What are `@bitSizeOf(u7)` and `@sizeOf(u7)`?","system_prompt":"Give exact bit and byte quantities.","rubric":"answer: Exact two values.\n 0 — Does not give both 7 bits and 1 byte.\n 1 — States `@bitSizeOf(u7)==7` and `@sizeOf(u7)==1` byte.","expected_deliverables":"","reference_files":""}
|
| 90 |
+
{"id_aa":"zig_012","title":"Mutable pointer coercion to const","category":"Zig","prompt":"Assume Zig 0.13.0. Does this compile?\n```zig\nfn f(x:*const u8)u8{return x.*;}\npub fn main()void{var x:u8=4;const y=f(&x);_ = y;}\n```","system_prompt":"Apply pointer constness coercion.","rubric":"answer: Compilation and value.\n 0 — Says `*u8` cannot be passed as `*const u8`.\n 1 — States it compiles and `y==4`; a mutable pointer may coerce to a const pointer for read-only access.","expected_deliverables":"","reference_files":""}
|
| 91 |
+
{"id_aa":"zig_013","title":"Typed left shift","category":"Zig","prompt":"Assume Zig 0.13.0. What exact value does this compile-time expression produce?\n```zig\nconst x=@as(u8,3)<<2;\n```","system_prompt":"Give exact type and value.","rubric":"answer: Exact value and type.\n 0 — Gives a value other than 12 or a type other than u8.\n 1 — States `x` has type `u8` and value 12.","expected_deliverables":"","reference_files":""}
|
| 92 |
+
{"id_aa":"zig_014","title":"Tagged union inactive field assignment","category":"Zig","prompt":"Assume Zig 0.13.0. Does this compile?\n```zig\nconst U=union(enum){a:u8,b:u16};\npub fn main()void{var u=U{.a=3};u.b=4;}\n```\nClassify the direct field assignment when `.a` is active.","system_prompt":"Apply tagged-union active-field safety rules.","rubric":"diagnosis: Legality of assigning inactive field directly.\n 0 — Says direct assignment switches the active tag to `.b`.\n 1 — States the code is invalid/traps under safety because `.b` is not the active field; switching variants requires assigning a whole union value such as `u=U{.b=4}`.","expected_deliverables":"","reference_files":""}
|
| 93 |
+
{"id_aa":"v_011","title":"V string byte length","category":"V","prompt":"Assume V 0.4.10. What exact output is printed?\n```v\nfn main(){ s:='abc'; println(s.len) }\n```","system_prompt":"Give exact output for ASCII input.","rubric":"answer: Exact output and unit.\n 0 — Gives anything other than 3.\n 1 — States it prints 3; for this ASCII string the byte length is three.","expected_deliverables":"","reference_files":""}
|
| 94 |
+
{"id_aa":"v_012","title":"Mutable field on immutable struct binding","category":"V","prompt":"Assume V 0.4.10. Does this compile?\n```v\nstruct S { mut: x int }\nfn main(){ s:=S{}; s.x=1 }\n```\nAccount for both field and variable mutability.","system_prompt":"Apply V nested mutability requirements.","rubric":"answer: Compilation and minimal fix.\n 0 — Says the mutable field declaration alone permits mutation through immutable `s`.\n 1 — States it fails because `s` itself is immutable; declare `mut s := S{}` (with the field already in `mut:`) to permit `s.x=1`.","expected_deliverables":"","reference_files":""}
|
| 95 |
+
{"id_aa":"v_013","title":"V array slice length","category":"V","prompt":"Assume V 0.4.10. What exact output is printed?\n```v\nfn main(){ a:=[1,2,3]; println(a[1..].len) }\n```","system_prompt":"Evaluate slice bounds exactly.","rubric":"answer: Exact result.\n 0 — Gives anything other than 2.\n 1 — States it prints 2 because the slice from index 1 to the omitted exclusive end contains elements 2 and 3.","expected_deliverables":"","reference_files":""}
|
| 96 |
+
{"id_aa":"v_014","title":"V if expression value","category":"V","prompt":"Assume V 0.4.10. Does this compile?\n```v\nfn main(){ x:=if true {1}else{2}; println(x) }\n```\nGive the output and classify `if` here.","system_prompt":"Apply V expression typing.","rubric":"answer: Compilation, output, expression form.\n 0 — Says V `if` cannot yield a value or gives output other than 1.\n 1 — States it compiles and prints 1; the `if` is used as an expression and both branches yield compatible integer values.","expected_deliverables":"","reference_files":""}
|
| 97 |
+
{"id_aa":"cuda_011","title":"Warp broadcast from lane zero","category":"CUDA","prompt":"Assume CUDA 12.x and launch `k<<<1,32>>>(out)`. What does lane 7 write?\n```cpp\n__global__ void k(int*out){int x=threadIdx.x;out[x]=__shfl_sync(0xffffffff,x,0);}\n```","system_prompt":"Compute the exact shuffle source.","rubric":"answer: Exact written value.\n 0 — Gives anything other than 0.\n 1 — States lane 7 writes 0 because every participating lane reads lane 0's value.","expected_deliverables":"","reference_files":""}
|
| 98 |
+
{"id_aa":"cuda_012","title":"Fence without execution synchronization","category":"CUDA","prompt":"Assume CUDA 12.x. Within one block, thread 0 writes shared memory, calls `__threadfence_block()`, and thread 1 reads without a barrier or atomic handshake. Is the read guaranteed to see the write?","system_prompt":"Separate a fence from a collective barrier.","rubric":"answer: Visibility guarantee.\n 0 — Says the fence alone forces thread 1 to wait and observe the write.\n 1 — States the read is not guaranteed and the accesses remain unsynchronized; `__threadfence_block()` orders the calling thread's memory operations but is not an execution barrier or handshake.","expected_deliverables":"","reference_files":""}
|
| 99 |
+
{"id_aa":"cuda_013","title":"CUDA launch cardinality","category":"CUDA","prompt":"Assume CUDA 12.x and launch `k<<<3,10>>>(out)`. How many threads execute the kernel body, and what is the maximum one-dimensional global index `blockIdx.x*blockDim.x+threadIdx.x`?","system_prompt":"Give exact count and maximum index.","rubric":"answer: Both exact integers.\n 0 — Gets both values wrong.\n 1 — Gives either 30 threads or maximum index 29.\n 2 — States 30 threads execute and the maximum global index is 29.","expected_deliverables":"","reference_files":""}
|
| 100 |
+
{"id_aa":"cuda_014","title":"Block barrier is not grid barrier","category":"CUDA","prompt":"Assume CUDA 12.x. Is `__syncthreads()` a grid-wide barrier when a kernel has multiple blocks? If not, can it by itself make a producer in block 0 safely hand data to a consumer in block 1 within the same kernel launch?","system_prompt":"State synchronization scope and consequence.","rubric":"answer: Scope and cross-block consequence.\n 0 — Calls it grid-wide or says matching calls in both blocks synchronize with each other.\n 1 — States `__syncthreads()` synchronizes only threads of one block and cannot by itself implement a safe block-0 to block-1 handoff; separate kernel launches, cooperative-grid synchronization under its requirements, or a correct atomic protocol is needed.","expected_deliverables":"","reference_files":""}
|
LICENSE
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Open Data Attribution Training Disclosure License (ODATL‑1.0)
|
| 2 |
+
Version 1.0 — July 2026
|
| 3 |
+
|
| 4 |
+
A permissive open‑data license requiring attribution and mandatory disclosure of AI training use.
|
| 5 |
+
|
| 6 |
+
--------------------------------------------------------------------
|
| 7 |
+
SECTION 1 — DEFINITIONS
|
| 8 |
+
--------------------------------------------------------------------
|
| 9 |
+
1.1 “Dataset” refers to the collection of data, files, metadata, annotations, structures, or any other materials distributed under this License, including any updates, subsets, or modified versions.
|
| 10 |
+
|
| 11 |
+
1.2 “Licensor” refers to the entity or individual who releases the Dataset under this License.
|
| 12 |
+
|
| 13 |
+
1.3 “Licensee” refers to any person, organization, or system that accesses, uses, modifies, redistributes, or incorporates the Dataset.
|
| 14 |
+
|
| 15 |
+
1.4 “Model” refers to any machine learning system, artificial intelligence system, algorithm, statistical model, or computational process trained, fine‑tuned, evaluated, or otherwise developed using the Dataset.
|
| 16 |
+
|
| 17 |
+
1.5 “Public Notice” refers to a clear, visible, and publicly accessible statement acknowledging use of the Dataset.
|
| 18 |
+
|
| 19 |
+
1.6 “Derivative Dataset” refers to any dataset created by modifying, transforming, filtering, augmenting, or otherwise altering the original Dataset.
|
| 20 |
+
|
| 21 |
+
1.7 “Derivative Model” refers to any Model whose training data includes the Dataset or any Derivative Dataset.
|
| 22 |
+
|
| 23 |
+
--------------------------------------------------------------------
|
| 24 |
+
SECTION 2 — GRANT OF RIGHTS
|
| 25 |
+
--------------------------------------------------------------------
|
| 26 |
+
2.1 The Licensor grants the Licensee a worldwide, royalty‑free, non‑exclusive, irrevocable permission to:
|
| 27 |
+
- Use, copy, and redistribute the Dataset for any purpose.
|
| 28 |
+
- Modify, transform, or build upon the Dataset.
|
| 29 |
+
- Create Derivative Datasets.
|
| 30 |
+
- Train, fine‑tune, evaluate, or otherwise use the Dataset for machine learning or AI development.
|
| 31 |
+
- Create Derivative Models based on the Dataset.
|
| 32 |
+
|
| 33 |
+
2.2 These rights are intended to be compatible with open‑source and open‑data principles, including but not limited to CC‑BY, ODC‑BY, and other permissive data licenses.
|
| 34 |
+
|
| 35 |
+
2.3 No patent rights are granted or implied by this License.
|
| 36 |
+
|
| 37 |
+
--------------------------------------------------------------------
|
| 38 |
+
SECTION 3 — MANDATORY ATTRIBUTION
|
| 39 |
+
--------------------------------------------------------------------
|
| 40 |
+
3.1 Any public use, redistribution, publication, or derivative work involving the Dataset must include the following attribution:
|
| 41 |
+
|
| 42 |
+
“This work uses data provided under the Open Data Attribution Training Disclosure License (ODATL‑1.0).”
|
| 43 |
+
|
| 44 |
+
3.2 Attribution must appear in:
|
| 45 |
+
- Documentation
|
| 46 |
+
- Research papers
|
| 47 |
+
- Model cards
|
| 48 |
+
- Public datasets
|
| 49 |
+
- Product descriptions
|
| 50 |
+
- Any public‑facing material referencing the Dataset
|
| 51 |
+
|
| 52 |
+
3.3 Attribution must remain intact and may not be removed, obscured, or altered.
|
| 53 |
+
|
| 54 |
+
--------------------------------------------------------------------
|
| 55 |
+
SECTION 4 — MANDATORY TRAINING DISCLOSURE
|
| 56 |
+
--------------------------------------------------------------------
|
| 57 |
+
4.1 If the Dataset is used to train, fine‑tune, evaluate, or otherwise develop any Model, the Licensee must provide a Public Notice stating:
|
| 58 |
+
|
| 59 |
+
“This model was trained using data provided under the Open Data Attribution Training Disclosure License (ODATL‑1.0).”
|
| 60 |
+
|
| 61 |
+
4.2 This disclosure must appear in:
|
| 62 |
+
- Model cards
|
| 63 |
+
- Public releases of the Model
|
| 64 |
+
- Research publications
|
| 65 |
+
- Technical documentation
|
| 66 |
+
- Product descriptions
|
| 67 |
+
- Any public announcement or description of the Model
|
| 68 |
+
|
| 69 |
+
4.3 Disclosure must be truthful, visible, and accessible to the general public.
|
| 70 |
+
|
| 71 |
+
4.4 Failure to provide this disclosure immediately terminates all rights granted under this License.
|
| 72 |
+
|
| 73 |
+
--------------------------------------------------------------------
|
| 74 |
+
SECTION 5 — REDISTRIBUTION REQUIREMENTS
|
| 75 |
+
--------------------------------------------------------------------
|
| 76 |
+
5.1 If the Licensee redistributes the Dataset or any Derivative Dataset, the Licensee must:
|
| 77 |
+
- Include this License in full.
|
| 78 |
+
- Clearly indicate any modifications made.
|
| 79 |
+
- Preserve all attribution and disclosure requirements.
|
| 80 |
+
|
| 81 |
+
5.2 Derivative Datasets may be dual‑licensed under other open‑data licenses, provided this License remains included and enforceable.
|
| 82 |
+
|
| 83 |
+
--------------------------------------------------------------------
|
| 84 |
+
SECTION 6 — OPEN‑SOURCE COMPATIBILITY
|
| 85 |
+
--------------------------------------------------------------------
|
| 86 |
+
6.1 This License is designed to be compatible with:
|
| 87 |
+
- Open Data Commons Attribution (ODC‑BY)
|
| 88 |
+
- Creative Commons Attribution (CC‑BY)
|
| 89 |
+
- Open‑source AI research workflows
|
| 90 |
+
- Open‑data distribution platforms
|
| 91 |
+
|
| 92 |
+
6.2 Redistribution through open‑source repositories (e.g., GitHub, HuggingFace, Kaggle) is permitted and encouraged.
|
| 93 |
+
|
| 94 |
+
6.3 Licensees may combine the Dataset with other open datasets, provided attribution and training disclosure obligations remain intact.
|
| 95 |
+
|
| 96 |
+
--------------------------------------------------------------------
|
| 97 |
+
SECTION 7 — PROHIBITED USES
|
| 98 |
+
--------------------------------------------------------------------
|
| 99 |
+
7.1 The Licensee may not:
|
| 100 |
+
- Claim exclusive ownership of the Dataset.
|
| 101 |
+
- Remove or alter attribution or disclosure requirements.
|
| 102 |
+
- Use the Dataset in violation of applicable laws or regulations.
|
| 103 |
+
- Misrepresent the origin, nature, or licensing of the Dataset.
|
| 104 |
+
|
| 105 |
+
7.2 The Licensee may not apply technical or legal measures that restrict others from exercising rights granted under this License.
|
| 106 |
+
|
| 107 |
+
--------------------------------------------------------------------
|
| 108 |
+
SECTION 8 — NO WARRANTY
|
| 109 |
+
--------------------------------------------------------------------
|
| 110 |
+
8.1 The Dataset is provided “as‑is,” without warranty of any kind, express or implied.
|
| 111 |
+
|
| 112 |
+
8.2 The Licensor is not liable for any damages, losses, or claims arising from use of the Dataset or any Derivative Model.
|
| 113 |
+
|
| 114 |
+
--------------------------------------------------------------------
|
| 115 |
+
SECTION 9 — TERMINATION
|
| 116 |
+
--------------------------------------------------------------------
|
| 117 |
+
9.1 Rights under this License automatically terminate if the Licensee:
|
| 118 |
+
- Fails to provide required attribution.
|
| 119 |
+
- Fails to provide required training disclosure.
|
| 120 |
+
- Violates any other term of this License.
|
| 121 |
+
|
| 122 |
+
9.2 Rights may be reinstated upon correction of the violation, unless the Licensor explicitly revokes permission.
|
| 123 |
+
|
| 124 |
+
--------------------------------------------------------------------
|
| 125 |
+
SECTION 10 — ACCEPTANCE
|
| 126 |
+
--------------------------------------------------------------------
|
| 127 |
+
10.1 By accessing or using the Dataset, the Licensee agrees to be bound by the terms of this License.
|
| 128 |
+
|
| 129 |
+
10.2 Continued use of the Dataset constitutes ongoing acceptance of all terms.
|
| 130 |
+
|
| 131 |
+
--------------------------------------------------------------------
|
| 132 |
+
SECTION 11 — CONTACT
|
| 133 |
+
--------------------------------------------------------------------
|
| 134 |
+
11.1 For permissions beyond this License, contact the Licensor.
|
README.md
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: open-data-attribution-training-disclosure-license-odatl-1.0
|
| 4 |
+
license_link: LICENSE
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
tags:
|
| 8 |
+
- benchmark
|
| 9 |
+
- bench
|
| 10 |
+
- corpus
|
| 11 |
+
- coding
|
| 12 |
+
- code
|
| 13 |
+
- english
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Coding-Corpus-Bench
|
| 17 |
+
|
| 18 |
+
A benchmark dataset for evaluating language-semantics reasoning across systems programming and low-level programming languages.
|
| 19 |
+
|
| 20 |
+
## Overview
|
| 21 |
+
|
| 22 |
+
**Coding-Corpus-Bench** contains 100 curated programming-language questions designed to test whether a model can reason precisely about language semantics rather than rely on superficial pattern matching or observed behavior.
|
| 23 |
+
|
| 24 |
+
The benchmark covers:
|
| 25 |
+
|
| 26 |
+
* Rust
|
| 27 |
+
* Go
|
| 28 |
+
* C
|
| 29 |
+
* C++
|
| 30 |
+
* Zig
|
| 31 |
+
* V
|
| 32 |
+
* CUDA
|
| 33 |
+
|
| 34 |
+
Questions focus on subtle semantic rules including ownership, lifetimes, type systems, overload resolution, memory models, evaluation order, synchronization, representation validity, and compiler behavior under explicitly stated language/toolchain versions.
|
| 35 |
+
|
| 36 |
+
Each example provides both a question and a rubric describing the reasoning and conclusion expected from a high-quality answer.
|
| 37 |
+
|
| 38 |
+
## Dataset Statistics
|
| 39 |
+
|
| 40 |
+
| Language | Examples |
|
| 41 |
+
| --------- | -------: |
|
| 42 |
+
| Rust | 15 |
|
| 43 |
+
| Go | 15 |
|
| 44 |
+
| C | 14 |
|
| 45 |
+
| C++ | 14 |
|
| 46 |
+
| Zig | 14 |
|
| 47 |
+
| V | 14 |
|
| 48 |
+
| CUDA | 14 |
|
| 49 |
+
| **Total** | **100** |
|
| 50 |
+
|
| 51 |
+
## Dataset Format
|
| 52 |
+
|
| 53 |
+
The dataset is provided as **JSONL**. Each line represents one benchmark item.
|
| 54 |
+
|
| 55 |
+
```json
|
| 56 |
+
{
|
| 57 |
+
"id_aa": "rust_001",
|
| 58 |
+
"title": "GAT higher-ranked implied static",
|
| 59 |
+
"category": "Rust",
|
| 60 |
+
"prompt": "...",
|
| 61 |
+
"system_prompt": "...",
|
| 62 |
+
"rubric": "...",
|
| 63 |
+
"expected_deliverables": "",
|
| 64 |
+
"reference_files": ""
|
| 65 |
+
}
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
### Fields
|
| 69 |
+
|
| 70 |
+
| Field | Description |
|
| 71 |
+
| ----------------------- | ------------------------------------------------------------------------------------------------------ |
|
| 72 |
+
| `id_aa` | Unique identifier for the benchmark item. |
|
| 73 |
+
| `title` | Short description of the semantic issue being tested. |
|
| 74 |
+
| `category` | Programming language or platform category. |
|
| 75 |
+
| `prompt` | The question presented to the model, often including a code fragment and explicit version assumptions. |
|
| 76 |
+
| `system_prompt` | Task-specific instruction describing the required reasoning perspective. |
|
| 77 |
+
| `rubric` | Evaluation criteria for judging the answer. |
|
| 78 |
+
| `expected_deliverables` | Reserved field for expected deliverables; currently empty for all examples. |
|
| 79 |
+
| `reference_files` | Reserved field for supporting references; currently empty for all examples. |
|
| 80 |
+
|
| 81 |
+
## What the Benchmark Tests
|
| 82 |
+
|
| 83 |
+
The corpus emphasizes questions where a superficially plausible answer can be wrong without precise knowledge of the language specification.
|
| 84 |
+
|
| 85 |
+
### Rust
|
| 86 |
+
|
| 87 |
+
Examples cover topics such as:
|
| 88 |
+
|
| 89 |
+
* Generic associated types and higher-ranked trait bounds
|
| 90 |
+
* Lifetime inference and implied `'static` requirements
|
| 91 |
+
* Drop timing
|
| 92 |
+
* Wildcard patterns
|
| 93 |
+
* Method-call receiver adjustment and autoref
|
| 94 |
+
* Closure capture and closure traits
|
| 95 |
+
* Two-phase borrows
|
| 96 |
+
* Trait coherence
|
| 97 |
+
* `ManuallyDrop`
|
| 98 |
+
* Type validity and undefined behavior
|
| 99 |
+
* Trait-object method dispatch
|
| 100 |
+
* `Self: Sized` and dyn compatibility
|
| 101 |
+
* Non-lexical lifetimes
|
| 102 |
+
* Borrowing through `ref` patterns
|
| 103 |
+
* Compile-time evaluation
|
| 104 |
+
* Trait bounds
|
| 105 |
+
|
| 106 |
+
### Go
|
| 107 |
+
|
| 108 |
+
Examples test areas including:
|
| 109 |
+
|
| 110 |
+
* `select` operand evaluation
|
| 111 |
+
* Typed nil values inside interfaces
|
| 112 |
+
* Slice range semantics
|
| 113 |
+
* Generic type sets
|
| 114 |
+
* Named return values and `defer`
|
| 115 |
+
* Channel synchronization and happens-before
|
| 116 |
+
* Method sets
|
| 117 |
+
* Buffered-channel synchronization
|
| 118 |
+
* Deferred argument evaluation
|
| 119 |
+
* Slice capacity
|
| 120 |
+
* Approximation elements such as `~int`
|
| 121 |
+
* Closed-channel receive semantics
|
| 122 |
+
* Untyped constants and representability
|
| 123 |
+
|
| 124 |
+
### C
|
| 125 |
+
|
| 126 |
+
Examples address ISO C semantics such as:
|
| 127 |
+
|
| 128 |
+
* Object representation and byte size
|
| 129 |
+
* `CHAR_BIT`
|
| 130 |
+
* Relational comparison of pointers
|
| 131 |
+
* Integer promotions
|
| 132 |
+
* Unsigned arithmetic
|
| 133 |
+
* Pointer representation and object-pointer sizes
|
| 134 |
+
|
| 135 |
+
### C++
|
| 136 |
+
|
| 137 |
+
Examples cover:
|
| 138 |
+
|
| 139 |
+
* Mutable lambda captures
|
| 140 |
+
* Guaranteed copy elision
|
| 141 |
+
* Deleted copy constructors
|
| 142 |
+
* Overload resolution
|
| 143 |
+
* Character literal types
|
| 144 |
+
|
| 145 |
+
### Zig
|
| 146 |
+
|
| 147 |
+
Examples cover:
|
| 148 |
+
|
| 149 |
+
* Bit size versus ABI size
|
| 150 |
+
* Pointer constness coercion
|
| 151 |
+
* Typed shifts
|
| 152 |
+
* Tagged-union active-field rules
|
| 153 |
+
|
| 154 |
+
### V
|
| 155 |
+
|
| 156 |
+
Examples cover:
|
| 157 |
+
|
| 158 |
+
* String byte length
|
| 159 |
+
* Mutability of struct fields and bindings
|
| 160 |
+
* Array slicing
|
| 161 |
+
* `if` expressions
|
| 162 |
+
|
| 163 |
+
### CUDA
|
| 164 |
+
|
| 165 |
+
Examples cover:
|
| 166 |
+
|
| 167 |
+
* Warp shuffle operations
|
| 168 |
+
* Memory fences versus execution synchronization
|
| 169 |
+
* Kernel launch cardinality
|
| 170 |
+
* Block-level versus grid-level barriers
|
| 171 |
+
|
| 172 |
+
## Version-Specific Reasoning
|
| 173 |
+
|
| 174 |
+
Questions explicitly state the relevant language or toolchain version where the answer depends on version-specific semantics.
|
| 175 |
+
|
| 176 |
+
Examples include:
|
| 177 |
+
|
| 178 |
+
* **Rust 1.85.0, edition 2021**
|
| 179 |
+
* **Go 1.23**
|
| 180 |
+
* **ISO C17**
|
| 181 |
+
* **ISO C++20**
|
| 182 |
+
* **Zig 0.13.0**
|
| 183 |
+
* **V 0.4.10**
|
| 184 |
+
* **CUDA 12.x**
|
| 185 |
+
|
| 186 |
+
Evaluations should therefore be performed against the assumptions stated in each individual item rather than against an unspecified "latest" language version.
|
| 187 |
+
|
| 188 |
+
## Evaluation
|
| 189 |
+
|
| 190 |
+
The `rubric` field contains the expected evaluation criteria.
|
| 191 |
+
|
| 192 |
+
Rubrics generally distinguish between:
|
| 193 |
+
|
| 194 |
+
1. **The final conclusion** — whether code compiles, what it prints, whether behavior is defined, etc.
|
| 195 |
+
2. **The decisive reasoning** — whether the answer identifies the particular language rule responsible for that conclusion.
|
| 196 |
+
|
| 197 |
+
For example, a benchmark item may require both:
|
| 198 |
+
|
| 199 |
+
* the exact output; and
|
| 200 |
+
* an explanation of why evaluation order, borrowing, synchronization, or destructor timing produces that output.
|
| 201 |
+
|
| 202 |
+
This makes the dataset suitable for evaluating **reasoning quality**, not merely final-answer accuracy.
|
| 203 |
+
|
| 204 |
+
### Example
|
| 205 |
+
|
| 206 |
+
A Rust item concerning a reborrow expects the answer to recognize that the program compiles because the reborrow's lifetime ends at its last use under non-lexical lifetimes, rather than incorrectly rejecting the program merely because two mutable references appear in the same scope.
|
| 207 |
+
|
| 208 |
+
## Intended Uses
|
| 209 |
+
|
| 210 |
+
The dataset can be used for:
|
| 211 |
+
|
| 212 |
+
* Evaluating LLM coding and reasoning models
|
| 213 |
+
* Testing language-semantics competence
|
| 214 |
+
* Comparing models across programming languages
|
| 215 |
+
* Building automated benchmark/evaluation pipelines
|
| 216 |
+
* Studying hallucination and specification-reasoning errors
|
| 217 |
+
* Evaluating whether models provide decisive explanations rather than unsupported conclusions
|
| 218 |
+
|
| 219 |
+
## Recommended Evaluation Protocol
|
| 220 |
+
|
| 221 |
+
For each item:
|
| 222 |
+
|
| 223 |
+
1. Provide the `prompt` to the model under the assumptions stated in the prompt.
|
| 224 |
+
2. Preserve the relevant language/toolchain version.
|
| 225 |
+
3. Evaluate the response against the associated `rubric`.
|
| 226 |
+
4. Score the requested conclusion separately from the supporting reasoning where the rubric provides separate criteria.
|
| 227 |
+
5. Do not award correctness merely because a model happens to give the expected output without explaining the semantic rule when the rubric explicitly requires that explanation.
|
| 228 |
+
|
| 229 |
+
## Data Integrity
|
| 230 |
+
|
| 231 |
+
The supplied corpus contains:
|
| 232 |
+
|
| 233 |
+
* **100** benchmark items
|
| 234 |
+
* **7** language/platform categories
|
| 235 |
+
* An empty `expected_deliverables` field for every item
|
| 236 |
+
* An empty `reference_files` field for every item
|
| 237 |
+
|
| 238 |
+
The benchmark is therefore self-contained at the example/rubric level; no external reference files are specified by the dataset entries themselves.
|
| 239 |
+
|
| 240 |
+
## License
|
| 241 |
+
|
| 242 |
+
Open Data Attribution Training Disclosure License (ODATL‑1.0)
|