Follow-up to BasisResearch/RoboTL#576.
When we keep several synthesized loss factories alive and checkpoint them through Encodable, an earlier factory can be saved as a different function. I reproduced this on master with Python 3.14: the live functions return the right values, but some return another function's values after serialization and replay. This breaks evaluation caching and resume.
The synthesized filenames use Python object IDs, which can be recycled after decoding. A later decode can then overwrite the earlier function's cached source. One solution could be giving each synthesized source a unique filename, as we already do for REPL snippets.
Follow-up to BasisResearch/RoboTL#576.
When we keep several synthesized loss factories alive and checkpoint them through
Encodable, an earlier factory can be saved as a different function. I reproduced this on master with Python 3.14: the live functions return the right values, but some return another function's values after serialization and replay. This breaks evaluation caching and resume.The synthesized filenames use Python object IDs, which can be recycled after decoding. A later decode can then overwrite the earlier function's cached source. One solution could be giving each synthesized source a unique filename, as we already do for REPL snippets.