Dataset Viewer
Auto-converted to Parquet Duplicate
case_id
stringlengths
73
73
display_order
int64
1
600
domain
stringclasses
2 values
task_id
stringclasses
110 values
task_key
stringclasses
110 values
task_title
stringclasses
56 values
task_statement_original_sha256
stringclasses
101 values
reference
dict
evidence
dict
unified::69a8e53e6ceaf50517b6bde03a6f3c83c0e346ef9996ccbb3da4ba71a2714b88
1
PF
KTLT::0ac87df303945d2d2a8dfc43b09e8b2c8235c0b20d1dfe2917361878f0b1c6f7
PF01
[Pointer 2][Q 4.4] Create array 2D
25ead69519de7b7e90eb9a83d38811897861d6743097c5587431994561adeafc
{ "root_concept": "INPUT_HANDLING", "defect_form_status": "ATOMIC", "defect_form": "WRONG_CONTROL_FLOW", "causal_location": "11", "diagnosis": "After a zero, the inner loop continues reading the same row instead of advancing to the next row.", "causal_chain": "wrong continue target -> subsequent tokens are ...
{ "language": "cpp", "failing_code": "int** readArray()\n{\n int arr[10][10];\n for (int i = 0; i < 10; i++) {\n for (int j = 0; j < 10; j++) {\n cin >> arr[i][j];\n if (arr[i][j] == 0) {\n for (int k = j + 1; k < 10; k++) {\n arr[i][k] = 0;\n ...
unified::9332cd5f432f4e15f98bd4b591444a465ae1dbf5bdbf4d141d4a5466f6219f96
2
DSA
DSA::916775e0ffa0493a8455c6784c8cbee26d39cf4ee1350b083857763ccf41d944
DSA01
ce0eddf8f1475f3db960879c341a11488bde9f93fa38711156102e22d5daae56
{ "root_concept": "MAINTAINED_STATE_OR_INVARIANT", "defect_form_status": "ATOMIC", "defect_form": "EXTRANEOUS_OPERATION", "causal_location": "3", "diagnosis": "An extraneous state update (`sum += root->val;`) corrupts the maintained state/invariant for the selected execution.", "causal_chain": "defect -> in...
{ "language": "cpp", "failing_code": "\nvoid longestPathSum(BTNode* root, int depth, int& max_depth, int sum, int& max_sum){\n sum += root->val;\n\n if (!root->left && !root->right) {\n // Node lá\n if (depth > max_depth || (depth == max_depth && sum > max_sum)) {\n max_depth = depth;...
unified::f76c75db58a8679b91f052d1db1e29938bdddccb7387d48f128f94e5094af923
3
DSA
DSA::9c71ce331c2b1a86bf5b99adca052fb4860abebefa82be0a46a362a3c51ce9bd
DSA02
65ec9b45928f9a08ba3c9344f001e488e707e5c83de118beb3c9dd5a39f08c2f
{ "root_concept": "INDEX_OR_RANGE", "defect_form_status": "ATOMIC", "defect_form": "WRONG_EXPRESSION", "causal_location": "25", "diagnosis": "The implementation uses the wrong position/range expression `list[temp]*=2;`; `list[temp] = list[temp-1] * 2;` targets the required index or boundary.", "causal_chain...
{ "language": "cpp", "failing_code": "\nbool isdigit(char a)\n{\n return (a >= '0' && a <= '9');\n}\nint baseballScore(string ops)\n{\n int list[ops.length()];\n int temp = 0;\n int sum = 0;\n for (size_t i = 0; i < ops.length(); i++)\n {\n if(isdigit(ops[i])) \n {\n list[...
unified::950083f8f5a18bbeca496e56a752831c9ee902384fdfb854c8a601e34b6c3fe4
4
DSA
DSA::9c71ce331c2b1a86bf5b99adca052fb4860abebefa82be0a46a362a3c51ce9bd
DSA02
65ec9b45928f9a08ba3c9344f001e488e707e5c83de118beb3c9dd5a39f08c2f
{ "root_concept": "ALGORITHM_OR_LOGIC", "defect_form_status": "ATOMIC", "defect_form": "WRONG_EXPRESSION", "causal_location": "6", "diagnosis": "The digit branch checks only the lower character bound, so operation characters are also interpreted as numeric scores.", "causal_chain": "incomplete digit-range p...
{ "language": "cpp", "failing_code": "\nint baseballScore(string ops){\n/*TODO*/\n stack<int> st;\n for (auto ch : ops) {\n if (ch >= 0 + '0') {\n st.push(ch-'0');\n }\n else if (ch == '+') {\n int x = st.top();\n st.pop();\n int y = st.top();\n...
unified::32f1d1299485dd767ca32c3b2fe754adebeef05bc192b5b09b9dc9c18acb4421
5
PF
KTLT::c6919abc833dfa51ad769743936583fe569ec6518c509419911e814ddf1e74f6
PF02
[Linked List] [Q 3.6] Insert node
2b561be83d854834cef37486a807c6c4dae670466ccb904da0254551f7161e48
{ "root_concept": "INDEX_OR_RANGE", "defect_form_status": "ATOMIC", "defect_form": "WRONG_EXPRESSION", "causal_location": "15", "diagnosis": "The traversal stops at the requested node rather than its predecessor, inserting the new node one position too late.", "causal_chain": "off-by-one traversal endpoint ...
{ "language": "cpp", "failing_code": "#include <iostream>\nusing namespace std;\nstruct node\n{\n int data;\n node *next;\n};\n\nnode *createLinkedList(int n); // The implementation is provided implicitly\n\nnode *insertNode(node *head, node *newNode, int position)\n{\n node *temp = head;\n int coun...
unified::21b363143f352ff1d2f8b3b7d7f3f34cebdb1159d4713bf91751d3001188a41f
6
PF
KTLT::2ba96bd83e3f23581f63f916f91a7f703af7daa867b19a478f37a22f314c65dc
PF03
[OOP 1] [1.03] Room
90673b185a4b33b2ed9a9fa697d1302fbfa48f7ae8fa989b045f50b8edb1b9e6
{ "root_concept": "ALGORITHM_OR_LOGIC", "defect_form_status": "ATOMIC", "defect_form": "WRONG_EXPRESSION", "causal_location": "16", "diagnosis": "calculateArea computes total surface area although the required room area is length times breadth.", "causal_chain": "wrong area formula -> wall and ceiling terms...
{ "language": "cpp", "failing_code": "class Room\n{\nprivate:\n int length;\n int breadth;\n int height;\npublic:\n Room(int length, int breadth, int height)\n {\n this->length = length;\n this->breadth = breadth;\n this->height = height;\n }\n int calculateArea()\n {\n ...
unified::42d865a0c6c2319b255133215938cc6e72191447318f5ad8466fba9b1ed40232
7
DSA
DSA::5a74f0765df43fab9a0b248856507de329b46976fbffadcba4d7add899617ceb
DSA03
448c1bb9d3687747d9f0c4c52e93eccf6d54371f4a0e760849bf1db05b72df2e
{"root_concept":"MAINTAINED_STATE_OR_INVARIANT","defect_form_status":"ATOMIC","defect_form":"WRONG_C(...TRUNCATED)
{"language":"cpp","failing_code":"\n//Helping functions\nbool insertnode(Node*&root,const T&value){\(...TRUNCATED)
unified::64404d45a08b199ad3852af39c1b93ce3ca489342d0343e915f93db8961dcfc7
8
DSA
DSA::9dfdb25f011c1e4f8e6d9968dc195919254f9c7ffae49c5bf604cda65da663b8
DSA04
2649169e2cc0eab26e7bf18c5ab66010be78b5d17413654c66d2c583e4d3d719
{"root_concept":"ALGORITHM_OR_LOGIC","defect_form_status":"ATOMIC","defect_form":"WRONG_EXPRESSION",(...TRUNCATED)
{"language":"cpp","failing_code":"\nbool canEatFood(int maze[5][5], int fx, int fy)\n{\n if (maze(...TRUNCATED)
unified::d5c904e33fba0f2a42293ed055ef84b2d602710b8e93d334bd26f58e1ed956e5
9
PF
KTLT::46b8e2b42d57b897423b6555e92d3376183b76db6a7f443a240d8cc2564e797e
PF04
[Recursion] [Q 2.8] Số các biểu diễn thành tổng các bình phương của một số.
390f52e7e165e985d63b4de3ef8707706b1181139b0872bb207f910df14f4759
{"root_concept":"TERMINATION_OR_PROGRESS","defect_form_status":"ATOMIC","defect_form":"WRONG_EXPRESS(...TRUNCATED)
{"language":"cpp","failing_code":"int WayofSqrt(int x,int k)\n{\n if ((x>0)||(k*k==x))\n {\n (...TRUNCATED)
unified::424b451d4a5077d9e44001076093486fa1a62a415b4f1bb4b1f9aa89312df7f8
10
PF
KTLT::d7de3a6d622118836671230296109df1847634f19284dfbb199e6929d24f1587
PF05
[Pointer Basic][Q 3.5] Tìm phần tử lớn nhất trong mảng 1 chiều bằng con trỏ
e2796795705a8a667b76aefd34d449e236f9dec7b64063cfd2311c4e09102d53
{"root_concept":"SPECIFICATION_OR_POLICY_CONSTRAINT","defect_form_status":"ATOMIC","defect_form":"WR(...TRUNCATED)
{"language":"cpp","failing_code":"int findMax(int *ptr, int n)\n{\n int max=0;\n for (int i=0;(...TRUNCATED)
End of preview. Expand in Data Studio

FailDiag: Selected Program Failure Diagnosis Benchmark

Companion dataset for FailDiag: Evaluating LLMs for Diagnosis of Selected Program Failures by Huy Tran and Thanh Thi Nguyen.

Dataset summary

FailDiag contains 600 real C++ selected-failure diagnosis cases drawn from 110 programming tasks:

  • 300 Programming Fundamentals (PF) cases
  • 300 Data Structures and Algorithms (DSA) cases
  • 110 tasks (55 PF, 55 DSA)

Each case provides the faulty program as submitted, one selected failure as an expected-versus-observed pair (or a runtime error), same-lineage repair evidence (the author's own later passing revision, the diff between them, and the post-repair test outcomes), and a structured diagnostic reference.

What the benchmark measures

A program may contain multiple genuine defects. FailDiag evaluates whether a diagnosis identifies the defect that explains the selected failure, rather than merely identifying any defect in the program. A response that correctly describes a real but unrelated bug is not counted as correct.

Task statements

field meaning
task_statement_original the exact task text used in the reported paper experiments, byte for byte
task_statement_en an English-only public-facing representation, for accessibility and future evaluations

Exact reproduction of the reported experiments MUST use task_statement_original. task_statement_en is a different input representation unless byte-identical to the original, which english_is_byte_identical_to_original records per task (55 of 110).

PF statements are bilingual Vietnamese/English in the source; DSA statements are English. The English rendering starts as an exact slice of the original at its own English separator; any further change is recorded per task.

translation_source tasks
official_english 98
official_english_with_translated_missing_parts 6
official_english_with_source_correction 6
translated_from_vietnamese 0

A small number of English renderings contain documented corrections of obvious inconsistencies in the original bilingual source, while the original evaluated text remains unchanged. The 6 affected tasks are PF06, PF39, PF40, PF42, PF43, PF46.

Four tasks have no statement in the source. DSA07, DSA37, DSA40, DSA50 carry the placeholder Problem statement unavailable in the retained source artifact., marked task_statement_status = "placeholder_in_source". Nothing was invented for them.

Evidence conditions

condition evidence
Code-Only (CO) task statement + faulty program
Failure-Informed (FI) CO + selected failing fixture/input, expected behaviour, observed behaviour or runtime error
Repair-Assisted (RA) FI + canonical same-lineage repair evidence

The public case records intentionally contain the fields needed for all three conditions. Construct condition-specific inputs; do not feed a complete record to every condition.

Loading evidence safely

The archival public JSONL contains the evidence needed to construct all three experimental conditions. Passing an entire case record directly to a diagnosis model would leak evidence across conditions — the selected failure into Code-Only, the repair into Failure-Informed, and the structured reference into all three. Use the bundled reference loader.

from faildiag import load_cases, load_tasks, get_case, build_case_evidence

cases = load_cases()
tasks = load_tasks()
case = cases[0]                       # or get_case("<case_id>")

co = build_case_evidence(case, "CO", tasks=tasks)
fi = build_case_evidence(case, "FI", tasks=tasks)
ra = build_case_evidence(case, "RA", tasks=tasks)

From the command line:

python faildiag.py --case-id <CASE_ID> --condition CO
python faildiag.py --case-id <CASE_ID> --condition FI
python faildiag.py --case-id <CASE_ID> --condition RA
python faildiag.py --case-id <CASE_ID> --condition CO --task-statement-field task_statement_en

Evidence hierarchy:

  • CO = task + faulty program
  • FI = CO + selected-failure evidence
  • RA = FI + same-lineage repair evidence

Structured references are evaluation targets and are never part of diagnosis-model evidence. The loader excludes root concept, defect-form status, atomic defect form, causal location, reference diagnosis and causal chain from every packet, in every condition.

For exact reproduction of the paper, use task_statement_original — the loader's default. task_statement_en is available through the explicit task_statement_field argument and is not exact reproduction of the reported experiments.

The loader ships with tests and an exhaustive audit over all 600 cases: 0 / 0 / 0 cross-condition leakage violations for CO / FI / RA (reports/loader_leakage_audit.json).

Structured outputs

A diagnosis is scored on four structured fields:

  1. Root concept — one of 13 values.
  2. Defect-form status — one of ATOMIC, COMPOSITE, UNSCOREABLE.
  3. Atomic defect form — one of 9 values, applicable only when the status is ATOMIC.
  4. Failure-relevant code location — visible-line intervals over the displayed faulty program (N, N-M, or a comma-separated list). The loader's line_numbered=True option renders the program with the L<n> | prefixes these intervals index.

Full value lists are in schema/faildiag_public_release_schema.json under structured_reference_vocabulary.

The structured reference set was created through an AI-assisted curation process with final human approval. A subsequent stratified blinded human-led audit of 120 cases was used to assess and refine reference reliability. The released structured references are the finalized benchmark references. Aggregate results from the 120-case blinded audit are provided in reports/reference_audit_summary.md. Per-case annotation-workflow provenance is internal and is not part of this release.

Dataset organization

benchmark/     faildiag_cases_public.jsonl   one record per case (600 records)
tasks/         faildiag_tasks.{jsonl,json,csv}  one record per task (110 records)
cases/         case_to_task.{csv,jsonl}      every case mapped to its task
faildiag.py    condition-safe reference loader and CLI
tests/         loader tests and the all-case leakage audit
schema/        field-by-field description of every record type
reports/       reference audit summary, translation and source-correction audit, privacy
               review, validation report, loader leakage audit
RELEASE_METADATA.json   authors, license, counts, vocabulary, reproducibility checksums
CITATION.cff   citation metadata
LICENSE        CC-BY-4.0
CHANGELOG.md   what the public-release transformation did
SHA256SUMS     digest of every file in this release

Task text is normalised at the task level and not duplicated across cases. Each case references its task_id and carries task_statement_original_sha256.

Example record

Abbreviated and synthetic — field shapes only, not a real submission:

{
  "case_id": "unified::<64-hex>",
  "display_order": 1,
  "domain": "PF",
  "task_id": "PF::<64-hex>",
  "task_key": "PF01",
  "task_title": "[Example] Sum of an array",
  "task_statement_original_sha256": "<64-hex>",
  "reference": {
    "root_concept": "INDEX_OR_RANGE",
    "defect_form_status": "ATOMIC",
    "defect_form": "WRONG_EXPRESSION",
    "causal_location": "3",
    "diagnosis": "The loop bound compares i <= n, so the loop reads one element past the end of the array.",
    "causal_chain": "loop bound uses <= n -> a[n] is read past the end of the array -> the returned sum includes an out-of-bounds value"
  },
  "evidence": {
    "language": "cpp",
    "failing_code": "int total(int* a, int n) {\n    int s = 0;\n    for (int i = 0; i <= n; i++) {\n        s += a[i];\n    }\n    return s;\n}",
    "repair_code": "int total(int* a, int n) {\n    int s = 0;\n    for (int i = 0; i < n; i++) {\n        s += a[i];\n    }\n    return s;\n}",
    "repair_diff": "@@ -3,1 +3,1 @@\n-    for (int i = 0; i <= n; i++) {\n+    for (int i = 0; i < n; i++) {",
    "repair_validation_summary": {
      "repair_shape": "SINGLE_SUBSTANTIVE_EDIT",
      "successor_full_pass": true
    },
    "selected_failing_test": {
      "test_id": "t3",
      "test_index": 3,
      "input": "3\n1 2 3",
      "fixture": "3\n1 2 3",
      "expected": "6",
      "actual_before": "32774",
      "error_before": null,
      "actual_after": "6",
      "passed_after": true
    },
    "visible_failing_code_line_count": 7
  }
}

causal_location is a string of visible-line intervals over failing_code; here "3" is the loop-bound line, and visible_failing_code_line_count matches the seven visible lines. causal_chain is a string, and defect_form is one of the nine atomic forms.


## Reproducing the paper

1. use **`task_statement_original`**;
2. construct **CO / FI / RA** with the bundled loader, or according to the documented
   evidence conditions;
3. use the paper's prompt, output-schema and configuration artifacts;
4. **do not substitute `task_statement_en`** for the original task statement.

`RELEASE_METADATA.json` records `paper_evaluation_task_field = "task_statement_original"` and
the digest of the internal authoritative annotation file the reported experiments consumed.

## Known source issues

- **PF19** — the bilingual source declares the parameter as `int** matrix`
  in one half and `int**& matrix` in the other. Left **intentionally unresolved**.
- **DSA07, DSA37, DSA40, DSA50** — four DSA tasks carry a source placeholder instead of a statement.
- **PF06, PF39, PF40, PF42, PF43, PF46** — obvious source-English inconsistencies corrected **only in
  `task_statement_en`**; the original evaluated text is preserved unchanged.

Detail: `reports/translation_and_source_correction_audit.csv`.

## Privacy and provenance

Automated privacy screening found no direct identifiers under the implemented checks. Manual review was completed for flagged release items, but automated screening cannot guarantee the absence of all incidental identifiers.

The release excludes LMS account identifiers, student identity information, private student
linkage, submission-level restricted provenance, account histories and private salts, each
listed with its reason in `RELEASE_METADATA.json`.

**No claim of absolute anonymity is made.** The programs are real student submissions and may
contain incidental content automated screening cannot detect. Numeric literals carrying task
semantics, such as a modulus or a `#define` string literal, are deliberately not redacted.

## License

Released under the **Creative Commons Attribution 4.0 International** license
(**CC-BY-4.0**) — see [`LICENSE`](LICENSE) and <https://creativecommons.org/licenses/by/4.0/>.

You may share and adapt the material, including commercially, provided you give appropriate
credit, link to the license, and indicate if changes were made.

## Archival release and citation

The frozen public release associated with the reported FailDiag experiments is archived on
Zenodo at <https://doi.org/10.5281/zenodo.22269090>. The archive corresponds to Hugging Face revision
`0aa5c7a19daad4595fbc3dc43ffa03cf79a52861`.

- The **version DOI** [`10.5281/zenodo.22269090`](https://doi.org/10.5281/zenodo.22269090) identifies the exact frozen
  release: one archive whose contents are fixed and can never change.
- This **Hugging Face repository may receive later documentation updates** — corrections to
  the dataset card, citation metadata and reports. Its revision hash therefore moves over
  time, while the Zenodo archive does not.
- **Exact reproduction of the reported experiments should use the archived Zenodo version**,
  together with `task_statement_original` as described above.

A concept DOI, [`10.5281/zenodo.22269089`](https://doi.org/10.5281/zenodo.22269089), also exists and always resolves to the
most recent version. Use it to refer to the dataset in general; **do not cite it for exact
reproducibility**, because it does not identify a fixed snapshot.

```bibtex
@dataset{tran_faildiag_2026,
  author    = {Huy Tran and Thanh Thi Nguyen},
  title     = {FailDiag: Selected Program Failure Diagnosis Benchmark},
  year      = {2026},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.22269090},
  url       = {https://doi.org/10.5281/zenodo.22269090}
}

The associated manuscript, FailDiag: Evaluating LLMs for Diagnosis of Selected Program Failures, has no DOI assigned yet.

Machine-readable metadata is in CITATION.cff. Corresponding author: Thanh Thi Nguyen tnguyen5@usc.edu.au.

Downloads last month
75