Reproducibility#

Diagram, five numbered cards in a row: fixed hashed inputs; pinned claims (dependencies, weights, seeds); provenance written by the code; the clean-room test; real hardware. Below them a red dashed box with what the 2026 study measured and what the clean-room test caught in this repository

The five steps come from Sciunits [5], which packages code, data and the recorded run together, and from the 2026 study of dependency gaps in AI-generated code [6], which measures what a project claims against what loads when it runs. Each step is a file in this repository, named on its card. The full checklist is docs/reproducibility.md and the audit against the paper is docs/reproducibility_audit.md. Everything in experiments/results/ ran on one NVIDIA RTX 4000 Ada (20 GB), Ubuntu, Python 3.12.3, torch 2.11.0+cu128, transformers 5.5.4. Continuous integration is not set up yet. The commands a workflow would run are make test and make lint.

Stats for nerds (how the results were made, step by step)

Workflow diagram of the experiments, six numbered cards: 100 VoxCeleb clips from a hashed test slice; 60 LibriSpeech clips with known damage; three models over every patch; every run writes provenance.json; statistics; the clean-room test, with the dependency gap it caught in red

  • The 100 clips are default_rng(8001).choice(1500, 100, replace=False) on a test slice with a recorded sha256, disjoint from the development and held-out slices (the script asserts it). The LibriSpeech set and the VoiceBank-DEMAND archives are hashed the same way.

  • requirements.txt pins every version. AADD is pinned to a git commit because it is not on PyPI. An earlier version of the file listed aadd==3.1.0, which is not on PyPI, and the clean-environment run caught it. Model weights are pinned to Hugging Face snapshot commits (experiments/common.py).

  • Every model pass writes provenance.json with the git commit and whether the tree was clean, Python, torch and CUDA versions, the GPU, input hashes, model commits, seeds, the claimed dependency list and the runtime dependency list, plus the difference between the two. The records of the runs behind the current numbers were removed in 0.3.2 because they no longer described those runs. The next run of each script writes a new one.

  • scripts/reproduce_clean_env.sh builds a fresh venv, installs only requirements.txt, runs the tests, imports every third-party module the code uses, and records what loaded. It passed for both torch builds. CPU: 49 tests, 16 claimed packages, 60 distributions loaded, 84 versions in provenance/requirements-lock.txt. CUDA 12.8 on the GPU above: all 52 tests, 63 loaded, 103 versions in provenance/requirements-lock-cu128.txt.

The checklist#

This is the checklist I followed, taken from Dr Tanu Malik’s work on reproducible computation: Sciunits (Ton That, Fils, Yuan and Malik, 2017), which package code, data and the recorded execution so someone else can re-run them, and the three-layer dependency view in Vangala, Adibifar, Gehani and Malik (2026), which separates what a project claims it needs, what it needs to run, and what actually loads at runtime. The study in that paper found that only 68.3 % of AI-generated projects ran out of the box in a clean environment. Missing dependencies (ImportError) explained only 10.5 % of the failures. Most came from code errors such as malformed syntax, incorrect file paths and uninitialized variables. Declared dependencies also understated what actually loaded by 13.5x on average. The steps below exist to close those gaps for this repository.

1. Fixed, hashed inputs#

  • The test slice is a fixed test.csv in the data folder, sha256 dfb0451d8ea3ed486a07a659fa318b568cab9f4303d7b313bd796d0148e95515, 1 500 rows, disjoint from the 500-row development slice and the 1 426-row held-out slice (asserted in experiments/sample_test100.py).

  • The 100 comparison clips are numpy.random.default_rng(8001).choice(1500, 100, replace=False) on that file. The list and its hash are in experiments/sample100.csv and experiments/sample100_provenance.json.

  • Human transcripts come from the data folder’s transcripts.tsv; AADD frame probabilities from its aadd_frames_20ms.csv (v3.1, 20 ms, generated by the AADD CLI). Every provenance.json a run writes holds the hash of both.

  • The held-out slice’s audio was never read.

  • The controlled set is LibriSpeech test-clean (CC BY 4.0) with the 60 clips, windows and degradations fixed by seed 8001 (experiments/results/controlled/manifest.csv). The on-and-off set is the VoiceBank-DEMAND test set (CC BY 4.0): experiments/demand.py downloads the four archives from Edinburgh DataShare by bitstream id and refuses to continue unless their SHA-256 match the values written in the script; the 100 clips, the segment cuts and the on/off patterns are fixed by seed 8001 (experiments/results/demand/manifest.csv).

2. Pinned code, models and seeds#

  • requirements.txt pins every claimed dependency to the exact version used. AADD is not on PyPI, so it is pinned to a git commit (c6a2debc). That line was wrong in the first draft (aadd==3.1.0), and the clean-environment run below caught it, which is the point of the run.

  • Model weights are pinned by Hugging Face snapshot commit. The commits recorded in each provenance.json (models field) are in experiments/common.py (REVISIONS) and every experiment passes them as revision=: whisper-tiny 169d4a43, whisper-base e37978b9, moonshine-base 7a73d8d5. ways explain --revision <commit> does the same from the command line. Two weights are not pinned this way: AADD downloads its checkpoints from the main branch of gertelrina/aadd (sha256 of the files used here: v3.1 2c16784e…, v3-lite 571c0508…, v2 6afd98fb…), and train_detectors.py builds the whisper-base detector through AADD’s WhisperFrameModel, which takes no revision.

  • Seeds: sample 8001, bootstrap 8001. Greedy decoding and teacher forcing are deterministic; the surprisal of a clip scored twice differs by 0.0 (checked in the smoke run, see README).

3. Runtime provenance, written by the code#

ways.provenance.write() runs at the end of every model pass of every experiment (the 100-clip runs, the controlled set, the latent view, the on-and-off set) and records the git commit of this repository, Python, torch and CUDA versions, the GPU, the input hashes, the model snapshots, the claimed dependency list, and the runtime dependency list (every distribution behind a module that was imported during the run, which is Vangala et al.’s D_r). It also writes the difference runtime_not_claimed and the multiplier |D_r| / |D_c|, the model revisions that were loaded, and code_dirty, which is true when tracked files differed from the commit.

The records of the runs behind the current numbers were removed in 0.3.2. The three 100-clip records had no code commit and no model revision, and the nine records of the controlled, on-and-off and latent runs were written when finished runs were re-entered and named a commit that no longer exists. A record that does not describe its run is worse than none. The next run of each script writes a new one, and the dependency sets of a clean install are in provenance/.

A model pass skips a clip only when its saved map exists. The maps (npz) are not committed, so on a fresh clone every pass recomputes its clips and rewrites the tracked rows.

4. Clean-environment execution test#

scripts/reproduce_clean_env.sh creates a fresh virtual environment with no system site packages, installs only requirements.txt (CPU torch, so it needs no GPU), installs this package, runs pip check, runs the CPU test suite (pytest -m "not gpu and not slow"), runs ways explain --help, imports every third-party module the package, the experiments and the figure scripts use, and writes the runtime set it observed to provenance/clean_env_run.json. That is the “executable reliability” check of Vangala et al. applied to this repository, short of the GPU runs. The script writes its own log to provenance/clean_env_run.log. The audit of this repository against that paper is reproducibility_audit.md.

TORCH_INDEX=cu128 scripts/reproduce_clean_env.sh does the same with the CUDA 12.8 build of torch on a machine with a GPU, runs the GPU tests as well, and writes clean_env_run_cu128.{log,json} and requirements-lock-cu128.txt.

5. Tested on real hardware#

Everything in experiments/results/ was produced on one NVIDIA RTX 4000 Ada (20 GB), Ubuntu, Python 3.12, torch 2.11.0+cu128, transformers 5.5.4. Timings in the README are from that machine. Continuous integration is not set up yet (no Actions minutes this month); the same test command is what a workflow would run.

Re-running#

What a full re-run needs besides this repository: Python 3.12, a CUDA GPU for the model runs (the tests need none), internet on the first run for the Hugging Face weights and the AADD checkpoints, the VoxCeleb data folder (layout in experiments/common.py: audio/, test.csv, development.csv, heldout.csv, transcripts.tsv, aadd_frames_20ms.csv), LibriSpeech test-clean and dev-clean for the controlled set and the detectors, and Playwright’s Chromium for the two hand-drawn figures. The data folder is the one path the scripts need: pass it as the argument where shown, or set WAYS_DATA, otherwise they look for ways-data next to this repository and stop with a message if it is not there. The .sh scripts use $PY (default python, so activate the venv first) and run offline by default.

python -m venv .venv && . .venv/bin/activate
pip install --extra-index-url https://download.pytorch.org/whl/cu128 -r requirements.txt
pip install --no-deps -e .
pytest tests -q -m "not gpu and not slow"         # the CPU checks, under a minute
export WAYS_DATA=/path/to/ways-data
python experiments/sample_test100.py "$WAYS_DATA"
HF_HUB_OFFLINE=0 TRANSFORMERS_OFFLINE=0 experiments/run_all.sh   # three models, 100 clips, about 40 minutes on the GPU above
python experiments/run_aadd_variants.py "$WAYS_DATA"
python experiments/compare.py
python experiments/example_clip.py "$WAYS_DATA"
python experiments/vox_mixed_figures.py "$WAYS_DATA"
python experiments/gif_erase_sweep.py "$WAYS_DATA"
# controlled set: LibriSpeech test-clean into experiments/cache/librispeech/, then
mkdir -p experiments/cache/librispeech && cd experiments/cache/librispeech
curl -LO https://www.openslr.org/resources/12/test-clean.tar.gz
echo "39fde525e59672dc6d1551919b1478f724438a95aa55f874b576be21967e6c23  test-clean.tar.gz" | sha256sum -c && tar xzf test-clean.tar.gz
cd ../../..
python experiments/controlled.py prepare && experiments/run_controlled.sh && python experiments/controlled_figures.py
# detector backbones: LibriSpeech dev-clean into experiments/cache/librispeech/, then
cd experiments/cache/librispeech && curl -LO https://www.openslr.org/resources/12/dev-clean.tar.gz
echo "76f87d090650617fca0cac8f88b9416e0ebf80350acb97b343a85fa903728ab3  dev-clean.tar.gz" | sha256sum -c && tar xzf dev-clean.tar.gz
cd ../../..
experiments/run_backbones.sh                      # trains two detectors (about 5 minutes) and runs the comparison
# VoiceBank-DEMAND on-and-off set: demand.py downloads the four test-set archives from Edinburgh DataShare
# (about 330 MB, SHA-256 checked), then the three models with a 30 minute cap each, then the figures
experiments/run_demand.sh && python experiments/demand_figures.py
# the latent view: three models over the 100 VoxCeleb clips and the 60 controlled clips
experiments/run_latent.sh
# the ambiguous clip under both methods (needs the controlled set above)
python experiments/ambiguous_case.py && python experiments/ambiguous_wer.py
# the tool example figures on one partly degraded clip, and the two checks of the method
python experiments/tool_examples.py "$WAYS_DATA"
python experiments/check_timestamps.py && python experiments/check_spillover_frontend.py
# the scoring-speed check, then the two circuit experiments (development slice to fit, test clips scored once)
python experiments/check_fast_attention.py "$WAYS_DATA"
# the hand-drawn workflow figures and the two charts (fonts are in docs/images/fonts, no internet needed)
python -m playwright install chromium
python docs/images/src/make_detector_figure.py && python docs/images/src/make_demand_figure.py && python docs/images/render.py

The detector comparison reuses the saved detector probabilities only while weights.sha256 next to them matches the checkpoint, so retrained detectors are always rescored.

Two lock files hold the full closure of a clean install, each written by the clean-environment run of that build: provenance/requirements-lock.txt for CPU torch and provenance/requirements-lock-cu128.txt for the CUDA 12.8 build the results were made with. pip install -r <lock file> installs exactly that set.

The VoxCeleb audio and transcripts in the data folder are not redistributed here; the clip ids, the hashes and every derived number are.