Repository navigation
perf(coverage): run build_coverage store reads off the event loop (#626 step 3) - #647
Merged
Merged
Conversation
…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
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.
Part of #626 (step 3): the remaining synchronous
audio_lang_storereads inbuild_coveragenow run off the event loop.Change
_build_verification_lookupruns throughasyncio.to_thread. It still has no try, so a failing read still propagates out ofbuild_coverage, same as before._read_post_pass_lookupsfetches 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.Nonestore takes no thread hop.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
build_coverage, plustest_on_loop_sqlite_627.pyandtest_loop_lag.py: 369 passed.ruff check src testsis clean.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