fix: add exact resume-safe WWPGD projection dose telemetry #1050
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| quality: | |
| name: quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install package and tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --no-cache-dir -e . | |
| python -m pip install ruff pytest | |
| - name: Compile source and tests | |
| run: python -m compileall -q src tests | |
| - name: Ruff | |
| run: ruff check src tests | |
| - name: Reject WWPGD dependency pins and hard-coded required SHAs | |
| shell: bash | |
| run: | | |
| ! grep -R "WW_PGD.git""@" pyproject.toml .github scripts src tests docs README.md | |
| ! rg 'required.{0,40}[0-9a-f]{40}|[0-9a-f]{40}.{0,40}required' pyproject.toml .github scripts src tests docs README.md | |
| git diff --check | |
| tests: | |
| name: complete portable test suite | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install package and tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e . pytest | |
| - name: Run complete portable test suite | |
| shell: bash | |
| run: | | |
| set -o pipefail | |
| mkdir -p artifacts/test-logs | |
| pytest -q -ra --tb=short 2>&1 | tee artifacts/test-logs/pytest.log | |
| - name: Upload pytest log | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pytest-log | |
| path: artifacts/test-logs/pytest.log | |
| if-no-files-found: error | |
| level0-2-local-runtime: | |
| name: Level 0-2 local runtime acceptance | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install package and tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --no-cache-dir -e . pytest | |
| - name: Run real pip-package readiness for Levels 0-2 | |
| run: | | |
| wwgpt local-readiness \ | |
| --device cpu \ | |
| --levels 0,1,2 \ | |
| --optimizers adamw \ | |
| --output artifacts/local-readiness | |
| - name: Run bounded Level 0-2 training and post-processing acceptance | |
| env: | |
| MPLBACKEND: Agg | |
| run: | | |
| pytest -q \ | |
| tests/test_acceleration_analysis.py \ | |
| tests/test_cached_controller_csv_routing.py \ | |
| tests/test_cached_endpoint_relaxation.py \ | |
| tests/test_level012_cached_end_to_end.py \ | |
| tests/test_level012_full_pipeline.py \ | |
| tests/test_overtraining_mode.py \ | |
| tests/test_local_level_scripts.py \ | |
| tests/test_pass6_resume_analysis_cli_ci.py \ | |
| tests/test_release_readiness_audit.py \ | |
| tests/test_source_structure.py | |
| - name: Run clean-process Level 0-2 shell acceptance | |
| env: | |
| MPLBACKEND: Agg | |
| run: | | |
| ./scripts/run_bounded_level012_acceptance.sh \ | |
| artifacts/bounded-level012-release | |
| - name: Upload local readiness report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: level0-2-local-readiness | |
| path: artifacts/local-readiness/** | |
| if-no-files-found: error | |
| macos-python310-release-acceptance: | |
| name: macOS Python 3.10 / NumPy 1.x release acceptance | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install constrained scientific stack and package | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| python -m pip install --upgrade pip | |
| printf 'numpy<2\npandas<2\n' > /tmp/wwgpt-constraints.txt | |
| python -m pip install --no-cache-dir \ | |
| -c /tmp/wwgpt-constraints.txt \ | |
| -e . pytest | |
| - name: Run real package readiness on macOS | |
| run: | | |
| wwgpt local-readiness \ | |
| --device cpu \ | |
| --levels 0,1,2 \ | |
| --optimizers adamw \ | |
| --output artifacts/macos-local-readiness | |
| - name: Run Python 3.10 and NumPy 1.x regressions | |
| env: | |
| MPLBACKEND: Agg | |
| run: | | |
| pytest -q \ | |
| tests/test_acceleration_analysis.py \ | |
| tests/test_level012_full_pipeline.py \ | |
| tests/test_overtraining_mode.py \ | |
| tests/test_pass6_resume_analysis_cli_ci.py \ | |
| tests/test_release_readiness_audit.py \ | |
| tests/test_source_structure.py | |
| - name: Run clean-process Level 0-2 shell acceptance on macOS | |
| env: | |
| MPLBACKEND: Agg | |
| run: | | |
| ./scripts/run_bounded_level012_acceptance.sh \ | |
| artifacts/macos-bounded-level012-release | |
| - name: Upload macOS readiness and acceptance outputs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-python310-release-acceptance | |
| path: | | |
| artifacts/macos-local-readiness/** | |
| artifacts/macos-bounded-level012-release/** | |
| if-no-files-found: error | |
| resolved-pilot-manifests: | |
| name: resolved pilot manifests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install package | |
| run: python -m pip install -e . | |
| - name: Resolve and validate Level 0, 1, and 2 execution manifests | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p artifacts/resolved-pilot-manifests | |
| for level in 0 1 2; do | |
| wwgpt run-multiseed \ | |
| --level "$level" \ | |
| --config "configs/level${level}_adaptive_alpha.yaml" \ | |
| --data-root /tmp/wwgpt-data \ | |
| --results-root /tmp/wwgpt-results \ | |
| --token-multiplier 20 \ | |
| --device cpu \ | |
| --dry-run \ | |
| | tail -n +2 > "artifacts/resolved-pilot-manifests/level${level}.json" | |
| python -m json.tool "artifacts/resolved-pilot-manifests/level${level}.json" >/dev/null | |
| done | |
| wwgpt run-multiseed \ | |
| --level 0 \ | |
| --config configs/level0_overtraining_pilot.yaml \ | |
| --data-root /tmp/wwgpt-data \ | |
| --results-root /tmp/wwgpt-overtraining-results \ | |
| --token-multiplier 20 \ | |
| --device cpu \ | |
| --dry-run \ | |
| | tail -n +2 > artifacts/resolved-pilot-manifests/level0-overtraining.json | |
| python - <<'PY' | |
| import json | |
| from pathlib import Path | |
| expected = { | |
| 0: (25, 75, 0.02), | |
| 1: (250, 500, 0.002049), | |
| 2: (1000, 3000, 0.000511), | |
| } | |
| overtraining = json.loads( | |
| Path( | |
| "artifacts/resolved-pilot-manifests/level0-overtraining.json" | |
| ).read_text() | |
| ) | |
| assert overtraining["nominal_optimizer_steps"] == 242 | |
| assert overtraining["resolved_optimizer_steps"] == 1000 | |
| assert overtraining["overtraining_active"] is True | |
| assert overtraining["training_protocol"] == "fixed_corpus_overtraining" | |
| assert overtraining["valid_for_scaling_law_fit"] is False | |
| assert overtraining["optimizer_step_limit_source"] == "overtraining_max_steps" | |
| for level, (interval, first_active, gain) in expected.items(): | |
| payload = json.loads( | |
| Path(f"artifacts/resolved-pilot-manifests/level{level}.json").read_text() | |
| ) | |
| schedule = payload["wwpgd_adaptive_schedule"] | |
| assert payload["endpoint_measurement_interval"] == interval | |
| assert payload["endpoint_measurement_source"] == "measurement.alpha_interval" | |
| assert schedule["first_possible_active_endpoint_step"] == first_active | |
| assert abs(schedule["effective_base_gain"] - gain) <= max( | |
| 1e-6, gain * 0.01 | |
| ) | |
| assert ( | |
| schedule["worst_case_endpoint_fraction_per_refresh"] | |
| <= 0.40 + 1e-12 | |
| ) | |
| PY | |
| - name: Upload resolved pilot execution manifests | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: resolved-pilot-execution-manifests | |
| path: artifacts/resolved-pilot-manifests/*.json | |
| if-no-files-found: error | |
| analysis-notebooks: | |
| name: schema-v3 Papermill notebooks | |
| runs-on: ubuntu-latest | |
| env: | |
| MPLBACKEND: Agg | |
| WWGPT_RESULTS_ROOT: tests/fixtures/schema_v3_results/experiments/level_00/multiplier_1 | |
| WWGPT_NOTEBOOK_OUTPUT_DIR: artifacts/analysis-notebooks | |
| WWGPT_ANALYSIS_PLAN: configs/analysis_plan_exploratory.yaml | |
| WWGPT_LEVEL: '0' | |
| WWGPT_TOKEN_MULTIPLIER: '1' | |
| WWGPT_BASE_OPTIMIZER: adamw | |
| WWGPT_NOTEBOOK_STRICT: '0' | |
| WWGPT_RUN_ANALYSIS: '0' | |
| WWGPT_REUSE_ANALYSIS: '1' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install package and notebook tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --no-cache-dir -e ".[notebooks]" | |
| python -m pip install pytest | |
| - name: Execute all schema-v3 analysis notebooks through Papermill | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| ./scripts/run_analysis_notebooks.sh | |
| test "$(find "$WWGPT_NOTEBOOK_OUTPUT_DIR/executed" -name '*.ipynb' | wc -l)" -eq 7 | |
| test -f "$WWGPT_NOTEBOOK_OUTPUT_DIR/tables/repository_validation.csv" | |
| test -f "$WWGPT_NOTEBOOK_OUTPUT_DIR/tables/selected_checkpoint_effects_by_seed.csv" | |
| test -f "$WWGPT_NOTEBOOK_OUTPUT_DIR/tables/selected_checkpoint_effect_summary.csv" | |
| test -f "$WWGPT_NOTEBOOK_OUTPUT_DIR/tables/cross_level_scaling_readiness.csv" | |
| test -f "$WWGPT_NOTEBOOK_OUTPUT_DIR/tables/wwpgd_diagnostic_health.csv" | |
| - name: Upload executed notebooks and analysis outputs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: schema-v3-analysis-notebooks | |
| path: artifacts/analysis-notebooks/** | |
| if-no-files-found: error |