Skip to content

Commit 6c4e0e4

Browse files
authored
feat: parallelise at hole level (#44)
* feat: parallelise at hole level * fix(ci): move strategy to testbed job * feat: output json results file * fix(ci): install jq * fix(ci): add missing `runs-on` * fix(ci): add dependency to testbed job * fix(ci): invalid artifact key name * fix(ci): add missing i in fastapi key * feat(ci): make CI run different # of threads per repo * fix(ci): results.json not in markdown * feat: round output values * fix: avoid creating zombie processes * fix: check on word instead of line * feat: recreate holes for long CI
1 parent 3ad64a3 commit 6c4e0e4

19 files changed

+381
-221
lines changed

.github/workflows/test.yml

Lines changed: 119 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ concurrency:
1111

1212
jobs:
1313
testbed:
14+
strategy:
15+
matrix:
16+
repo:
17+
- { name: simple, key: simple, parallel: 8 }
18+
- { name: mmaitre314/picklescan, key: picklescan, parallel: 8 }
19+
- { name: huggingface/huggingface_hub, key: huggingface_hub, parallel: 8 }
20+
- { name: tiangolo/fastapi, key: fastapi, parallel: 8 }
21+
- { name: encode/starlette, key: starlette, parallel: 8 }
22+
- { name: lancedb/lancedb, key: lancedb, parallel: 2 }
23+
- { name: lancedb/lance, key: lance, parallel: 2 }
24+
- { name: tkaitchuck/constrandom, key: constrandom, parallel: 8 }
25+
- { name: jaemk/cached, key: cached, parallel: 4 }
26+
- { name: smol-rs/async-executor, key: async-executor, parallel: 4 }
27+
- { name: gcanti/io-ts, key: io-ts, parallel: 8 }
28+
- { name: colinhacks/zod, key: zod, parallel: 8 }
29+
- { name: helix-editor/helix, key: helix, parallel: 2 }
1430
runs-on: [self-hosted, intel-cpu, 8-cpu, ci]
1531
container:
1632
image: ubuntu:22.04
@@ -60,17 +76,118 @@ jobs:
6076
run: cargo build -r
6177

6278
- name: Run testbed
63-
run: cargo run --bin testbed -r -- --api-token $API_TOKEN -r `pwd`/crates/testbed/repositories-ci.yaml
79+
run: 'cargo run --bin testbed -r -- --api-token $API_TOKEN -r `pwd`/crates/testbed/repositories-ci.yaml -f ${{ matrix.repo.name }} -p ${{ matrix.repo.parallel }}'
6480
if: github.event_name == 'push' || github.event_name == 'pull_request'
6581
env:
6682
API_TOKEN: ${{ secrets.API_TOKEN }}
6783

6884
- name: Run testbed
69-
run: cargo run --bin testbed -r -- --api-token $API_TOKEN
85+
run: 'cargo run --bin testbed -r -- --api-token $API_TOKEN -f ${{ matrix.repo.name }} -p ${{ matrix.repo.parallel }}'
7086
if: github.event_name == 'workflow_dispatch'
7187
env:
7288
API_TOKEN: ${{ secrets.API_TOKEN }}
7389

90+
- name: Upload artifacts
91+
uses: actions/upload-artifact@v1
92+
with:
93+
name: results-${{ matrix.repo.key }}
94+
path: ./results.json
95+
96+
comment_results:
97+
needs: [testbed]
98+
runs-on: [self-hosted, intel-cpu, 8-cpu, ci]
99+
container:
100+
image: ubuntu:22.04
101+
steps:
102+
- name: Install dependencies
103+
run: |
104+
apt update
105+
apt install -y jq
106+
107+
- uses: actions/download-artifact@v1
108+
with:
109+
name: results-simple
110+
path: results-simple
111+
112+
- uses: actions/download-artifact@v1
113+
with:
114+
name: results-picklescan
115+
path: results-picklescan
116+
117+
- uses: actions/download-artifact@v1
118+
with:
119+
name: results-huggingface_hub
120+
path: results-huggingface_hub
121+
122+
- uses: actions/download-artifact@v1
123+
with:
124+
name: results-fastapi
125+
path: results-fastapi
126+
127+
- uses: actions/download-artifact@v1
128+
with:
129+
name: results-starlette
130+
path: results-starlette
131+
132+
- uses: actions/download-artifact@v1
133+
with:
134+
name: results-lancedb
135+
path: results-lancedb
136+
137+
- uses: actions/download-artifact@v1
138+
with:
139+
name: results-lance
140+
path: results-lance
141+
142+
- uses: actions/download-artifact@v1
143+
with:
144+
name: results-constrandom
145+
path: results-constrandom
146+
147+
- uses: actions/download-artifact@v1
148+
with:
149+
name: results-cached
150+
path: results-cached
151+
152+
- uses: actions/download-artifact@v1
153+
with:
154+
name: results-async-executor
155+
path: results-async-executor
156+
157+
- uses: actions/download-artifact@v1
158+
with:
159+
name: results-io-ts
160+
path: results-io-ts
161+
162+
- uses: actions/download-artifact@v1
163+
with:
164+
name: results-zod
165+
path: results-zod
166+
167+
- uses: actions/download-artifact@v1
168+
with:
169+
name: results-helix
170+
path: results-helix
171+
172+
- name: Display structure of downloaded files
173+
run: ls -R
174+
175+
- name: output to markdown
176+
run: |
177+
cat > results.md <<EOF
178+
| Repository name | Source type | Average hole completion time (s) | Pass percentage |
179+
| :-------------- | :---------- | -------------------------------: | --------------: |
180+
EOF
181+
cat **/results.json | jq -r '"| \(.[0].repo_name) | \(.[0].source_type) | \(.[0].avg_hole_completion_time_ms) | \(.[0].pass_percentage)% |"' >> results.md
182+
cat >> results.md <<EOF
183+
184+
**Note:** The "hole completion time" represents the full process of:
185+
- copying files from the setup cache directory
186+
- replacing the code from the file with a completion from the model
187+
- building the project
188+
- running the tests
189+
EOF
190+
74191
- name: Find Comment
75192
uses: peter-evans/find-comment@v2
76193
id: fc

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ dist/
33
target/
44
.DS_Store
55
__pycache__/
6-
results.md
6+
results.json
77
.pytest_cache/

crates/llm-ls/src/document.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use ropey::Rope;
22
use tower_lsp::jsonrpc::Result;
33
use tower_lsp::lsp_types::Range;
4-
use tracing::info;
54
use tree_sitter::{InputEdit, Parser, Point, Tree};
65

76
use crate::language_id::LanguageId;

crates/testbed/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ Here is a simplified pseudo code algorithm for testbed:
1111
read the repositories file
1212
read the holes file(s)
1313
for each repository
14-
spawn a thread
15-
setup the repository
1614
for each hole
15+
spawn a thread
16+
setup the repository -- only once for each repository
17+
copy files from the setup cache to a new temp dir
1718
make the hole as specified by the file
1819
generate completions
1920
build the code
@@ -37,7 +38,7 @@ Before running testbed, you will need to generate a holes file for each reposito
3738

3839
### Setup
3940

40-
testbed runs completions for each repository in parallel. It will first create a temporary directory, then copy or download the repository's source files to that location and finally run the setup commands.
41+
testbed runs hole completions in parallel. It will first, and only once per repository, create a temporary directory, then copy or download the repository's source files to that location and finally run the setup commands. Then for each subsequent completion it will copy the content of the "setup directory" to a new temporary directory so that work can be parallelised.
4142

4243
Setup commands are useful to install dependencies.
4344

@@ -60,9 +61,11 @@ build_args: ["-m", "compileall", "-q", "."]
6061
6162
### Runners
6263
63-
testbed supports two test runners at the moment:
64+
testbed supports four test runners:
6465
- cargo
66+
- jest
6567
- pytest
68+
- vitest
6669
6770
To configure your runner, you have the following options:
6871
```yaml
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"cursor":{"line":86,"character":2},"file":"src/lib.rs"},{"cursor":{"line":266,"character":3},"file":"src/lib.rs"},{"cursor":{"line":565,"character":6},"file":"src/lib.rs"},{"cursor":{"line":914,"character":12},"file":"src/lib.rs"},{"cursor":{"line":261,"character":3},"file":"src/lib.rs"},{"cursor":{"line":839,"character":4},"file":"src/lib.rs"},{"cursor":{"line":337,"character":4},"file":"src/lib.rs"},{"cursor":{"line":517,"character":0},"file":"src/lib.rs"},{"cursor":{"line":763,"character":12},"file":"src/lib.rs"},{"cursor":{"line":551,"character":1},"file":"src/lib.rs"},{"cursor":{"line":461,"character":14},"file":"src/lib.rs"},{"cursor":{"line":847,"character":0},"file":"src/lib.rs"},{"cursor":{"line":835,"character":14},"file":"src/lib.rs"},{"cursor":{"line":793,"character":4},"file":"src/lib.rs"},{"cursor":{"line":901,"character":13},"file":"src/lib.rs"},{"cursor":{"line":191,"character":3},"file":"src/lib.rs"},{"cursor":{"line":694,"character":7},"file":"src/lib.rs"},{"cursor":{"line":824,"character":5},"file":"src/lib.rs"},{"cursor":{"line":840,"character":3},"file":"src/lib.rs"},{"cursor":{"line":310,"character":0},"file":"src/lib.rs"},{"cursor":{"line":762,"character":7},"file":"src/lib.rs"},{"cursor":{"line":664,"character":2},"file":"src/lib.rs"},{"cursor":{"line":267,"character":1},"file":"src/lib.rs"},{"cursor":{"line":484,"character":12},"file":"src/lib.rs"},{"cursor":{"line":24,"character":4},"file":"src/lib.rs"},{"cursor":{"line":100,"character":4},"file":"src/lib.rs"},{"cursor":{"line":873,"character":9},"file":"src/lib.rs"},{"cursor":{"line":690,"character":2},"file":"src/lib.rs"},{"cursor":{"line":876,"character":13},"file":"src/lib.rs"},{"cursor":{"line":435,"character":4},"file":"src/lib.rs"},{"cursor":{"line":79,"character":11},"file":"src/lib.rs"},{"cursor":{"line":552,"character":4},"file":"src/lib.rs"},{"cursor":{"line":472,"character":0},"file":"src/lib.rs"},{"cursor":{"line":762,"character":0},"file":"src/lib.rs"},{"cursor":{"line":845,"character":5},"file":"src/lib.rs"},{"cursor":{"line":707,"character":4},"file":"src/lib.rs"},{"cursor":{"line":433,"character":10},"file":"src/lib.rs"},{"cursor":{"line":754,"character":1},"file":"src/lib.rs"},{"cursor":{"line":758,"character":12},"file":"src/lib.rs"},{"cursor":{"line":811,"character":8},"file":"src/lib.rs"},{"cursor":{"line":760,"character":13},"file":"src/lib.rs"},{"cursor":{"line":898,"character":8},"file":"src/lib.rs"},{"cursor":{"line":149,"character":3},"file":"src/lib.rs"},{"cursor":{"line":242,"character":14},"file":"src/lib.rs"},{"cursor":{"line":805,"character":6},"file":"src/lib.rs"},{"cursor":{"line":830,"character":4},"file":"src/lib.rs"},{"cursor":{"line":578,"character":4},"file":"src/lib.rs"},{"cursor":{"line":701,"character":11},"file":"src/lib.rs"},{"cursor":{"line":181,"character":10},"file":"src/lib.rs"},{"cursor":{"line":704,"character":14},"file":"src/lib.rs"},{"cursor":{"line":852,"character":8},"file":"src/lib.rs"},{"cursor":{"line":311,"character":1},"file":"src/lib.rs"},{"cursor":{"line":707,"character":6},"file":"src/lib.rs"},{"cursor":{"line":75,"character":0},"file":"src/lib.rs"},{"cursor":{"line":699,"character":1},"file":"src/lib.rs"},{"cursor":{"line":600,"character":0},"file":"src/lib.rs"},{"cursor":{"line":191,"character":3},"file":"src/lib.rs"},{"cursor":{"line":150,"character":1},"file":"src/lib.rs"},{"cursor":{"line":767,"character":10},"file":"src/lib.rs"},{"cursor":{"line":739,"character":0},"file":"src/lib.rs"},{"cursor":{"line":919,"character":3},"file":"src/lib.rs"},{"cursor":{"line":143,"character":6},"file":"src/lib.rs"},{"cursor":{"line":234,"character":5},"file":"src/lib.rs"},{"cursor":{"line":860,"character":6},"file":"src/lib.rs"},{"cursor":{"line":519,"character":0},"file":"src/lib.rs"},{"cursor":{"line":668,"character":14},"file":"src/lib.rs"},{"cursor":{"line":184,"character":7},"file":"src/lib.rs"},{"cursor":{"line":607,"character":10},"file":"src/lib.rs"},{"cursor":{"line":931,"character":5},"file":"src/lib.rs"},{"cursor":{"line":191,"character":0},"file":"src/lib.rs"},{"cursor":{"line":710,"character":6},"file":"src/lib.rs"},{"cursor":{"line":509,"character":1},"file":"src/lib.rs"},{"cursor":{"line":873,"character":11},"file":"src/lib.rs"},{"cursor":{"line":539,"character":12},"file":"src/lib.rs"},{"cursor":{"line":524,"character":9},"file":"src/lib.rs"},{"cursor":{"line":959,"character":1},"file":"src/lib.rs"},{"cursor":{"line":147,"character":11},"file":"src/lib.rs"},{"cursor":{"line":620,"character":2},"file":"src/lib.rs"},{"cursor":{"line":903,"character":6},"file":"src/lib.rs"},{"cursor":{"line":931,"character":13},"file":"src/lib.rs"},{"cursor":{"line":830,"character":3},"file":"src/lib.rs"},{"cursor":{"line":832,"character":11},"file":"src/lib.rs"},{"cursor":{"line":652,"character":3},"file":"src/lib.rs"},{"cursor":{"line":673,"character":7},"file":"src/lib.rs"},{"cursor":{"line":22,"character":9},"file":"src/lib.rs"},{"cursor":{"line":150,"character":6},"file":"src/lib.rs"},{"cursor":{"line":853,"character":13},"file":"src/lib.rs"},{"cursor":{"line":658,"character":13},"file":"src/lib.rs"},{"cursor":{"line":616,"character":0},"file":"src/lib.rs"},{"cursor":{"line":457,"character":12},"file":"src/lib.rs"},{"cursor":{"line":856,"character":10},"file":"src/lib.rs"},{"cursor":{"line":795,"character":11},"file":"src/lib.rs"},{"cursor":{"line":763,"character":3},"file":"src/lib.rs"},{"cursor":{"line":778,"character":6},"file":"src/lib.rs"},{"cursor":{"line":866,"character":1},"file":"src/lib.rs"},{"cursor":{"line":764,"character":4},"file":"src/lib.rs"},{"cursor":{"line":181,"character":9},"file":"src/lib.rs"},{"cursor":{"line":780,"character":11},"file":"src/lib.rs"},{"cursor":{"line":846,"character":5},"file":"src/lib.rs"},{"cursor":{"line":651,"character":2},"file":"src/lib.rs"}]
1+
[{"cursor":{"line":875,"character":11},"file":"src/lib.rs"},{"cursor":{"line":730,"character":4},"file":"src/lib.rs"},{"cursor":{"line":716,"character":4},"file":"src/lib.rs"},{"cursor":{"line":37,"character":14},"file":"src/lib.rs"},{"cursor":{"line":906,"character":9},"file":"src/lib.rs"},{"cursor":{"line":322,"character":9},"file":"src/lib.rs"},{"cursor":{"line":914,"character":1},"file":"src/lib.rs"},{"cursor":{"line":757,"character":1},"file":"src/lib.rs"},{"cursor":{"line":37,"character":13},"file":"src/lib.rs"},{"cursor":{"line":314,"character":10},"file":"src/lib.rs"},{"cursor":{"line":927,"character":2},"file":"src/lib.rs"},{"cursor":{"line":694,"character":7},"file":"src/lib.rs"},{"cursor":{"line":490,"character":6},"file":"src/lib.rs"},{"cursor":{"line":159,"character":2},"file":"src/lib.rs"},{"cursor":{"line":494,"character":0},"file":"src/lib.rs"},{"cursor":{"line":690,"character":4},"file":"src/lib.rs"},{"cursor":{"line":602,"character":0},"file":"src/lib.rs"},{"cursor":{"line":940,"character":1},"file":"src/lib.rs"},{"cursor":{"line":190,"character":1},"file":"src/lib.rs"},{"cursor":{"line":655,"character":4},"file":"src/lib.rs"},{"cursor":{"line":843,"character":0},"file":"src/lib.rs"},{"cursor":{"line":802,"character":9},"file":"src/lib.rs"},{"cursor":{"line":781,"character":13},"file":"src/lib.rs"},{"cursor":{"line":748,"character":9},"file":"src/lib.rs"},{"cursor":{"line":233,"character":8},"file":"src/lib.rs"},{"cursor":{"line":781,"character":9},"file":"src/lib.rs"},{"cursor":{"line":864,"character":12},"file":"src/lib.rs"},{"cursor":{"line":26,"character":0},"file":"src/lib.rs"},{"cursor":{"line":822,"character":11},"file":"src/lib.rs"},{"cursor":{"line":902,"character":1},"file":"src/lib.rs"},{"cursor":{"line":898,"character":0},"file":"src/lib.rs"},{"cursor":{"line":753,"character":0},"file":"src/lib.rs"},{"cursor":{"line":583,"character":1},"file":"src/lib.rs"},{"cursor":{"line":250,"character":1},"file":"src/lib.rs"},{"cursor":{"line":745,"character":2},"file":"src/lib.rs"},{"cursor":{"line":88,"character":0},"file":"src/lib.rs"},{"cursor":{"line":519,"character":3},"file":"src/lib.rs"},{"cursor":{"line":747,"character":2},"file":"src/lib.rs"},{"cursor":{"line":264,"character":12},"file":"src/lib.rs"},{"cursor":{"line":656,"character":0},"file":"src/lib.rs"},{"cursor":{"line":872,"character":4},"file":"src/lib.rs"},{"cursor":{"line":189,"character":5},"file":"src/lib.rs"},{"cursor":{"line":470,"character":0},"file":"src/lib.rs"},{"cursor":{"line":906,"character":7},"file":"src/lib.rs"},{"cursor":{"line":378,"character":0},"file":"src/lib.rs"},{"cursor":{"line":871,"character":14},"file":"src/lib.rs"},{"cursor":{"line":378,"character":9},"file":"src/lib.rs"},{"cursor":{"line":850,"character":8},"file":"src/lib.rs"},{"cursor":{"line":683,"character":4},"file":"src/lib.rs"},{"cursor":{"line":925,"character":0},"file":"src/lib.rs"},{"cursor":{"line":504,"character":14},"file":"src/lib.rs"},{"cursor":{"line":460,"character":12},"file":"src/lib.rs"},{"cursor":{"line":79,"character":7},"file":"src/lib.rs"},{"cursor":{"line":241,"character":8},"file":"src/lib.rs"},{"cursor":{"line":605,"character":8},"file":"src/lib.rs"},{"cursor":{"line":741,"character":11},"file":"src/lib.rs"},{"cursor":{"line":875,"character":11},"file":"src/lib.rs"},{"cursor":{"line":854,"character":13},"file":"src/lib.rs"},{"cursor":{"line":800,"character":2},"file":"src/lib.rs"},{"cursor":{"line":502,"character":13},"file":"src/lib.rs"},{"cursor":{"line":316,"character":6},"file":"src/lib.rs"},{"cursor":{"line":711,"character":14},"file":"src/lib.rs"},{"cursor":{"line":675,"character":4},"file":"src/lib.rs"},{"cursor":{"line":531,"character":4},"file":"src/lib.rs"},{"cursor":{"line":147,"character":2},"file":"src/lib.rs"},{"cursor":{"line":90,"character":3},"file":"src/lib.rs"},{"cursor":{"line":334,"character":6},"file":"src/lib.rs"},{"cursor":{"line":336,"character":7},"file":"src/lib.rs"},{"cursor":{"line":461,"character":5},"file":"src/lib.rs"},{"cursor":{"line":895,"character":0},"file":"src/lib.rs"},{"cursor":{"line":38,"character":14},"file":"src/lib.rs"},{"cursor":{"line":823,"character":8},"file":"src/lib.rs"},{"cursor":{"line":845,"character":3},"file":"src/lib.rs"},{"cursor":{"line":856,"character":14},"file":"src/lib.rs"},{"cursor":{"line":525,"character":2},"file":"src/lib.rs"},{"cursor":{"line":919,"character":6},"file":"src/lib.rs"},{"cursor":{"line":462,"character":10},"file":"src/lib.rs"},{"cursor":{"line":215,"character":3},"file":"src/lib.rs"},{"cursor":{"line":389,"character":10},"file":"src/lib.rs"},{"cursor":{"line":76,"character":0},"file":"src/lib.rs"},{"cursor":{"line":844,"character":10},"file":"src/lib.rs"},{"cursor":{"line":563,"character":6},"file":"src/lib.rs"},{"cursor":{"line":529,"character":14},"file":"src/lib.rs"},{"cursor":{"line":659,"character":3},"file":"src/lib.rs"},{"cursor":{"line":286,"character":1},"file":"src/lib.rs"},{"cursor":{"line":525,"character":4},"file":"src/lib.rs"},{"cursor":{"line":669,"character":3},"file":"src/lib.rs"},{"cursor":{"line":622,"character":9},"file":"src/lib.rs"},{"cursor":{"line":280,"character":3},"file":"src/lib.rs"},{"cursor":{"line":916,"character":0},"file":"src/lib.rs"},{"cursor":{"line":574,"character":9},"file":"src/lib.rs"},{"cursor":{"line":795,"character":0},"file":"src/lib.rs"},{"cursor":{"line":246,"character":2},"file":"src/lib.rs"},{"cursor":{"line":878,"character":8},"file":"src/lib.rs"},{"cursor":{"line":785,"character":4},"file":"src/lib.rs"},{"cursor":{"line":757,"character":10},"file":"src/lib.rs"},{"cursor":{"line":921,"character":11},"file":"src/lib.rs"},{"cursor":{"line":647,"character":11},"file":"src/lib.rs"},{"cursor":{"line":154,"character":6},"file":"src/lib.rs"},{"cursor":{"line":558,"character":1},"file":"src/lib.rs"}]

0 commit comments

Comments
 (0)