Datasets:
The dataset viewer is not available for this split.
Error code: StreamingRowsError
Exception: FileNotFoundError
Message: datasets/PV-SJTU/PV-Bench@2504377f6e2344ce1176cce2dabef409ef52d8b3/experiments/t1/instruction.md
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/utils.py", line 149, 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 274, in decorator
return func(*args, **kwargs)
File "/src/services/worker/src/worker/utils.py", line 129, 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 544, 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 3074, in __iter__
for key, example in ex_iterable:
^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2588, in __iter__
for key, example in self.ex_iterable:
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 355, in __iter__
for key_example in islice(self.generate_examples_fn(**gen_kwargs), shard_example_idx_start, None):
~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/harbor/harbor.py", line 197, in _generate_examples
with open(instruction_file, encoding="utf-8") as f:
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/streaming.py", line 73, in wrapper
return function(*args, download_config=download_config, **kwargs)
File "/usr/local/lib/python3.14/site-packages/datasets/utils/file_utils.py", line 976, in xopen
file_obj = fs.open(paths[0], mode)
File "/usr/local/lib/python3.14/site-packages/fsspec/spec.py", line 1405, in open
self.open(
~~~~~~~~~^
path,
^^^^^
...<4 lines>...
**kwargs,
^^^^^^^^^
),
^
File "/usr/local/lib/python3.14/site-packages/fsspec/spec.py", line 1417, in open
f = self._open(
path,
...<4 lines>...
**kwargs,
)
File "/usr/local/lib/python3.14/site-packages/huggingface_hub/hf_file_system.py", line 720, in _open
return HfFileSystemFile(self, path, mode=mode, revision=revision, **kwargs)
File "/usr/local/lib/python3.14/site-packages/huggingface_hub/hf_file_system.py", line 1542, in __init__
super().__init__(fs, self.resolved_path.unresolve(), **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/fsspec/spec.py", line 1990, in __init__
self.size = self.details["size"]
^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/fsspec/spec.py", line 2003, in details
self._details = self.fs.info(self.path)
~~~~~~~~~~~~^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/huggingface_hub/hf_file_system.py", line 1268, in info
_raise_file_not_found(path, None)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/huggingface_hub/hf_file_system.py", line 1768, in _raise_file_not_found
raise FileNotFoundError(msg) from err
FileNotFoundError: datasets/PV-SJTU/PV-Bench@2504377f6e2344ce1176cce2dabef409ef52d8b3/experiments/t1/instruction.mdNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
PV-Bench
A benchmark for measuring how well LLMs do program verification β not code generation β on real, human-authored problems.
It has 242 problems. Each one comes with a correct C solution that has been given a formal spec and checked by QCP. The proofs are done in one of two backends, Rocq or Lean 4. All 242 have a Rocq version; 83 also have a Lean one.
The problems are in four groups, all under benchmarks/, next to the build files:
| group | problems | C lines | source |
|---|---|---|---|
benchmarks/Codeforces/ |
147 | 7,692 | competitive-programming problems, grouped into examples_shard<NN>/ slices |
benchmarks/Algorithms/ |
77 | 4,171 | classic algorithms, one directory per algorithm |
benchmarks/Data_structures/ |
10 | 618 | array stack, BIT, three priority-queue interfaces, linked lists and three linked queues |
benchmarks/Engineering/ |
8 | 338 | MiniSat vectors and C string / memory routines |
| total | 242 | 12,819 |
"C lines" counts the unannotated solution.c β the program a model is asked to specify and
verify. They are small by design: a median of 45 lines, 53 on average, from 5 up to 228
(Algorithms/kosaraju). The difficulty is in the property to be proved, not in the size of the
code.
docs/ROCQ_COVERAGE.md and
docs/LEAN_COVERAGE.md break these down by topic, difficulty and tag.
The tool: QCP
QCP verifies annotated C programs using symbolic execution and separation logic. It automatically discharges verification conditions where possible and exports the remaining obligations to Rocq or Lean 4. This workflow motivates PV-Bench's three tasks: writing specifications, supplying annotations, and completing residual proofs.
Verification combines QCP's automatic reasoning with proof-assistant checking. The released automatic results use Admitted / sorry without exported proof certificates; they are not independently rechecked by the proof-assistant kernel. See Verification model for details.
The three tasks
Every problem starts from one fully checked reference version. We cut three tasks out of it. Each answer is checked by the proof assistant β no test suite, no mutants, nothing is run.
| Stage | Given | Model produces | Oracle |
|---|---|---|---|
| T1 β Spec | problem + the whole correct program | the entry-point contract (Require, Ensure) |
prove the contract means the same as the gold one |
| T2 β Annotate | + the gold spec | loop invariants, helper contracts, asserts, ghost bindings | QCP proves all VCs, with the code and spec left byte-for-byte unchanged |
| T3 β Prove | + the gold annotations | the manual proofs that are left | the backend closes every manual goal, no admit/Axiom |
The harnesses that run models on these tasks are in experiments/,
one per task. Each prepares an isolated workspace holding only that task's inputs, runs a
codex or claude agent in a sandbox, records what the agent did, and checks the answer with
the oracle above.
Layout of each problem
The problem statement, its metadata and the reference C solution do not depend on a backend,
so they stay at the top level. Everything that does depend on one goes in a rocq/ or
lean/ subdirectory β including the annotated C, because the annotations are written in that
backend's assertion language.
benchmarks/Codeforces/examples_shard01/P001_1031A_golden_plate/
benchmarks/Algorithms/bubble_sort/
βββ problem.md # NL statement
βββ manifest.json # provenance + stratification only
βββ solution.c # correct reference C solution, unannotated (given at T1)
βββ rocq/
β βββ solution_spec.c # + the entry-point contract (T1 target)
β βββ spec_lib.v # its Rocq defs: Pre, Spec, vocabulary (T1 target)
β βββ solution_annotated.c# + all verification annotations (T2 target)
β βββ [helper_lib.v] # annotation-support defs, when needed (T2 target)
β βββ groundtruth/ # the VCs QCP emits, plus a checked proof (T3 target)
β # that closes them
βββ [lean/] # same five entries, Lean 4 instead of Rocq
βββ solution_spec.c
βββ spec_lib.lean
βββ solution_annotated.c
βββ [helper_lib.lean]
βββ groundtruth/
rocq/ is present for all 242 problems; lean/ for 83 of them β 45 Algorithms,
34 Codeforces (14 in examples_shard00, 20 in examples_shard01), 3 Data_structures and
1 Engineering. The .lean libraries mirror the corresponding .v files; cases without
private definitions import shared libraries directly from the C annotations.
What groundtruth/ is for
Running QCP on solution_annotated.c emits the verification conditions. groundtruth/ holds
them, together with one proof script that closes them all. Those proofs were written by an
LLM and then checked by the proof assistant, so what is committed is machine-verified either
way.
| file | written by | role |
|---|---|---|
<case>_goal.v |
QCP | the VCs β what T3 has to prove |
<case>_proof_auto.v |
QCP | the part QCP discharges by itself |
<case>_goal_check.v |
QCP | the oracle: it compiles only if every goal is closed |
<case>_proof_manual.v |
by LLM | the proofs QCP could not find β T3's reference answer |
proof_lib.v |
by LLM | supporting lemmas the manual proof leans on |
So the reference proof is not the criterion; goal_check is. A model's T3 answer replaces
<case>_proof_manual.v and is judged by whether goal_check still compiles β the committed
script only shows that at least one machine-checked proof exists, so the goal is known to be
provable and the case really does verify.
Build products (.vo, .glob, .olean, β¦) stay out of the repository. To regenerate the
QCP-written files, see Regenerating groundtruth.
Setup
All builds run from benchmarks/, which holds Makefile, CONFIGURE.example,
lakefile.lean and lean-toolchain.
Both backends load QCP's libraries from a checkout whose location differs per machine, so
the resolved configuration (_CoqProject, CONFIGURE, lake-manifest.json) is untracked.
The two backends are independent β set up only the one you need.
Where the QCP libraries come from
The problems are here; the tool that checks them is not. QCP's libraries and its symexec
binary are distributed from GitHub:
https://github.com/QinxiangCao/PV-bench
Its with-backend branch carries a backend/ directory with the smallest set of QCP
libraries these problems need β 261 .v files for Rocq and 11 Lake packages for Lean,
copied verbatim from the QCP repository. Fetch it once, point this checkout at it, and
everything below runs from here:
git clone -b with-backend https://github.com/QinxiangCao/PV-bench ../qcp-backend
(cd ../qcp-backend && tools/fetch-backend-binaries.sh) # symexec, StrategyCheck
(cd ../qcp-backend/backend/Rocq && make depend && make -j6) # build the libraries once
cd benchmarks
cp CONFIGURE.example CONFIGURE # set QCP_ROCQ = ../../qcp-backend/backend/Rocq
make depend && make -j6
See backend/README.md in that clone for the Lean equivalent and for how the directory is
kept in sync with upstream. If you already have a QCP checkout of your own, point
QCP_ROCQ at it instead, as described below.
Rocq
Use Coq 8.20.1. Put the path to QCP's Rocq/ directory in a local CONFIGURE;
make reads it and passes the library mappings to coqc directly:
cd benchmarks
cp CONFIGURE.example CONFIGURE # then set QCP_ROCQ to your QCP checkout's Rocq/
make -j6 # bounded parallelism; never a bare `make -j`
make clean removes the build products. To check a single file:
make Algorithms/bubble_sort/rocq/helper_lib.vo
make _CoqProject writes the mappings out for your editor's Rocq plugin; nothing
in the build reads that file.
Lean
Use Lean 4.25.2. Point qcpLean at QCP's Lean/ directory (the one holding
SeparationLogic/, auxlibs/, examples/, β¦):
cd benchmarks
QCP_LEAN=/absolute/path/to/QCP/Lean
lake -KqcpLean="$QCP_LEAN" update
lake exe cache get # prebuilt Mathlib oleans β see below
lake -KqcpLean="$QCP_LEAN" build
Run lake exe cache get before the first build. QCP's flocq and unifysl packages
depend on Mathlib, which update fetches as source (~650 MB under .lake/packages/);
without the cache, Lake compiles Mathlib from scratch, which takes hours instead of seconds.
Lake loads the libraries through Lean/examples and compiles the case modules under
Algorithms/, Codeforces/, Data_structures/ and Engineering/. The QCP library must
provide AUXLib.Arithmetic, AUXLib.Sorting, AUXLib.NumberTheory, AUXLib.Prime and
AUXLib.ZParity, together with their list, separation-logic and MaxMinLib dependencies.
Run update again after changing the library path.
To clean, or to check one file:
lake -KqcpLean="$QCP_LEAN" clean
lake -KqcpLean="$QCP_LEAN" lean path/to/file.lean
If a run reports the qcpLean option as unset even though you passed -KqcpLean=, Lake is
reusing a cached lakefile configuration; remove .lake/config and retry.
Either backend builds the specification and helper libraries only; neither runs QCP on the C programs nor completes their correctness proofs.
Regenerating groundtruth
tools/ drives QCP's symexec over the annotated C and rewrites groundtruth/. It needs
the QCP backend (binaries plus the shared .strategies/.h that symexec reads), which this
repository does not ship β point QCP_BACKEND at one, or work from the GitHub repository's
with-backend branch, where the scripts find ./backend on their own.
export QCP_BACKEND=/path/to/backend
tools/gen-rocq.sh # every problem
tools/gen-rocq.sh benchmarks/Algorithms/bubble_sort # one problem
tools/gen-lean.sh benchmarks/Algorithms/bubble_sort # the Lean side
OUT_DIR=/tmp/gt tools/gen-rocq.sh <problem> # write elsewhere, to diff
tools/check-rocq.sh # regenerate into a temp dir and diff; touches nothing
tools/check-rocq.sh benchmarks/Codeforces/examples_shard00
A <case>_proof_manual.v that already holds real proofs (Qed./Defined.) is left alone;
pass --force-manual to reset it to the generator's template. proof_lib.v is not a
generator output and is never touched.
Regenerating is reproducible: for every problem in the benchmark, the goal, proof_auto and
goal_check files come back byte-for-byte identical to the committed ones. check-rocq.sh
verifies exactly that and exits non-zero on any difference; run it after editing an
annotated source, a spec, a helper library or a strategy file, since those commits change
the goals without touching any .v file.
Contributors
Kan Liu, Qi Liu, Zitong Ni, Lixiang Wang, Shushu Wu, Xiwei Wu, Lihan Xie
- Downloads last month
- 831