calculate states/traces differently with caches