fix: ManagedMemoryStore sync methods must respect the path prefix - #4204
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4204 +/- ##
=======================================
Coverage 93.91% 93.91%
=======================================
Files 91 91
Lines 12678 12723 +45
=======================================
+ Hits 11906 11949 +43
- Misses 772 774 +2
🚀 New features to boost your workflow:
|
d-v-b
force-pushed
the
fix/store-sync-async-parity
branch
from
July 29, 2026 14:32
4ee9723 to
78228b1
Compare
ManagedMemoryStore inherited get_sync/set_sync/delete_sync from MemoryStore, which use the raw key, while every async method prefixed keys with self.path. Any code taking the sync fast path (e.g. FusedCodecPipeline) wrote/read chunks outside the store's path prefix, so a fresh handle re-reading through the prefix silently got fill values. Override the three sync methods to prefix like their async counterparts. GpuMemoryStore.set_sync gets the same treatment: it now converts its value to a gpu.Buffer like set does, preserving the store's all-values-are-gpu invariant for the sync API. Also fix ManagedMemoryStore.get_partial_values, which applied self.path twice whenever path was non-empty (it pre-prefixed keys, then delegated to MemoryStore.get_partial_values, which itself dispatches through the already-overridden self.get) -- this made it return None for every key. Discovered via the strengthened test fixture below. Add sync/async parity laws to the shared StoreTests suite so every store subclass exercises this invariant: set through one API and read through the other (including byte_range variants), and confirm delete_sync is visible to async get. These are the tests that would have caught the ManagedMemoryStore bug. TestManagedMemoryStore's raw set/get test helpers now respect self.path, and store_kwargs uses a non-empty path, so prefix handling is actually exercised instead of passing vacuously. Add an end-to-end regression with FusedCodecPipeline writing to a ManagedMemoryStore(path=...) sharing a dict with a fresh handle. Add a LocalStore.delete_sync directory-branch test. Assisted-by: ClaudeCode:claude-sonnet-5
d-v-b
force-pushed
the
fix/store-sync-async-parity
branch
from
July 29, 2026 14:35
78228b1 to
1a20c4c
Compare
d-v-b
marked this pull request as ready for review
July 29, 2026 14:38
Contributor
Author
|
I will be self-merging this as it resolves a data corruption risk in the context of the fused codec pipeline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes bugged behavior in the
ManagedMemoryStorecaused by failure to overridex_syncmethods inherited fromMemoryStore, leading to the fused codec pipeline writing chunks to the wrong place in the store.The tests required to fix this revealed a few other bugs in the managed memory store, which this PR fixes.
Assisted-by: ClaudeCode:claude-sonnet-5
based on a claude-authored PR: d-v-b#258
Summary
[Describe what this PR changes and why, in your own words.]
For reviewers
[What would you most value a second look at? What are you already confident in? For a refactor, say whether behavior is meant to be unchanged.]
Author attestation
TODO
docs/user-guide/*.mdchanges/