|
| 1 | +name: Benchmark Suite |
| 2 | + |
| 3 | +'on': |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + instances: |
| 7 | + description: 'Number of instances per benchmark' |
| 8 | + required: true |
| 9 | + default: '25' |
| 10 | + type: choice |
| 11 | + options: ['10', '25', '50', '100', '200', '500'] |
| 12 | + scoring: |
| 13 | + description: 'Scoring modes to run' |
| 14 | + required: true |
| 15 | + default: 'both' |
| 16 | + type: choice |
| 17 | + options: ['ppr', 'ego', 'both'] |
| 18 | + budget: |
| 19 | + description: 'Token budget' |
| 20 | + required: true |
| 21 | + default: '8000' |
| 22 | + |
| 23 | +jobs: |
| 24 | + benchmark: |
| 25 | + name: Run benchmarks (${{ inputs.instances }} instances, ${{ inputs.scoring }}) |
| 26 | + runs-on: ubuntu-latest-16-cores |
| 27 | + timeout-minutes: 360 |
| 28 | + |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v6 |
| 31 | + |
| 32 | + - name: Set up Python |
| 33 | + uses: actions/setup-python@v6 |
| 34 | + with: |
| 35 | + python-version: '3.12' |
| 36 | + |
| 37 | + - name: Cache pip |
| 38 | + uses: actions/cache@v5 |
| 39 | + with: |
| 40 | + path: ~/.cache/pip |
| 41 | + key: bench-pip-${{ hashFiles('pyproject.toml') }} |
| 42 | + |
| 43 | + - name: Cache cloned repos |
| 44 | + uses: actions/cache@v5 |
| 45 | + with: |
| 46 | + path: /tmp/contextbench_repos |
| 47 | + key: bench-repos-v1 |
| 48 | + restore-keys: bench-repos- |
| 49 | + |
| 50 | + - name: Install |
| 51 | + run: pip install -e ".[dev,tree-sitter]" datasets |
| 52 | + |
| 53 | + - name: Run ContextBench (PPR) |
| 54 | + if: inputs.scoring == 'ppr' || inputs.scoring == 'both' |
| 55 | + run: | |
| 56 | + python benchmarks/forensic_contextbench.py \ |
| 57 | + --limit ${{ inputs.instances }} \ |
| 58 | + --budget ${{ inputs.budget }} \ |
| 59 | + 2>&1 | tee results/cb_ppr.txt |
| 60 | + env: |
| 61 | + DIFFCTX_SCORING: precise |
| 62 | + |
| 63 | + - name: Run ContextBench (EgoGraph) |
| 64 | + if: inputs.scoring == 'ego' || inputs.scoring == 'both' |
| 65 | + run: | |
| 66 | + python benchmarks/forensic_contextbench.py \ |
| 67 | + --limit ${{ inputs.instances }} \ |
| 68 | + --budget ${{ inputs.budget }} \ |
| 69 | + 2>&1 | tee results/cb_ego.txt |
| 70 | + env: |
| 71 | + DIFFCTX_SCORING: discover |
| 72 | + |
| 73 | + - name: Run LOO (PPR) |
| 74 | + if: inputs.scoring == 'ppr' || inputs.scoring == 'both' |
| 75 | + run: | |
| 76 | + python benchmarks/loo_swebench.py \ |
| 77 | + --limit ${{ inputs.instances }} \ |
| 78 | + --budget ${{ inputs.budget }} \ |
| 79 | + --output results/loo_ppr.json \ |
| 80 | + 2>&1 | tee results/loo_ppr.txt |
| 81 | +
|
| 82 | + - name: Run LOO (EgoGraph) |
| 83 | + if: inputs.scoring == 'ego' || inputs.scoring == 'both' |
| 84 | + run: | |
| 85 | + python benchmarks/loo_swebench.py \ |
| 86 | + --limit ${{ inputs.instances }} \ |
| 87 | + --budget ${{ inputs.budget }} \ |
| 88 | + --output results/loo_ego.json \ |
| 89 | + 2>&1 | tee results/loo_ego.txt |
| 90 | + env: |
| 91 | + DIFFCTX_SCORING: discover |
| 92 | + |
| 93 | + - name: Generate summary |
| 94 | + if: always() |
| 95 | + run: python benchmarks/summarize_results.py results/ >> "$GITHUB_STEP_SUMMARY" |
| 96 | + |
| 97 | + - name: Upload results |
| 98 | + if: always() |
| 99 | + uses: actions/upload-artifact@v4 |
| 100 | + with: |
| 101 | + name: benchmark-results-${{ inputs.instances }}-${{ inputs.scoring }} |
| 102 | + path: results/ |
| 103 | + retention-days: 90 |
0 commit comments