Skip to content

Align edit-base documentation with current runtime and packaging contracts #333

Align edit-base documentation with current runtime and packaging contracts

Align edit-base documentation with current runtime and packaging contracts #333

Workflow file for this run

name: Tests
on:
workflow_dispatch:
push:
branches: [main, edit-base, codex/startup-chain-optimization]
pull_request:
branches: [main, edit-base]
permissions:
contents: read
jobs:
maps-scale-contract:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install Linux system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libegl1 libgl1 libxkbcommon0 libpulse0
- name: Install Maps scale-contract dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
- name: Run 1k, 10k, and 50k marker clustering contract
env:
IPHOTO_RUN_MAPS_SCALE_CONTRACT: "1"
QT_QPA_PLATFORM: offscreen
run: python -m pytest -q tests/contracts/test_map_marker_scale_contract.py
pets-scale-contract:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install Linux system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libegl1 libgl1 libxkbcommon0 libpulse0
- name: Install Pets scale-contract dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]" "usearch>=2.26,<3"
- name: Run 50k incremental index contract
env:
IPHOTO_RUN_PETS_SCALE_CONTRACT: "1"
QT_QPA_PLATFORM: offscreen
NUMBA_DISABLE_JIT: "1"
run: python -m pytest -q tests/contracts/test_pets_scale_contract.py
pets-production-shape-contract:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libegl1 libgl1 libxkbcommon0 libpulse0
- name: Install production-shape dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]" "usearch>=2.26,<3"
- name: Run 384-dimensional USearch and fallback contracts
env:
IPHOTO_RUN_PETS_PRODUCTION_SHAPE_CONTRACT: "1"
QT_QPA_PLATFORM: offscreen
NUMBA_DISABLE_JIT: "1"
run: python -m pytest -q -s tests/contracts/test_pets_scale_contract.py
pets-model-contract:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install Linux system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libegl1 libgl1 libxkbcommon0 libpulse0
- uses: actions/cache@v4
with:
path: ~/.cache/iphoto-contracts
key: pets-yolox-c789161ed43c8269-dog-5a9522051c3cec2b
- name: Install Pets model-contract dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]" onnxruntime
- name: Run official YOLOX contract
env:
IPHOTO_RUN_PETS_MODEL_CONTRACT: "1"
QT_QPA_PLATFORM: offscreen
run: python -m pytest -q tests/contracts/test_pets_model_contract.py
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: |
pyproject.toml
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libegl1 libgl1 libxkbcommon0 libpulse0
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
- name: Run tests
env:
QT_QPA_PLATFORM: offscreen
NUMBA_DISABLE_JIT: "1"
run: |
python tools/check_architecture.py
python -m compileall -q src tools
python tools/run_pytest_ci.py tests/ --tb=short -v
git diff --check
startup-contracts:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libegl1 libgl1 libxkbcommon0 libpulse0
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
- name: Run cross-platform startup contracts
env:
QT_QPA_PLATFORM: offscreen
NUMBA_DISABLE_JIT: "1"
run: >-
python -m pytest -q
tests/application/test_library_probe.py
tests/application/test_library_session.py
tests/application/test_runtime_context.py
tests/gui/test_startup_orchestrator.py
tests/gui/test_gui_startup_job_queue.py
tests/gui/test_startup_import_boundary.py
tests/gui/test_startup_shutdown_smoke.py
tests/test_library_bind_double_scan.py
tests/test_startup_benchmark.py
detail-gpu-first-contracts:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libegl1 libgl1 libxkbcommon0 libpulse0
- name: Install development dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run Detail GPU-first contracts
env:
QT_QPA_PLATFORM: offscreen
NUMBA_DISABLE_JIT: "1"
run: >-
python -m pytest -q
tests/gui/test_detail_pipeline.py
tests/gui/test_detail_render_coordinator.py
tests/gui/test_detail_decode_backend.py
tests/gui/test_detail_request_scheduler.py
tests/gui/test_detail_surface_cache.py
tests/gui/test_detail_surface_residency.py
tests/gui/test_detail_render_session.py
tests/ui/controllers/test_player_view_controller_adjustments.py
tests/ui/widgets/test_still_texture_residency.py
tests/test_detail_benchmark.py
tests/test_detail_surface_cache_benchmark.py
- name: Run static gates
run: |
python tools/check_architecture.py
python -m compileall -q src tools
python -m ruff check --select F,E9 src/iPhoto/gui/detail_pipeline.py src/iPhoto/gui/detail_render_coordinator.py src/iPhoto/gui/detail_decode_backend.py src/iPhoto/gui/detail_decode_macos.py src/iPhoto/gui/detail_decode_windows.py src/iPhoto/gui/detail_benchmark_harness.py src/iPhoto/gui/detail_surface_cache.py src/iPhoto/gui/detail_surface_cache_index.py src/iPhoto/gui/detail_surface_residency.py tools/detail_benchmark.py tools/detail_surface_cache_benchmark.py tools/run_detail_packaged_benchmark.py
git diff --check
detail-surface-cache-contract:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: Check out candidate
uses: actions/checkout@v4
with:
path: candidate
- name: Check out fixed v2 baseline
uses: actions/checkout@v4
with:
ref: fe623e68d101048751fd9acb85ddb5d08c564c83
path: baseline
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: candidate/pyproject.toml
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libegl1 libgl1 libxkbcommon0 libpulse0
- name: Install benchmark dependencies
run: |
python -m pip install --upgrade pip
pip install -e "candidate[test]"
- name: Run fixed baseline and candidate cache benchmarks
shell: bash
env:
QT_QPA_PLATFORM: offscreen
run: |
mkdir -p metrics
PYTHONPATH="${{ github.workspace }}/baseline/src" python candidate/tools/detail_surface_cache_benchmark.py run --label baseline --repo-root baseline --sizes-mib 16 --defer-fresh-probes --output metrics/baseline-16.json
PYTHONPATH="${{ github.workspace }}/candidate/src" python candidate/tools/detail_surface_cache_benchmark.py run --label candidate --repo-root candidate --sizes-mib 16 --defer-fresh-probes --output metrics/candidate-16.json
python candidate/tools/detail_surface_cache_benchmark.py pair-fresh --baseline metrics/baseline-16.json --candidate metrics/candidate-16.json --baseline-repo baseline --candidate-repo candidate --size-mib 16
python candidate/tools/detail_surface_cache_benchmark.py compare --baseline metrics/baseline-16.json --candidate metrics/candidate-16.json --output metrics/comparison-16.json
PYTHONPATH="${{ github.workspace }}/candidate/src" python candidate/tools/detail_surface_cache_benchmark.py run --label candidate --repo-root candidate --sizes-mib 64 --defer-fresh-probes --output metrics/candidate-64.json
PYTHONPATH="${{ github.workspace }}/baseline/src" python candidate/tools/detail_surface_cache_benchmark.py run --label baseline --repo-root baseline --sizes-mib 64 --defer-fresh-probes --output metrics/baseline-64.json
python candidate/tools/detail_surface_cache_benchmark.py pair-fresh --baseline metrics/baseline-64.json --candidate metrics/candidate-64.json --baseline-repo baseline --candidate-repo candidate --size-mib 64
python candidate/tools/detail_surface_cache_benchmark.py compare --baseline metrics/baseline-64.json --candidate metrics/candidate-64.json --output metrics/comparison-64.json
PYTHONPATH="${{ github.workspace }}/baseline/src" python candidate/tools/detail_surface_cache_benchmark.py run --label baseline --repo-root baseline --sizes-mib 180 --defer-fresh-probes --output metrics/baseline-180.json
PYTHONPATH="${{ github.workspace }}/candidate/src" python candidate/tools/detail_surface_cache_benchmark.py run --label candidate --repo-root candidate --sizes-mib 180 --defer-fresh-probes --output metrics/candidate-180.json
python candidate/tools/detail_surface_cache_benchmark.py pair-fresh --baseline metrics/baseline-180.json --candidate metrics/candidate-180.json --baseline-repo baseline --candidate-repo candidate --size-mib 180
python candidate/tools/detail_surface_cache_benchmark.py compare --baseline metrics/baseline-180.json --candidate metrics/candidate-180.json --output metrics/comparison-180.json
- name: Upload cache benchmark metrics
if: always()
uses: actions/upload-artifact@v4
with:
name: detail-surface-cache-${{ matrix.os }}
path: metrics/*.json