misukisu's picture
kreatix-code-debug v0.1.0: verified Python data, card, generator
1c01ed6 verified
|
Raw History Blame Contribute Delete
1.67 kB

Rebuilding kreatix-code-debug v0.1.0

Uses the problem generator of kreatix-code-hard, which must sit next to this folder (../kreatix-code-hard/generator/codegen). Python 3.10+ only.

python generator/build_debug.py --candidates 18000 --workers 8  # data/train.jsonl + data/test.jsonl
python ../common/validate.py data/train.jsonl data/test.jsonl
python ../common/samples_stats.py kreatix-code-debug --n 24 --family-depth 3   # from the parent folder
  • Each row starts from a verified problem (reference == brute-force oracle, large input within the time limit).
  • codegen/mutate.py injects one bug by editing an exact source span found through the AST, so comments and layout stay as they were. Bug kinds: flipped comparison, +/- swap, and/or swap, min/max swap, bisect_left/bisect_right swap, off-by-one in a range, index 0/-1 swap, wrong initial value, dropped minus sign, dropped statement in a loop.
  • A mutant is used only if it compiles and fails at least one of the problem's verified inputs. The smallest failing input is the one shown. Tracebacks are real: the buggy file is run and its traceback is kept, with the file name normalised to solution.py.
  • The fix shown restores the verified reference exactly.
  • Splits: problems from the families in codegen/base.py: HELDOUT go to test only. Each buggy program (program_id) appears at most twice (--cap-program 2) and each family at most --cap-family 80 times (--test-cap-family 100).
  • When the buggy code raises instead of returning, the request and reply say so ("raises TypeError: ...").
  • Seeds: candidate jobs use seeds 3,000,000+.