{"record":{"id":"82890091804104a3","repo":"jax-ml/jax","slug":"jaxprinputeffect-eff-does-not-have-a-correspon","errorCode":null,"errorMessage":"`JaxprInputEffect` {eff} does not have a corresponding jaxpr input.\n Equation: {eqn}\n\n Effects: {eqn.effects}\n\n Jaxpr: {core.Jaxpr(constvars, invars, outvars, eqns, set(), dbg)}","messagePattern":"`JaxprInputEffect` (.+?) does not have a corresponding jaxpr input\\.\n Equation: (.+?)\n\n Effects: (.+?)\n\n Jaxpr: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/interpreters/partial_eval.py","lineNumber":1463,"sourceCode":"def make_jaxpr_effects(constvars, invars, outvars, eqns) -> effects.Effects:\n  jaxpr_effects = set()\n  input_vars = {*constvars, *invars}\n  mut_arrays = set()\n  for eqn in eqns:\n    if eqn.primitive.ref_allocating:\n      outvar, = eqn.outvars\n      mut_arrays.add(outvar)\n    for eff in eqn.effects:\n      if isinstance(eff, effects.JaxprInputEffect):\n        if eff.input in mut_arrays:\n          continue\n        if eff.input not in input_vars:\n          # TODO(mattjj): ask for forgiveness\n          dbg = type('Fake', (), {'resolve_result_paths': lambda self_: self_,\n                                  'assert_arg_names': lambda _, __: None,\n                                  'assert_result_paths': lambda _, __: None,\n                                  })()\n          raise ValueError(\n                f\"`JaxprInputEffect` {eff} does not have \"\n                f\"a corresponding jaxpr input.\"\n                f\"\\n Equation: {eqn}\\n\"\n                f\"\\n Effects: {eqn.effects}\\n\"\n                \"\\n Jaxpr: \"\n                f\"{core.Jaxpr(constvars, invars, outvars, eqns, set(), dbg)}\")\n      jaxpr_effects.add(eff)\n  return jaxpr_effects\n\n\nclass JaxprStackFrame:\n  __slots__ = (\n      'gensym', 'constid_to_tracer', 'constvar_to_val', 'tracing_eqns',\n      'invars', 'effects', 'debug_info', 'is_high', 'auto_dce')\n\n  gensym: Callable[[AbstractValue], Var]\n  constid_to_tracer: WeakValueDictionary[ConstId, DynamicJaxprTracer]\n  constvar_to_val: dict[Var, Any]","sourceCodeStart":1445,"sourceCodeEnd":1481,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/interpreters/partial_eval.py#L1445-L1481","documentation":"When a JaxprEqn carries a JaxprInputEffect (an effect tied to a specific jaxpr input, e.g. a mutable-array get/put effect referencing input #2), the referenced input must actually be one of the jaxpr's input vars. If the effect's input index points at a var that isn't in input_vars, jaxpr construction is inconsistent and JAX raises with the full eqn, effects, and jaxpr printed.","triggerScenarios":"Usually an internal invariant failure or a bug in custom primitives/effects that construct eqns manually; can surface via tracers_to_jaxpr, _dce_jaxpr (dead-code elimination removing an input an effect still references), or partial-eval custom caching (_partial_eval_jaxpr_custom_cached).","commonSituations":"JAX version mismatches after upgrades; custom primitives with declared input effects where DCE or partial evaluation removes the referenced input; bugs in experimental mutable-array code paths.","solutions":["Update/downgrade JAX to a consistent version — many instances are fixed internal bugs","Reduce the reproducer (usually remat + mutable state + DCE interplay) and report it upstream with the printed jaxpr","Avoid combining experimental Ref/mutable-array state with remat or heavy DCE-triggering code until fixed","If you build eqns manually, ensure JaxprInputEffect.input indices stay within the surviving invars"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    jaxpr = jax.make_jaxpr(f)(*args)\nexcept ValueError as e:\n    if 'JaxprInputEffect' in str(e):\n        # likely internal bug: capture full message (contains jaxpr dump) and report","preventionTips":["Pin a known-good JAX version in production","Minimize remat+state combinations that trigger DCE of effect-referenced inputs"],"tags":["jax","jaxpr","effects","internal-invariant","mutable-arrays"],"backgroundTag":"library-internal-invariant-violation","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}