Repository navigation
fix: resume-incremental write + role-specific ubatch (INC-6C62) - #37
Merged
Merged
Conversation
added 3 commits
September 20, 2026 13:39
IndexProjectRunner.run() previously accumulated all embeddings in memory and wrote them in a single bulk_write at the end. A crash on a large project (330K chunks, ~9h) lost all work: empty table -> empty known_hashes -> full re-embed on restart. Fix: - WRITE_FLUSH_FILES=32: completed files flushed incrementally via _flush_pending(), RAM freed (embeddings zeroed + gc.collect) - _verify_and_repair_table_integrity() run once at start of run(): detects dead fragment refs from drop+create inheritance, recreates table physically before indexing starts - Resume: on restart, known_hashes (table) skip already-written files; only the unfinished tail is re-processed - Double-write guard: test_no_double_write_of_completed_files - Crash preservation: test_crash_preserves_written_files_in_db - RAM invariant: test_ram_is_freed_after_flush Red Team 5/5: concurrency/idempotent, BATCH_SIZE boundary, TOCTOU crash during bulk_write, runner restart, integrity-recreate vs skip.
- resolve_ubatch(role): embed->512, rerank->1024 (ceil to 128) env LLAMA_UBATCH_SIZE is hard override for both roles - _ubatch_arg(model_key): selects ubatch by role in llama_runner - _truncate_rerank_pair(query, passages): heuristic trim so query+max_passage <= ubatch tokens (1 token ~ 2 chars) - remote_embedder uses LLAMA_EMBED_MAX_TOKENS instead of hardcoded 480 A/B on 2227 real chunks, port 8082: ubatch 512 -> 596 MB / 18.9 ch/s ubatch 2048 -> 1686 MB / 16.1 ch/s Tests: test_ubatch_roles.py (6 cases), ruff clean.
- ISSUE.md: 11 research tasks (KI-R1..R11) for search quality / E13 - AGENT_DIARY.md: [2026-09-20] entry with priority order - EXPERIMENTS_LOG.md: E13 context + plan - KNOWN_ISSUES.md: auto-sync (entry added) - README.md, .env.example: minor updates Not committed: experiments/ search_quality artifacts (scratch).
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Что сделано
Commit 1 — fix(indexing): resume-incremental write + table integrity
Commit 2 — perf(rerank): role-specific ubatch + query truncate
Commit 3 — docs: research notes KI-R1..R11 + diary + experiments log
Верификация
Связанные задачи