Repository navigation
Speed up validate-all: batch reference validation in one LRV process - #1522
Conversation
|
Claude finished @cmungall's task in 3m 29s —— View job PR Review: Batch Reference Validation
This is an infrastructure/tooling PR (no gene annotations changed), so the GO term / PMID / annotation review checklist does not apply. Reviewing for code correctness, robustness, and maintainability. SummaryClean, well-motivated change. The core idea — single-process batch validation instead of ~2,670 process spawns — is sound and the implementation handles the key subtleties (temp files alongside originals for Approved — no critical or important issues found. Findings🔵 SUGGESTION:
validate-references-all:
{{ref_validator}} validate data genes/*/*/*-ai-review.yaml --schema {{schema_path}} --target-class GeneReview --config {{ref_validator_config}}Not blocking since 🔵 SUGGESTION:
🔵 SUGGESTION: No explicit The inline Python script imports Code Quality Notes
VerdictNo critical or important issues. Three minor suggestions, all nice-to-haves. The approach is well-designed and the implementation is correct. ✅ Approved. |
There was a problem hiding this comment.
Infrastructure PR — no gene annotation changes. Code review found no critical or important issues. Three minor suggestions (batch the standalone validate-references-all recipe, note ruamel.yaml key sorting in temp files, consider explicit ruamel-yaml dependency). Well-designed batching approach with correct temp file handling, cleanup, and backward compatibility.
9333d4f to
7ec7c49
Compare
|
Claude finished @cmungall's task in 1m 52s —— View job PR Review: Batch Reference Validation (Infrastructure)
This is an infrastructure/tooling PR — no gene annotations changed. The GO term / PMID / annotation review checklist does not apply.
Verdict: ApprovedClean, well-motivated change. Batching ~2,670 LRV invocations into a single process is the right approach, and the implementation handles the key subtleties correctly. FindingsNo critical or important issues found. 🔵 SUGGESTION:
validate-references-all:
{{ref_validator}} validate data genes/*/*/*-ai-review.yaml --schema {{schema_path}} --target-class GeneReview --config {{ref_validator_config}}Not blocking since 🔵 SUGGESTION: No explicit
Code Quality Notes
|
There was a problem hiding this comment.
Infrastructure PR — no gene annotation changes. Code review found no critical or important issues. One minor suggestion (batch the standalone validate-references-all recipe to match the new validate-all pattern). Well-designed batching approach with correct temp file handling, cleanup, backward compatibility, and ARG_MAX headroom for ~2,670 files.
…rectly) Bumps linkml-reference-validator to 0.2.1rc1 (multi-file 'validate data') and runs references as one batched process instead of one per file. To let the validator read the data files directly (no parser workaround), the corpus is made valid under LRV's strict YAML parser: - Quote unquoted CURIE scalars in flow-style lists (e.g. 'additional_reference_ids: [PMID:123]' -> '["PMID:123"]') across 29 files; a ':'-bearing plain scalar in flow context is ambiguous and only PyYAML accepts it. - Fix genes/ARATH/GIP1: duplicate top-level 'status' key (DRAFT + a stray COMPLETE); PyYAML silently kept the last, ruamel errors. Kept the operative value (COMPLETE). - Add tests/test_gene_yaml_strict.py to keep every gene-review YAML valid under the strict parser (guards against reintroducing lenient-only YAML; catches dup keys). run_reference_validator.sh now passes each file to LRV unchanged, writing a stripped temp copy ONLY for files carrying full_text_unavailable entries (its sole, project- specific preprocessing). validate-all calls it once over the whole glob (errors block, label warnings advisory) and drops --references from the per-file best-practices call. Measured ~4.5x on cached files; takes the ~60-min reference portion of the full validate-all down to a few minutes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7ec7c49 to
bb16c8b
Compare
|
Claude finished @cmungall's task in 3m 7s —— View job PR Review: Batch Reference Validation
This is an infrastructure/tooling PR — no gene annotation content changed. The GO term / PMID / annotation review checklist applies only to the YAML quoting/dedup fixes below.
Verdict: ApprovedWell-designed change. Batching ~2,670 LRV invocations into a single process is the right architecture fix, and the implementation handles the key subtleties correctly (temp files alongside originals for FindingsNo critical or important issues found. Gene YAML changes (30 files) — all mechanical, all correctEvery gene YAML change falls into exactly two categories:
Infrastructure changes
🔵 SUGGESTION:
validate-references-all:
{{ref_validator}} validate data genes/*/*/*-ai-review.yaml --schema {{schema_path}} --target-class GeneReview --config {{ref_validator_config}}Not blocking since |
There was a problem hiding this comment.
Infrastructure PR — no gene annotation content changed. All 30 gene YAML edits are mechanical (quoting CURIEs in flow sequences for strict YAML compliance, one duplicate-key fix). Script, justfile, and test changes are clean and well-designed. One minor suggestion (batch the standalone validate-references-all recipe). Approved.
Why
The full
validate-all(run on infra PRs + the weekly job) was ~80 min, dominated byreference validation spawning one linkml-reference-validator process per file (~2,670×),
each re-parsing the schema and rebuilding the Validator — almost all process/import startup,
not actual work.
What
Now that
linkml-reference-validator0.2.1rc1supports multi-filevalidate data(linkml/linkml-reference-validator#49), validate references in a single batched process:
run_reference_validator.shaccepts many data files: it stripsfull_text_unavailablesupporting_textacross all of them in one pass (temp copiesalongside originals so
file:refs still resolve) and makes a singlelinkml-reference-validator validate data F1..FNcall. Backward compatible withsingle-file use (
just validate/validate-changed).validate-allruns references as one batch step (errors block, label-mismatchwarnings advisory) and drops
--referencesfrom the per-file best-practices call.linkml-reference-validator==0.2.1rc1.Impact
Measured locally on cached files: 12 files in 2.7 s (one process) vs 12.3 s per-file
(~4.5×), widening with file count (schema parsed once). This should take the ~60-min
reference portion of the full
validate-alldown to a few minutes. This PR's own CI runsthe full
validate-all(it touchesinfrapaths), so its runtime is the real measure.Note: if CI is still slow, the likely remaining factor is NCBI fetches for references not in
the committed
publications/cache — that cost is identical for per-file and batch and is aseparate cache-completeness matter.