{"record":{"id":"5276664f9a8b3cf9","repo":"kovidgoyal/kitty","slug":"linear-easing-curve-must-have-strictly-increasing","errorCode":null,"errorMessage":"Linear easing curve must have strictly increasing points: {params} does not","messagePattern":"Linear easing curve must have strictly increasing points: (.+?) does not","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/options/utils.py","lineNumber":1676,"sourceCode":"            raise ValueError('cubic-bezier easing function must have four points')\n        return cls(type='cubic-bezier', cubic_bezier_points=(unit_float(parts[0]), float(parts[1]), unit_float(parts[2]), float(parts[3])))\n\n    @classmethod\n    def linear(cls, params: str) -> 'EasingFunction':\n        parts = params.split(',')\n        if len(parts) < 2:\n            raise ValueError('Must specify at least two points for the linear easing function')\n        xaxis: list[float] = []\n        yaxis: list[float] = []\n\n        def balance(end: float) -> None:\n            extra = len(yaxis) - len(xaxis)\n            if extra <= 0:\n                return\n            start = xaxis[-1] if xaxis else 0.0\n            delta = (end - start) / max(1, extra - 1)\n            if delta <= 0.0:\n                raise ValueError(f'Linear easing curve must have strictly increasing points: {params} does not')\n            if xaxis:\n                for i in range(extra):\n                    xaxis.append(start + (i + 1) * delta)\n            else:\n                for i in range(extra):\n                    xaxis.append(i * delta)\n\n        def add_point(y: float, x: float | None = None) -> None:\n            if x is None:\n                yaxis.append(y)\n            else:\n                x = unit_float(x)\n                balance(x)\n                xaxis.append(x)\n                yaxis.append(y)\n\n        for r in parts:\n            points = r.strip().split()","sourceCodeStart":1658,"sourceCodeEnd":1694,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L1658-L1694","documentation":"When kitty fills in missing x-axis values for a linear easing curve it computes a delta; if the implied/computed x points are not strictly increasing (delta <= 0), the curve is invalid and this error is raised.","triggerScenarios":"Supplying x-axis values in a linear() easing that repeat or decrease relative to the auto-balanced points, e.g. linear(0, 0, 1) style inputs causing delta <= 0.","commonSituations":"Hand-authoring linear easing with duplicate or descending x coordinates, or mixing y-only and x,y points inconsistently.","solutions":["Ensure all x coordinates strictly increase from 0 toward 1","Omit x values entirely and let kitty balance them, giving only y values"],"exampleFix":"# before\ncursor_blink_interval 0.5:linear(0 0, 0 1)\n# after\ncursor_blink_interval 0.5:linear(0 0, 1 1)","handlingStrategy":"validation","validationCode":"def valid_linear_xs(parts: list[str]) -> bool:\n    xs = [float(p.split()[0]) for p in parts if len(p.split()) == 2]\n    return all(b > a for a, b in zip(xs, xs[1:]))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Give only y values and let kitty derive strictly increasing x values"],"tags":["kitty","config","animation","easing"],"backgroundTag":"value-out-of-range","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}