From dc4b0465b55811c4516f234b72358d9ec0f0a435 Mon Sep 17 00:00:00 2001 From: ethernet Date: Fri, 22 May 2026 17:46:38 -0400 Subject: [PATCH] feat(ci): use 6-way slicing based on benchmark results MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Benchmarked 4/5/6/7/8 slices with LPT duration-balanced distribution: - 4 slices: 4.8m wall, 135s spread - 5 slices: 3.4m wall, 46s spread - 6 slices: 3.3m wall, 26s spread ← optimal - 7 slices: 3.9m wall, 109s spread - 8 slices: 3.7m wall, 96s spread 6 slices is the sweet spot: lowest wall time, tightest spread. 7+ gets slower due to per-slice startup overhead dominating. Also removes benchmark branch markers from save-durations condition. --- .github/workflows/tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 077318ffae2..b48b0bab080 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - slice: [1, 2, 3, 4] + slice: [1, 2, 3, 4, 5, 6] steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -65,7 +65,7 @@ jobs: source .venv/bin/activate uv pip install -e ".[all,dev]" - - name: Run tests (slice ${{ matrix.slice }}/4) + - name: Run tests (slice ${{ matrix.slice }}/6) # Per-file isolation via scripts/run_tests_parallel.py: discovers # every test_*.py file under tests/ (excluding integration/ + e2e/), # then runs `python -m pytest ` in a freshly-spawned subprocess @@ -84,14 +84,14 @@ jobs: # fix. ThreadPoolExecutor + subprocess.run is ~60 lines and does # the job with cleaner semantics. # - # Matrix slicing (--slice I/N): files are distributed across 4 + # Matrix slicing (--slice I/N): files are distributed across 6 # jobs by cached duration (LPT algorithm) so each job gets # roughly equal wall time. Without a cache, files default to 2s # estimate and get split roughly evenly by count — still correct, # just not perfectly balanced. run: | source .venv/bin/activate - python scripts/run_tests_parallel.py --slice ${{ matrix.slice }}/4 + python scripts/run_tests_parallel.py --slice ${{ matrix.slice }}/6 env: # Ensure tests don't accidentally call real APIs OPENROUTER_API_KEY: "" @@ -109,7 +109,7 @@ jobs: # (including PRs) get balanced slicing. save-durations: needs: test - if: always() && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/ethie/slice-test-')) + if: always() && github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - name: Download all slice durations