Description
Is your feature request related to a problem? Please describe.
When API traces are serialized, we are saving each ID as a triple of (index, epoch, backend), e.g.:
id: Id(0, 1, Metal)
This is verbose and redundant, also incorrect from the player point of view. The player picks the backend independently and just wants to treat all the IDs as belonging to this backend. So we don't want to have the backend specified in a trace, other than maybe once at the top for informational reasons only.
Describe the solution you'd like
@lachlansneff suggested to have a custom serializer/deserializer implementation for traces. It would behave just like the standard one from serde
, but omit the backend on serialization and recover it on deserialization, based on a global setting.
Ideally, it would look something like:
Id(index: 0, epoch: 1)
Describe alternatives you've considered
A text-based search&replace would also work, but it's a bit awkward.
Besides, we don't want to pollute traces with irrelevant data.
Additional context
We could live without this for the matter of replaying traces manually, but it now it's needed for #786