FAILURE MAP
← Case archive

FA-6476 / Calendar arithmetic / Open access

Gregorian leap century rule · case 01

Divisibility by four ignores the century exception.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Divisibility by four ignores the century exception.

THE FAILURE

Divisibility by four ignores the century exception.

Unsuccessful approach: Excluding all centuries ignores the four-hundred-year restoration.

Case contract

Valid ISO Gregorian dates in years 1 through 9999; generated dates must remain in that range. Month is 1 through 12 and zero-based weekday is Monday 0 through Sunday 6 unless the output convention says otherwise. Gregorian leap century rule. Exact operational definition: calendar.isleap(year)

Why this case matters

Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Calendar conventions results depend on the stated convention.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(year):
    return year%4==0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2000,)', solve(*(2000,)), True)
check('fixture 2: (2100,)', solve(*(2100,)), False)
check('fixture 3: (2024,)', solve(*(2024,)), True)
check('fixture 4: (2023,)', solve(*(2023,)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1: (2000,)TrueTruePassed
fixture 2: (2100,)TrueFalseFailed
fixture 3: (2024,)TrueTruePassed
fixture 4: (2023,)FalseFalsePassed

SHA-256 / c99375b88ce9bb5f873bc25e4ca12d02f2069a92f13d87ef97d563415bdca766

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(year):
    return year%4==0 and year%100!=0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2000,)', solve(*(2000,)), True)
check('fixture 2: (2100,)', solve(*(2100,)), False)
check('fixture 3: (2024,)', solve(*(2024,)), True)
check('fixture 4: (2023,)', solve(*(2023,)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1: (2000,)FalseTrueFailed
fixture 2: (2100,)FalseFalsePassed
fixture 3: (2024,)TrueTruePassed
fixture 4: (2023,)FalseFalsePassed

SHA-256 / b5822285a54b538f7ad6a364272de8f45dcc389c2ba75b1ce4fe37dd3f5f3ee6

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 4 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:02.415708+00:00.

Case digest / cceaf0f1aa79974f76e48c4ef0810619b10e0ac8c111de8faf50690de0cbcf93