mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-12-03 17:43:54 +01:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
c91e662034
47 files changed
+4699
-375
No files matched your search
+332
-5
@@ -342,6 +342,7 @@ app.get("/api/conferences/:id", (req, res) => {
|
||||
const explorerFiles = {
|
||||
"": [
|
||||
{ name: "src", path: "" },
|
||||
{ name: "docs", path: "" },
|
||||
{ name: "README.md", path: "", size: 640, sha: "a1" },
|
||||
{ name: "LICENSE", path: "", size: 1070, sha: "a2" },
|
||||
{ name: "requirements.txt", path: "", size: 40, sha: "a3" },
|
||||
@@ -351,13 +352,80 @@ const explorerFiles = {
|
||||
{ name: "train.py", path: "src", size: 900, sha: "b1" },
|
||||
],
|
||||
"src/utils": [{ name: "data.py", path: "src/utils", size: 300, sha: "c1" }],
|
||||
docs: [
|
||||
{ name: "REPRODUCING.md", path: "docs", size: 3400, sha: "d1" },
|
||||
{ name: "NOTES.md", path: "docs", size: 120, sha: "d2" },
|
||||
],
|
||||
};
|
||||
// A long guide (h1-h3, a redacted heading) for the Markdown outline, and a short
|
||||
// note with two headings, which shows no outline.
|
||||
const reproducingGuide = [
|
||||
"# Reproducing the results",
|
||||
"",
|
||||
"This guide walks through every experiment in the paper by XXXX-1, from a clean machine to the numbers in Table 2. Each step lists the command, how long it takes on one GPU, and what the output should look like.",
|
||||
"",
|
||||
"## Requirements",
|
||||
"",
|
||||
"A Linux machine with Python 3.11, 32 GB of RAM and one GPU with at least 16 GB of memory. The scripts also run on CPU, about twenty times slower.",
|
||||
"",
|
||||
"### Python packages",
|
||||
"",
|
||||
"```bash\npip install -r requirements.txt\n```",
|
||||
"",
|
||||
"### Datasets",
|
||||
"",
|
||||
"The three datasets are mirrored on Zenodo. `scripts/fetch.sh` downloads them into `data/` and checks their hashes; nothing else needs a network connection.",
|
||||
"",
|
||||
"## Training",
|
||||
"",
|
||||
"Training reads `configs/base.yaml`. The defaults reproduce the main model; the ablations override one key each.",
|
||||
"",
|
||||
"```bash\npython src/train.py --config configs/base.yaml --seed 1\n```",
|
||||
"",
|
||||
"A full run takes about six hours. Checkpoints are written to `out/checkpoints/` every epoch, so an interrupted run resumes where it stopped.",
|
||||
"",
|
||||
"### Seeds",
|
||||
"",
|
||||
"The paper reports the mean of five seeds (1 to 5). Pass `--seed` to choose one; `scripts/sweep.sh` runs all five in sequence.",
|
||||
"",
|
||||
"## Evaluation",
|
||||
"",
|
||||
"`src/evaluate.py` loads a checkpoint and writes one JSON line per benchmark task to `out/results.jsonl`. The aggregate table is built from that file.",
|
||||
"",
|
||||
"| Benchmark | Tasks | Time |",
|
||||
"| --- | --- | --- |",
|
||||
"| Defects4J | 395 | 40 min |",
|
||||
"| QuixBugs | 40 | 5 min |",
|
||||
"| Bears | 251 | 30 min |",
|
||||
"",
|
||||
"### Expected numbers",
|
||||
"",
|
||||
"Within one point of Table 2 on every benchmark. Larger gaps usually mean a different PyTorch version; see the troubleshooting section.",
|
||||
"",
|
||||
"## Results from XXXX-2 cluster",
|
||||
"",
|
||||
"The original runs used the XXXX-2 cluster. Their logs are in `logs/` so the numbers can be checked without retraining.",
|
||||
"",
|
||||
"## Troubleshooting",
|
||||
"",
|
||||
"**Out of memory.** Lower `batch_size` in the config; accuracy is unchanged down to 8.",
|
||||
"",
|
||||
"**Different numbers.** Check `pip freeze` against `requirements.lock`. Contact XXXX-1 through the conference system if the gap persists.",
|
||||
"",
|
||||
"## License",
|
||||
"",
|
||||
"Code under MIT, data under CC BY 4.0.",
|
||||
"",
|
||||
].join("\n");
|
||||
|
||||
const explorerContent = {
|
||||
"README.md": "# DeepLearnUtils\n\nDeveloped by XXXX-1 at XXXX-2.\n\nUtilities for reproducing the paper's experiments. Every script in `src/` reads its configuration from `configs/` and writes results to `out/`, so a full run of the evaluation only needs the two commands below. The long sentence here checks the reading width of rendered Markdown.\n\n## Quick start\n\n```bash\n# maintained by XXXX-1\npip install -r requirements.txt\npython src/train.py --config configs/base.yaml\n```\n\n```mermaid\ngraph LR; XXXX-2 --> Paper\n```\n\n| Model | Accuracy |\n| --- | --- |\n| Baseline | 71.2 |\n| Ours | 78.9 |\n\nContact: XXXX-3\n",
|
||||
LICENSE: "MIT License\n\nCopyright (c) 2026 XXXX-1\n",
|
||||
"requirements.txt": "torch>=2.3\nnumpy\npyyaml\n",
|
||||
"src/train.py": '# Copyright 2026 XXXX-1, XXXX-2\nimport argparse\nimport yaml\n\nfrom utils.data import load_dataset\n\n\ndef main():\n parser = argparse.ArgumentParser(description="Train the model")\n parser.add_argument("--config", required=True)\n args = parser.parse_args()\n with open(args.config) as f:\n config = yaml.safe_load(f)\n dataset = load_dataset(config["data"])\n print(f"Loaded {len(dataset)} examples")\n\n\nif __name__ == "__main__":\n main()\n',
|
||||
"src/utils/data.py": "def load_dataset(path):\n with open(path) as f:\n return [line.strip() for line in f]\n",
|
||||
"docs/REPRODUCING.md": reproducingGuide,
|
||||
"docs/NOTES.md": "# Notes\n\nScratch notes.\n\n## Open questions\n\nNone yet.\n",
|
||||
};
|
||||
const EXPLORER_ID = "anonymous_github-C72C";
|
||||
app.get("/api/repo/missing-repo/{*rest}", (req, res) =>
|
||||
@@ -379,7 +447,7 @@ app.get(`/api/repo/${EXPLORER_ID}/options`, (req, res) =>
|
||||
})
|
||||
);
|
||||
app.get(`/api/repo/${EXPLORER_ID}/files/counts`, (req, res) =>
|
||||
res.json({ "": 6, src: 2, "src/utils": 1 })
|
||||
res.json({ "": 9, src: 2, "src/utils": 1, docs: 2 })
|
||||
);
|
||||
app.get(`/api/repo/${EXPLORER_ID}/files`, (req, res) =>
|
||||
res.json(explorerFiles[req.query.path || ""] || [])
|
||||
@@ -411,7 +479,60 @@ const galleryNotebook = JSON.stringify({
|
||||
{ cell_type: "code", execution_count: 4, metadata: {}, source: ["ax = df.groupby(\"model\").accuracy.mean().plot.bar()\n", "ax.figure.savefig(\"figures/accuracy.png\")"], outputs: [{ output_type: "display_data", metadata: {}, data: { "image/png": galleryPng.toString("base64"), "text/plain": ["<Figure size 720x400 with 1 Axes>"] } }] },
|
||||
],
|
||||
}, null, 1);
|
||||
|
||||
// Table viewer fixtures (tables/): a per-seed results table, a TSV with dates and
|
||||
// thousands separators, a table with redacted cells, a README with a Markdown
|
||||
// results table, and a ~1 MB CSV for the viewer's timing. All deterministic.
|
||||
const tableRng = (seed) => () => { seed = (seed * 1103515245 + 12345) % 2147483648; return seed / 2147483648; };
|
||||
const tableFixtures = (() => {
|
||||
const rnd = tableRng(42);
|
||||
const models = [["Baseline", 71.2, 410], ["+ Aug.", 74.0, 447], ["+ Pretrain", 76.1, 471], ["Ours", 78.9, 503]];
|
||||
const perSeed = ["model,dataset,seed,accuracy,precision,recall,plausible"];
|
||||
for (const [model, acc, plaus] of models) for (const [dataset, shift] of [["Defects4J", 0], ["QuixBugs", 3.6]]) for (let seed = 1; seed <= 5; seed++) {
|
||||
const a = acc + shift + (rnd() - 0.5) * 0.8;
|
||||
perSeed.push([model, dataset, seed, a.toFixed(1), (a / 100 + 0.04 + (rnd() - 0.5) * 0.02).toFixed(3), (a / 100 - 0.03 + (rnd() - 0.5) * 0.02).toFixed(3),
|
||||
model === "+ Aug." && dataset === "QuixBugs" && seed === 3 ? "" : Math.round(plaus + shift * 8 + (rnd() - 0.5) * 10)].join(","));
|
||||
}
|
||||
const runs = ["date\tmodel\taccuracy\truntime_s\tdelta\tgpu_share"];
|
||||
const start = Date.UTC(2026, 2, 2);
|
||||
for (let day = 0; day < 14; day++) for (const [model, acc] of models.slice(1)) {
|
||||
const date = new Date(start + day * 86400000).toISOString().slice(0, 10);
|
||||
const a = acc - 4 + day * 0.32 + (rnd() - 0.5) * 0.9;
|
||||
runs.push([date, model, a.toFixed(1), Math.round(900 + rnd() * 900 + (model === "Ours" ? 400 : 0)).toLocaleString("en-US"), (rnd() - 0.4).toFixed(2), (40 + rnd() * 55).toFixed(1) + "%"].join("\t"));
|
||||
}
|
||||
const redacted = [
|
||||
"run,author,cluster,model,accuracy,notes",
|
||||
"1,XXXX-1,XXXX-2,Ours,78.7,first run",
|
||||
"2,XXXX-1,XXXX-2,Ours,79.1,",
|
||||
"3,XXXX-4,XXXX-2,Baseline,71.0,rerun by XXXX-4",
|
||||
"4,XXXX-4,XXXX-5,Baseline,71.4,",
|
||||
"5,XXXX-1,XXXX-5,+ Aug.,74.2,\"uses XXXX-3's split, seed 2\"",
|
||||
];
|
||||
const large = ["run_id,date,model,dataset,seed,accuracy,f1,loss,latency_ms,coverage"];
|
||||
const datasets = ["Defects4J", "QuixBugs", "Bears", "BugsInPy", "ManyBugs"];
|
||||
let size = large[0].length + 1, id = 0;
|
||||
while (true) {
|
||||
const [model, acc] = models[id % 4];
|
||||
const dataset = datasets[Math.floor(id / 4) % 5];
|
||||
const a = acc - (datasets.indexOf(dataset) * 2.1) + (rnd() - 0.5) * 3;
|
||||
const row = [id + 1, new Date(start + Math.floor(id / 40) * 3600000).toISOString().slice(0, 16).replace("T", " "), model, dataset, (id % 10) + 1,
|
||||
a.toFixed(2), (a / 100 - 0.02).toFixed(3), (rnd() * 0.004).toExponential(2), '"' + Math.round(800 + rnd() * 2400).toLocaleString("en-US") + '"', (50 + rnd() * 50).toFixed(1) + "%"].join(",");
|
||||
if (size + row.length + 1 > 1000 * 1024) break;
|
||||
large.push(row); size += row.length + 1; id++;
|
||||
}
|
||||
return {
|
||||
"tables/per-seed.csv": perSeed.join("\n") + "\n",
|
||||
"tables/runs.tsv": runs.join("\n") + "\n",
|
||||
"tables/redacted.csv": redacted.join("\n") + "\n",
|
||||
"tables/benchmark-1mb.csv": large.join("\n") + "\n",
|
||||
"tables/README.md": "# Result tables\n\nAccuracy (%) on each benchmark, averaged over five seeds. Runs by XXXX-1 on the XXXX-2 cluster.\n\n"
|
||||
+ "| Model | Defects4J | QuixBugs | Bears | Train time (h) |\n| --- | ---: | ---: | ---: | ---: |\n"
|
||||
+ "| Baseline | 71.2 | 75.0 | 52.4 | 3.1 |\n| + Aug. | 74.0 | 78.1 | 55.0 | 3.4 |\n| + Pretrain | 76.1 | 80.2 | 58.7 | 6.2 |\n| XXXX-3 | 77.5 | 81.0 | 59.9 | 5.8 |\n| Ours | 78.9 | 82.5 | 61.2 | 6.0 |\n\n"
|
||||
+ "`per-seed.csv` has the runs behind this table; `runs.tsv` tracks the nightly evaluation.\n",
|
||||
};
|
||||
})();
|
||||
const galleryText = {
|
||||
...tableFixtures,
|
||||
"README.md": "# Replication package\n\nArtifact for *Learning Robust Repair Strategies from Developer Histories*, prepared by XXXX-1.\n\n| File | What it shows |\n| --- | --- |\n| `paper.pdf` | The submitted paper |\n| `analysis.ipynb` | Notebook that rebuilds Table 2 and Figure 1 |\n| `figures/` | Figures as PNG and SVG |\n| `demo/` | A short screen recording of a full run |\n\n\n",
|
||||
"results.csv": "model,seed,accuracy,plausible\nBaseline,1,71.0,410\nBaseline,2,71.4,414\n+ Aug.,1,73.8,445\n+ Aug.,2,74.2,449\n+ Pretrain,1,76.0,470\n+ Pretrain,2,76.2,472\nOurs,1,78.7,501\nOurs,2,79.1,505\n",
|
||||
"figures/pipeline.svg": '<svg xmlns="http://www.w3.org/2000/svg" width="640" height="200" viewBox="0 0 640 200" font-family="Inter, Arial, sans-serif" font-size="14"><rect width="640" height="200" fill="#ffffff"/><g fill="#eef6f4" stroke="#1f6f66" stroke-width="1.5"><rect x="20" y="70" width="150" height="60" rx="8"/><rect x="245" y="70" width="150" height="60" rx="8"/><rect x="470" y="70" width="150" height="60" rx="8"/></g><g fill="#1b1a18" text-anchor="middle"><text x="95" y="105">Mine histories</text><text x="320" y="105">Pretrain on edits</text><text x="545" y="105">Rank patches</text></g><g stroke="#6f6a61" stroke-width="1.5" marker-end="url(#a)"><line x1="172" y1="100" x2="240" y2="100"/><line x1="397" y1="100" x2="465" y2="100"/></g><defs><marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M0 0L10 5L0 10z" fill="#6f6a61"/></marker></defs></svg>\n',
|
||||
@@ -427,7 +548,8 @@ const gallerySize = (name) =>
|
||||
: name === "data/train.parquet" ? 312 * 1024 * 1024
|
||||
: Buffer.byteLength(galleryText[name] || "");
|
||||
const galleryTree = {
|
||||
"": ["data", "demo", "figures", "logs", "models", "outputs", "README.md", "analysis.ipynb", "paper.pdf", "results.csv"],
|
||||
"": ["data", "demo", "figures", "logs", "models", "outputs", "tables", "README.md", "analysis.ipynb", "paper.pdf", "results.csv"],
|
||||
tables: ["README.md", "benchmark-1mb.csv", "per-seed.csv", "redacted.csv", "runs.tsv"],
|
||||
data: ["train.parquet"],
|
||||
demo: ["demo.mp4", "demo.webm"],
|
||||
figures: ["accuracy.png", "pipeline.svg"],
|
||||
@@ -443,7 +565,7 @@ app.get(`/api/repo/${GALLERY_ID}/options`, (req, res) =>
|
||||
res.json({ url: null, download: true, lastUpdateDate: ago(5), anonymizedAt: ago(5), sourceCommitDate: ago(6), expirationDate: ahead(90), isAdmin: false, isOwner: false, hasWebsite: false, truncatedFolders: [], hasSubmodules: false })
|
||||
);
|
||||
app.get(`/api/repo/${GALLERY_ID}/files/counts`, (req, res) =>
|
||||
res.json({ "": 13, data: 1, demo: 2, figures: 2, logs: 1, models: 1, outputs: 0 })
|
||||
res.json({ "": 18, data: 1, demo: 2, figures: 2, logs: 1, models: 1, outputs: 0, tables: 5 })
|
||||
);
|
||||
app.get(`/api/repo/${GALLERY_ID}/files`, (req, res) => res.json(galleryFiles(req.query.path || "")));
|
||||
app.get(`/api/repo/${GALLERY_ID}/file/{*rest}`, (req, res) => {
|
||||
@@ -473,6 +595,7 @@ const sourceText = {
|
||||
"src/jsmith-utils/io.js": "// Helpers shared by the evaluation scripts. Author: Jane Smith <jane.smith@csail.mit.edu>\nconst fs = require(\"fs\");\n\n/** Reads one JSON object per line. */\nfunction readJsonLines(path) {\n return fs.readFileSync(path, \"utf8\").split(\"\\n\").filter(Boolean).map((line) => JSON.parse(line));\n}\n\nmodule.exports = { readJsonLines, lab: \"MIT CSAIL\" };\n",
|
||||
"paper/main.tex": "\\documentclass{article}\n\\title{Learning Robust Repair Strategies from Developer Histories}\n\\author{Jane Smith \\\\ MIT CSAIL}\n\n\\begin{document}\n\\maketitle\n\n\\section{Introduction}\nWe build on our earlier work~\\cite{smith2024repair}, done at MIT CSAIL.\n\n\\bibliographystyle{plain}\n\\bibliography{refs}\n\\end{document}\n",
|
||||
"paper/refs.bib": "@inproceedings{smith2024repair,\n title = {Repairing Programs with Developer Histories},\n author = {Jane Smith and Ana Lopez},\n booktitle = {Proceedings of ICSE},\n year = {2024},\n note = {MIT CSAIL}\n}\n",
|
||||
"results/per-seed.csv": "model,seed,accuracy,run_by\nBaseline,1,71.0,Jane Smith\nBaseline,2,71.4,Jane Smith\n+ Aug.,1,73.8,jsmith\n+ Aug.,2,74.2,jsmith\nOurs,1,78.7,MIT CSAIL\nOurs,2,79.1,MIT CSAIL\n",
|
||||
"configs/base.yaml": "# Base configuration (Jane Smith)\ndata: data/train.jsonl\nmodel: transformer-small\nseed: 1\noutput: /home/jsmith/out\n",
|
||||
"requirements.txt": "torch>=2.3\nnumpy\npyyaml\n",
|
||||
LICENSE: "MIT License\n\nCopyright (c) 2026 Jane Smith\n",
|
||||
@@ -999,12 +1122,12 @@ app.get("/api/admin/users", (req, res) => {
|
||||
res.json(page(req, rows, false));
|
||||
});
|
||||
app.get("/api/admin/users/:username/repos", (req, res) => {
|
||||
const u = adminUsers.find((x) => x.username === req.params.username || x._id === req.params.username);
|
||||
const u = adminUsers.find((x) => x.username === req.params.username || "id:" + x._id === req.params.username);
|
||||
if (!u) return res.status(404).json({ error: "user_not_found" });
|
||||
res.json(adminRepos.filter((r) => r.owner === u._id).map(repoView));
|
||||
});
|
||||
app.get("/api/admin/users/:username", (req, res) => {
|
||||
const u = adminUsers.find((x) => x.username === req.params.username || x._id === req.params.username);
|
||||
const u = adminUsers.find((x) => x.username === req.params.username || "id:" + x._id === req.params.username);
|
||||
if (!u) return res.status(404).json({ error: "user_not_found" });
|
||||
res.json(Object.assign({}, u, { repositories: githubRepos(u) }));
|
||||
});
|
||||
@@ -1365,6 +1488,210 @@ app.get("/api/admin/billing/grants", (req, res) => {
|
||||
res.json({ page: pageNo, limit, total: rows.length, results, stateCounts, statuses: [...new Set(billingGrants.map((g) => g.status))].sort() });
|
||||
});
|
||||
|
||||
// Reviewer pages for an anonymized pull request and gist: several files, a long
|
||||
// diff, issue and review comments, and redacted terms in the title, body and diff.
|
||||
const PR_ID = "robust-repair-pr-1F3A";
|
||||
const longEvalBody = Array.from({ length: 46 }, (_, i) => `+ rows.append(score_task(model, tasks[${i}], seed=seed)) # task ${i + 1}`).join("\n");
|
||||
const prDiff = [
|
||||
"diff --git a/src/evaluate.py b/src/evaluate.py",
|
||||
"index 3f2a1c0..8b9d4e2 100644",
|
||||
"--- a/src/evaluate.py",
|
||||
"+++ b/src/evaluate.py",
|
||||
"@@ -1,18 +1,24 @@",
|
||||
" # Evaluation harness for the XXXX-1 repair model.",
|
||||
" import argparse",
|
||||
" import json",
|
||||
"+import statistics",
|
||||
" ",
|
||||
" from utils.data import load_dataset",
|
||||
"+from utils.seeds import SEEDS",
|
||||
" ",
|
||||
" ",
|
||||
"-def evaluate(model, tasks):",
|
||||
"- return [score_task(model, t) for t in tasks]",
|
||||
"+def evaluate(model, tasks, seeds=SEEDS):",
|
||||
"+ \"\"\"Score every task once per seed and keep the per-seed rows.\"\"\"",
|
||||
"+ rows = []",
|
||||
"+ for seed in seeds:",
|
||||
"+ rows.extend(score_task(model, t, seed=seed) for t in tasks)",
|
||||
"+ return rows",
|
||||
" ",
|
||||
" ",
|
||||
" def main():",
|
||||
" parser = argparse.ArgumentParser(description=\"Evaluate a checkpoint\")",
|
||||
" parser.add_argument(\"--checkpoint\", required=True)",
|
||||
"+ parser.add_argument(\"--seeds\", type=int, nargs=\"+\", default=SEEDS)",
|
||||
" args = parser.parse_args()",
|
||||
"- rows = evaluate(load_model(args.checkpoint), load_dataset(\"data/test.jsonl\"))",
|
||||
"+ rows = evaluate(load_model(args.checkpoint), load_dataset(\"data/test.jsonl\"), args.seeds)",
|
||||
"+ print(\"mean accuracy\", statistics.mean(r[\"accuracy\"] for r in rows))",
|
||||
" with open(\"out/results.jsonl\", \"w\") as f:",
|
||||
" for row in rows:",
|
||||
" f.write(json.dumps(row) + \"\\n\")",
|
||||
"@@ -40,6 +46,58 @@ def score_task(model, task):",
|
||||
" return {\"task\": task[\"id\"], \"accuracy\": acc}",
|
||||
" ",
|
||||
" ",
|
||||
"+def score_all(model, tasks, seed):",
|
||||
"+ rows = []",
|
||||
longEvalBody,
|
||||
"+ return rows",
|
||||
"+",
|
||||
"+",
|
||||
" if __name__ == \"__main__\":",
|
||||
" main()",
|
||||
"diff --git a/src/utils/seeds.py b/src/utils/seeds.py",
|
||||
"new file mode 100644",
|
||||
"index 0000000..1d2c3b4",
|
||||
"--- /dev/null",
|
||||
"+++ b/src/utils/seeds.py",
|
||||
"@@ -0,0 +1,6 @@",
|
||||
"+\"\"\"Seeds used for every number in the paper (see XXXX-2 lab notes).\"\"\"",
|
||||
"+",
|
||||
"+SEEDS = [1, 2, 3, 4, 5]",
|
||||
"+",
|
||||
"+# Seed 6 diverged on the XXXX-2 cluster; keep it out of the mean.",
|
||||
"+EXCLUDED = [6]",
|
||||
"diff --git a/configs/base.yaml b/configs/base.yaml",
|
||||
"index 6a7b8c9..0d1e2f3 100644",
|
||||
"--- a/configs/base.yaml",
|
||||
"+++ b/configs/base.yaml",
|
||||
"@@ -1,5 +1,6 @@",
|
||||
"-# Base configuration (XXXX-1)",
|
||||
"+# Base configuration",
|
||||
" data: data/train.jsonl",
|
||||
" model: transformer-small",
|
||||
"-seed: 1",
|
||||
"+seeds: [1, 2, 3, 4, 5]",
|
||||
"+batch_size: 16",
|
||||
" output: /home/XXXX-3/out",
|
||||
"diff --git a/scripts/sweep.sh b/scripts/sweep.sh",
|
||||
"new file mode 100755",
|
||||
"index 0000000..aa11bb2",
|
||||
"--- /dev/null",
|
||||
"+++ b/scripts/sweep.sh",
|
||||
"@@ -0,0 +1,7 @@",
|
||||
"+#!/usr/bin/env bash",
|
||||
"+# Run the five seeds of Table 2 in sequence.",
|
||||
"+set -euo pipefail",
|
||||
"+for seed in 1 2 3 4 5; do",
|
||||
"+ python src/train.py --config configs/base.yaml --seed \"$seed\"",
|
||||
"+done",
|
||||
"+python src/evaluate.py --checkpoint out/checkpoints/last.pt",
|
||||
"diff --git a/README.md b/README.md",
|
||||
"index 1234567..89abcde 100644",
|
||||
"--- a/README.md",
|
||||
"+++ b/README.md",
|
||||
"@@ -8,9 +8,12 @@ Utilities for reproducing the paper's experiments.",
|
||||
" ## Quick start",
|
||||
" ",
|
||||
" ```bash",
|
||||
"-# maintained by XXXX-1",
|
||||
" pip install -r requirements.txt",
|
||||
" python src/train.py --config configs/base.yaml",
|
||||
"+# all five seeds, then the evaluation",
|
||||
"+bash scripts/sweep.sh",
|
||||
" ```",
|
||||
" ",
|
||||
"+Results are the mean of five seeds; see `src/utils/seeds.py`.",
|
||||
"+",
|
||||
" Contact: XXXX-3",
|
||||
"diff --git a/scripts/old_eval.sh b/scripts/old_eval.sh",
|
||||
"deleted file mode 100644",
|
||||
"index 5566778..0000000",
|
||||
"--- a/scripts/old_eval.sh",
|
||||
"+++ /dev/null",
|
||||
"@@ -1,3 +0,0 @@",
|
||||
"-#!/usr/bin/env bash",
|
||||
"-# Single-seed evaluation used before the camera-ready.",
|
||||
"-python src/evaluate.py --checkpoint out/checkpoints/last.pt",
|
||||
].join("\n") + "\n";
|
||||
const prContent = {
|
||||
anonymizeDate: ago(1), merged: false, state: "open", draft: false,
|
||||
title: "Average Table 2 over five seeds in the XXXX-1 evaluation harness",
|
||||
body: "This replaces the single-seed evaluation with the five-seed protocol described in Section 5 of the paper.\n\n## Changes\n\n- `evaluate()` scores every task once per seed and keeps the per-seed rows.\n- New `src/utils/seeds.py` lists the seeds; seed 6 is excluded (it diverged on the XXXX-2 cluster).\n- `scripts/sweep.sh` trains and evaluates all five seeds.\n\n## How to test\n\n```bash\nbash scripts/sweep.sh\n```\n\nThe mean accuracy should be within one point of Table 2. cc @XXXX-3",
|
||||
author: "XXXX-3", baseRef: "main", headRef: "XXXX-3/five-seeds",
|
||||
diff: prDiff,
|
||||
creationDate: ago(9), updatedDate: ago(2),
|
||||
commits: [
|
||||
{ message: "Score every task once per seed", author: "XXXX-3", date: ago(9) },
|
||||
{ message: "Add the seed list and exclude seed 6\n\nSeed 6 diverged on the XXXX-2 cluster.", author: "XXXX-3", date: ago(8) },
|
||||
{ message: "Add scripts/sweep.sh for the five-seed protocol", author: "XXXX-3", date: ago(6) },
|
||||
{ message: "Drop the single-seed evaluation script", author: "XXXX-3", date: ago(5) },
|
||||
{ message: "Document the sweep in the README", author: "XXXX-4", date: ago(3) },
|
||||
],
|
||||
comments: [
|
||||
{ author: "XXXX-4", body: "Thanks! I ran the sweep on a second machine and got 78.7 mean accuracy, which matches Table 2 within 0.2.", creationDate: ago(7), updatedDate: ago(7) },
|
||||
{ author: "XXXX-3", body: "Great, I also added `scripts/sweep.sh` so reviewers can run the same protocol. The README points to it now.", creationDate: ago(4), updatedDate: ago(4) },
|
||||
],
|
||||
reviewComments: [
|
||||
{ path: "src/evaluate.py", line: 15, comments: [
|
||||
{ author: "XXXX-4", body: "Should the default come from the config instead of `SEEDS`? Otherwise `configs/base.yaml` and this list can drift.", creationDate: ago(6), updatedDate: ago(6) },
|
||||
{ author: "XXXX-3", body: "Good point. The config now has `seeds:` and the CLI flag overrides it; `SEEDS` is only the fallback.", creationDate: ago(5), updatedDate: ago(5) },
|
||||
] },
|
||||
{ path: "src/utils/seeds.py", line: 5, comments: [
|
||||
{ author: "XXXX-4", body: "Can we say why seed 6 diverged? A reviewer will ask.", creationDate: ago(6), updatedDate: ago(6) },
|
||||
] },
|
||||
],
|
||||
};
|
||||
app.get(`/api/pr/${PR_ID}/options`, (req, res) => res.json({ url: null, lastUpdateDate: ago(1), isAdmin: false, isOwner: false }));
|
||||
app.get(`/api/pr/${PR_ID}/content`, (req, res) => res.json(prContent));
|
||||
|
||||
const GIST_ID = "robust-repair-gist-8D2E";
|
||||
const gistContent = {
|
||||
anonymizeDate: ago(2), isPublic: false,
|
||||
description: "Five-seed evaluation notes for the XXXX-1 replication",
|
||||
ownerLogin: "XXXX-3", creationDate: ago(20), updatedDate: ago(3),
|
||||
files: [
|
||||
{ filename: "PROTOCOL.md", language: "Markdown", type: "text/markdown", size: 1480, content: "# Evaluation protocol\n\nHow the numbers in Table 2 were produced, written for the artifact reviewers.\n\n## Setup\n\nOne GPU with 16 GB of memory. Install the pinned packages from `requirements.lock`.\n\n### Data\n\nThe three benchmarks are mirrored on Zenodo; `fetch.sh` downloads and checks them.\n\n## Running the sweep\n\nRun `sweep.sh` below. It trains five seeds in sequence and then evaluates the last checkpoint of each.\n\n### Seeds\n\nSeeds 1 to 5. Seed 6 diverged on the XXXX-2 cluster and is excluded.\n\n## Results from XXXX-2\n\nMean accuracy 78.9 over the five seeds, standard deviation 0.3.\n\n## Contact\n\nQuestions go through the conference system, not to XXXX-1 directly.\n" },
|
||||
{ filename: "sweep.sh", language: "Shell", type: "application/x-sh", size: 240, content: "#!/usr/bin/env bash\n# Run the five seeds of Table 2 in sequence.\nset -euo pipefail\nfor seed in 1 2 3 4 5; do\n python src/train.py --config configs/base.yaml --seed \"$seed\"\ndone\npython src/evaluate.py --checkpoint out/checkpoints/last.pt\n" },
|
||||
{ filename: "aggregate.py", language: "Python", type: "application/x-python", size: 980, content: "\"\"\"Aggregate per-seed rows into Table 2 (XXXX-1, 2026).\"\"\"\nimport json\nimport statistics\nimport sys\n\n\ndef load(path):\n with open(path) as f:\n return [json.loads(line) for line in f if line.strip()]\n\n\ndef table(rows):\n by_bench = {}\n for row in rows:\n by_bench.setdefault(row[\"benchmark\"], []).append(row[\"accuracy\"])\n return {name: (statistics.mean(v), statistics.pstdev(v)) for name, v in sorted(by_bench.items())}\n\n\nif __name__ == \"__main__\":\n for name, (mean, sd) in table(load(sys.argv[1])).items():\n print(f\"{name:12} {mean:5.1f} ± {sd:.1f}\")\n" },
|
||||
{ filename: "results.json", language: "JSON", type: "application/json", size: 310, content: "{\n \"Defects4J\": { \"mean\": 78.9, \"sd\": 0.3 },\n \"QuixBugs\": { \"mean\": 82.5, \"sd\": 1.1 },\n \"Bears\": { \"mean\": 61.2, \"sd\": 0.8 }\n}\n" },
|
||||
],
|
||||
comments: [
|
||||
{ author: "XXXX-4", body: "Ran `sweep.sh` on a second machine: Defects4J 78.7, within the reported deviation.", creationDate: ago(4), updatedDate: ago(4) },
|
||||
],
|
||||
};
|
||||
app.get(`/api/gist/${GIST_ID}/options`, (req, res) => res.json({ url: null, lastUpdateDate: ago(2), isAdmin: false, isOwner: false }));
|
||||
app.get(`/api/gist/${GIST_ID}/content`, (req, res) => res.json(gistContent));
|
||||
|
||||
|
||||
// A gist with every format the explorer renders, for the per-file viewers and the
|
||||
// Rendered/Raw toggle. Binary files are base64, as the gist content route returns them.
|
||||
const FORMATS_GIST_ID = "replication-gist-formats-5B71";
|
||||
const b64 = (buf) => Buffer.from(buf).toString("base64");
|
||||
const toneWav = (() => {
|
||||
const rate = 8000, n = rate; // one second, 440 Hz
|
||||
const data = Buffer.alloc(n * 2);
|
||||
for (let i = 0; i < n; i++) data.writeInt16LE(Math.round(Math.sin((2 * Math.PI * 440 * i) / rate) * 8000), i * 2);
|
||||
const head = Buffer.alloc(44);
|
||||
head.write("RIFF", 0); head.writeUInt32LE(36 + data.length, 4); head.write("WAVE", 8); head.write("fmt ", 12);
|
||||
head.writeUInt32LE(16, 16); head.writeUInt16LE(1, 20); head.writeUInt16LE(1, 22); head.writeUInt32LE(rate, 24);
|
||||
head.writeUInt32LE(rate * 2, 28); head.writeUInt16LE(2, 32); head.writeUInt16LE(16, 34); head.write("data", 36); head.writeUInt32LE(data.length, 40);
|
||||
return Buffer.concat([head, data]);
|
||||
})();
|
||||
const galleryBytes = (name) => fs.readFileSync(path.join(GALLERY_DIR, name));
|
||||
const formatsGist = {
|
||||
anonymizeDate: ago(2), isPublic: true, description: "Replication files for the XXXX-1 artifact, one of each format",
|
||||
ownerLogin: "XXXX-3", creationDate: ago(12), updatedDate: ago(2),
|
||||
files: [
|
||||
{ filename: "README.md", language: "Markdown", type: "text/markdown", size: 320, content: "# Replication files\n\nOne file of each kind the reviewer page renders, prepared by XXXX-1.\n\n## Contents\n\n- `results.csv`: the per-seed table\n- `analysis.ipynb`: the notebook behind Figure 1\n\n## Results\n\n| Model | Accuracy | Plausible |\n| --- | ---: | ---: |\n| Baseline | 71.2 | 412 |\n| + Aug. | 74.0 | 447 |\n| + Pretrain | 76.1 | 471 |\n| Ours | 78.9 | 503 |\n\n## Contact\n\nThrough the conference system.\n" },
|
||||
{ filename: "results.csv", language: "CSV", type: "text/csv", size: galleryText["results.csv"].length, content: galleryText["results.csv"].replace("Baseline,1", "XXXX-2 baseline,1") },
|
||||
{ filename: "analysis.ipynb", language: "Jupyter Notebook", type: "application/x-ipynb+json", size: galleryNotebook.length, content: galleryNotebook },
|
||||
{ filename: "train.py", language: "Python", type: "application/x-python", size: 160, content: "# Copyright 2026 XXXX-1\nimport argparse\n\n\ndef main():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"--seed\", type=int, default=1)\n print(parser.parse_args())\n" },
|
||||
{ filename: "pipeline.svg", language: "SVG", type: "image/svg+xml", size: galleryText["figures/pipeline.svg"].length, content: galleryText["figures/pipeline.svg"] },
|
||||
{ filename: "accuracy.png", type: "image/png", size: galleryPng.length, encoding: "base64", content: b64(galleryPng) },
|
||||
{ filename: "paper.pdf", type: "application/pdf", size: galleryBytes("paper.pdf").length, encoding: "base64", content: b64(galleryBytes("paper.pdf")) },
|
||||
{ filename: "demo.mp4", type: "video/mp4", size: galleryBytes("demo/demo.mp4").length, encoding: "base64", content: b64(galleryBytes("demo/demo.mp4")) },
|
||||
{ filename: "tone.wav", type: "audio/wav", size: toneWav.length, encoding: "base64", content: b64(toneWav) },
|
||||
{ filename: "checkpoint.bin", type: "application/octet-stream", size: galleryCheckpoint.length, encoding: "base64", content: b64(galleryCheckpoint) },
|
||||
{ filename: "train.parquet", type: "application/octet-stream", size: 312 * 1024 * 1024, encoding: "base64", tooLarge: true },
|
||||
],
|
||||
comments: [],
|
||||
};
|
||||
app.get(`/api/gist/${FORMATS_GIST_ID}/options`, (req, res) => res.json({ url: null, lastUpdateDate: ago(2), isAdmin: false, isOwner: false }));
|
||||
app.get(`/api/gist/${FORMATS_GIST_ID}/content`, (req, res) => res.json(formatsGist));
|
||||
|
||||
app.all("/api/{*rest}", (req, res) => res.status(404).json({ error: "not mocked: " + req.path }));
|
||||
|
||||
app.use((req, res, next) => {
|
||||
|
||||
Reference in new issue
Block a user