Skip to content

One embed_names job per base: a running copy counts as queued - #46

Merged
gedaiu merged 1 commit into
re-devfrom
fix/embed-names-once
Nov 1, 2026
Merged

gedaiu merged 1 commit into
re-devfrom
fix/embed-names-once

Conversation

@gedaiu

@gedaiu gedaiu commented Nov 1, 2026

Copy link
Copy Markdown

embed_names_job is fork-only (0c56fd1), and its per-document enqueue used enqueue_unless_queued, which looks at queued copies only. Once the first copy was claimed, every document extracted while it ran queued another one; on the lore base, where pending() walks 48,045 identity names to find 20 prose ones (deeplethe#1472), 14 copies ran at once on 2026-10-31, each 1 to 3 h, each blocked in MultiXactOffsetSLRU.

  • The per-document enqueue is now enqueue_unless_pending (queued or running, no debounce), the helper the ontology page already uses for the same pile-up.
  • The job re-enqueues itself with enqueue_unless_queued whenever it filled anything, not only when a batch was full, so names written while it ran are picked up by the next copy; a run that fills nothing ends the chain. At most one idle extra run per burst.

Tests: a_name_embedding_runs_while_model_work_holds_every_slot and extraction_open (18) pass against a fresh database. The real fix for the scan itself is upstream deeplethe#1472.

Related: #45 (the signature scan beside it).

🤖 Generated with Claude Code

The per-document enqueue only looked at queued copies, so once the
first embed_names claimed, every document extracted while it ran
queued another, and on a base whose pending scan takes hours (48k
identity names, deeplethe#1472) 14 copies sat behind it, each
scanning the same facts. The enqueue now skips a running copy too, and
the job re-enqueues itself whenever it filled anything, so names
written while it ran are picked up by the next one.

Refs deeplethe#1472.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@gedaiu
gedaiu merged commit 8d6d09d into re-dev Nov 1, 2026
6 checks passed
@gedaiu
gedaiu deleted the fix/embed-names-once branch November 1, 2026 13:58
gedaiu added a commit to re-cinq/lore that referenced this pull request Nov 1, 2026
…job per base (#4062)

Bumps the Utopia pin to `0.1.0-re.27` (digest `sha256:55321d80…`), the
re-dev head after two fork merges:

- re-cinq/utopia#45: `signature_keys_of_document` reaches
`fact_evidence` by its own `document_id` column (indexed) instead of
through `chunks`, which seq-scanned all 8.3M evidence rows per extracted
document (12 s each, 28 to 30 at once). Measured 0.16 s with the index.
Upstream: deeplethe/utopia#1471.
- re-cinq/utopia#46: one `embed_names` job per base. A per-document
enqueue now counts a running copy as queued, so 14 parallel 1 to 3 h
backfills over the same 48k identity names no longer pile up. Upstream:
deeplethe/utopia#1472.

No new migration. The terraform apply is Bogdan's, from main.

Related: #4025, #4057.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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