Skip to content

fix: reject a local MMseqs2 database rebuilt under the same identifier - #69

Merged
DimaMolod merged 2 commits into
mainfrom
fix/issue-56-database-provenance
Oct 13, 2026
Merged

DimaMolod merged 2 commits into
mainfrom
fix/issue-56-database-provenance

Conversation

@DimaMolod

@DimaMolod DimaMolod commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

The MSA cache key records each database's identifier, not its content, and a completed shard is never re-validated against the databases. So a database rebuilt or re-copied in place under the same identifier kept serving MSAs from the old build, while proteins added later were searched against the new one. AlphaPulldown's own index_size check never ran, because no search job is scheduled on a cache hit.

This implements option 1 from the issue, adding a durable witness so that the check also covers a complete DAG.

Changes

  • validate_database_provenance() in rules/mmseqs2_gpu.smk runs at parse time whenever local MMseqs2 has proteins to search:
    • Reads each {path}.index size. An unreadable index fails with a message saying indexes must be visible on the submit host and on the workers.
    • Writes a witness on first use. {msa_cache}/.database_provenance.json records an identifier and index size per database. It is published atomically with os.link, so a racing parse checks the winner's witness instead of overwriting it.
    • Checks it on every later parse, including when everything is complete. On a mismatch it stops with, for example, uniref90 (index size 6 -> 12) and "Assign a new identifier to the rebuilt database and rerun."
    • Refuses a mixed legacy cache. A cache created before this change is adopted only after every completed, valid bundle's recorded provenance matches today's indexes. An existing mixture of old and new builds is refused rather than blessed.
  • The cache key is unchanged, so every parse still agrees on the cache path (the cross-parse constraint behind feat: schedule local MMseqs2 features for AlphaFold 2 runs #55).
  • config/config.yaml states the new requirement and the witness's limits; the README is unchanged.

Testing

Compatibility

  • Databases visible only on the workers' local disks are no longer supported. The submit host must be able to read the .index files at the configured paths. Node-local staging still works if those paths also resolve on the submit host to the same build.
  • Index size is not a content hash. A rebuild that leaves every .index the same size, or changes data without changing the index, is not detected. Identifiers still have to change on a rebuild; this check makes the common case fail loudly instead of silently.
  • Upgrading reads the cache once. The first parse on an existing cache reads every completed bundle before writing the witness. On a large campaign over NFS this can take a while, once.
  • Option 2 (a witness in the shard registry, compared by the search job) was not taken. It cannot catch a fully complete cache, because no search job runs.

Closes #56.

🤖 Generated with Claude Code

DimaMolod and others added 2 commits October 13, 2026 09:41
The MSA cache key records each database's identifier, not its content,
and completed shards are never re-validated, so a database rebuilt or
re-copied in place kept serving MSAs from the old build while new
proteins were searched against the new one.

Every parse now compares each configured .index size against a witness
stored once, atomically, in the MSA cache, and fails with instructions to
assign a new identifier when it differs. This runs even when the whole
DAG is complete. Caches from before the witness are adopted only after
every completed bundle's recorded provenance matches today's indexes.

Indexes must now be readable on the submit host as well as the workers.

Closes #56.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The submit-host requirement is stated in config/config.yaml and in the
parse-time error, which names it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DimaMolod
DimaMolod merged commit b293deb into main Oct 13, 2026
2 checks passed
@DimaMolod
DimaMolod deleted the fix/issue-56-database-provenance branch October 13, 2026 08:17
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.

Local MMseqs2: a database rebuilt in place under the same identifier is never re-searched

1 participant