Skip to content

fix(graph): prevent stale concurrent refresh publication - #32

Closed
stugorf wants to merge 1 commit into
mainfrom
codex/issue-12-refresh-corrected
Closed

stugorf wants to merge 1 commit into
mainfrom
codex/issue-12-refresh-corrected

Conversation

@stugorf

@stugorf stugorf commented Oct 26, 2026

Copy link
Copy Markdown
Member

Problem and change

Concurrent refresh() calls could publish an older replacement after a newer snapshot. Replacements are built outside the state lock and published only when the starting Arc snapshot is still current; otherwise refresh retries from the new snapshot. Snapshot identity avoids incorrectly treating equal dataset version numbers as equal engine state.

Existing readers retain their original snapshot and failed refresh preserves the previous state. The Lance guide and API reference document retries. There is no public signature change.

Validation

Head 58b96fb601eda5f02caff0dc537c1ffa0f18bd15; frozen parent 54e02307a48e467a98d9da2183f5adcb767e7c99. Focused checks and regression details record commands, results, documentation and compatibility. The release receipt pins wheel/archive identity and 22 installed tests.

Both complete workloads pass unchanged goldens in memory and lazy modes. Retained first-pass geometric mean speedups are below (greater than one is faster). Per-query results and paired investigations remain in the audit archive.

Workload/mode Main Actual parent
Q30 memory 0.964 0.964
Q30 lazy 0.947 0.947
IC memory 0.972 0.972
IC lazy 0.984 0.984

Measurements use the same Apple M4 Max (16 cores, 128 GiB), macOS 26.6.2 arm64 and Python 3.13.17, with Q30 revision 6260689 and IC revision c185123. Reproduction instructions pin settings, data checksums, locks and commands. The frozen main baseline is code-identical to current main 90114f3; the equivalence check also verifies clean prospective main-target merges.

Individual review gates pass under the recorded repeat/controlled-investigation rules. Initial failed measurements remain intact in the audit record.

User impact

Concurrent refresh can discard and retry a stale candidate; readers keep their original snapshot and a failed refresh preserves the previous state. Refresh documentation describes this behavior.

Review ledger · Current contribution guide

Audit archive: 47,675,190 bytes; SHA-256 b3486fb30a34639c830b5d49353b3838f96369f95df959ac35f85511f7f8b2de. The small current-main supplement preserves the documentation update. Original absolute paths in receipts map to included records through the archive index.

Submitted by David Hughes (@stugorf), with AI Collaboration.

Retry refresh when another replacement has been published since its starting snapshot. Add deterministic publication coverage and preserve failed-refresh and active-reader behavior.

Resolves #12. Implemented with assistance from Codex; runtime and benchmark validation pending.
@prrao87

prrao87 commented Oct 26, 2026

Copy link
Copy Markdown
Member

Closing as this is superceded by #53 as part of a Rust crate refactor (where I fixed this issue separately).

@prrao87 prrao87 closed this Oct 26, 2026
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.

2 participants