How maheshgouru/gpuverify-extended works
Project Type and Purpose
• GPUVerify is a command‐line static analyser for GPU kernels (OpenCL/CUDA).
• It ingests kernel source, generates verification conditions (VCs), invokes Boogie+SMT solvers, then post‐processes results to report races or divergence issues.
File Structure
Top‐level components:
– CLI wrappers & orchestrators:
• GPUVerify.py / gpuverify (Python)
• gputester.py, GPUVerify.bat, gvfindtools.py, etc.
– Core analysis libraries & executables (all C#/.NET):
• VC generator: GPUVerifyVCGen/
• Boogie driver: GPUVerifyBoogieDriver/
• Interpreter (“cruncher”): GPUVerifyCruncher/
• Shared library: GPUVerifyLib/
– Python support modules: GPUVerifyScript/
– External tool binaries: BoogieBinaries/, plus CI scripts to download Z3/CVC4.
– Testsuite: testsuite/CUDA/, testsuite/OpenCL/
– Documentation, CI workflows (.github/workflows), utilities (utils/GPUVerifyRise4Fun/).
Key Architecture Insights from README
• Static analysis pipeline: source → VCGen → Boogie → SMT solvers → cruncher → report.
• Sphinx‐based documentation.
• CI integrates multi‐platform builds, solver downloads, and test execution.
Main Components
a. CLI Layer (Python)
– GPUVerify.py / gpuverify entry‐point
– Argument parser & JSON loader (GPUVerifyScript/)
b. Analysis Pipeline (C# .NET executables)
– VC Generator (GPUVerifyVCGen)
– Boogie Driver (GPUVerifyBoogieDriver)
– Cruncher / Interpreter (GPUVerifyCruncher)
– Shared analysis routines (GPUVerifyLib)
c. External Tools
– Boogie engine (BoogieBinaries)
– SMT solvers (Z3, CVC4, …)
d. Test Harness & Utilities
– Test runner (gputester.py) → invokes CLI
– Rise4Fun webservice (utils/GPUVerifyRise4Fun)
Relationships & Data Flows
• The CLI reads kernel source and flags → calls VCGen.exe → produces .bpl (Boogie) file
• BoogieDriver.exe invokes Boogie on .bpl → passes queries to SMT solvers → collects raw solver output
• Cruncher.exe interprets Boogie traces & error models → generates human‐readable reports / JSON
• GPUVerify.py assembles results, formats output, and returns exit codes.
• Testsuite scripts drive this CLI sequence for each test .cu/.cl file.
• CI workflows trigger builds, downloads solvers, runs tests, and publishes badges.
Architectural Patterns & Design Principles
• Modular pipeline: each stage is a separate executable / library.
• Language separation: Python for orchestration, C# for heavy analysis, external tools for solving.
• Plugin‐style extensibility: support for new SMT backends, new analysis rules in VCGen.
• Clear separation of concerns: parsing/configuration vs. VC generation vs. solving vs. post‐processing.
Technologies & Frameworks
• Python 3.x for CLI and scripting
• .NET Framework / .NET Core for C# executables (projects under *.csproj)
• Boogie verification framework
• SMT solvers: Z3, CVC4
• Sphinx for documentation
• GitHub Actions for CI
Essential Elements to Capture
– Clear component boundaries (CLI, VCGen, BoogieDriver, Cruncher, Solvers)
– Data flow for kernel → verification → report
– External dependencies (Boogie, Z3/CVC4)
– Language/runtime pivots (Python vs. .NET)