From 15f1fa3374a848d550247fd73d93333b41950f3f Mon Sep 17 00:00:00 2001 From: Aditya Mukhopadhyay Date: Tue, 3 Nov 2026 09:34:38 +0530 Subject: [PATCH] ci(bench): route bounded row-frame shortlist Route 18 existing row-frame cases and skip measurement/uploads when the checked-out tree lacks the suite. Document the remaining manual sweep and provisional runtime allowance. Refs #776. Co-Authored-By: Codex --- .github/workflows/bench.yml | 28 ++++++++++++++++++++++++++-- docs/BENCHMARKS.md | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 625af6d741..3cf413ed7b 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -202,6 +202,13 @@ jobs: filter: "^window/" file: bench_window.txt + # ── Bounded row frames (v3 only, #776 P01) ─────────────────────────── + # 18 existing IDs; reserve 5–15 job-minutes pending phase-B timing. + # See docs/BENCHMARKS.md for the selection and remaining manual sweep. + - name: window_rows + filter: "^window_rows/((10000|100000)/(one|hundred)/sum/(zero|two|prefix)|100000/hundred/(min|max)/(two|prefix)|10000/hundred/frame_bench_sum/two|100000/hundred/frame_bench_sum/prefix)$" + file: bench_window_rows.txt + # ── Temporal metadata ─────────────────────────────────────────────── - name: temporal_metadata filter: "^temporal_metadata/" @@ -250,6 +257,18 @@ jobs: path: target key: ${{ runner.os }}-bench-target-${{ hashFiles('**/Cargo.lock', 'benches/**', 'src/**/*.rs') }} + # Inspect the actual checkout: manual refs can be branches, tags or SHAs. + # Main has no row-frame group; skip its run and upload without empty data. + - name: Check row-frame suite availability + id: row_frames + if: matrix.name == 'window_rows' + run: | + if git grep -q -F 'fn bench_window_rows(' HEAD -- benches/minigraf_bench.rs; then + echo "available=true" >> "$GITHUB_OUTPUT" + else + echo "Skipping window_rows: no row-frame suite in $(git rev-parse HEAD)" >> "$GITHUB_STEP_SUMMARY" + fi + - name: Download benchmark enumeration uses: actions/download-artifact@v7 with: @@ -258,9 +277,12 @@ jobs: # Select from the shared listing without rerunning any fixture setup. # Every required matrix route must be nonempty before measurement starts. - name: Verify selected IDs + if: matrix.name != 'window_rows' || steps.row_frames.outputs.available == 'true' run: node .bench-workflow/.github/bench/report.cjs select - name: Run benchmarks (${{ matrix.name }}) + id: benchmarks + if: matrix.name != 'window_rows' || steps.row_frames.outputs.available == 'true' run: | set -o pipefail CARGO_TERM_COLOR=never cargo bench --bench minigraf_bench -- "$BENCH_FILTER" \ @@ -268,10 +290,12 @@ jobs: node .bench-workflow/.github/bench/report.cjs execution - name: Install Bencher CLI + if: steps.benchmarks.outcome == 'success' uses: bencherdev/bencher@v0.4.25 - name: Upload to Bencher id: bencher + if: steps.benchmarks.outcome == 'success' continue-on-error: true run: | set -o pipefail @@ -449,13 +473,13 @@ jobs: # Run even when selection, measurement or upload failed. Alerts keep the # existing two-run reporting policy; API/partial/empty uploads fail the job. - name: Verify reporting and summarize - if: always() + if: always() && (matrix.name != 'window_rows' || steps.row_frames.outputs.available == 'true') env: BENCHER_OUTCOME: ${{ steps.bencher.outcome }} run: node .bench-workflow/.github/bench/report.cjs finish - name: Retain coverage evidence - if: always() + if: always() && (matrix.name != 'window_rows' || steps.row_frames.outputs.available == 'true') uses: actions/upload-artifact@v6 with: name: bench-evidence-${{ strategy.job-index }} diff --git a/docs/BENCHMARKS.md b/docs/BENCHMARKS.md index e217502334..0831995d05 100644 --- a/docs/BENCHMARKS.md +++ b/docs/BENCHMARKS.md @@ -660,6 +660,39 @@ The UDF benchmark registers an integer sum with a fresh accumulator per bounded The harness omits the quadratic 100,000-row, half-partition UDF case. The large-case query scan and result materialization dominate the built-in timings; this snapshot checks relative growth of this complete query shape, not isolated deque or sum-step throughput. +### Nightly row-frame shortlist (#776 P01) + +The `bench / window_rows` job selects 18 existing IDs with this exact filter: + +```text +^window_rows/((10000|100000)/(one|hundred)/sum/(zero|two|prefix)|100000/hundred/(min|max)/(two|prefix)|10000/hundred/frame_bench_sum/two|100000/hundred/frame_bench_sum/prefix)$ +``` + +This covers sum frames of zero, two and prefix width at 10k/100k rows with +one/100 partitions (12 cases), plus min/max two-versus-prefix deque controls +at 100k rows with 100 partitions (4 cases). The remaining two cases exercise +the bounded UDF replay at 10k rows and its full-prefix running-accumulator +control at 100k rows, both with 100 partitions. The UDF pair covers different +execution paths and scales; it is not a same-size latency comparison. +Fixtures and UDF registration remain outside the timed loop; IDs are unchanged. + +The workflow checks the selected checkout for `bench_window_rows` and skips +this job's measurement and Bencher upload when it is absent, including main's +02:00 UTC run. The v3 run is at 14:00 UTC. Results use +`bench_window_rows.txt`, the existing latency reporting path and shared +0.999 threshold. Reserve **5–15 job-minutes**, an unverified planning allowance; +phase B must dispatch serially and verify executed IDs, uploads and runtime +before this route is treated as measured nightly coverage. + +The other 110 registered cases remain a deliberate manual sweep: default, +sqrt and half widths, count/avg, the remaining min/max combinations and UDF +zero/half/one-partition variants. Run the full `^window_rows/` selection only +on idle hardware under the release performance review; expensive replay +cases do not belong in every nightly run. The unregistered 100k half-partition +UDF case remains excluded for quadratic callback cost. An untimed local check +of the shortlist uses `cargo bench --bench minigraf_bench -- --test ''` +with the exact filter above. + ## Performance Envelope (v3.0.0, #394) **Version**: `v3` branch (format v8), unreleased · **Date**: 2026-10-11 · **Command**: `cargo run --profile envelope --example perf_envelope -- --scales 100k,1m,10m` · Intel Core i7-1065G7 (4 cores / 8 threads, 16 GB RAM), Rust 1.94.0, Linux 6.12.108, on AC power and otherwise idle; the `.graph` file on an SSD with the OS page cache warm.