diff --git a/.github/workflows/inspect-r-api-update.yml b/.github/workflows/inspect-r-api-update.yml index dbe20dee..ab52e420 100644 --- a/.github/workflows/inspect-r-api-update.yml +++ b/.github/workflows/inspect-r-api-update.yml @@ -370,6 +370,36 @@ jobs: NNS_R_CACHE_ONLY=1 python -m pytest -q tests/parity } 2>&1 | tee committed-cache-verification.log + # Thousands of generated cases per area, compared with the new oracle at + # exact equality, with and without the native extension + # (scripts/live_parity/README.md). + - name: Run live R sweeps + id: sweeps + if: always() + continue-on-error: true + shell: bash + env: + NNS_LIVE_OUT: live-parity-reports + run: | + set -o pipefail + python scripts/live_parity/run.py --mode both --jobs 4 \ + --summary live-parity-summary.md 2>&1 | tee live-parity.log + + - name: Collect live sweep summary + id: sweepsummary + if: always() + shell: bash + run: | + { + echo 'summary<> "$GITHUB_OUTPUT" + - name: Upload parity diagnostics if: always() uses: actions/upload-artifact@v4 @@ -378,6 +408,9 @@ jobs: path: | parity-regeneration.log committed-cache-verification.log + live-parity.log + live-parity-summary.md + live-parity-reports/ if-no-files-found: warn # Rebuild directly on the existing #192 branch. Do not let the @@ -421,10 +454,13 @@ jobs: - Windows binary verified: `${{ steps.package.outputs.windows_binary }}` - Live regeneration result: `${{ steps.regenerate.outcome }}` - Cache-only verification result: `${{ steps.verify.outcome }}` + - Live R sweeps result: `${{ steps.sweeps.outcome }}` The exact R source package was installed and the committed parity cache was regenerated. `sync/nns_source.json` records this R commit as the behavioral-truth provenance. Any remaining Python/R parity mismatches are retained in the workflow diagnostics and should be repaired against this R-authored baseline. ${{ steps.cachediff.outputs.summary }} + + ${{ steps.sweepsummary.outputs.summary }} add-paths: | tests/_r.py tests/_r_cache/** @@ -436,8 +472,13 @@ jobs: run: | echo "Live regeneration outcome: ${{ steps.regenerate.outcome }}" echo "Cache-only verification outcome: ${{ steps.verify.outcome }}" + echo "Live R sweeps outcome: ${{ steps.sweeps.outcome }}" echo "The regenerated R cache has been preserved on the audit branch or in its PR." if [ "${{ steps.regenerate.outcome }}" != "success" ] || [ "${{ steps.verify.outcome }}" != "success" ]; then echo "::error::The oracle regeneration or its offline verification failed; generated cache is for review, not release." exit 1 fi + if [ "${{ steps.sweeps.outcome }}" != "success" ]; then + echo "::error::The live R sweeps found differences from the new oracle; see live-parity.log in the diagnostics." + exit 1 + fi diff --git a/.github/workflows/r14-reproduction.yml b/.github/workflows/r14-reproduction.yml index be0e678f..3955c374 100644 --- a/.github/workflows/r14-reproduction.yml +++ b/.github/workflows/r14-reproduction.yml @@ -25,8 +25,8 @@ jobs: git archive --format=tar.gz --output=reproduction/python-source.tar.gz HEAD git rev-parse HEAD > reproduction/python-commit.txt curl --fail --location --retry 3 \ - https://raw.githubusercontent.com/OVVO-Financial/NNS/9c8bd21a77b377cb49d43fececc662d62b00a94e/NNS_14.0.tar.gz \ - --output reproduction/NNS_14.0.tar.gz + https://raw.githubusercontent.com/OVVO-Financial/NNS/f0387ed857de3d3bf047fa581b854dc5e3d0c3a6/NNS_14.2.tar.gz \ + --output reproduction/NNS_14.2.tar.gz sha256sum reproduction/*.tar.gz > reproduction/SHA256SUMS python -m pip download --only-binary=:all: --dest reproduction/wheels \ hypothesis pytest-benchmark pytest-xdist nanobind scikit-build-core ruff mypy @@ -50,12 +50,12 @@ jobs: ca-certificates curl r-base-core r-base-dev r-cran-rcpp \ r-cran-rcppparallel r-cran-jsonlite r-cran-mass r-cran-mlbench curl --fail --location --retry 3 \ - https://raw.githubusercontent.com/OVVO-Financial/NNS/9c8bd21a77b377cb49d43fececc662d62b00a94e/NNS_14.0.tar.gz \ - --output /tmp/NNS_14.0.tar.gz - echo '754dad65629b95bf3ddca9bf9018ef197f5c346dd12dcfb49e505835920bc5cb /tmp/NNS_14.0.tar.gz' | sha256sum -c - - MAKEFLAGS=-j2 R CMD INSTALL /tmp/NNS_14.0.tar.gz + https://raw.githubusercontent.com/OVVO-Financial/NNS/f0387ed857de3d3bf047fa581b854dc5e3d0c3a6/NNS_14.2.tar.gz \ + --output /tmp/NNS_14.2.tar.gz + echo 'a4e04b26b3ea01aeae1d6676448194b275bdd3f2aacbafd78b82ba5c2a649201 /tmp/NNS_14.2.tar.gz' | sha256sum -c - + MAKEFLAGS=-j2 R CMD INSTALL /tmp/NNS_14.2.tar.gz mkdir -p oracle-runtime/dependent-libraries - Rscript -e 'library(NNS); stopifnot(packageVersion("NNS") == "14.0"); sessionInfo()' > oracle-runtime/session-info.txt + Rscript -e 'library(NNS); stopifnot(packageVersion("NNS") == "14.2"); sessionInfo()' > oracle-runtime/session-info.txt find /usr/lib/R /usr/local/lib/R -name '*.so' -print0 | \ xargs -0 -r ldd 2>/dev/null | awk '/=> \/.* \(/{print $3}' | sort -u > oracle-runtime/library-paths.txt while IFS= read -r lib; do