{"record":{"id":"c1bc73dda7d2cb86","repo":"keras-team/keras","slug":"cycle-detected-in-type-promotion-lattice-for-node","errorCode":null,"errorMessage":"cycle detected in type promotion lattice for node {n}","messagePattern":"cycle detected in type promotion lattice for node (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/common/dtypes.py","lineNumber":102,"sourceCode":"        f2: [f4],\n        f4: [f8, c64],\n        f8: [c128],\n        c64: [c128],\n        c128: [],\n    }\n    return out\n\n\ndef _make_lattice_upper_bounds():\n    lattice = _type_promotion_lattice()\n    upper_bounds = {node: {node} for node in lattice}\n    for n in lattice:\n        while True:\n            new_upper_bounds = set().union(\n                *(lattice[b] for b in upper_bounds[n])\n            )\n            if n in new_upper_bounds:\n                raise ValueError(\n                    f\"cycle detected in type promotion lattice for node {n}\"\n                )\n            if new_upper_bounds.issubset(upper_bounds[n]):\n                break\n            upper_bounds[n] |= new_upper_bounds\n    return upper_bounds\n\n\nLATTICE_UPPER_BOUNDS = _make_lattice_upper_bounds()\n\n\n@functools.lru_cache(512)\ndef _least_upper_bound(*nodes):\n    \"\"\"Compute the least upper bound of a set of nodes.\n\n    Args:\n        nodes: sequence of entries from dtypes + weak_types\n","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/common/dtypes.py#L84-L120","documentation":"Error \"cycle detected in type promotion lattice for node {n}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/common/dtypes.py:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}