weave
weave copied to clipboard
fix(weave): Defer ref zero-ing until save time
Resolves:
- https://wandb.atlassian.net/browse/WB-20376
This PR defers ref zeroing until save time (instead of immediately on mutations), which has a few effects:
- It allows anything dependent on the parent ref (like an
OpRef
) to be de-ref'd even after the object is mutated - It now means that looking at the
ref
alone is not sufficient to tell if it's fresh or stale. You must also look at_is_dirty
. In future, a helper method to check "freshness" of a ref may be useful.
Ref-zeroing already happens here:
- https://github.com/wandb/weave/blame/andrew/zero-ref/weave/weave_client.py#L765