|
1 | | -name: Instant mixer sparse sample regression |
| 1 | +name: Instant mixer sparse and PCM identity proof |
2 | 2 | on: |
3 | 3 | push: |
4 | 4 | branches: [ci/fixproof-instant-mixer] |
|
10 | 10 | CARGO_INCREMENTAL: "0" |
11 | 11 | jobs: |
12 | 12 | compare: |
13 | | - runs-on: blacksmith-6vcpu-macos-15 |
14 | | - timeout-minutes: 30 |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + include: |
| 17 | + - os: macos |
| 18 | + runner: blacksmith-6vcpu-macos-15 |
| 19 | + target: aarch64-apple-darwin |
| 20 | + - os: windows |
| 21 | + runner: blacksmith-8vcpu-windows-2025 |
| 22 | + target: x86_64-pc-windows-msvc |
| 23 | + runs-on: ${{ matrix.runner }} |
| 24 | + timeout-minutes: 60 |
15 | 25 | defaults: |
16 | 26 | run: |
17 | 27 | shell: bash |
18 | 28 | steps: |
19 | 29 | - uses: actions/checkout@v4 |
20 | 30 | - uses: ./.github/actions/engine-verify-setup |
21 | 31 | with: |
22 | | - target: aarch64-apple-darwin |
| 32 | + target: ${{ matrix.target }} |
23 | 33 | tier: fast |
24 | 34 | - name: Link native framework |
| 35 | + if: runner.os == 'macOS' |
25 | 36 | run: | |
26 | 37 | mkdir -p target/ci-verify/Frameworks |
27 | 38 | ln -s "$GITHUB_WORKSPACE/target/Frameworks/Spacedrive.framework" target/ci-verify/Frameworks/Spacedrive.framework |
@@ -50,22 +61,39 @@ jobs: |
50 | 61 | ) |
51 | 62 | path.write_text(source) |
52 | 63 | PY |
53 | | - - name: Compare unchanged strict sparse probe |
| 64 | + - name: Compare strict sparse probe and single-source recordings |
54 | 65 | run: | |
55 | | - set +e |
56 | 66 | set -o pipefail |
57 | | - failed=0 |
| 67 | + root="$RUNNER_TEMP/mixer-regression" |
58 | 68 | for arm in main candidate; do |
59 | | - cp "$RUNNER_TEMP/mixer-regression/$arm.rs" crates/recording/src/sources/audio_mixer.rs |
60 | | - cargo test -p cap-recording --lib --profile ci-verify --locked pcm_sparse_system_and_pause_resume_preserve_later_gaps -- --nocapture 2>&1 | tee "$RUNNER_TEMP/mixer-regression/$arm.log" |
61 | | - status=$? |
62 | | - echo "ARM=$arm EXIT=$status" |
63 | | - if [ "$status" != 0 ]; then failed=1; fi |
| 69 | + cp "$root/$arm.rs" crates/recording/src/sources/audio_mixer.rs |
| 70 | + status=0 |
| 71 | + cargo test -p cap-recording --lib --profile ci-verify --locked pcm_sparse_system_and_pause_resume_preserve_later_gaps -- --nocapture 2>&1 | tee "$root/$arm.log" || status=$? |
| 72 | + if [[ "$arm" == main ]]; then test "$status" = 101; else test "$status" = 0; fi |
| 73 | + cargo run -p cap-verify --example mixer-pcm-identity --profile ci-verify --locked -- "$root/$arm-recordings" > "$root/$arm-recordings.log" 2>&1 |
64 | 74 | done |
65 | | - exit "$failed" |
| 75 | + python3 - <<'PYCODE' |
| 76 | + import hashlib |
| 77 | + import json |
| 78 | + import os |
| 79 | + from pathlib import Path |
| 80 | + root = Path(os.environ["RUNNER_TEMP"]) / "mixer-regression" |
| 81 | + assert "peaks=[14401, 28802, 43203]" in (root / "main.log").read_text() |
| 82 | + assert "peaks=[14400, 28800, 43200]" in (root / "candidate.log").read_text() |
| 83 | + results = {} |
| 84 | + for source in ["mic", "system"]: |
| 85 | + files = [root / f"{arm}-recordings/{source}.pcm" for arm in ["main", "candidate"]] |
| 86 | + data = [file.read_bytes() for file in files] |
| 87 | + assert data[0] == data[1] and data[0], (source, [len(value) for value in data]) |
| 88 | + metadata = [json.loads((root / f"{arm}-recordings/{source}.json").read_text()) for arm in ["main", "candidate"]] |
| 89 | + assert metadata[0] == metadata[1], (source, metadata) |
| 90 | + results[source] = {"bytes": len(data[0]), "sha256": hashlib.sha256(data[0]).hexdigest(), "metadata": metadata[0]} |
| 91 | + (root / "identity.json").write_text(json.dumps(results, indent=2)) |
| 92 | + print(json.dumps(results, indent=2)) |
| 93 | + PYCODE |
66 | 94 | - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 |
67 | 95 | if: always() |
68 | 96 | with: |
69 | | - name: mixer-sparse-comparison |
| 97 | + name: mixer-sparse-comparison-${{ matrix.os }} |
70 | 98 | path: ${{ runner.temp }}/mixer-regression |
71 | 99 | retention-days: 7 |
0 commit comments