Any leetcode grinder can tell you there are a few dozen types of competitive programming problem (monostack, breadth-first state search, binary search over solution space, etc.) so solutions to new problems are often very similar to solutions for old problems.
The training corpus for these code transformers is so large that almost all evaluation involves asking them to generate code from the training corpus.
To evaluate CoPilot, we should ask questions that are unusual enough they can't be answered through regurgitation of the training corpus.
What does CoPilot generate, given this prompt:
// A Go function to set the middle six bits of an unsigned 64-bit integer to 1.
Here is a human solution: func six1s(x uint64) uint64 {
const (
ones = uint64(63)
shift = (64 - 6) / 2
mask = ones << shift
)
return x | mask
}
Can it solve this simple but unusual problem?