Experiments on using LLMs to generate unit tests for the notifiers in Taskflow: the lock-free primitives that put idle worker threads to sleep and wake them when work arrives.
The repository contains:
- a fault-injection benchmark: ten bugs and one control change injected into
AtomicNotifierandNonblockingNotifier, one patch each; - the harness that builds a test against each variant and against unmodified code, runs it repeatedly, and scores it;
- the prompts, the model replies, and the extracted tests for every phase;
- the raw and scored results;
- a reproducer for a lost wakeup in
NonblockingNotifierV2, the default notifier in Taskflow v3.8 to v3.11.
taskflow/ Taskflow source (pinned: TASKFLOW_COMMIT.txt), never modified
exp/README.md how to run everything: start here
exp/BUG_SPEC.md the injected faults and how detectable each one is
exp/bugs/ one patch per injected fault
exp/bin/ harness, model clients, scoring
exp/prompts/ prompt templates and the generated prompts
exp/responses/ model replies
exp/tests/ tests extracted from the replies
exp/results/ calibration runs, scored tests, API spend
exp/releases/ the NonblockingNotifierV2 finding (see FINDING.md)
exp/archive/ superseded notes and runs not used in the study
exp/variants/ and exp/build/ are generated and gitignored.
cd exp
python3 bin/make_patches.py
./bin/mutate.sh CLEAN A1 A2 A3 A4 A5 N1 N2 N3 N4 N4b N5
./bin/calibrate.sh arm64 5 # Taskflow's own suite on every variant
./bin/eval_test.sh tests/claude_A1_2b_3_s1.cpp A1 # score one generated test
python3 bin/score.py --by-model # metric table per model from results/tests.csv
Model calls need API keys in exp/.env (never committed).