[
  {
    "test_id": "01_prime_sieve",
    "test_name": "Prime Number Sieve",
    "domain": "Pure Mathematics",
    "model": "claude-sonnet-4.5",
    "code_generated": "n = 1000\nsieve = [True] * (n + 1)\nsieve[0] = sieve[1] = False\nfor i in range(2, int(n**0.5) + 1):\n    if sieve[i]:\n        sieve[i*i:n+1:i] = [False] * len(sieve[i*i:n+1:i])\nprint([i for i in range(n + 1) if sieve[i]])",
    "code_executed": true,
    "execution_output": "[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577",
    "verified": true,
    "verification_message": "All expected values present, no unexpected values",
    "time_to_generate": 5.400359153747559,
    "time_to_execute": 0.0011487007141113281,
    "human_readable": true
  },
  {
    "test_id": "02_matrix_mult",
    "test_name": "Matrix Multiplication",
    "domain": "Pure Mathematics",
    "model": "claude-sonnet-4.5",
    "code_generated": "from functools import reduce\n\nA = [[1,2,3],[4,5,6],[7,8,9]]\nB = [[9,8,7],[6,5,4],[3,2,1]]\n\nresult = [[reduce(lambda acc, k: acc + A[i][k] * B[k][j], range(3), 0) for j in range(3)] for i in range(3)]\n\nprint(result)",
    "code_executed": true,
    "execution_output": "[[30, 24, 18], [84, 69, 54], [138, 114, 90]]",
    "verified": true,
    "verification_message": "Matrix multiplication verified by SymPy",
    "time_to_generate": 4.130185842514038,
    "time_to_execute": 0.0,
    "human_readable": true
  },
  {
    "test_id": "03_fibonacci_matrix",
    "test_name": "Fibonacci Matrix Exponentiation",
    "domain": "Pure Mathematics",
    "model": "claude-sonnet-4.5",
    "code_generated": "def matrix_mult(A, B):\n    return [\n        [A[0][0]*B[0][0] + A[0][1]*B[1][0], A[0][0]*B[0][1] + A[0][1]*B[1][1]],\n        [A[1][0]*B[0][0] + A[1][1]*B[1][0], A[1][0]*B[0][1] + A[1][1]*B[1][1]]\n    ]\n\ndef matrix_pow(M, n):\n    if n == 0:\n        return [[1, 0], [0, 1]]\n    if n == 1:\n        return M\n    if n % 2 == 0:\n        half = matrix_pow(M, n // 2)\n        return matrix_mult(half, half)\n    return matrix_mult(M, matrix_pow(M, n - 1))\n\nM = [[1, 1], [1, 0]]\nfibs = [0]\nfor i in range(1, 20):\n    result = matrix_pow(M, i)\n    fibs.append(result[0][1])\n\nprint(fibs)",
    "code_executed": true,
    "execution_output": "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181]",
    "verified": true,
    "verification_message": "Fibonacci sequence verified",
    "time_to_generate": 6.264644622802734,
    "time_to_execute": 0.0,
    "human_readable": true
  },
  {
    "test_id": "04_backprop",
    "test_name": "Neural Network Backpropagation",
    "domain": "AI & Algorithms",
    "model": "claude-sonnet-4.5",
    "code_generated": "import math\n\ndef sigmoid(x):\n    return 1 / (1 + math.exp(-x))\n\ndef sigmoid_derivative(x):\n    s = sigmoid(x)\n    return s * (1 - s)\n\nweights = [0.5, -0.5]\nbias = 0.1\ninputs = [1.0, 2.0]\ntarget = 1.0\nlearning_rate = 0.1\n\nz = sum(w * x for w, x in zip(weights, inputs)) + bias\noutput = sigmoid(z)\n\nerror = target - output\ndelta = error * sigmoid_derivative(z)\n\nweights = [w + learning_rate * delta * x for w, x in zip(weights, inputs)]\nbias = bias + learning_rate * delta\n\nprint(weights)",
    "code_executed": true,
    "execution_output": "[0.5143841143684869, -0.47123177126302623]",
    "verified": true,
    "verification_message": "Gradient check - manual verification needed",
    "time_to_generate": 5.640119552612305,
    "time_to_execute": 0.0026092529296875,
    "human_readable": true
  },
  {
    "test_id": "05_dfs_maze",
    "test_name": "DFS Maze Solver",
    "domain": "AI & Algorithms",
    "model": "claude-sonnet-4.5",
    "code_generated": "print((lambda maze, start, end: (lambda dfs: dfs(dfs, start[0], start[1], set()))(lambda f, r, c, visited: (r, c) == end or ((r, c) not in visited and 0 <= r < len(maze) and 0 <= c < len(maze[0]) and maze[r][c] == 0 and any(f(f, nr, nc, visited | {(r, c)}) for nr, nc in [(r+1,c),(r-1,c),(r,c+1),(r,c-1)]))))([[0,0,1,0],[0,1,0,0],[0,0,0,1],[1,1,0,0]], (0,0), (3,3)))",
    "code_executed": true,
    "execution_output": "True",
    "verified": true,
    "verification_message": "Path found (as expected for this maze)",
    "time_to_generate": 6.476532459259033,
    "time_to_execute": 0.0,
    "human_readable": false
  },
  {
    "test_id": "06_bitonic_sort",
    "test_name": "Bitonic Sort",
    "domain": "AI & Algorithms",
    "model": "claude-sonnet-4.5",
    "code_generated": "arr = [3,7,4,8,6,2,1,5,9,0,12,15,10,11,13,14]\n\ncompare_swap = lambda arr, i, j, direction: (arr.__setitem__(i, arr[j]), arr.__setitem__(j, arr[i])) if (arr[i] > arr[j]) == direction else None\n\nbitonic_merge = lambda arr, low, cnt, direction: (\n    None if cnt <= 1 else (\n        (lambda k: [compare_swap(arr, low + i, low + i + k, direction) for i in range(k)] + [bitonic_merge(arr, low, k, direction)] + [bitonic_merge(arr, low + k, k, direction)])(cnt // 2)\n    )\n)\n\nbitonic_sort_rec = lambda arr, low, cnt, direction: (\n    None if cnt <= 1 else (\n        (lambda k: [bitonic_sort_rec(arr, low, k, True)] + [bitonic_sort_rec(arr, low + k, k, False)] + [bitonic_merge(arr, low, cnt, direction)])(cnt // 2)\n    )\n)\n\nbitonic_sort = lambda arr: bitonic_sort_rec(arr, 0, len(arr), True) or arr\n\nprint(bitonic_sort(arr))",
    "code_executed": true,
    "execution_output": "[[[[None, None, [None, None, None]], [None, None, [(None, None), None, None]], [None, None, [None, None, None], [None, None, None]]], [[None, None, [(None, None), None, None]], [None, None, [(None, None), None, None]], [(None, None), (None, None), [(None, None), None, None], [(None, None), None, None]]], [None, (None, None), (None, None), (None, None), [None, None, [None, None, None], [None, None, None]], [None, None, [None, None, None], [None, None, None]]]], [[[None, None, [(None, None), None,",
    "verified": false,
    "verification_message": "Not sorted correctly. Expected [0, 1, 2, 3, 4]...",
    "time_to_generate": 8.427877187728882,
    "time_to_execute": 0.0,
    "human_readable": true
  },
  {
    "test_id": "07_rsa",
    "test_name": "RSA Encryption",
    "domain": "Security & Finance",
    "model": "claude-sonnet-4.5",
    "code_generated": "print((lambda p, q, m: (lambda n, phi, e: (lambda d: (pow(m, e, n), pow(pow(m, e, n), d, n)))(next(d for d in range(2, phi) if (e * d) % phi == 1)))(p * q, (p - 1) * (q - 1), 65537))(61, 53, 42))",
    "code_executed": true,
    "execution_output": "(2557, 42)",
    "verified": true,
    "verification_message": "RSA verified: encrypt(42)=2557, decrypt=42",
    "time_to_generate": 5.379313707351685,
    "time_to_execute": 0.0011811256408691406,
    "human_readable": true
  },
  {
    "test_id": "08_black_scholes",
    "test_name": "Black-Scholes Option Pricing",
    "domain": "Security & Finance",
    "model": "claude-sonnet-4.5",
    "code_generated": "print(100 * (0.5 * (1 + ((0.125 / (1 + 0.196854 * 0.125 + 0.115194 * 0.125**2 + 0.000344 * 0.125**3 + 0.019527 * 0.125**4)) * (0.3989423 * (2.718281828**(-0.125**2 / 2))) - (1 / (1 + 0.2316419 * 0.125)) * (0.3989423 * (2.718281828**(-0.125**2 / 2))) * (0.319381530 - 0.356563782 * (1 / (1 + 0.2316419 * 0.125)) + 1.781477937 * (1 / (1 + 0.2316419 * 0.125))**2 - 1.821255978 * (1 / (1 + 0.2316419 * 0.125))**3 + 1.330274429 * (1 / (1 + 0.2316419 * 0.125))**4)))) - 100 * (2.718281828**(-0.05 * 1)) * (0.5 * (1 + (((-0.075) / (1 + 0.196854 * abs(-0.075) + 0.115194 * (-0.075)**2 + 0.000344 * abs(-0.075)**3 + 0.019527 * (-0.075)**4)) * (0.3989423 * (2.718281828**(-(-0.075)**2 / 2))) - (1 / (1 + 0.2316419 * abs(-0.075))) * (0.3989423 * (2.718281828**(-(-0.075)**2 / 2))) * (0.319381530 - 0.356563782 * (1 / (1 + 0.2316419 * abs(-0.075))) + 1.781477937 * (1 / (1 + 0.2316419 * abs(-0.075)))**2 - 1.821255978 * (1 / (1 + 0.2316419 * abs(-0.075)))**3 + 1.330274429 * (1 / (1 + 0.2316419 * abs(-0.075)))**4)))))",
    "code_executed": true,
    "execution_output": "6.092294731405179",
    "verified": false,
    "verification_message": "Value 6.0923 outside range (9.0, 11.0)",
    "time_to_generate": 11.923842191696167,
    "time_to_execute": 0.0020165443420410156,
    "human_readable": false
  },
  {
    "test_id": "09_game_of_life",
    "test_name": "Conway's Game of Life",
    "domain": "Simulation",
    "model": "claude-sonnet-4.5",
    "code_generated": "grid = [[0,1,0,0,0],[0,0,1,0,0],[1,1,1,0,0],[0,0,0,0,0],[0,0,0,0,0]]\nprint([[int((sum(grid[(i+di)%5][(j+dj)%5] for di in [-1,0,1] for dj in [-1,0,1] if di or dj) == 3) or (grid[i][j] and sum(grid[(i+di)%5][(j+dj)%5] for di in [-1,0,1] for dj in [-1,0,1] if di or dj) == 2)) for j in range(5)] for i in range(5)])",
    "code_executed": true,
    "execution_output": "[[0, 0, 0, 0, 0], [1, 0, 1, 0, 0], [0, 1, 1, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 0, 0]]",
    "verified": true,
    "verification_message": "Game of Life generation produced valid grid",
    "time_to_generate": 6.120673418045044,
    "time_to_execute": 0.0,
    "human_readable": true
  },
  {
    "test_id": "10_sudoku",
    "test_name": "Sudoku Validator",
    "domain": "Simulation",
    "model": "claude-sonnet-4.5",
    "code_generated": "print(all(len(set(b[i][j] for j in range(9)))==9 for i in range(9)) and all(len(set(b[i][j] for i in range(9)))==9 for j in range(9)) and all(len(set(b[i+r][j+c] for r in range(3) for c in range(3)))==9 for i in range(0,9,3) for j in range(0,9,3)) for b in [[[5,3,4,6,7,8,9,1,2],[6,7,2,1,9,5,3,4,8],[1,9,8,3,4,2,5,6,7],[8,5,9,7,6,1,4,2,3],[4,2,6,8,5,3,7,9,1],[7,1,3,9,2,4,8,5,6],[9,6,1,5,3,7,2,8,4],[2,8,7,4,1,9,6,3,5],[3,4,5,2,8,6,1,7,9]]])",
    "code_executed": true,
    "execution_output": "<generator object <genexpr> at 0x0000023602AF8C40>",
    "verified": false,
    "verification_message": "Sudoku verification error: invalid syntax (<string>, line 1)",
    "time_to_generate": 6.1321189403533936,
    "time_to_execute": 0.0,
    "human_readable": false
  },
  {
    "test_id": "11_fibonacci_original",
    "test_name": "Fibonacci One-Liner (Original)",
    "domain": "Pure Mathematics",
    "model": "claude-sonnet-4.5",
    "code_generated": "print([int((lambda m,n:__import__('functools').reduce(lambda a,b:[[a[0][0]*b[0][0]+a[0][1]*b[1][0],a[0][0]*b[0][1]+a[0][1]*b[1][1]],[a[1][0]*b[0][0]+a[1][1]*b[1][0],a[1][0]*b[0][1]+a[1][1]*b[1][1]]],(__import__('functools').reduce(lambda x,y:y[1](x[0],x[1])if y[0]&n else x,enumerate([lambda p,q:[[p[0][0]*q[0][0]+p[0][1]*q[1][0],p[0][0]*q[0][1]+p[0][1]*q[1][1]],[p[1][0]*q[0][0]+p[1][1]*q[1][0],p[1][0]*q[0][1]+p[1][1]*q[1][1]]]]*n.bit_length()),([[1,0],[0,1]],m))[1] if n else [[1,0],[0,1]]))([[1,1],[1,0]],i)[0][1] if i else 0)for i in range(100)])",
    "code_executed": false,
    "execution_output": "closing parenthesis ']' does not match opening parenthesis '(' (<string>, line 1)",
    "verified": false,
    "verification_message": "Not verified",
    "time_to_generate": 8.600115537643433,
    "time_to_execute": 0.0036983489990234375,
    "human_readable": false
  }
]