Skip to content

perf(coverage): run build_coverage store reads off the event loop (#626 step 3) - #647

Merged
coaxk merged 2 commits into
mainfrom
dspilot/626-coverage-store-reads
Oct 31, 2026
Merged

coaxk merged 2 commits into
mainfrom
dspilot/626-coverage-store-reads

Conversation

@coaxk

@coaxk coaxk commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Part of #626 (step 3): the remaining synchronous audio_lang_store reads in build_coverage now run off the event loop.

Change

  • _build_verification_lookup runs through asyncio.to_thread. It still has no try, so a failing read still propagates out of build_coverage, same as before.
  • New _read_post_pass_lookups fetches the five post-pass reads (multilingual, carried, mixed-dismissed, track-mismatch-dismissed, ignored titles) in ONE thread hop. Each read keeps its own fallback and warning text, so one failing read never stops the others.
  • The order the results are applied in is unchanged. A None store takes no thread hop.
  • The carried-verdict annotation stays inside a try with the original warning. The old try covered both the read and the annotation: a note must never block the build.

Tests

tests/test_coverage_store_reads_626.py (17 tests): an off-loop spy for each of the 8 store methods (each spy also asserts the method was called), the None-store path, per-read failure fallbacks, application order, propagation from the verification lookup, and the annotation guard.

Verification

  • Full suite on 92f9c39: 3018 passed, 9 skipped, 0 failed (the import path was confirmed to be the branch source).
  • After ed86baf: the new file plus every test file that calls build_coverage, plus test_on_loop_sqlite_627.py and test_loop_lag.py: 369 passed. ruff check src tests is clean.
  • Break-it check: with the base coverage_engine.py, all 8 off-loop spies fail; without the annotation guard, its test fails.

The first commit was built by a DeepSeek flash worker (dspilot run ddef5868) and reviewed before commit.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ShzWm3urD55AUk5yrSgXsi

coaxk and others added 2 commits October 31, 2026 17:36
…nt loop (#626)

The verification lookup and the five post-pass store reads were synchronous
SQLite queries on the event loop. The lookup now runs via asyncio.to_thread and
the post-pass reads are fetched in one worker thread, each with its own
fallback. Application order and failure behaviour are unchanged.

Built by the DeepSeek flash worker (dspilot run ddef5868), reviewed by main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PB1TKdFofPtkAyMM5fWv4w
…uild (#626)

The pre-626 try wrapped both the carried lookup read and the annotation.
Moving the read into the worker left the annotation unguarded, so a raise
there would fail the whole coverage build. Restore the guard with the same
warning, and pin it with a test that fails without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ShzWm3urD55AUk5yrSgXsi
@coaxk
coaxk merged commit 7c9e0b4 into main Oct 31, 2026
19 checks passed
@coaxk
coaxk deleted the dspilot/626-coverage-store-reads branch October 31, 2026 14: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