You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make the degenerate-row interpolation contract hold under autodiff
The singleton/empty-row overrides selected the right primal values but ran
after the bracket arithmetic had touched the NaN padding, and `jnp.where`
propagates cotangents through both of its branches — so `jax.grad` of the
read returned NaN (0 · NaN) where the constant clamp's derivative is zero,
poisoning the asset-row Euler marginal whenever a child carry row has one
finite node. The gathered bracket endpoints are now sanitized to finite
dummies on degenerate rows before the arithmetic; the overrides still
publish the contract values. A `lax.cond` dispatch would not fix this: the
production readers vmap the row read, and `cond` lowers to `select` under
`vmap`, re-evaluating both branches.
Also re-pin NaN queries to NaN (the singleton constant would otherwise mask
an upstream failure with a finite value) and add a `Phased` cost-free-base
regression for the composed NEGM resources.
Regressions: query gradient and node-value gradient of a singleton row,
the vmap+grad composition, and the production stacked read differentiated
with a singleton winning candidate.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123hk3uzBgBeZown4eBBQ2C
0 commit comments