Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    TypeError
Message:      Couldn't cast array of type
struct<ast_schema_drift: int64, exact_replay_match: int64, function_or_label_mismatch: int64, patch_lines_covered: int64, patch_lines_total: int64, published_records: int64>
to
{'ast_schema_drift': Value('int64'), 'exact_replay_match': Value('int64'), 'patch_lines_covered': Value('int64'), 'patch_lines_total': Value('int64'), 'published_records': Value('int64'), 'source_content_mismatch': Value('int64')}
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 147, in get_rows_or_raise
                  return get_rows(
                      dataset=dataset,
                  ...<4 lines>...
                      column_names=column_names,
                  )
                File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 127, in get_rows
                  rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
                File "/src/services/worker/src/worker/utils.py", line 478, in safe_iter
                  yield from ds.decode(False) if ds.features else ds
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2818, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2355, in __iter__
                  for key, pa_table in self._iter_arrow():
                                       ~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2380, in _iter_arrow
                  for key, pa_table in self.ex_iterable._iter_arrow():
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 536, in _iter_arrow
                  for key, pa_table in iterator:
                                       ^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 419, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2369, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2303, in cast_table_to_schema
                  cast_array_to_feature(
                  ~~~~~~~~~~~~~~~~~~~~~^
                      table[name] if name in table_column_names else pa.array([None] * len(table), type=schema.field(name).type),
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      feature,
                      ^^^^^^^^
                  )
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1852, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                                           ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2149, in cast_array_to_feature
                  raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
              TypeError: Couldn't cast array of type
              struct<ast_schema_drift: int64, exact_replay_match: int64, function_or_label_mismatch: int64, patch_lines_covered: int64, patch_lines_total: int64, published_records: int64>
              to
              {'ast_schema_drift': Value('int64'), 'exact_replay_match': Value('int64'), 'patch_lines_covered': Value('int64'), 'patch_lines_total': Value('int64'), 'published_records': Value('int64'), 'source_content_mismatch': Value('int64')}

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

HAM-Net datasets

This repository contains the JSONL datasets used by HAM-Net for mixed-project defect prediction. The final artifacts use one record per sample. For MIL datasets, a record is a bag and functions contains the function-level AST subgraphs; label is the bag label and project identifies the source project.

Original data sources

The published JSONL files are derived from the following public datasets. The source granularity and the granularity used by HAM-Net are listed separately because several sources are transformed into MIL bags during preprocessing.

Dataset Original source Original annotations / content HAM-Net representation
devign_c Devign repository Function-level vulnerability annotations from FFmpeg and QEMU C/C++ projects Function-level C/C++ samples with AST graphs and binary labels
promise_java PROMISE repository Classic Java class-level defect metric datasets with a bug count/label Java class-level MIL bags; bug > 0 becomes the bag label
bigvul_c MSR 2020 Big-Vul dataset Large-scale C/C++ vulnerability records containing code changes and CVE-related metadata C/C++ file-level MIL bags; buggy-side patch lines identify function-level labels
defactors_python Defactors Line-level defect annotations from multiple Python projects Python file-level MIL bags; functions overlapping defect lines receive func_label=1
bugsinpy_python BugsInPy Reproducible defects, buggy/fixed commits, and patch information from Python projects Python file-level MIL bags constructed from buggy files and same-project negative files

Devign remains in its original function-level format, whereas PROMISE, Big-Vul, Defactors, and BugsInPy are converted into class-level or file-level bags for multiple-instance learning. The dataset sources provide the original labels or patch/line annotations; the exact sampling, parsing, AST normalization, and bag construction rules are described below.

Dataset summary

Percentages are computed from the final JSONL files. P50/P90/P99 are the numbers of functions per bag. mixed positive bags means positive bags containing both at least one func_label=1 function and at least one func_label=0 function. positive functions is computed only for datasets that retain function-level labels.

Dataset Language / granularity Bags or samples Positive / negative Functions per bag P50 / P90 / P99 Mixed positive bags Positive functions
promise_java Java class-level MIL bag 1,695 bags 647 / 1,048 (38.17% / 61.83%) 8 / 26 / 94.12 N/A: no function-level labels N/A
defactors_python Python file-level MIL bag 1,700 bags 873 / 827 (51.35% / 48.65%) 18 / 86 / 227.06 808 / 873 (92.55%) 3,190 / 58,028 (5.50%)
bugsinpy_python Python file-level MIL bag 2,416 bags 525 / 1,891 (21.73% / 78.27%) 9 / 79 / 205 503 / 525 (95.81%) 1,076 / 63,818 (1.69%)
bigvul_c C/C++ file-level MIL bag 1,700 bags 733 / 967 (43.12% / 56.88%) 16 / 64 / 279.01 733 / 733 (100.00%) 1,270 / 51,668 (2.46%)
devign_c C/C++ function-level sample 27,318 samples 12,460 / 14,858 (45.61% / 54.39%) N/A: function-level schema N/A N/A

promise_java uses bug > 0 as its class/bag label and therefore does not claim function-level defect localization ground truth. devign_c is retained in its original function-level schema and does not contain a functions bag list.

Defect-line coverage and construction audit

The following audit distinguishes metrics that are recoverable from the final JSONL from metrics that require the original patch/line annotations. Function labels in the final MIL files are derived from the corresponding defect lines, but the final records do not retain function start/end line spans or the complete raw line sets.

Dataset Defect-line coverage by parsed functions Final AST/function audit Construction-time failures/deletions
defactors_python 21,171 / 28,799 defect lines covered (73.51%); 7,628 uncovered 0 empty bags; 0 functions with empty AST/edge lists The final rebuild processed 1,700 reference bags; the final JSONL does not preserve a separate count of discarded raw rows.
bugsinpy_python Final JSONL alone is insufficient; source replay covers 6,692 / 7,919 patch lines (84.51%) 0 empty bags; 0 functions with empty AST/edge lists See the source-replay report; the final JSONL does not preserve all historical per-stage deletion counters.
bigvul_c Final JSONL alone is insufficient; source replay covers 5,017 / 5,879 buggy-side patch lines (85.34%) 0 empty bags; 0 functions with empty AST/edge lists See the source-replay report; the final JSONL does not preserve all historical per-stage deletion counters.
promise_java Not applicable: the source label is a class-level bug value, not a retained defect-line annotation 0 empty bags; 0 functions with empty AST/edge lists The final JSONL does not preserve per-stage parse-failure/deletion counters.
devign_c Not applicable in this artifact: function-level labels are retained, but no line-span annotation is stored Function-level records contain non-empty AST/edge lists The final JSONL does not preserve per-stage parse-failure/deletion counters.

For all five final artifacts, the reported final-audit counts were obtained by scanning the JSONL itself. “Not recoverable” means that the information is not encoded in the published artifact; it is not an assertion that the corresponding builder did not perform line coverage or parsing checks.

Source replay audits

The following audit reports replay the published records from the original local sources without rewriting the JSONL files. PROMISE replays all source CSV rows. BugsInPy and Big-Vul replay each published record from its stored project, patch/CVE identifier, file path, and Git snapshot. The reports contain the input JSONL SHA-256, counters, bounded mismatch examples, and patch-line coverage where applicable.

Dataset Audit scope Current result Report
promise_java All 13,010 CSV rows and all 1,695 published bags Pass: 1,695 / 1,695 exact source/function/AST matches; 8,612 valid source candidates, of which 6,917 were not selected into the fixed final sample set promise_java_source_replay_audit.json
bugsinpy_python 2,416 published bags against BugsInPy metadata, patches, and buggy Git snapshots Source/commit/bag-label replay succeeds; 37 function-or-label mismatches and 745 AST-schema drifts are retained as historical reproducibility findings bugsinpy_python_source_replay_audit.json
bigvul_c 1,700 published bags against the MSR CSV, patches, and local Git snapshots One source-content mismatch and 638 AST-schema drifts; all remaining source/function/label replays match bigvul_c_source_replay_audit.json

ast_schema_drift means the function source and label replayed successfully but the AST graph generated by the current normalization implementation differs from the published graph. It is reported separately from source, function, or label mismatches. The reports were generated from the HAM-Net preprocessing repository (which contains the raw-source builders and Git caches) with:

python scripts/replay_source_audits.py promise \
  --dataset-path datasets/promise_java.jsonl \
  --output datasets/audits/promise_java_source_replay_audit.json

python scripts/replay_source_audits.py bugsinpy \
  --dataset-path datasets/bugsinpy_python.jsonl \
  --output datasets/audits/bugsinpy_python_source_replay_audit.json

python scripts/replay_source_audits.py bigvul \
  --dataset-path datasets/bigvul_c.jsonl \
  --output datasets/audits/bigvul_c_source_replay_audit.json

Bag construction policy

  • promise_java: one Java class per bag; all parseable methods and constructors are retained in the published JSONL, subject to the minimum-function filter.
  • defactors_python: one Python file per bag; all parseable functions are retained in the published JSONL, and func_label marks functions overlapping Defactors defect lines.
  • bugsinpy_python: one buggy Python file or sampled negative Python file per bag; func_label marks functions overlapping buggy-side patch lines.
  • bigvul_c: one C/C++ file per bag; func_label marks functions overlapping buggy-side patch lines.
  • devign_c: function-level records rather than MIL bags.

The published Promise and Defactors files are built without a construction-time maximum function cap. Training-time function selection is handled separately by the label-agnostic ast_topk_v1 cap files in the HAM-Net experiment repository (K=16, top_m=12).

Files

  • promise_java.jsonl
  • defactors_python.jsonl
  • bugsinpy_python.jsonl
  • bigvul_c.jsonl
  • devign_c.jsonl

The JSONL files are UTF-8 encoded. Each line is an independent JSON record.

Downloads last month
25