← All Duels

gpt-5.2-2025-12-11_vs_gemini-3-pro-preview_20260124_035746.jsonl — 10 puzzles

gpt-5.2-2025-12-11
-3
vs
gemini-3-pro-preview
-1
#1 Sample Solution Wrong
import hashlib
import hmac
import math
import struct

def mystery(x):
    # Accept either str or number; normalize deterministically to bytes
    if isinstance(x, (int, float)):
        # Canonicalize floats/ints via IEEE-754 double bytes so many "similar" values differ.
        # Reject NaN/inf to avoid weirdness.
        if isinstance(x, float) and (math.isnan(x) or math.isinf(x)):
            return False
        b = struct.pack(">d", float(x))
    elif isinstance(x, str):
        b = x.encode("utf-8")
    else:
        return False

    # A tiny, fixed "key" derived from a non-obvious arithmetic identity (still constant).
    key = (str(sum(i*i*i for i in range(1, 11))) + ":" + str(math.prod(range(1, 8)))).encode("ascii")

    # Build a MAC, then hash again; check for a fairly rare pattern in the digest.
    mac = hmac.new(key, b, hashlib.sha256).digest()
    d = hashlib.sha256(mac + b"|" + hashlib.sha1(b).digest()).hexdigest()

    # Condition: digest must begin with 5 zero hex chars and end with exactly '42'
    return d.startswith("00000") and d.endswith("42")
"openai-2025-01-24"
Proposer: gpt-5.2-2025-12-11 Solver: gemini-3-pro-preview
-1 vs 0
#2 Solved
def mystery(x):
    # Input must be a string of length 7
    if not isinstance(x, str) or len(x) != 7:
        return False
    
    # Convert to ASCII values
    v = [ord(c) for c in x]
    
    # 1. Boundary constraints
    # The string must start with 'P' (80) and end with '!' (33)
    if v[0] != 0x50 or v[6] != 0x21:
        return False
        
    # 2. Linear constraints
    # The sum of all ASCII values must be 683
    if sum(v) != 683:
        return False
    
    # The alternating sum (c0 - c1 + c2 - c3 + c4 - c5 + c6) must be 3
    # This effectively creates a relation between the even and odd indexed characters.
    alt_sum = sum(v[i] * (1 if i % 2 == 0 else -1) for i in range(7))
    if alt_sum != 3:
        return False
        
    # 3. Structural constraints
    # The 3rd and 4th characters must be identical
    if v[2] != v[3]:
        return False
        
    # The 2nd and 5th characters must satisfy a specific bitwise XOR relationship
    if v[1] ^ v[4] != 0x19: # 0x19 is 25
        return False
        
    # 4. Filter constraints to ensure uniqueness
    # The 2nd character must be a lowercase vowel
    if x[1] not in "aeiou":
        return False
        
    # The 3rd character must be lexically greater than 'x' (ASCII 120)
    if v[2] <= 120:
        return False
        
    return True
"Puzzle!"
"Puzzle!"
Proposer: gemini-3-pro-preview Solver: gpt-5.2-2025-12-11
-1 vs 0
#3 Sample Solution Wrong
import math

def mystery(x):
    # Only accept strings
    if not isinstance(x, str):
        return False

    # Exact length requirement
    if len(x) != 22:
        return False

    # Must be printable ASCII (space..~)
    if any(not (32 <= ord(c) <= 126) for c in x):
        return False

    # Character-class constraints to narrow the search space without making it obvious
    if not (x[:4].isalpha() and x[:4].isupper()):
        return False
    if x[4] != "-":
        return False
    if not x[5:9].isdigit():
        return False
    if x[9] != "-":
        return False
    if not x[10:14].islower():
        return False
    if x[14] != "-":
        return False
    if not x[15:22].isalnum():
        return False

    # Nonlinear arithmetic constraints (hard to solve by inspection)
    v = [ord(c) for c in x]

    # A few "checksum-like" relations mixing positions
    if (sum(v[i] * (i + 1) for i in range(22)) % 997) != 827:
        return False

    if (sum((v[i] ^ v[21 - i]) for i in range(11)) % 256) != 34:
        return False

    # A disguised exact match using floating-point edge conditions but stable for integers
    t = sum(((v[i] + 17) * (v[i] - 31)) for i in range(22))
    if not math.isfinite(float(t)):
        return False
    if (t % 10007) != 540:
        return False

    # Final gate: a single exact string, but masked behind the above constraints
    target = "NOVA-0420-lumen-A1b2C3d"
    return x == target
"NOVA-0420-lumen-A1b2C3d"
Proposer: gpt-5.2-2025-12-11 Solver: gemini-3-pro-preview
-2 vs 0
#4 Sample Solution Wrong
def mystery(x):
    # Input validation: must be an 8-character string
    if not isinstance(x, str) or len(x) != 8:
        return False
    
    # Convert string to list of ASCII integers
    v = [ord(c) for c in x]
    
    # Constraint 1: Structural anchors
    # The 5th character must be '_' (underscore)
    # The 8th character must be '!' (exclamation mark)
    if v[4] != 0x5F or v[7] != 0x21:
        return False
        
    # Constraint 2: Aggregate checksums
    # Simple sum must be 619
    if sum(v) != 619:
        return False
    
    # Weighted sum must be 2460
    # Formula: v[0]*1 + v[1]*2 + ... + v[7]*8
    if sum(v[i] * (i + 1) for i in range(8)) != 2460:
        return False
        
    # Constraint 3: Bitwise correlation
    # Treat the first 4 characters as one 32-bit integer (big endian)
    # Treat the last 4 characters as another 32-bit integer
    part_a = (v[0] << 24) | (v[1] << 16) | (v[2] << 8) | v[3]
    part_b = (v[4] << 24) | (v[5] << 16) | (v[6] << 8) | v[7]
    
    # Their XOR sum must equal this specific magic number
    # 475470916 is 0x1C575C44 in hex
    if (part_a ^ part_b) != 475470916:
        return False
        
    # Constraint 4: Nonlinear relation
    # A specific algebraic relationship between the first four characters
    if (v[0] * v[2] + v[1] * v[3]) != 17911:
        return False
        
    return True
"Code_88!"
Proposer: gemini-3-pro-preview Solver: gpt-5.2-2025-12-11
-2 vs -1
#5 Solved
import hashlib
import math
import struct

def mystery(x):
    # Accept str or number; canonicalize to bytes
    if isinstance(x, str):
        b = x.encode("utf-8")
        tag = b"S"
    elif isinstance(x, (int, float)):
        if isinstance(x, float) and (math.isnan(x) or math.isinf(x)):
            return False
        # Canonical IEEE-754 double representation
        b = struct.pack(">d", float(x))
        tag = b"N"
    else:
        return False

    # Cheap decoys to waste time (but deterministic)
    h1 = hashlib.sha256(b"decoy|" + tag + b + b"|1").digest()
    h2 = hashlib.blake2b(b"decoy|" + h1 + b"|2", digest_size=32).digest()
    _ = int.from_bytes(h2[:8], "big") ^ int.from_bytes(h2[8:16], "big")

    # The real gate: a "public-key looking" check that is actually just one exact preimage.
    target = b"paper-boat/13"
    d = hashlib.sha256(b"gate|" + target).digest()

    return hashlib.sha256(b"gate|" + b).digest() == d
"paper-boat/13"
"paper-boat/13"
Proposer: gpt-5.2-2025-12-11 Solver: gemini-3-pro-preview
-2 vs -1
#6 Solved
import functools

def mystery(x):
    # Validate container format: Must look like "Key{...}"
    if not isinstance(x, str) or not x.startswith("Key{") or not x.endswith("}"):
        return False
    
    content = x[4:-1]
    # Enforce lowercase hex characters and commas only (no 0x prefix, no uppercase)
    if not set(content).issubset(set("0123456789abcdef,")):
        return False
        
    parts = content.split(",")
    # Must contain exactly 5 numbers
    if len(parts) != 5:
        return False
        
    try:
        # Parse hex strings to integers
        v = [int(p, 16) for p in parts]
    except ValueError:
        return False
    
    # Constraint 1: The sequence must be strictly increasing
    if any(v[i] >= v[i+1] for i in range(4)):
        return False
        
    # Constraint 2: The first three numbers form an Arithmetic Progression (AP)
    # a, a+d, a+2d => (a) + (a+2d) == 2*(a+d)
    if v[0] + v[2] != 2 * v[1]:
        return False

    # Constraint 3: The last three numbers form a Geometric Progression (GP)
    # b, b*r, b*r^2 => b * b*r^2 == (b*r)^2
    if v[2] * v[4] != v[3] ** 2:
        return False

    # Constraint 4: The difference between the last and first number is fixed
    if v[4] - v[0] != 121:
        return False
        
    # Constraint 5: The product of all five numbers must match this large constant
    product = functools.reduce(lambda a, b: a * b, v)
    if product != 69574032:
        return False
        
    return True
"Key{b,16,21,42,84}"
"Key{b,16,21,42,84}"
Proposer: gemini-3-pro-preview Solver: gpt-5.2-2025-12-11
-2 vs -1
#7 Solved
import hashlib
import struct
import math

def mystery(x):
    # normalize to bytes, but with a twist for numbers
    if isinstance(x, str):
        b = x.encode("utf-8")
        kind = 0x53  # 'S'
    elif isinstance(x, (int, float)):
        if isinstance(x, float) and (math.isnan(x) or math.isinf(x)):
            return False
        # canonical IEEE-754 bytes for floats; ints go through float() too
        b = struct.pack(">d", float(x))
        kind = 0x4E  # 'N'
    else:
        return False

    # "looks like crypto": chained hashes with mixed domains
    h = hashlib.sha256(b"\x01salt|" + bytes([kind]) + b).digest()
    h = hashlib.blake2s(b"\x02mix|" + h + b[::-1], digest_size=32).digest()
    h = hashlib.sha3_256(b"\x03fin|" + h + b + bytes([len(b) & 0xFF])).digest()

    # derive a seemingly-arbitrary 64-bit check value
    chk = int.from_bytes(h[:8], "big") ^ int.from_bytes(h[8:16], "big")

    # final gate: forced equality to an embedded value, but disguised behind chk
    # (so preimage hunting via chk is still effectively "find the exact b")
    target = b"steganography>entropy"
    want = int.from_bytes(hashlib.sha3_256(b"\x03fin|" +
                                           hashlib.blake2s(
                                               b"\x02mix|" +
                                               hashlib.sha256(b"\x01salt|" + b"\x53" + target).digest() +
                                               target[::-1],
                                               digest_size=32
                                           ).digest() +
                                           target + bytes([len(target) & 0xFF])
                                           ).digest()[:8], "big") ^ \
           int.from_bytes(hashlib.sha3_256(b"\x03fin|" +
                                           hashlib.blake2s(
                                               b"\x02mix|" +
                                               hashlib.sha256(b"\x01salt|" + b"\x53" + target).digest() +
                                               target[::-1],
                                               digest_size=32
                                           ).digest() +
                                           target + bytes([len(target) & 0xFF])
                                           ).digest()[8:16], "big")

    return chk == want
"steganography>entropy"
"steganography>entropy"
Proposer: gpt-5.2-2025-12-11 Solver: gemini-3-pro-preview
-2 vs -1
#8 Sample Solution Wrong
def mystery(x):
    # Input must be an 8-character string
    if not isinstance(x, str) or len(x) != 8:
        return False
    
    v = [ord(c) for c in x]
    
    # Constraint 1: Global checksum
    # The sum of all ASCII values must be 688
    if sum(v) != 688:
        return False
        
    # Constraint 2: Pairwise Sum and XOR relations
    # We treat the string as 4 pairs of characters.
    # For each pair (a, b), we check their sum and their XOR.
    # Note: For any integers a and b, knowing (a+b) and (a^b) strictly constrains the values,
    # though swapping a and b is possible, and sometimes other bit-shifts are possible.
    targets = [
        (178, 44),  # Pair 0: v[0], v[1]
        (201, 1),   # Pair 1: v[2], v[3]
        (201, 41),  # Pair 2: v[4], v[5]
        (108, 6)    # Pair 3: v[6], v[7]
    ]
    
    for i in range(4):
        a, b = v[2*i], v[2*i+1]
        t_sum, t_xor = targets[i]
        
        if a + b != t_sum or a ^ b != t_xor:
            return False

    # Constraint 3: Specific filters to resolve ambiguity
    # These ensure there is only one valid string among the candidates generated above.
    
    # Filter for Pair 0
    if v[0] % 5 != 2:
        return False
        
    # Filter for Pair 1
    if v[2] >= v[3]:
        return False
        
    # Filter for Pair 2
    if v[5] % 5 != 1:
        return False
        
    # Filter for Pair 3
    if abs(v[6] - v[7]) != 6 or v[6] >= v[7]:
        return False
        
    return True
CodePy39
Proposer: gemini-3-pro-preview Solver: gpt-5.2-2025-12-11
-2 vs -2
#9 Sample Solution Wrong
import hashlib
import struct
import math

def mystery(x):
    # normalize input -> bytes (numbers use IEEE-754 double, strings use UTF-8)
    if isinstance(x, str):
        b = x.encode("utf-8")
        kind = b"S"
    elif isinstance(x, (int, float)):
        if isinstance(x, float) and (math.isnan(x) or math.isinf(x)):
            return False
        b = struct.pack(">d", float(x))
        kind = b"N"
    else:
        return False

    # compute a "fingerprint" that looks like it depends on many properties
    h = hashlib.blake2s(b"\x01" + kind + b, digest_size=32).digest()
    h = hashlib.sha3_256(b"\x02" + h + bytes([len(b) & 0xFF]) + b[::-1]).digest()
    tag = hashlib.sha256(b"\x03" + h + b"\x00" + kind).hexdigest()

    # seemingly arbitrary constraint (rare prefix/suffix), plus an embedded equality trap
    if not (tag.startswith("0e") and tag.endswith("c0")):
        return False

    # final gate: forces the exact intended preimage, but hidden behind the earlier checks
    target = b"brittle/maze::v2|17"
    want = hashlib.sha256(b"\x03" + hashlib.sha3_256(
        b"\x02" + hashlib.blake2s(b"\x01" + b"S" + target, digest_size=32).digest()
        + bytes([len(target) & 0xFF]) + target[::-1]
    ).digest() + b"\x00" + b"S").hexdigest()

    return tag == want
"brittle/maze::v2|17"
Proposer: gpt-5.2-2025-12-11 Solver: gemini-3-pro-preview
-3 vs -2
#10 Solver Failed
def mystery(x):
    # Input must be an 8-character string
    if not isinstance(x, str) or len(x) != 8:
        return False
    
    v = [ord(c) for c in x]
    
    # Interpret the string as two 32-bit big-endian integers
    # 'a' comes from the first 4 characters
    # 'b' comes from the last 4 characters
    a = (v[0] << 24) | (v[1] << 16) | (v[2] << 8) | v[3]
    b = (v[4] << 24) | (v[5] << 16) | (v[6] << 8) | v[7]
    
    # Constraint 1: The two integers must satisfy this XOR relation
    if (a ^ b) != 0x6E5B5644:
        return False
        
    # Constraint 2: The two integers must satisfy this arithmetic Sum relation
    if (a + b) != 0x70A39686:
        return False
        
    # Constraint 3: Fixed anchor character
    if x[4] != '-':
        return False
        
    # Constraint 4: Polynomial Rolling Hash to verify the permutation
    # Base 31, Modulo 10^9 + 7
    h = 0
    MOD = 1000000007
    for c in v:
        h = (h * 31 + c) % MOD
        
    if h != 815623291:
        return False
        
    return True
"NO-SOLN!"
"Code-42!"
Proposer: gemini-3-pro-preview Solver: gpt-5.2-2025-12-11
-3 vs -1