{"record":{"id":"71fad57962c3ca35","repo":"jax-ml/jax","slug":"character-must-be-used-inside-ellipsis","errorCode":null,"errorMessage":"Character '.' must be used inside ellipsis '...'","messagePattern":"Character '\\.' must be used inside ellipsis '\\.\\.\\.'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/custom_partitioning_sharding_rule.py","lineNumber":347,"sourceCode":"    permutation_factors: A tuple of factors that are permutation factors.\n    **factor_sizes: The optional factor sizes.\n\n  Raises:\n    ValueError: If there is any problem with the rule or factor_sizes.\n  \"\"\"\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],","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/custom_partitioning_sharding_rule.py#L329-L365","documentation":"After replacing '...' with the sentinel, any remaining '.' in the rule is invalid — dots are only legal as part of the ellipsis '...' (and it must be exactly three dots).","triggerScenarios":"Rule like 'i.j->j', '..i->i' (two dots), or '...i.j' with a stray dot.","commonSituations":"Typos when typing ellipsis (two or four dots); einsum habits where '.' never appears; filesystem-like names in factor names.","solutions":["Fix the ellipsis to be exactly '...' or remove the stray dot","Ensure factor names contain no '.' characters"],"exampleFix":"# before\nrule = '..i,j->j'\n# after\nrule = '...i,j->j'","handlingStrategy":"validation","validationCode":"assert '..' not in rule.replace('...', ''), 'dots only allowed inside ...'","typeGuard":"def dots_only_in_ellipsis(rule: str) -> bool:\n    return '.' not in rule.replace('...', '')","tryCatchPattern":null,"preventionTips":["Type ellipsis as exactly three dots; grep rules for stray '.' in review"],"tags":["jax","sharding","ellipsis","rule-syntax"],"backgroundTag":"invalid-dsl-syntax","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}