Skip to content

Commit 1a817b6

Browse files
committed
Update developer guides and restore VPL profiling support
Document the compiler pipeline, CLI behavior, proof entry points, and manual evaluation workflows. Clarify expected test results and remove unsupported explanations from saved runtime reports.
1 parent 1caa280 commit 1a817b6

35 files changed

Lines changed: 1340 additions & 1254 deletions

File tree

ENVIRONMENT.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
# Development environment
1+
# Development Environment
22

33
The [Dockerfile](Dockerfile) defines the reference build environment. It pins
44
OCaml 4.13.1, Coq 8.13.2, and the OCaml libraries, and rebuilds both Pluto
55
revisions listed in [tools/ci/pluto-baseline.env](tools/ci/pluto-baseline.env).
66
The historical compiler is isolated at `/opt/polcert/pluto-buggy`; ordinary
77
optimization uses `/pluto`.
88

9-
## Interactive development
9+
## Interactive Development
1010

1111
```sh
1212
docker build --target development -t polcert-dev .
1313
docker run --rm -it -v "$PWD":/polcert polcert-dev
1414
```
1515

1616
The bind mount makes edits and build outputs visible in the host checkout.
17+
It also hides the image's source directory, so a new checkout still needs
18+
the build below. Image construction requires network access for the base image,
19+
system packages, opam packages, and pinned Pluto sources.
1720
After mounting a fresh checkout, configure it before building:
1821

1922
```sh
@@ -32,7 +35,12 @@ For a clean rebuild, run `make clean` before `make depend`. Large proof modules
3235
use several GiB of memory; start with two proof jobs. The CI scripts choose
3336
proof and OCaml build parallelism separately according to available memory.
3437

35-
## CI-equivalent validation
38+
After changes to Rocq sources, run `make depend`, rebuild the affected proofs,
39+
and repeat extraction and both executable builds. Old binaries do not reflect
40+
new proofs until extraction and linking finish. Run the relevant
41+
[regressions](doc/TESTING.md) before using the result in an experiment.
42+
43+
## CI-Equivalent Validation
3644

3745
Build the source and run the isolated regression shards:
3846

@@ -46,13 +54,15 @@ gate, extraction, and executable builds. The shard runner then tests those
4654
executables in separate containers. Logs identify each check and its exit
4755
status. See [Testing](doc/TESTING.md) for smaller test selections.
4856

49-
## Native setup
57+
## Native Setup
5058

5159
Install the system and opam dependencies listed in the Dockerfile, including
5260
GLPK, GMP, Eigen, and the pinned Coq/OCaml versions. Build the pinned fixed
5361
[Pluto fork](https://github.com/verif-scop/pluto), with its submodules initialized
54-
and GLPK enabled. Set `POLCERT_PLUTO` and `POLCERT_POLYCC` when those tools are
55-
not installed at the container paths. Historical bug tests additionally need
62+
and GLPK enabled. `POLCERT_PLUTO` selects the optimizer used by the driver;
63+
test and Evaluation runners have their own producer options, including
64+
`--pluto` and `--polycc`. Check the runner's `--help` when using native paths.
65+
Historical bug tests additionally need
5666
the pinned `buggy` checkout and `POLCERT_BUGGY_ROOT`.
5767

5868
Use the same configure and build commands as above. A successful native build

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ documentation: proof-documentation
609609
# Rocq documentation. Keep this set focused on the semantic
610610
# spine; the generated declaration index links into the supporting modules.
611611
PROOF_DOC_FILES = \
612+
polygen/StateTy.v polygen/InstrTy.v polygen/PolIRs.v polygen/Loop.v syntax/SInstr.v \
612613
src/CState.v src/CInstr.v polygen/InstanceListSema.v src/PolyLang.v \
613614
src/ExtractorFrontend.v src/ExtractorFacts.v src/ExtractorCorrect.v \
614615
src/ISSRefinement.v src/ISSBoolChecker.v src/ISSCutSemantics.v src/ISSValidatorCorrect.v \
@@ -618,7 +619,9 @@ PROOF_DOC_FILES = \
618619
src/TilingBandDirectRuntime.v \
619620
polygen/ParallelLoop.v src/ParallelValidator.v src/RawCodegenOrigin.v \
620621
src/ParallelCodegenCore.v src/ParallelCodegenCompatibility.v src/ParallelCodegenCorrect.v \
621-
polygen/LoopUnroll.v driver/VerifiedLoopPostpass.v \
622+
polygen/CodeGen.v polygen/LoopStride.v polygen/LoopUnroll.v driver/VerifiedLoopPostpass.v \
623+
src/LoopJamTrace.v src/LoopJamFusion.v src/LoopJamNative.v src/LoopJamValidator.v \
624+
src/LoopJamLower.v src/LoopJamContext.v src/LoopJamBridge.v \
622625
src/PrepareCodegen.v src/StrengthenDomain.v \
623626
driver/PolOptCorrect.v driver/PolOptBandTiling.v driver/ParallelPolOptCorrect.v \
624627
driver/VerifiedCompilerConfig.v driver/VerifiedParallelCompilerConfig.v \

POLCERT.md

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,65 @@
1-
# polcert
1+
# Standalone Validation with polcert
22

3-
`polcert` checks externally supplied polyhedral transformations without
4-
running loop extraction or code generation. It accepts OpenScop models and
5-
uses the same verified affine and tiling validators as `polopt`.
3+
`polcert` checks supplied polyhedral models without running the complete
4+
loop-to-loop compiler. It uses the affine and tiling validators also used by
5+
`polopt`. Build instructions are in [Environment](ENVIRONMENT.md).
66

7-
## Affine scheduling
7+
## Affine Scheduling
88

99
```sh
1010
./polcert before.scop after.scop
1111
```
1212

13-
The models must describe the supported common instructions, domains, and
14-
accesses. The validator checks whether the changed schedule preserves the
15-
required dependences. This is not a validator for arbitrary C programs.
13+
Supply two OpenScop models with the supported common domains and accesses.
14+
The checker tests whether the new schedule preserves required dependence
15+
orders. It omits instruction bodies and relies on the supplied access
16+
summaries and memory model. Acceptance is consequently a model-level result,
17+
not a proof of arbitrary C-program equivalence.
1618

17-
## Tiling and subsequent scheduling
19+
## Tiling and Phase Composition
1820

1921
```sh
2022
./polcert --kind tiling mid.scop posttile.scop
2123
./polcert before.scop mid.scop posttile.scop
2224
./polcert before.scop mid.scop posttile.scop after.scop
23-
./polcert --second-level-tile --kind tiling mid.scop posttile.scop
2425
```
2526

2627
The three-file form checks affine scheduling followed by tiling. The four-file
27-
form also checks the final affine transformation, as used by diamond tiling
28-
and intra-tile scheduling. Intermediate files describe actual stage results;
29-
their names alone do not establish that they form a valid pipeline.
28+
form adds post-tiling affine validation. Add `--second-level-tile` for the
29+
corresponding two-level layout. These files must represent actual consecutive
30+
stage results; [Pluto interface](doc/PLUTO_INTERFACE.md) explains the exports.
3031

31-
A successful tiling check reports `permutable-band`. Unsupported layouts and
32-
failed band conditions are rejected; solver alarms propagate as failures.
33-
The tiling dispatcher does not fall back to general affine validation.
32+
A runnable positive control is:
3433

35-
The [Pluto interface](doc/PLUTO_INTERFACE.md) describes how to obtain the
36-
corresponding `.beforescheduling.scop`, `.midtransform.scop`,
37-
`.posttile.scop`, and `.afterscheduling.scop` files.
34+
```sh
35+
./polcert --kind tiling \
36+
tools/tiling_routes/fixtures/diamond-tile-example.midtransform.scop \
37+
tools/tiling_routes/fixtures/diamond-tile-example.posttile.scop
38+
```
39+
40+
Expect acceptance through `permutable-band`. Failed recognition, failed band
41+
conditions, or solver alarms do not certify a proposal. Tiling has no fallback
42+
to general affine validation.
3843

39-
## Index-set splitting
44+
## Index-Set Splitting
4045

4146
```sh
4247
./polcert --iss-bridge bridge.txt
4348
./polcert --iss-debug-dumps before.txt after.txt
4449
```
4550

46-
These modes check the imported ISS structure. For an end-to-end ISS
47-
compilation with semantic refinement, use `polopt --iss`; a standalone bridge
48-
check is not itself a loop-to-loop compilation theorem.
51+
These modes check imported partition structure. The
52+
[ISS fixtures](tests/iss-pluto-dumps/README.md) describe the input formats and
53+
positive/negative expectations. Use `polopt --iss` when the desired result is
54+
a compiled loop with an end-to-end refinement theorem.
4955

50-
## Results and scope
56+
## Interpreting Results
5157

52-
Inspect the exit status as well as the validation message. A command may
53-
reject a proposal or fail to construct a supported checking problem; neither
54-
outcome certifies that proposal. Regression tests require the expected stage
55-
and acceptance or rejection, not merely the presence of an output file.
58+
Check both the exit status and diagnostic. Rejection can mean an illegal
59+
proposal, a conservative dependence check, or unsupported input structure.
60+
A solver alarm is a failure to certify, not evidence that the transformation
61+
is safe. Successful standalone checks do not perform extraction or code
62+
generation and cannot establish their guarantees.
5663

57-
Parsing and OpenScop import are engineering interfaces around the extracted
58-
validators. The formalization is parameterized by the instruction semantics;
59-
the executable instantiation and its limitations are described in
60-
[Verified pipeline](doc/VERIFIED_PIPELINE.md).
64+
For compiler-stage contracts and the concrete instruction model, read
65+
[Verified Pipeline](doc/VERIFIED_PIPELINE.md).

0 commit comments

Comments
 (0)