{"abstract":"Uses direct instance lookup for the implicit len protocol and changes the required Python-language result.","category":"Descriptor lookup","checks":6,"contract":"A per-instance __len__ shadows direct attribute calls but does not change implicit len or truth testing. Return the selected native result; declared is an integer from 0 through sys.maxsize, and shadow is any nonnegative integer. Inputs use the finite Python types shown in the fixtures. An error string denotes the specified caught exception, not an unhandled process failure.","evaluation_group":"xl-special-method-type-lookup","failed_approach":"The alternative still fails because it bypasses the instance shadow for an explicit __len__ call.","family":"xl-special-method-type-lookup-len-instance-dispatch","id":"FA-5056","implementations":{"attempt":{"sha256":"9906f478106ae22d65b731a2a8ebea255b6e48092b30bcd41f16560e31c1e0bc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(declared, shadow, operation):\n    class C:\n        def __len__(self): return declared\n    obj=C()\n    obj.__len__=lambda: shadow\n    if operation=='builtin': return len(obj)\n    if operation=='direct': return C.__len__(obj)\n    if operation=='class': return C.__len__(obj)\n    return bool(obj)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('implicit ignores shadow', solve(2, 9, 'builtin'), 2)\ncheck('direct sees shadow', solve(2, 9, 'direct'), 9)\ncheck('class explicit sees declared', solve(2, 9, 'class'), 2)\ncheck('zero native length false', solve(0, 9, 'truth'), False)\ncheck('positive native length true', solve(2, 0, 'truth'), True)\ncheck('zero shadow direct', solve(2, 0, 'direct'), 0)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"39f95b2efff246a21a8dda3e42a7559b332a20830c1350ba4bd139ea2d365783","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(declared, shadow, operation):\n    class C:\n        def __len__(self): return declared\n    obj=C()\n    obj.__len__=lambda: shadow\n    if operation=='builtin': return obj.__len__()\n    if operation=='direct': return obj.__len__()\n    if operation=='class': return C.__len__(obj)\n    return bool(obj)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('implicit ignores shadow', solve(2, 9, 'builtin'), 2)\ncheck('direct sees shadow', solve(2, 9, 'direct'), 9)\ncheck('class explicit sees declared', solve(2, 9, 'class'), 2)\ncheck('zero native length false', solve(0, 9, 'truth'), False)\ncheck('positive native length true', solve(2, 0, 'truth'), True)\ncheck('zero shadow direct', solve(2, 0, 'direct'), 0)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"a74ebdffc72f8ea8cbc50318adb0514f88f5314a1629dc175b55ea6dea6f20ba","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(declared, shadow, operation):\n    class C:\n        def __len__(self): return declared\n    obj=C()\n    obj.__len__=lambda: shadow\n    if operation=='builtin': return len(obj)\n    if operation=='direct': return obj.__len__()\n    if operation=='class': return C.__len__(obj)\n    return bool(obj)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('implicit ignores shadow', solve(2, 9, 'builtin'), 2)\ncheck('direct sees shadow', solve(2, 9, 'direct'), 9)\ncheck('class explicit sees declared', solve(2, 9, 'class'), 2)\ncheck('zero native length false', solve(0, 9, 'truth'), False)\ncheck('positive native length true', solve(2, 0, 'truth'), True)\ncheck('zero shadow direct', solve(2, 0, 'direct'), 0)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":" This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"xl-special-method-type-lookup-len-instance-dispatch","generated_at":"2026-09-29T14:37:45.702714+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Runs Python standard-library language operations in a deterministic local reproducer. Literal expected answers are authored independently. Related defects share an evaluation group to avoid benchmark split leakage.","repair":"A per-instance __len__ shadows direct attribute calls but does not change implicit len or truth testing. Return the selected native result; declared is an integer from 0 through sys.maxsize, and shadow is any nonnegative integer.","root_cause":"Uses direct instance lookup for the implicit len protocol. The executable reproducer isolates this operation from the rest of the contract.","sha256":"b3cda4e1f5b455080639d70f2dc64fc9255da042c456373dc1c725b7518fd1b8","title":"Special method type lookup: Uses direct instance lookup for the implicit len protocol · case 01","variant":1,"variant_policy":"The five numbered cases rerun the same authored boundary fixtures; they are reproducibility runs, not independent input variants.","verification":{"attempt":{"elapsed_ms":39.39,"exit_code":1,"observations":[{"actual":2,"check":"implicit ignores shadow","expected":2,"passed":true},{"actual":2,"check":"direct sees shadow","expected":9,"passed":false},{"actual":2,"check":"class explicit sees declared","expected":2,"passed":true},{"actual":false,"check":"zero native length false","expected":false,"passed":true},{"actual":true,"check":"positive native length true","expected":true,"passed":true},{"actual":2,"check":"zero shadow direct","expected":0,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"implicit ignores shadow\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"direct sees shadow\", \"actual\": 2, \"expected\": 9, \"passed\": false}, {\"check\": \"class explicit sees declared\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"zero native length false\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"positive native length true\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"zero shadow direct\", \"actual\": 2, \"expected\": 0, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":35.856,"exit_code":1,"observations":[{"actual":9,"check":"implicit ignores shadow","expected":2,"passed":false},{"actual":9,"check":"direct sees shadow","expected":9,"passed":true},{"actual":2,"check":"class explicit sees declared","expected":2,"passed":true},{"actual":false,"check":"zero native length false","expected":false,"passed":true},{"actual":true,"check":"positive native length true","expected":true,"passed":true},{"actual":0,"check":"zero shadow direct","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"implicit ignores shadow\", \"actual\": 9, \"expected\": 2, \"passed\": false}, {\"check\": \"direct sees shadow\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"class explicit sees declared\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"zero native length false\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"positive native length true\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"zero shadow direct\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":36.138,"exit_code":0,"observations":[{"actual":2,"check":"implicit ignores shadow","expected":2,"passed":true},{"actual":9,"check":"direct sees shadow","expected":9,"passed":true},{"actual":2,"check":"class explicit sees declared","expected":2,"passed":true},{"actual":false,"check":"zero native length false","expected":false,"passed":true},{"actual":true,"check":"positive native length true","expected":true,"passed":true},{"actual":0,"check":"zero shadow direct","expected":0,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"implicit ignores shadow\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"direct sees shadow\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"class explicit sees declared\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"zero native length false\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"positive native length true\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"zero shadow direct\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}