Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

set test dataset

laurenspriem2ff8f6e330d6
diff --git a/infra/ml/ground_truth/README.md b/infra/ml/ground_truth/README.md
index 31d0c4dbe9..0bb5616157 100644
--- a/infra/ml/ground_truth/README.md
+++ b/infra/ml/ground_truth/README.md
@@ -3,10 +3,25 @@
This directory stores bootstrap assets for the ML indexing parity suite:
- `manifest.json`: corpus definition and per-item metadata.
-- `goldens/*.json`: per-item parity outputs in the shared schema.
-- `goldens/results.json`: combined output used by the comparator.
- `schema.py`: strict shared result schema used by all runners.
+Runtime outputs (`goldens/*.json`, `goldens/results.json`, and
+`infra/ml/out/parity/**`) are generated on demand and are gitignored.
+
+## Dataset Source
+
+The default corpus is sourced from:
+
+- `https://github.com/ente-io/test-fixtures/tree/main/ml/indexing/v1`
+- Canonical fixture metadata:
+ `https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/manifest.json`
+
+`manifest.json` in this directory uses:
+
+- `source`: local runtime path under `infra/ml/test_data/...`
+- `source_url`: remote raw fixture URL used by `run_suite.sh` for download
+- `source_sha256`: integrity check value used during download and generation
+
## Current Scope
The current generator (`tools/generate_goldens.py`) emits deterministic bootstrap
@@ -18,14 +33,18 @@ the full ONNX-backed Python pipeline lands.
```bash
uv run --project infra/ml python infra/ml/tools/generate_goldens.py \
--manifest infra/ml/ground_truth/manifest.json \
- --output-dir infra/ml/ground_truth/goldens
+ --output-dir infra/ml/out/parity/python
```
+`generate_goldens.py` expects fixture files to already be present locally.
+`run_suite.sh` is responsible for clearing `infra/ml/test_data/ml-indexing/v1`,
+downloading fixtures, and then calling the generator.
+
## Compare Against Platforms
```bash
uv run --project infra/ml python infra/ml/tools/compare_parity_outputs.py \
- --ground-truth infra/ml/ground_truth/goldens/results.json \
+ --ground-truth infra/ml/out/parity/python/results.json \
--platform-result android=infra/ml/out/parity/android/results.json \
--platform-result ios=infra/ml/out/parity/ios/results.json \
--platform-result desktop=infra/ml/out/parity/desktop/results.json
diff --git a/infra/ml/ground_truth/manifest.json b/infra/ml/ground_truth/manifest.json
index a2a34c3742..ead0a0747b 100644
--- a/infra/ml/ground_truth/manifest.json
+++ b/infra/ml/ground_truth/manifest.json
@@ -1,24 +1,215 @@
{
"schema_version": "1",
- "dataset": "local-bootstrap-corpus",
+ "dataset": "ente-io/test-fixtures/ml/indexing/v1",
+ "dataset_repo": "https://github.com/ente-io/test-fixtures/tree/main/ml/indexing/v1",
+ "dataset_manifest": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/manifest.json",
+ "dataset_version": 1,
"items": [
+ {
+ "file_id": "1343_rotate_90_cw.jpg",
+ "source": "test_data/ml-indexing/v1/files/1343_rotate_90_cw.jpg",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/1343_rotate_90_cw.jpg",
+ "source_sha256": "58a0ed2c14f781cce1121a31fda990e7a9caf7b1cbcf11f946857ca5ed174537",
+ "source_size": 2883662,
+ "source_mime_type": "image/jpeg",
+ "fixture_path": "files/1343_rotate_90_cw.jpg",
+ "tags": [
+ "jpeg",
+ "orientation",
+ "rotate_90_cw"
+ ],
+ "bootstrap_face_count": 1
+ },
+ {
+ "file_id": "1718_rotate_90_cw.HEIC",
+ "source": "test_data/ml-indexing/v1/files/1718_rotate_90_cw.HEIC",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/1718_rotate_90_cw.HEIC",
+ "source_sha256": "7680b1b6009c7adec43aebf75738fb03dd0679ab1fd5a59db6f798ac8060fac1",
+ "source_size": 4983539,
+ "source_mime_type": "image/heic",
+ "fixture_path": "files/1718_rotate_90_cw.HEIC",
+ "tags": [
+ "heic",
+ "orientation",
+ "rotate_90_cw"
+ ],
+ "bootstrap_face_count": 1
+ },
+ {
+ "file_id": "7765_horizontal_normal.HEIC",
+ "source": "test_data/ml-indexing/v1/files/7765_horizontal_normal.HEIC",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/7765_horizontal_normal.HEIC",
+ "source_sha256": "6a1bdb4b6d06d6d3ffa40e35902bb14d0708f1de327b38f74b234b262cfecbdd",
+ "source_size": 4900407,
+ "source_mime_type": "image/heic",
+ "fixture_path": "files/7765_horizontal_normal.HEIC",
+ "tags": [
+ "heic",
+ "orientation",
+ "horizontal_normal"
+ ],
+ "bootstrap_face_count": 0
+ },
+ {
+ "file_id": "7949_mirror_horizontal_rotate_270_cw.HEIC",
+ "source": "test_data/ml-indexing/v1/files/7949_mirror_horizontal_rotate_270_cw.HEIC",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/7949_mirror_horizontal_rotate_270_cw.HEIC",
+ "source_sha256": "94d2e8396114479cc19b3fc54ecb0f9702e0253cfacf47efe7b2cb083261038f",
+ "source_size": 657724,
+ "source_mime_type": "image/heic",
+ "fixture_path": "files/7949_mirror_horizontal_rotate_270_cw.HEIC",
+ "tags": [
+ "heic",
+ "orientation",
+ "mirror_horizontal",
+ "rotate_270_cw"
+ ],
+ "bootstrap_face_count": 1
+ },
+ {
+ "file_id": "IMG_0682_pano.HEIC",
+ "source": "test_data/ml-indexing/v1/files/IMG_0682_pano.HEIC",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/IMG_0682_pano.HEIC",
+ "source_sha256": "421880549246551f71c78b973960ed6e6c2901af87c2abddd258638a82a319db",
+ "source_size": 7881238,
+ "source_mime_type": "image/heic",
+ "fixture_path": "files/IMG_0682_pano.HEIC",
+ "tags": [
+ "heic",
+ "panorama"
+ ],
+ "bootstrap_face_count": 1
+ },
+ {
+ "file_id": "IMG_8606_rotate_90_cw_contains_text.HEIC",
+ "source": "test_data/ml-indexing/v1/files/IMG_8606_rotate_90_cw_contains_text.HEIC",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/IMG_8606_rotate_90_cw_contains_text.HEIC",
+ "source_sha256": "f0cc163af8dff0737152616caf5959ec6e404e92bcfe4bdd9797169b2b3d3037",
+ "source_size": 1404763,
+ "source_mime_type": "image/heic",
+ "fixture_path": "files/IMG_8606_rotate_90_cw_contains_text.HEIC",
+ "tags": [
+ "heic",
+ "orientation",
+ "rotate_90_cw",
+ "contains_text"
+ ],
+ "bootstrap_face_count": 0
+ },
+ {
+ "file_id": "IMG_8905.CR2",
+ "source": "test_data/ml-indexing/v1/files/IMG_8905.CR2",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/IMG_8905.CR2",
+ "source_sha256": "31339ecb9850138bfa7ad98404e5b429045b0db45ef02773290829ded53fd306",
+ "source_size": 26356626,
+ "source_mime_type": "image/x-canon-cr2",
+ "fixture_path": "files/IMG_8905.CR2",
+ "tags": [
+ "raw",
+ "cr2"
+ ],
+ "bootstrap_face_count": 1
+ },
+ {
+ "file_id": "IMG_pano.jpg",
+ "source": "test_data/ml-indexing/v1/files/IMG_pano.jpg",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/IMG_pano.jpg",
+ "source_sha256": "1d17c9e5983a8784b6a805885b735705b8644190b592a66505e62536783c7b47",
+ "source_size": 6222699,
+ "source_mime_type": "image/jpeg",
+ "fixture_path": "files/IMG_pano.jpg",
+ "tags": [
+ "jpeg",
+ "panorama"
+ ],
+ "bootstrap_face_count": 1
+ },
+ {
+ "file_id": "astronaut.png",
+ "source": "test_data/ml-indexing/v1/files/astronaut.png",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/astronaut.png",
+ "source_sha256": "2418889d0d83962d51facc3832b55cf1849690018a1e873d1c551146555cd02f",
+ "source_size": 424520,
+ "source_mime_type": "image/png",
+ "fixture_path": "files/astronaut.png",
+ "tags": [
+ "png"
+ ],
+ "bootstrap_face_count": 1
+ },
{
"file_id": "man.jpeg",
- "source": "data/man.jpeg",
- "tags": ["smoke", "single-face"],
+ "source": "test_data/ml-indexing/v1/files/man.jpeg",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/man.jpeg",
+ "source_sha256": "f366fe66a02c132c3ed8e65ef49475f483a5a879db170e7de6eb02edcf2ef97e",
+ "source_size": 4120,
+ "source_mime_type": "image/jpeg",
+ "fixture_path": "files/man.jpeg",
+ "tags": [
+ "jpeg",
+ "small_image",
+ "portrait"
+ ],
"bootstrap_face_count": 1
},
{
"file_id": "people.jpeg",
- "source": "data/people.jpeg",
- "tags": ["smoke", "group-photo"],
+ "source": "test_data/ml-indexing/v1/files/people.jpeg",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/people.jpeg",
+ "source_sha256": "2fdb1c7c7ae8007662b5c9e9ddcec7677b0090884ca8b8a5da3d1020f153a8f5",
+ "source_size": 9012,
+ "source_mime_type": "image/jpeg",
+ "fixture_path": "files/people.jpeg",
+ "tags": [
+ "jpeg",
+ "small_image",
+ "people"
+ ],
"bootstrap_face_count": 3
},
{
"file_id": "singapore.jpg",
- "source": "data/singapore.jpg",
- "tags": ["smoke", "cityscape", "no-face"],
+ "source": "test_data/ml-indexing/v1/files/singapore.jpg",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/singapore.jpg",
+ "source_sha256": "cfc5b98ec69a65f04b0e4bb7c06009ad6d43362773a5b546c19a48e467a8bf95",
+ "source_size": 613520,
+ "source_mime_type": "image/jpeg",
+ "fixture_path": "files/singapore.jpg",
+ "tags": [
+ "jpeg",
+ "cityscape",
+ "landscape"
+ ],
"bootstrap_face_count": 0
+ },
+ {
+ "file_id": "starwatchers.jpg",
+ "source": "test_data/ml-indexing/v1/files/starwatchers.jpg",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/starwatchers.jpg",
+ "source_sha256": "4126a2c940110dfce7dc697ab6a430bcabaca038eccc52a260a7f2e6070d36ad",
+ "source_size": 85936,
+ "source_mime_type": "image/jpeg",
+ "fixture_path": "files/starwatchers.jpg",
+ "tags": [
+ "jpeg",
+ "low_light",
+ "night_scene"
+ ],
+ "bootstrap_face_count": 1
+ },
+ {
+ "file_id": "ui_app.webp",
+ "source": "test_data/ml-indexing/v1/files/ui_app.webp",
+ "source_url": "https://raw.githubusercontent.com/ente-io/test-fixtures/main/ml/indexing/v1/files/ui_app.webp",
+ "source_sha256": "3ac62b0b9972ef82daa7554b86f4cfbda9c758dc4aa0df80818389d5306cb268",
+ "source_size": 120022,
+ "source_mime_type": "image/webp",
+ "fixture_path": "files/ui_app.webp",
+ "tags": [
+ "webp",
+ "ui_screenshot"
+ ],
+ "bootstrap_face_count": 1
}
],
"threshold_defaults": {
diff --git a/infra/ml/ml-indexing-parity-test-plan.md b/infra/ml/ml-indexing-parity-test-plan.md
index 2043456549..c38a3d2e4e 100644
--- a/infra/ml/ml-indexing-parity-test-plan.md
+++ b/infra/ml/ml-indexing-parity-test-plan.md
@@ -99,12 +99,16 @@ This section is for implementation agents to keep a running log so handoffs stay
| Date (YYYY-MM-DD) | Agent | Change Summary | Files Touched | Validation Run | Next Step |
|---|---|---|---|---|---|
| 2026-02-13 | Codex (GPT-5) | Implemented shared parity result schema, comparator/report engine, bootstrap corpus manifest + deterministic golden generator, comparator CLI, suite runner scaffold, and pytest coverage for schema/comparator behavior across python/android/ios/desktop fixtures. | `infra/ml/ground_truth/schema.py`, `infra/ml/ground_truth/manifest.json`, `infra/ml/ground_truth/README.md`, `infra/ml/comparator/compare.py`, `infra/ml/tools/generate_goldens.py`, `infra/ml/tools/compare_parity_outputs.py`, `infra/ml/tools/run_suite.sh`, `infra/ml/tests/conftest.py`, `infra/ml/tests/test_schema.py`, `infra/ml/tests/test_comparator.py`, `infra/ml/.gitignore` | `uv run --project infra/ml --no-sync python infra/ml/tools/generate_goldens.py --manifest infra/ml/ground_truth/manifest.json --output-dir infra/ml/ground_truth/goldens`; `uv run --project infra/ml --no-sync --with pytest pytest infra/ml/tests/test_schema.py infra/ml/tests/test_comparator.py`; `uv run --project infra/ml --no-sync python infra/ml/tools/compare_parity_outputs.py --ground-truth infra/ml/ground_truth/goldens/results.json --platform-result desktop=infra/ml/ground_truth/goldens/results.json --output /tmp/ml_parity_compare_report.json`; `infra/ml/tools/run_suite.sh --suite smoke --platforms all --output-dir infra/ml/out/parity` | Implement real ONNX-backed Python pipeline modules (`clip.py`, `face_detection.py`, `face_alignment.py`, `face_embedding.py`, `pipeline.py`) and connect desktop/android/ios runners to emit schema outputs. |
+| 2026-02-16 | Codex (GPT-5) | Switched bootstrap corpus source to the canonical fixtures dataset (`ente-io/test-fixtures/ml/indexing/v1`), expanded manifest entries, and updated bootstrap generator to load remote fixture URLs with local cache and SHA-256 verification. | `infra/ml/ground_truth/manifest.json`, `infra/ml/tools/generate_goldens.py`, `infra/ml/ground_truth/README.md`, `infra/ml/ml-indexing-parity-test-plan.md`, `infra/ml/.gitignore` | `uv run --project infra/ml --no-sync python infra/ml/tools/generate_goldens.py --manifest infra/ml/ground_truth/manifest.json --output-dir infra/ml/ground_truth/goldens`; `uv run --project infra/ml --no-sync --with pytest pytest infra/ml/tests/test_schema.py infra/ml/tests/test_comparator.py`; `infra/ml/tools/run_suite.sh --suite smoke --platforms all --output-dir infra/ml/out/parity` | Keep using bootstrap outputs for parity harness bring-up until ONNX-backed Python pipeline modules land (W2). |
+| 2026-02-16 | Codex (GPT-5) | Switched parity artifact policy to runtime-only outputs: removed checked-in per-file/result JSON artifacts and documented gitignored fixture-data + platform output directories generated by `run_suite.sh`. | `infra/ml/ground_truth/goldens/*.json`, `infra/ml/.gitignore`, `infra/ml/ml-indexing-parity-test-plan.md`, `infra/ml/tools/run_suite.sh`, `infra/ml/tools/generate_goldens.py`, `infra/ml/ground_truth/manifest.json` | `git status --short`; `ls infra/ml/ground_truth/goldens`; `infra/ml/tools/run_suite.sh --suite smoke --platforms all --output-dir infra/ml/out/parity` | Implement W4/W5/W6 runners to emit runtime output JSONs into `infra/ml/out/parity/<platform>/`. |
### Decisions and Rationale Log
| Date | Decision | Rationale | Impacted Files |
|---|---|---|---|
| 2026-02-13 | Start with strict schema + comparator + contract tests before platform runner wiring. | Provides immediate, automated parity coverage and a stable JSON contract while platform-specific runner implementations are still pending. | `infra/ml/ground_truth/schema.py`, `infra/ml/comparator/compare.py`, `infra/ml/tests/test_schema.py`, `infra/ml/tests/test_comparator.py` |
| 2026-02-13 | Use deterministic bootstrap golden generation from manifest-defined corpus metadata for initial suite bring-up. | Allows end-to-end tool validation (`generate_goldens` -> comparator -> report) without waiting for full Python model pipeline completion. | `infra/ml/tools/generate_goldens.py`, `infra/ml/ground_truth/manifest.json`, `infra/ml/tools/run_suite.sh` |
+| 2026-02-16 | Point default parity corpus to `ente-io/test-fixtures/ml/indexing/v1` and verify each fixture by SHA-256 during bootstrap generation. | Aligns suite inputs with the dedicated maintained fixture set while preserving deterministic generation and reducing local corpus drift risk. | `infra/ml/ground_truth/manifest.json`, `infra/ml/tools/generate_goldens.py`, `infra/ml/ground_truth/README.md` |
+| 2026-02-16 | Keep all parity outputs ephemeral (gitignored), generated fresh on each suite run. | Avoids stale checked-in artifacts and ensures every comparison is based on current runner outputs over the same fixture set. | `infra/ml/.gitignore`, `infra/ml/ground_truth/goldens/`, `infra/ml/tools/run_suite.sh` |
### Open Questions / Blockers
| Date | Owner | Blocker | Unblocked By |
@@ -181,13 +185,15 @@ This gives immediate safety without blocking on architectural alignment work.
4. Canonicalize output ordering and JSON float formatting.
## Corpus and Ground Truth Storage
-1. Corpus source: separate dedicated repo (as discussed).
-2. Ground truth in main repo:
+1. Corpus source: `https://github.com/ente-io/test-fixtures/tree/main/ml/indexing/v1`.
+2. Ground truth config in main repo:
- `infra/ml/ground_truth/README.md`
- `infra/ml/ground_truth/manifest.json`
-- `infra/ml/ground_truth/goldens/*.json`
-3. Manifest includes:
-- corpus item id, source path/key, file type, tags
+3. Runtime-only (gitignored) parity artifacts:
+- `infra/ml/test_data/ml-indexing/v1/*` (downloaded fixture files)
+- `infra/ml/out/parity/<platform>/results.json` and per-file outputs
+4. Manifest includes:
+- corpus item id, source URL/path, SHA-256 (where available), file type, tags
- expected face count ranges (optional)
- thresholds per stage and per file class
- exclusions/known exceptions (if any)
@@ -221,7 +227,7 @@ All runners emit the same schema:
- Emit JSON in common schema.
4. Python runner (`infra/ml/tools/generate_goldens.py`)
-- Process corpus and generate/refresh goldens in common schema.
+- Process the local fixture directory and emit python results in common schema to a gitignored output directory.
## Comparator and Acceptance Rules
## Threshold Policy (Dual Threshold)
@@ -250,11 +256,12 @@ All runners emit the same schema:
Entrypoint: `infra/ml/tools/run_suite.sh`
Default behavior:
-1. Ensure corpus present (sync/fetch helper).
-2. Run/validate Python ground truth generation.
-3. Run desktop, Android, iOS parity runners (attempt all).
-4. Compare outputs and print unified report.
-5. Clearly mark unavailable/failed platform runs.
+1. Create/clear a local gitignored fixture directory (for example `infra/ml/test_data/ml-indexing/v1`).
+2. Download all files from `ente-io/test-fixtures/ml/indexing/v1` into that directory.
+3. Run/validate Python ground truth generation and write outputs under `infra/ml/out/parity/python/`.
+4. Run desktop, Android, iOS parity runners (attempt all) and write outputs under `infra/ml/out/parity/<platform>/`.
+5. Compare outputs and print unified report.
+6. Clearly mark unavailable/failed platform runs.
Flags:
1. `--suite smoke|full`
@@ -306,7 +313,7 @@ No automatic run for unrelated PRs.
4. Phase 4: Expand corpus continuously and tighten thresholds where stable.
## Assumptions and Defaults
-1. Corpus is maintained in a separate repo and fetched by tooling.
-2. Ground truth files are committed in this repo and updated intentionally via PR.
+1. Corpus is maintained in `ente-io/test-fixtures` at `ml/indexing/v1`; `run_suite.sh` downloads fixture files to `infra/ml/test_data/ml-indexing/v1` using each manifest item's `source_url`.
+2. Parity outputs are runtime artifacts and are not committed; `run_suite.sh` regenerates them on each run.
3. Mobile behavior is the setup reference for ground-truth implementation details in this phase.
4. Missing local platform support is reported clearly by default, not automatically fatal unless strict mode is enabled.
diff --git a/infra/ml/tools/generate_goldens.py b/infra/ml/tools/generate_goldens.py
index 3bf636596c..275f7cbf6b 100755
--- a/infra/ml/tools/generate_goldens.py
+++ b/infra/ml/tools/generate_goldens.py
@@ -92,11 +92,43 @@ def _git_revision(default: str = "local") -> str:
return completed.stdout.strip() or default
-def _build_result(item: Mapping[str, Any], *, ml_dir: Path, code_revision: str) -> ParityResult:
+def _load_source_bytes(*, source: str, ml_dir: Path) -> bytes:
+ source_path = Path(source)
+ if not source_path.is_absolute():
+ source_path = ml_dir / source_path
+ return source_path.read_bytes()
+
+
+def _validate_source_hash(
+ *,
+ source_bytes: bytes,
+ expected_sha256: str | None,
+ file_id: str,
+) -> None:
+ if not expected_sha256:
+ return
+
+ actual_sha256 = hashlib.sha256(source_bytes).hexdigest()
+ if actual_sha256.lower() != expected_sha256.lower():
+ raise ValueError(
+ f"source hash mismatch for {file_id}: expected {expected_sha256}, got {actual_sha256}"
+ )
+
+
+def _build_result(
+ item: Mapping[str, Any],
+ *,
+ ml_dir: Path,
+ code_revision: str,
+) -> ParityResult:
file_id = str(item["file_id"])
- source_relative_path = Path(str(item["source"]))
- source_path = ml_dir / source_relative_path
- source_bytes = source_path.read_bytes()
+ source = str(item["source"])
+ source_bytes = _load_source_bytes(source=source, ml_dir=ml_dir)
+ _validate_source_hash(
+ source_bytes=source_bytes,
+ expected_sha256=item.get("source_sha256"),
+ file_id=file_id,
+ )
source_seed = file_id.encode("utf-8") + source_bytes
clip_embedding = _stable_unit_vector(source_seed + b":clip", 512)
@@ -175,7 +207,14 @@ def main() -> int:
raise ValueError("Manifest has no items")
code_revision = _git_revision()
- results = tuple(_build_result(item, ml_dir=ml_dir, code_revision=code_revision) for item in items)
+ results = tuple(
+ _build_result(
+ item,
+ ml_dir=ml_dir,
+ code_revision=code_revision,
+ )
+ for item in items
+ )
output_dir.mkdir(parents=True, exist_ok=True)
for result in results:
diff --git a/infra/ml/tools/run_suite.sh b/infra/ml/tools/run_suite.sh
index 5b1ae0ab38..2601473081 100755
--- a/infra/ml/tools/run_suite.sh
+++ b/infra/ml/tools/run_suite.sh
@@ -3,6 +3,8 @@ set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
ML_DIR="$ROOT_DIR/infra/ml"
+MANIFEST_PATH="$ROOT_DIR/infra/ml/ground_truth/manifest.json"
+TEST_DATA_DIR="$ML_DIR/test_data/ml-indexing/v1"
SUITE="smoke"
PLATFORMS="all"
@@ -71,6 +73,54 @@ echo " suite: $SUITE"
echo " platforms: $PLATFORMS"
echo " output_dir: $OUTPUT_DIR"
+echo "Preparing local fixture directory: $TEST_DATA_DIR"
+rm -rf "$TEST_DATA_DIR"
+mkdir -p "$TEST_DATA_DIR"
+
+downloaded_count=0
+while IFS=$'\t' read -r source_rel source_url source_sha; do
+ if [[ -z "$source_rel" ]]; then
+ continue
+ fi
+ if [[ -z "$source_url" ]]; then
+ echo "Manifest item missing source_url for source=$source_rel" >&2
+ exit 1
+ fi
+
+ target_path="$ML_DIR/$source_rel"
+ target_dir="$(dirname "$target_path")"
+ mkdir -p "$target_dir"
+
+ tmp_path="$target_path.tmp"
+ curl -fsSL --retry 3 --retry-delay 1 "$source_url" -o "$tmp_path"
+ mv "$tmp_path" "$target_path"
+
+ if [[ -n "$source_sha" ]]; then
+ actual_sha="$(shasum -a 256 "$target_path" | awk '{print $1}')"
+ if [[ "$actual_sha" != "$source_sha" ]]; then
+ echo "SHA-256 mismatch for $source_rel: expected $source_sha got $actual_sha" >&2
+ exit 1
+ fi
+ fi
+ downloaded_count=$((downloaded_count + 1))
+done < <(
+ python3 - "$MANIFEST_PATH" <<'PY'
+import json
+import sys
+from pathlib import Path
+
+manifest_path = Path(sys.argv[1])
+manifest = json.loads(manifest_path.read_text())
+items = manifest.get("items", [])
+for item in items:
+ source = str(item.get("source", "")).strip()
+ source_url = str(item.get("source_url", "")).strip()
+ source_sha = str(item.get("source_sha256", "")).strip()
+ print(f"{source}\t{source_url}\t{source_sha}")
+PY
+)
+echo "Downloaded fixture files: $downloaded_count"
+
echo "Generating Python goldens"
uv run --project "$ML_DIR" --no-sync python "$ML_DIR/tools/generate_goldens.py" \
--manifest "infra/ml/ground_truth/manifest.json" \