Skip to content

Prevent memory writer starvation and release 1.14.1 - #8

Merged
wess merged 1 commit into
mainfrom
fix/writequeue
Oct 20, 2026
Merged

wess merged 1 commit into
mainfrom
fix/writequeue

Conversation

@wess

@wess wess commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Changes

Main CI exposed a Windows write-contention failure after the learning-loop PR passed. Publication of the 1.14.0 draft was cancelled before any assets or cask update were published.

  • Share a fair in-process write gate between independent handles for the same canonical database path. Acquire the gate before a pool connection so waiting writers cannot occupy every read connection.
  • Queue memory, learning, and passive usage transactions. Keep SQLite arbitration and the existing timeout between processes.
  • Retain weak references in the queue registry and remove dead entries when handles open. Add no worker, timer, or polling.
  • Keep the original stress test, extend it to independently opened handles, and verify reads remain available while the writer lock is held. Repeat both contention tests three times on Windows CI after the full suite.
  • Advance desktop/core to 1.14.1; leave 1.14.0 as an unpublished draft.

Verification

  • Full core suite: 565 passed. No-default-features check and strict all-target clippy passed.
  • Desktop build and 26 tests passed. Formatting and diff checks passed.
  • Learning/MCP integration: 27 learning and 11 protocol tests passed.
  • Rebuilt optimized CLI and saturated-ledger benchmark for 1.14.1: recall plus drift p95 3.62 ms, feedback p95 0.46 ms, confirmation p95 0.61 ms, 21.95 MiB peak RSS. Eight-second idle sample: unchanged CPU time/database files, 14.3 MiB RSS. Final platform CI and release artifacts are the remaining gates.

Windows sustained contention exposed writer starvation after the snapshot upgrade fix. Share a FIFO gate across handles of the same database, acquire it before a connection, and use it for memory, learning, and passive usage transactions. Keep reads available and retain weak references only while handles are alive.

Exercise independent handles and read availability under a held writer, repeat contention tests on Windows CI, and advance desktop and core to 1.14.1. The unpublished 1.14.0 draft remains withheld.
@wess
wess merged commit e57e6dd into main Oct 20, 2026
7 checks passed
@wess
wess deleted the fix/writequeue branch October 20, 2026 15: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