Cache deterministic seed

Backwards compatible.
@Nullable on params that can be null.