Skip to content

fix: gate fused sync fast paths on full store sync capability; wrappers forward it - #257

Open
d-v-b wants to merge 1 commit into
mainfrom
fix/store-sync-capability-wrappers
Open

fix: gate fused sync fast paths on full store sync capability; wrappers forward it#257
d-v-b wants to merge 1 commit into
mainfrom
fix/store-sync-capability-wrappers

Conversation

@d-v-b

@d-v-b d-v-b commented Jul 29, 2026

Copy link
Copy Markdown
Owner

🤖 AI text below 🤖

Reworked per the discussion on zarr-developers#4206: no public API change. The capability decision is now a private, interim convention — zarr.abc.store._store_supports_sync_io(store) = structural SupportsSyncStore membership ∧ a per-instance _supports_sync_io opt-out (absent means capable) — the store-side twin of the codec-side _sync_capable convention from zarr-developers#4179, with the same deletion path when a formal sync/async store architecture lands.

Fixes (unchanged from before): full-surface write gating (set-sync-only stores get a clean async fallback instead of a mid-batch TypeError), WrapperStore sync delegation + capability forwarding (wrapped sync stores keep the fused fast path; wrappers of async-only stores fall back), LoggingStore sync logging, and the three LatencyStore fixes (sync latency injection, get_ranges/get_partial_values latency, _with_store preserving stochastic configs).

All behavior tests unchanged; 1296 passed across store + pipeline suites; mypy clean.

🤖 Generated with Claude Code

@d-v-b
d-v-b force-pushed the fix/store-sync-capability-wrappers branch from 2d73aa3 to 3247035 Compare July 29, 2026 11:46
@d-v-b

d-v-b commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

🤖 AI text below 🤖

Merge-order note: this branch has a small textual conflict with #254 in tests/test_fused_pipeline.py (both add tests there). Whichever merges second needs a trivial rebase — ask and I'll do it.

@d-v-b
d-v-b force-pushed the fix/store-sync-capability-wrappers branch from 3247035 to 186c392 Compare July 29, 2026 13:29
@d-v-b
d-v-b force-pushed the fix/store-sync-capability-wrappers branch 3 times, most recently from a9b0e73 to c3dfafc Compare July 30, 2026 07:09
@d-v-b d-v-b changed the title fix: explicit store sync-IO capability; wrappers forward it; LatencyStore fixes fix: gate fused sync fast paths on full store sync capability; wrappers forward it Jul 30, 2026
@d-v-b
d-v-b force-pushed the fix/store-sync-capability-wrappers branch from c3dfafc to 0227efd Compare July 30, 2026 07:25
…rs forward it

The fused write gate checked only SupportsSetSync, but write_sync also
needs get_sync (partial-chunk read-modify-write) and delete_sync
(all-fill chunk cleanup): a set-sync-only store passed the gate, wrote
some chunks, then died mid-batch with TypeError. And WrapperStore
forwarded no *_sync method, so every wrapped store (e.g. LatencyStore)
silently lost the sync fast path — latency benchmarks measured the async
fallback while claiming to measure the fused sync path.

Both gates now consult _store_supports_sync_io: structural membership in
SupportsSyncStore (the full get/set/delete sync surface) combined with a
per-instance _supports_sync_io opt-out (absent means capable). This is a
private, interim convention pending a formal sync/async store
architecture — the store-side twin of the codec-side _sync_capable
convention from zarr-developers#4179 — deliberately not new public API. WrapperStore
delegates the three sync methods and forwards the wrapped store's
capability, so wrapping a sync store keeps the fast path and wrapping an
async-only store falls back cleanly; LoggingStore logs the delegated
sync calls.

LatencyStore fixes: sync reads/writes now sleep the configured latency
on the worker thread; get_ranges/get_partial_values route through the
latency-injecting get instead of bypassing the wrapper; _with_store
passes the raw (loc, scale) latency config instead of a single sampled
float, so derived stores keep the distribution.

Assisted-by: ClaudeCode:claude-fable-5
@d-v-b
d-v-b force-pushed the fix/store-sync-capability-wrappers branch from 0227efd to 029e05a Compare July 30, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant