← All Duels

gpt-5.2-pro-2025-12-11_vs_gemini-2.5-flash_20260125_005422.jsonl — 10 puzzles

gpt-5.2-pro-2025-12-11
1
vs
gemini-2.5-flash
-5
#1 Solver Failed
def mystery(x):
    import base64
    import re

    # Normalize x -> integer n
    if isinstance(x, bool):
        return False

    if isinstance(x, (bytes, bytearray)):
        try:
            x = x.decode("ascii", "strict")
        except Exception:
            return False

    if isinstance(x, str):
        s = x.strip()
        # keep the search space "reasonable", but still nontrivial
        if not re.fullmatch(r"[+]?\d{1,12}", s):
            return False
        n = int(s, 10)
    elif isinstance(x, int):
        n = x
    elif isinstance(x, float):
        if not x.is_integer():
            return False
        n = int(x)
    else:
        return False

    if not (0 <= n < 1_000_000_000):
        return False

    # Unpack (modulus, remainder) pairs from an obfuscated blob
    def _pairs(blob_b64: str):
        k = int("2d", 16) ^ int("77", 16)  # 0x5A, but not written directly
        raw = base64.b64decode(blob_b64.encode("ascii"))
        raw = bytes((c ^ k) for c in raw)
        it = iter(raw)
        return list(zip(it, it))  # (m1,r1),(m2,r2),...

    constraints = _pairs("O30DCQlKFVcTGw==")

    ok = True
    for m, r in constraints:
        ok &= ((n - r) % m == 0)

    # Additional "noise" checks that look meaningful
    ds = str(n)
    ok &= (len(ds) == 9)
    ok &= (sum((ord(ch) & 0x0F) for ch in ds) == 45)
    ok &= ((int(ds[:3]) * int(ds[3:6]) - int(ds[6:])) == 55299)

    return bool(ok)
x`, and the fact that no such `x` exists, I cannot provide a value that satisfies the condition.
123456789
Proposer: gpt-5.2-pro-2025-12-11 Solver: gemini-2.5-flash
1 vs 0
#2 Sample Solution Wrong
import base64
import hashlib
import re

def mystery(x):
    # Ensure x is a string
    if not isinstance(x, str):
        return False

    # Input format: four hexadecimal byte values separated by hyphens
    parts = x.split('-')
    if len(parts) != 4:
        return False

    processed_parts = []
    for part in parts:
        # Each part must be exactly two hex digits
        if not re.fullmatch(r'[0-9a-fA-F]{2}', part):
            return False
        try:
            processed_parts.append(int(part, 16))
        except ValueError: # Should be caught by regex, but good practice
            return False

    # --- Obfuscated Key Derivation ---
    # The key material is hidden in a base64 encoded, XOR-scrambled string.
    obfuscated_key_blob = "aU/AA1Y_SHV_Qw==" # Derived from b"PuzzlerKey"
    key_bytes_xor_val = 0x3A # The XOR key used for obfuscation

    try:
        decoded_key_bytes = base64.b64decode(obfuscated_key_blob.encode('ascii'))
        key_material = bytes(b ^ key_bytes_xor_val for b in decoded_key_bytes)
        # Ensure sufficient key material for k_mod indexing
        if len(key_material) < 8:
            return False
    except Exception:
        return False # Handle malformed base64 or decoding errors

    # --- Obfuscated Target Derivation ---
    # The target value is derived from a SHA256 hash of another hidden string.
    obfuscated_target_blob = "FiMwJjYTGCMuNyc=" # Derived from b"TargetValue"
    target_bytes_xor_val = 0x42 # The XOR key used for obfuscation

    try:
        decoded_target_bytes = base64.b64decode(obfuscated_target_blob.encode('ascii'))
        target_material = bytes(b ^ target_bytes_xor_val for b in decoded_target_bytes)
    except Exception:
        return False

    # --- Core Transformation Logic ---
    # A stateful transformation is applied to the input bytes.
    # The initial 'seed' comes from the first byte of the key_material.
    seed = key_material[0] # The ordinal value of 'P' from "PuzzlerKey"

    transformed_bytes = []
    for i, p_byte in enumerate(processed_parts):
        # k_val: key byte based on current index (cycling through key_material)
        k_val = key_material[i % len(key_material)]
        # k_mod: another key byte, offset by 4, to add more complexity
        k_mod = key_material[(i + 4) % len(key_material)]
        
        # Calculate a dynamic XOR modifier based on key bytes and the current seed
        xor_modifier = (k_val + k_mod + seed) % 256
        
        # Apply XOR transformation to the input byte
        transformed = p_byte ^ xor_modifier
        
        transformed_bytes.append(transformed)
        
        # Update the seed for the next iteration using the current transformed byte
        seed = (seed + transformed) % 256

    # Combine the four transformed bytes into a single 32-bit integer (big-endian)
    final_int = 0
    for i, b in enumerate(transformed_bytes):
        final_int |= (b << (8 * (3 - i)))

    # --- Final Check ---
    # Compute the expected final integer from the first 4 bytes of the SHA256 hash of target_material
    hash_digest = hashlib.sha256(target_material).digest()
    expected_final_int = int.from_bytes(hash_digest[:4], 'big')

    return final_int == expected_final_int
16-A2-66-5B
Proposer: gemini-2.5-flash Solver: gpt-5.2-pro-2025-12-11
1 vs -1
#3 Solver Failed
def mystery(x):
    import re

    # --- normalize to int n ---
    if isinstance(x, bool):
        return False

    if isinstance(x, (bytes, bytearray)):
        try:
            x = x.decode("utf-8", "strict")
        except Exception:
            return False

    if isinstance(x, str):
        s = x.strip().replace("_", "")
        if s.startswith("+"):
            s = s[1:]
        if not re.fullmatch(r"\d{9}", s):
            return False
        n = int(s, 10)
    elif isinstance(x, int):
        n = x
    elif isinstance(x, float):
        if not x.is_integer():
            return False
        n = int(x)
    else:
        return False

    if not (100_000_000 <= n <= 999_999_999):
        return False

    # --- helper: digit sum without being too obvious ---
    def dsum(v: int) -> int:
        t = 0
        while v:
            v, r = divmod(v, 10)
            t += r
        return t

    ok = True

    # --- hidden modular constraints unpacked from a scrambled blob ---
    # The blob decodes to bytes: [m1,r1,m2,r2,...]
    blob = bytes.fromhex("b2f98a9980d89cc29ac0")
    k = (1 << 8) - 45  # 211
    raw = bytes((b ^ k) for b in blob)
    pairs = list(zip(raw[0::2], raw[1::2]))  # (mod, rem)

    for m, r in pairs:
        ok &= ((n - r) % m == 0)

    # --- extra constraints that look like "noise" but are decisive ---
    ok &= (dsum(n) == int("100011", 2))  # 35
    ok &= ((n & ((1 << 12) - 1)) == (0x4 << 8) + (0xC << 4) + 0x0)  # 0x4C0

    a = n // 1_000_000
    b = (n // 1_000) % 1_000
    c = n % 1_000
    ok &= (((a ^ b) + c) == int.from_bytes(b"\x05\xe9", "big"))  # 1513

    bb = n.to_bytes(4, "big", signed=False)
    score = (bb[0] * 7 + bb[1] * 11 + bb[2] * 13 + bb[3] * 17) % 257
    ok &= (score == (1 << 6) + 2)  # 66

    ok &= ((((bb[0] ^ bb[2]) * (bb[1] ^ bb[3])) & 0xFF) == (0x20 + 0x3F))  # 95

    return bool(ok)
x`. This suggests that there might be a subtle interpretation or an oversight in the analysis. Given the robustness of the CRT and Python's arithmetic, and the explicit nature of the range check, the conclusion that no such `n` exists within the specified range is very strong.
735134912
Proposer: gpt-5.2-pro-2025-12-11 Solver: gemini-2.5-flash
2 vs -1
#4 Sample Solution Wrong
import base64
import hashlib
import re

def mystery(x):
    # 1. Input type and format validation
    if not isinstance(x, str):
        return False

    # x must be a string of 16 characters, consisting only of uppercase letters and digits
    if not re.fullmatch(r'[A-Z0-9]{16}', x):
        return False

    # Convert the string into a list of 16 integers (ASCII values)
    char_vals = [ord(c) for c in x]

    # 2. Obfuscated key material for transformations
    # Derived from b"SecretKeyForPuzzle" XORed with 0x55
    key_blob_b64 = "MgQSEyYKFhQkFSMjXyQ0LSM1LSMdLSMU"
    key_xor_val = 0x55
    try:
        key_material_bytes = base64.b64decode(key_blob_b64.encode('ascii'))
        key_material = [b ^ key_xor_val for b in key_material_bytes]
        if len(key_material) < 16: # Ensure sufficient key material
            return False
    except Exception:
        return False

    # 3. Core transformation: A series of byte manipulations
    transformed_vals = []
    current_state = 0xAA # Initial state for a simple PRNG-like sequence

    for i in range(16):
        # Pick a character value from input x
        input_val = char_vals[i]

        # Use key material, cycling through it
        k_val = key_material[i % len(key_material)]

        # Combine input, key, and current state
        # A bitwise XOR with current state and key, ensuring byte range
        combined = (input_val ^ k_val ^ current_state) & 0xFF

        # Further transform using a "rotational shift" based on another key byte
        shift_amount = key_material[(i + 7) % len(key_material)] % 8 # Shift by 0-7 bits
        
        # Simple circular left shift operation
        transformed = ((combined << shift_amount) | (combined >> (8 - shift_amount))) & 0xFF
        
        transformed_vals.append(transformed)

        # Update the state for the next iteration using the current transformed byte
        current_state = (current_state + transformed + k_val) % 256

    # 4. Final checks and target values
    
    # Check 1: Sum of all 16 transformed values must match a hidden constant
    # Target value: 2383. Obfuscated as: (2383 ^ 0x7F) -> 2304 -> b'\x09\x00' -> "CQA="
    target_sum_blob = "CQA="
    target_sum_xor = 0x7F
    try:
        decoded_target_sum_bytes = base64.b64decode(target_sum_blob.encode('ascii'))
        if len(decoded_target_sum_bytes) != 2: return False
        expected_sum_val = int.from_bytes(decoded_target_sum_bytes, 'big') ^ target_sum_xor
    except Exception:
        return False

    if sum(transformed_vals) != expected_sum_val:
        return False

    # Check 2: The most significant 64 bits of the combined 128-bit transformed integer
    # Combine all 16 transformed bytes into a single 128-bit integer (big-endian)
    combined_128_bit_int = 0
    for i, byte_val in enumerate(transformed_vals):
        combined_128_bit_int |= (byte_val << (8 * (15 - i))) # Big-endian

    # The most significant 64 bits of this combined integer (first 8 bytes)
    msb_64_bits = combined_128_bit_int >> 64

    # This 64-bit value, when XORed with a specific magic number, must result in a target value.
    # Magic number: 0xDEADBEEFCAFEBABE (obfuscated in magic_number_blob_b64)
    # Target value: 0x79D1CD182552D107 (obfuscated in target_val_blob_b64)
    
    magic_number_blob_b64 = "3u2+78r+v7X+" # Base64 of b'\xde\xad\xbe\xef\xca\xfe\xba\xbe'
    target_val_blob_b64 = "edHNGCVS0Qc=" # Base64 of b'y\xd1\xcd\x18%\x52\xd1\x07'

    try:
        magic_num_bytes = base64.b64decode(magic_number_blob_b64.encode('ascii'))
        magic_number = int.from_bytes(magic_num_bytes, 'big')

        target_val_bytes = base64.b64decode(target_val_blob_b64.encode('ascii'))
        target_val = int.from_bytes(target_val_bytes, 'big')
    except Exception:
        return False

    if (msb_64_bits ^ magic_number) != target_val:
        return False

    # Check 3: CRC-8 of a specific 2-byte subset of transformed bytes must match a target value
    # Using CRC-8 polynomial 0x07 (x^8 + x^2 + x + 1), initial CRC 0xFF, no reflection.
    def crc8(data, poly=0x07, initial_crc=0xFF):
        crc = initial_crc
        for byte in data:
            crc ^= byte
            for _ in range(8):
                if crc & 0x80:
                    crc = (crc << 1) ^ poly
                else:
                    crc <<= 1
            crc &= 0xFF
        return crc

    crc_bytes = bytes(transformed_vals[8:10]) # Take 2 bytes (transformed_vals[8] and transformed_vals[9])
    
    # Target CRC-8 value: 0x51. Obfuscated as: (0x51 ^ 0xAA) -> 251 -> b'\xfb' -> "+w=="
    target_crc_blob = "+w=="
    target_crc_xor = 0xAA
    try:
        decoded_target_crc_bytes = base64.b64decode(target_crc_blob.encode('ascii'))
        if len(decoded_target_crc_bytes) != 1: return False
        expected_crc_val = decoded_target_crc_bytes[0] ^ target_crc_xor
    except Exception:
        return False

    if crc8(crc_bytes) != expected_crc_val:
        return False

    return True
"AAAAAAAAAAAAAAA"
Proposer: gemini-2.5-flash Solver: gpt-5.2-pro-2025-12-11
2 vs -2
#5 Solver Failed
def mystery(x):
    import base64
    import re

    # --- normalize to a canonical text form ---
    if isinstance(x, bool):
        return False

    if isinstance(x, (bytes, bytearray)):
        try:
            x = x.decode("ascii", "strict")
        except Exception:
            return False

    if not isinstance(x, str):
        return False

    s = x.strip()
    # format: 8 hex bytes separated by dashes
    if not re.fullmatch(r"(?i)(?:[0-9a-f]{2}-){7}[0-9a-f]{2}", s):
        return False

    parts = s.split("-")
    try:
        b = bytes(int(p, 16) for p in parts)
    except Exception:
        return False
    if len(b) != 8:
        return False

    # --- a small "checksum" gate (decoy-ish, but real) ---
    coeff = (1, 3, 5, 7, 11, 13, 17, 19)
    chk = sum(ci * bi for ci, bi in zip(coeff, b)) & 0xFF
    if chk != ((0xE << 2) & 0xFF):  # 0x38 without writing 0x38 directly
        return False

    # --- obfuscated constants ---
    def _u64_from_blob(blob_b64: str, mask: int):
        raw = base64.b64decode(blob_b64.encode("ascii"))
        raw = bytes((c ^ (mask & 0xFF)) for c in raw)
        if len(raw) != 8:
            return None
        return int.from_bytes(raw, "big", signed=False)

    k1 = _u64_from_blob("zM3Oz8jJyss=", ((0xF0 | 0x0F) ^ ord("<")))  # 0xC3
    k2 = _u64_from_blob("Tn1sGwo5KNc=", (0xAA ^ 0xF5))               # 0x5F
    k3 = _u64_from_blob("PDw8PDw8PDw=", (0x33 * 3))                 # 0x99
    target = _u64_from_blob("m7eXhXiDwyE=", ord("<"))               # 0x3C

    if None in (k1, k2, k3, target):
        return False

    # --- 64-bit invertible mixing ---
    def _rotl64(v: int, r: int) -> int:
        r &= 63
        v &= (1 << 64) - 1
        return ((v << r) | (v >> (64 - r))) & ((1 << 64) - 1)

    n = int.from_bytes(b, "big", signed=False)
    r = len("abcdefghijklmnopq")  # 17

    y = _rotl64(((n ^ k1) + k2) & ((1 << 64) - 1), r) ^ k3

    # --- final check ---
    return y == target
"e0-e4-cb-bc-80-84-61-70"
"13-37-c0-de-ba-ad-f0-0d"
Proposer: gpt-5.2-pro-2025-12-11 Solver: gemini-2.5-flash
3 vs -2
#6 Sample Solution Wrong
import base64
import hashlib
import re

def mystery(x):
    # --- 1. Input Validation ---
    if not isinstance(x, str):
        return False

    # Input must be a 10-character string consisting only of lowercase letters (a-z)
    if not re.fullmatch(r'[a-z]{10}', x):
        return False

    # Convert characters to 0-25 integer values
    char_to_int_vals = [ord(c) - ord('a') for c in x]

    # --- 2. Obfuscated Constants and Decoders ---

    def _decode_blob(blob_b64: str, xor_key: int) -> bytes:
        """Decodes a base64 string and XORs its bytes with a key."""
        try:
            decoded_bytes = base64.b64decode(blob_b64.encode('ascii'))
            return bytes(b ^ xor_key for b in decoded_bytes)
        except Exception:
            return b"" # Return empty bytes on failure

    # Key material for transformations, derived from b"CryptoWizardry" XORed with 0x77
    key_material_blob = "NDUODwMYSB0WFwUTDg=="
    key_material_xor = (0x70 + 0x07) # 0x77
    key_material = _decode_blob(key_material_blob, key_material_xor)
    if len(key_material) < 10: # Ensure sufficient key material for cycling
        return False

    # Permutation key for shuffling input values, derived from a permutation list XORed with 0x5A
    permutation_key_blob = "WVpYUzVbX1Jc"
    permutation_key_xor = (0x50 + 0x0A) # 0x5A
    permutation_key_bytes = _decode_blob(permutation_key_blob, permutation_key_xor)
    if len(permutation_key_bytes) != 10:
        return False
    permutation_key = [b for b in permutation_key_bytes] # Convert to list of integers

    # Initial state for the stateful mixer, derived from 0xDE XORed with 0xAB
    initial_state_blob = "dQ=="
    initial_state_xor = (0xA0 + 0x0B) # 0xAB
    initial_state_bytes = _decode_blob(initial_state_blob, initial_state_xor)
    if len(initial_state_bytes) != 1:
        return False
    initial_state = initial_state_bytes[0] ^ initial_state_xor # Re-XOR to get the original value

    # Target sum for specific mixed values, derived from 371 XORed with 0x66
    target_sum_blob = "ARU="
    target_sum_xor = (0x60 + 0x06) # 0x66
    target_sum_bytes = _decode_blob(target_sum_blob, target_sum_xor)
    if len(target_sum_bytes) != 2:
        return False
    expected_sum = int.from_bytes(target_sum_bytes, 'big') ^ target_sum_xor

    # Target hash prefix, a direct hex string
    target_hash_prefix = "64c39b25"

    # --- 3. Core Transformation Logic ---

    # Step A: Permute the input character values based on the permutation_key
    permuted_vals = [0] * 10
    for i in range(10):
        # Ensure permutation_key values are valid indices (0-9)
        if not (0 <= permutation_key[i] < 10):
            return False
        permuted_vals[i] = char_to_int_vals[permutation_key[i]]

    # Step B: Stateful Mixing - each value is transformed based on input, key, and a running state
    mixed_vals = []
    current_state = initial_state # Initialize with the obfuscated initial state

    for i in range(10):
        p_val = permuted_vals[i]
        k_val = key_material[i % len(key_material)] # Cycle through key material

        # Combine input, key, and current state using addition modulo 256
        intermediate = (p_val + k_val + current_state) & 0xFF

        # Apply a circular left shift to the intermediate value
        # The shift amount is determined by another key-derived value (0-4 bits)
        shift_amount = k_val % 5 
        transformed = ((intermediate << shift_amount) | (intermediate >> (8 - shift_amount))) & 0xFF
        
        mixed_vals.append(transformed)
        
        # Update the state for the next iteration using the current transformed byte
        current_state = (current_state + transformed) % 256

    # Step C: Aggregate the 10 mixed bytes into a single 80-bit integer (big-endian)
    final_int = 0
    for i, byte_val in enumerate(mixed_vals):
        final_int |= (byte_val << (8 * (9 - i)))

    # --- 4. Final Checks ---

    # Check 1: A specific property of the original input string
    # The 4th character (index 3) of the original input x, when mapped to 0-25,
    # must have a specific remainder when divided by 5.
    expected_remainder = (ord('d') - ord('a')) % 5 # 'd' is 3, 3 % 5 = 3
    if (char_to_int_vals[3] % 5) != expected_remainder:
        return False

    # Check 2: The sum of the 1st, 6th, and 10th mixed values must match a hidden constant
    if (mixed_vals[0] + mixed_vals[5] + mixed_vals[9]) != expected_sum:
        return False

    # Check 3: The SHA256 hash of the final 80-bit integer (as 10 bytes) must start with a specific prefix
    final_int_bytes = final_int.to_bytes(10, 'big')
    calculated_hash_prefix = hashlib.sha256(final_int_bytes).hexdigest()[:8]
    if calculated_hash_prefix != target_hash_prefix:
        return False

    return True
"shadowland"
Proposer: gemini-2.5-flash Solver: gpt-5.2-pro-2025-12-11
3 vs -3
#7 Sample Solution Wrong
def mystery(x):
    import base64
    import re

    # --- normalize x -> 64-bit unsigned int n ---
    if isinstance(x, bool):
        return False

    if isinstance(x, (bytes, bytearray)):
        try:
            x = x.decode("ascii", "strict")
        except Exception:
            return False

    if isinstance(x, str):
        s = x.strip().lower()
        # allow common "pretty" hex forms: 0x...., with optional separators
        s = s.replace("_", "").replace(":", "").replace("-", "").replace(" ", "")
        if s.startswith("0x"):
            s = s[2:]
        if not re.fullmatch(r"[0-9a-f]{16}", s):
            return False
        n = int(s, 16)
    elif isinstance(x, int):
        n = x
    elif isinstance(x, float):
        if not x.is_integer():
            return False
        n = int(x)
    else:
        return False

    if not (0 <= n < (1 << 64)):
        return False

    bb = n.to_bytes(8, "big", signed=False)

    # --- a "small" gate that looks like noise ---
    chk = sum((i + 1) * b for i, b in enumerate(bb)) % 251
    if chk != (0x11 - 0x0E):  # 3, but not written directly as 3
        return False

    # --- 8-bit rotate left ---
    def _rotl8(v: int, r: int) -> int:
        r &= 7
        v &= 0xFF
        return ((v << r) | (v >> (8 - r))) & 0xFF

    # --- stateful byte mixer ---
    s = 0xA7
    out = []
    for i, bi in enumerate(bb):
        s = (s * 73 + 41) & 0xFF
        v = (bi ^ s) & 0xFF
        v = (v + (bb[i - 1] if i else 0x5C)) & 0xFF
        out.append(_rotl8(v, i))

    outb = bytes(out)

    # --- decode the hidden target (8 bytes), with a per-position mask ---
    blob = base64.b64decode("xdHreTYNSFI=")  # 8 bytes
    if len(blob) != 8:
        return False

    target = bytes(blob[i] ^ ((0x33 + 17 * i) & 0xFF) for i in range(8))

    if outb != target:
        return False

    # --- extra invariants (more "noise", but real) ---
    t_little = int.from_bytes(outb, "little", signed=False)
    if ((t_little ^ (t_little >> 17) ^ (t_little >> 43)) & 0xFF) != (0x0C + 0x0D):  # 0x19
        return False

    t_big = int.from_bytes(outb, "big", signed=False)
    if t_big.bit_count() != ((1 << 5) + (1 << 2)):  # 36
        return False

    return True
"524944444C453432"
Proposer: gpt-5.2-pro-2025-12-11 Solver: gemini-2.5-flash
2 vs -3
#8 Sample Solution Wrong
import base64
import hashlib
import re

def mystery(x):
    # --- 1. Input Validation ---
    if not isinstance(x, str):
        return False

    # Input must be a string of five integers (0-255), separated by hyphens.
    # E.g., "123-45-67-89-10"
    parts = x.split('-')
    if len(parts) != 5:
        return False

    input_vals = []
    for part in parts:
        # Each part must be 1 to 3 digits (representing 0-255)
        if not re.fullmatch(r'\d{1,3}', part):
            return False
        try:
            val = int(part)
            if not (0 <= val <= 255): # Ensure values fit within a byte
                return False
            input_vals.append(val)
        except ValueError: # Should be caught by regex and range check, but included for robustness
            return False

    # --- 2. Obfuscated Constants & Helpers ---

    def _decode_blob(blob_b64: str, xor_key: int) -> bytes:
        """Decodes a base64 string and XORs its bytes with a key."""
        try:
            decoded_bytes = base64.b64decode(blob_b64.encode('ascii'))
            return bytes(b ^ xor_key for b in decoded_bytes)
        except Exception:
            return b"" # Return empty bytes on failure

    def is_prime(n: int) -> bool:
        """Checks if a number is prime."""
        if n < 2: return False
        if n == 2: return True
        if n % 2 == 0: return False
        i = 3
        while i * i <= n:
            if n % i == 0: return False
            i += 2
        return True

    # Key material for transformations, derived from b"KeyPy" XORed with 0x6A
    key_material_blob = "IxfkOQ=="
    key_xor_val = (0x60 + 0x0A) # 0x6A
    key_material = _decode_blob(key_material_blob, key_xor_val)
    if len(key_material) != 5: # Expect 5 key bytes for 5 input values
        return False

    # Initial state for the stateful mixer, derived from 0xCD XORed with 0xAB
    initial_state_blob = "ZmY="
    initial_state_xor = (0xA0 + 0x0B) # 0xAB
    initial_state_bytes = _decode_blob(initial_state_blob, initial_state_xor)
    if len(initial_state_bytes) != 1:
        return False
    # Re-XOR to get the original initial state value
    current_state = initial_state_bytes[0] ^ initial_state_xor 

    # Target SHA256 hash prefix for the combined transformed bytes
    target_hash_prefix = "b5924765"

    # Expected digit sum for the first input value (11), obfuscated as 11 ^ 0x55
    expected_digit_sum_blob = "Xg=="
    digit_sum_xor = (0x50 + 0x05) # 0x55
    expected_digit_sum_bytes = _decode_blob(expected_digit_sum_blob, digit_sum_xor)
    if len(expected_digit_sum_bytes) != 1:
        return False
    expected_digit_sum = expected_digit_sum_bytes[0] ^ digit_sum_xor

    # Expected product remainder for the first two input values (98), obfuscated as 98 ^ 0xCC
    expected_product_rem_blob = "rg=="
    product_rem_xor = (0xC0 + 0x0C) # 0xCC
    expected_product_rem_bytes = _decode_blob(expected_product_rem_blob, product_rem_xor)
    if len(expected_product_rem_bytes) != 1:
        return False
    expected_product_rem = expected_product_rem_bytes[0] ^ product_rem_xor

    # Prime modulus for the product remainder check (101), obfuscated as 101 ^ 0x3F
    prime_modulus_blob = "Wg=="
    prime_modulus_xor = (0x30 + 0x0F) # 0x3F
    prime_modulus_bytes = _decode_blob(prime_modulus_blob, prime_modulus_xor)
    if len(prime_modulus_bytes) != 1:
        return False
    prime_modulus = prime_modulus_bytes[0] ^ prime_modulus_xor


    # --- 3. Core Transformation Logic ---
    # A stateful XOR-based transformation is applied to each input value.
    transformed_vals = []
    
    # prev_state holds the state from the previous iteration or the initial state
    prev_state = current_state 

    for i in range(5):
        n_val = input_vals[i]
        k_A_val = key_material[i] # Key for input value transformation
        k_B_val = key_material[(i + 1) % len(key_material)] # Key for state update (cycling)

        # Transform the input value using XOR with key and previous state
        o_val = (n_val ^ k_A_val ^ prev_state) & 0xFF
        transformed_vals.append(o_val)
        
        # Update the state for the next iteration using XOR with previous state, transformed value, and another key byte
        current_state = (prev_state ^ o_val ^ k_B_val) & 0xFF
        prev_state = current_state # Update prev_state for the next loop iteration

    # --- 4. Final Checks ---

    # Check A: The sum of digits of the first input value must match a hidden constant
    first_input_str = str(input_vals[0])
    digit_sum = sum(int(d) for d in first_input_str)
    if digit_sum != expected_digit_sum:
        return False

    # Check B: Product of the first two input values modulo a hidden prime must match a constant
    product = input_vals[0] * input_vals[1]
    if (product % prime_modulus) != expected_product_rem:
        return False

    # Check C: The 3rd transformed byte (index 2) must be a prime number
    if not is_prime(transformed_vals[2]):
        return False

    # Check D: SHA256 hash of the combined transformed bytes must start with a specific prefix
    combined_transformed_bytes = bytes(transformed_vals)
    calculated_hash_prefix = hashlib.sha256(combined_transformed_bytes).hexdigest()[:len(target_hash_prefix)]
    if calculated_hash_prefix != target_hash_prefix:
        return False

    return True
"254-239-167-206-108"
Proposer: gemini-2.5-flash Solver: gpt-5.2-pro-2025-12-11
2 vs -4
#9 Sample Solution Wrong
def mystery(x):
    import base64
    import re

    # --- normalize x -> 6 bytes ---
    if isinstance(x, bool):
        return False

    b = None

    if isinstance(x, (bytes, bytearray)):
        b = bytes(x)
        if len(b) != 6:
            return False

    elif isinstance(x, str):
        s = x.strip()
        # exactly six hex bytes separated by colons
        if not re.fullmatch(r"(?i)(?:[0-9a-f]{2}:){5}[0-9a-f]{2}", s):
            return False
        try:
            b = bytes(int(p, 16) for p in s.split(":"))
        except Exception:
            return False

    elif isinstance(x, int):
        if not (0 <= x < (1 << 48)):
            return False
        b = int(x).to_bytes(6, "big", signed=False)

    elif isinstance(x, float):
        if not x.is_integer():
            return False
        xi = int(x)
        if not (0 <= xi < (1 << 48)):
            return False
        b = xi.to_bytes(6, "big", signed=False)

    else:
        return False

    if b is None or len(b) != 6:
        return False

    # --- tiny helper ---
    def _rotl8(v: int, r: int) -> int:
        r &= 7
        v &= 0xFF
        return ((v << r) | (v >> (8 - r))) & 0xFF

    # --- Gate 1: weighted checksum mod 257 (coefficients are hidden) ---
    coeff_blob = "np+Zm5eR"  # 6 bytes
    coeff_xor = ((0x37 << 2) + 0x28)  # 0x9C, not written directly
    try:
        coeff_raw = base64.b64decode(coeff_blob.encode("ascii"))
        if len(coeff_raw) != 6:
            return False
        coeff = [c ^ coeff_xor for c in coeff_raw]
    except Exception:
        return False

    chk = sum(ci * bi for ci, bi in zip(coeff, b)) % 257

    chk_blob = "SQ=="
    chk_xor = (0x20 + 0x1C)  # 0x3C
    try:
        chk_expect = base64.b64decode(chk_blob.encode("ascii"))[0] ^ chk_xor
    except Exception:
        return False
    if chk != chk_expect:
        return False

    # --- Gate 2: modulus condition on the 48-bit integer (hidden constant) ---
    n = int.from_bytes(b, "big", signed=False)

    rem_blob = "ExQ="  # 2 bytes
    rem_mask = (0x1000 + 0x337)  # 0x1337
    try:
        rem_expect = (int.from_bytes(base64.b64decode(rem_blob.encode("ascii")), "big") ^ rem_mask) & 0xFFFF
    except Exception:
        return False
    if (n % 97) != rem_expect:
        return False

    # --- decode hidden seed and key bytes ---
    seed_blob = "Vg=="
    seed_xor = (0xFE + 1)  # 0xFF
    key_blob = "Ucwzv2Sa"  # 6 bytes
    key_xor = (0x6A + 3)   # 0x6D

    try:
        seed = base64.b64decode(seed_blob.encode("ascii"))[0] ^ seed_xor
        key_raw = base64.b64decode(key_blob.encode("ascii"))
        if len(key_raw) != 6:
            return False
        key = [kb ^ key_xor for kb in key_raw]
    except Exception:
        return False

    # --- core mixer ---
    s = seed & 0xFF
    out = []
    for i in range(6):
        s = (s * 73 + 41 + i) & 0xFF
        prev = b[i - 1] if i else 0x5C
        t = _rotl8((prev ^ (s >> 3)) & 0xFF, i + 1)
        v = (b[i] + s) & 0xFF
        v ^= t
        v = _rotl8((v ^ key[i]) & 0xFF, (key[i] + i) & 7)
        out.append(v)
        s ^= v

    outb = bytes(out)

    # --- Gate 3: compare against hidden target bytes ---
    target_blob = "KOTavtE4"  # 6 bytes
    try:
        raw = base64.b64decode(target_blob.encode("ascii"))
        if len(raw) != 6:
            return False
        target = bytes(raw[i] ^ ((0xA7 + 23 * i) & 0xFF) for i in range(6))
    except Exception:
        return False

    if outb != target:
        return False

    # --- Gate 4: bit-count invariant (hidden) ---
    bc_blob = "Sjk="
    bc_mask = (0x4A00 + 0x2F)  # 0x4A2F
    try:
        bc_expect = int.from_bytes(base64.b64decode(bc_blob.encode("ascii")), "big") ^ bc_mask
    except Exception:
        return False

    if int.from_bytes(outb, "big", signed=False).bit_count() != bc_expect:
        return False

    return True
"10:20:30:40:50:60"
Proposer: gpt-5.2-pro-2025-12-11 Solver: gemini-2.5-flash
1 vs -4
#10 Sample Solution Wrong
import base64
import hashlib
import re

def mystery(x):
    # --- 1. Input Validation and Normalization ---
    if not isinstance(x, str):
        return False

    # Input must be a string of eight two-digit numbers (00-99), separated by single spaces.
    # Example: "12 34 56 78 90 11 23 45"
    parts = x.split(' ')
    if len(parts) != 8:
        return False

    input_vals = []
    for part in parts:
        # Each part must be exactly two digits
        if not re.fullmatch(r'\d{2}', part):
            return False
        try:
            val = int(part)
            if not (0 <= val <= 99): # Ensure values are two-digit numbers
                return False
            input_vals.append(val)
        except ValueError: # Should be caught by regex and range check, but included for robustness
            return False

    # --- 2. Obfuscated Constants & Helpers ---

    def _decode_blob(blob_b64: str, xor_key: int) -> bytes:
        """Decodes a base64 string and XORs its bytes with a key."""
        try:
            decoded_bytes = base64.b64decode(blob_b64.encode('ascii'))
            return bytes(b ^ xor_key for b in decoded_bytes)
        except Exception:
            return b"" # Return empty bytes on failure

    def _rotl8(v: int, r: int) -> int:
        """8-bit rotate left operation."""
        r &= 7 # Ensure rotation amount is within 0-7
        v &= 0xFF # Ensure value is an 8-bit byte
        return ((v << r) | (v >> (8 - r))) & 0xFF

    # Key material for stateful mixer, derived from b"CryptoKey" XORed with 0x5C
    key_material_blob = "Ly8tKSsgD++tKw=="
    key_xor_val = (0x50 + 0x0C) # 0x5C
    key_material_bytes = _decode_blob(key_material_blob, key_xor_val)
    if not key_material_bytes: return False
    key_material = list(key_material_bytes) # Convert to list of integers

    # Permutation indices, derived from [5, 2, 7, 0, 3, 6, 1, 4] XORed with 0x3A
    permutation_blob = "Ozg9Ojo+Og=="
    perm_xor_val = (0x30 + 0x0A) # 0x3A
    permutation_indices_bytes = _decode_blob(permutation_blob, perm_xor_val)
    if len(permutation_indices_bytes) != 8: return False
    permutation_indices = [b for b in permutation_indices_bytes]
    # Validate permutation indices are within 0-7
    if not all(0 <= idx < 8 for idx in permutation_indices):
        return False

    # Initial state for the stateful mixer, derived from 0xDE XORed with 0x7B
    initial_state_blob = "oQ=="
    initial_state_xor = (0x70 + 0x0B) # 0x7B
    initial_state_bytes = _decode_blob(initial_state_blob, initial_state_xor)
    if len(initial_state_bytes) != 1: return False
    initial_state = initial_state_bytes[0] ^ initial_state_xor # Re-XOR to get the original value

    # Target SHA256 hash prefix for the combined transformed bytes, derived from b"b5a88c22" XORed with 0xAA
    target_hash_blob = "HxImSA=="
    target_hash_xor = (0xA0 + 0x0A) # 0xAA
    target_hash_prefix_bytes = _decode_blob(target_hash_blob, target_hash_xor)
    if len(target_hash_prefix_bytes) != 4: return False
    target_hash_prefix = target_hash_prefix_bytes.hex() # Convert to hex string

    # Expected sum for specific input values, derived from 100 XORed with 0x4F
    expected_sum_blob = "Gw=="
    sum_xor_val = (0x40 + 0x0F) # 0x4F
    expected_sum_bytes = _decode_blob(expected_sum_blob, sum_xor_val)
    if len(expected_sum_bytes) != 1: return False
    expected_sum_input_vals = expected_sum_bytes[0] ^ sum_xor_val

    # Expected modulo result for a pair of permuted bytes, derived from 3 XORed with 0x15
    expected_mod_blob = "Eg=="
    mod_xor_val = (0x10 + 0x05) # 0x15
    expected_mod_check = _decode_blob(expected_mod_blob, mod_xor_val)
    if len(expected_mod_check) != 1: return False
    expected_mod_check = expected_mod_check[0] ^ mod_xor_val

    # Expected sum of a Fibonacci-like sequence, derived from 23 XORed with 0x23
    expected_fib_sum_blob = "AA=="
    fib_xor_val = (0x20 + 0x03) # 0x23
    expected_fib_sum_bytes = _decode_blob(expected_fib_sum_blob, fib_xor_val)
    if len(expected_fib_sum_bytes) != 1: return False
    expected_fib_sum = expected_fib_sum_bytes[0] ^ fib_xor_val


    # --- 3. Initial Byte Conversion ---
    # Each input value `p` is transformed into an 8-bit byte.
    input_transform_mult = 3
    input_transform_add = 17
    initial_bytes = [(p_val * input_transform_mult + input_transform_add) & 0xFF for p_val in input_vals]

    # --- 4. Core Transformation 1: Stateful Mixer ---
    # A stateful transformation is applied to the initial bytes.
    mixed_bytes = []
    current_state = initial_state # Initialize with the obfuscated initial state

    for i in range(8):
        input_byte = initial_bytes[i]
        k_val = key_material[i % len(key_material)] # Cycle through key material

        # Calculate shift amount using another key byte from the key_material
        shift_amount = key_material[(i + 3) % len(key_material)] % 8
        
        # Combine input, key, and current state using XOR
        intermediate = (input_byte ^ k_val ^ current_state) & 0xFF
        
        # Apply rotational left shift
        transformed = _rotl8(intermediate, shift_amount)
        
        mixed_bytes.append(transformed)
        
        # Update the state for the next iteration using the current transformed byte and key
        current_state = (current_state + transformed + k_val) % 256

    # --- 5. Core Transformation 2: Permutation ---
    # The mixed bytes are permuted based on hidden indices.
    permuted_bytes = [0] * 8
    for i in range(8):
        permuted_bytes[i] = mixed_bytes[permutation_indices[i]]

    # --- 6. Final Checks ---

    # Check A: Sum of specific input values
    if (input_vals[0] + input_vals[2] + input_vals[5]) != expected_sum_input_vals:
        return False

    # Check B: Modulo check on specific permuted bytes
    if (permuted_bytes[3] + permuted_bytes[7]) % 17 != expected_mod_check:
        return False

    # Check C: Fibonacci-like sequence sum derived from permuted bytes
    f0 = permuted_bytes[0] % 10
    f1 = permuted_bytes[1] % 10
    f2 = (f0 + f1) % 10
    f3 = (f1 + f2) % 10
    if (f0 + f1 + f2 + f3) != expected_fib_sum:
        return False

    # Check D: SHA256 hash prefix of the final permuted bytes
    combined_permuted_bytes = bytes(permuted_bytes)
    calculated_hash_prefix = hashlib.sha256(combined_permuted_bytes).hexdigest()[:len(target_hash_prefix)]
    if calculated_hash_prefix != target_hash_prefix:
        return False

    return True
"10 20 30 40 50 60 70 80"
Proposer: gemini-2.5-flash Solver: gpt-5.2-pro-2025-12-11
1 vs -5