Dynamic variational study of chaos: spin glasses in three dimensions