{"record":{"id":"ffef664840c83caf","repo":"jax-ml/jax","slug":"there-is-no-in-rule-rule","errorCode":null,"errorMessage":"There is no -> in rule: '{rule}'","messagePattern":"There is no -> in rule: '(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/custom_partitioning_sharding_rule.py","lineNumber":352,"sourceCode":"  \"\"\"\n  if not isinstance(rule, str):\n    raise TypeError(f\"rule must be a str, but got {type(rule)}\")\n  if not all(isinstance(size, int) for size in factor_sizes.values()):\n    raise TypeError(\n        f\"factor_sizes must be a dict of str to int, but got {factor_sizes}\")\n\n  # Replace ... with a single char to simplify parsing.\n  if BATCHING in rule:\n    raise ValueError(f\"Unknown character '{BATCHING}'\")\n  if \".\" in rule:\n    rule = rule.replace(\"...\", BATCHING)\n    if \".\" in rule:\n      raise ValueError(\"Character '.' must be used inside ellipsis '...'\")\n\n  try:\n    operands, results = rule.split(\"->\")\n  except ValueError as e:\n    raise ValueError(f\"There is no -> in rule: '{rule}'\") from e\n\n  operand_mappings = _parse_values(operands)\n  result_mappings = _parse_values(results)\n  return SdyShardingRule(operand_mappings, result_mappings,\n                         reduction_factors=reduction_factors,\n                         need_replication_factors=need_replication_factors,\n                         permutation_factors=permutation_factors,\n                         **factor_sizes)\n\n\ndef sdy_sharding_rule_to_mlir(\n  rule: SdyShardingRule,\n  operand_types: list[ir.Type],\n  result_types: list[ir.Type],) -> ir.Attribute:\n  \"\"\"Builds the MLIR representation for the sharding rule.\n\n  This is done by verifying that the rule is consistent with the types of\n  the operation and converting the Einsum notation like string to","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/custom_partitioning_sharding_rule.py#L334-L370","documentation":"The rule must separate operands from results with '->'. rule.split('->') raises ValueError when no arrow is present, which is re-raised with this message.","triggerScenarios":"Passing rule='ij' (no arrow) or using '=' / ':' instead of '->'.","commonSituations":"Also fires with multiple '->' (split yields >2 parts); adapting einsum strings that use '->' but dropping it during edits.","solutions":["Add exactly one '->' between operands and results, e.g. 'ij,jk->ik'","Verify rule.count('->') == 1 before calling"],"exampleFix":"# before\nrule = 'ij,jk'\n# after\nrule = 'ij,jk->ik'","handlingStrategy":"validation","validationCode":"assert rule.count('->') == 1, \"rule needs exactly one '->'\"","typeGuard":"def has_single_arrow(rule: str) -> bool:\n    return rule.count('->') == 1","tryCatchPattern":null,"preventionTips":["Treat the rule as operands '->' results; assert the arrow when generating rules in code"],"tags":["jax","sharding","missing-separator","rule-syntax"],"backgroundTag":"invalid-dsl-syntax","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}