Skip to content

Commit 58225f0

Browse files
celinvaljaisnan
andauthoredJun 4, 2024
Add contest book (rust-lang#6)
Add initial book and a workflow to build / deploy the book. I also created a few other configurations that we were missing. Co-authored-by: Jaisurya Nanduri <[email protected]>
1 parent 3327a8d commit 58225f0

13 files changed

+290
-0
lines changed
 

‎.github/CODEOWNERS

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright Kani Contributors
2+
# SPDX-License-Identifier: Apache-2.0 OR MIT
3+
4+
* @model-checking/kani-devs

‎.github/PULL_REQUEST_TEMPLATE.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
> Please add a description of your PR.
2+
> If this is a solution to an open challenge, please explain your solution.
3+
>
4+
> Don't forget to check our book to ensure your solution satisfy the overall
5+
> requirements as well as the challenge success criteria.
6+
>
7+
8+
Resolves #ISSUE-NUMBER
9+
10+
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

‎.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright Kani Contributors
2+
# SPDX-License-Identifier: Apache-2.0 OR MIT
3+
4+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

‎.github/workflows/book.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright Kani Contributors
2+
# SPDX-License-Identifier: Apache-2.0 OR MIT
3+
name: Build Book
4+
on:
5+
pull_request:
6+
paths:
7+
- 'doc/**'
8+
push:
9+
paths:
10+
- 'doc/**'
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Install mdbook
20+
run: cargo install mdbook --version "^0.4" --locked
21+
22+
- name: Install linkchecker
23+
run: cargo install mdbook-linkcheck "0.7" --locked
24+
25+
- name: Build Documentation
26+
run: mkdbook build doc
27+
28+
- name: Upload book
29+
uses: actions/upload-pages-artifact@v4
30+
with:
31+
path: book/html
32+
retention-days: "2"
33+
34+
deploy:
35+
needs: build
36+
runs-on: ubuntu-latest
37+
if: ${{ github.event_name == 'push' && startsWith('refs/heads/main', github.ref) }}
38+
39+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
40+
permissions:
41+
pages: write # to deploy to Pages
42+
id-token: write # to verify source
43+
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4
52+
53+

‎.gitignore

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright Kani Contributors
2+
# SPDX-License-Identifier: Apache-2.0 OR MIT
3+
4+
## File system
5+
.DS_Store
6+
desktop.ini
7+
8+
## Editor
9+
*.swp
10+
*.swo
11+
Session.vim
12+
.cproject
13+
.idea
14+
*.iml
15+
.vscode
16+
.project
17+
.favorites.json
18+
.settings/
19+
*.orig
20+
*.rej
21+
22+
## Build
23+
/book/
24+
/build/
25+
/target
26+
*.rlib
27+
*.rmeta
28+
*.mir
29+
30+
## Temporary files
31+
*~
32+
\#*
33+
\#*\#
34+
.#*
35+
36+
## Python
37+
__pycache__/
38+
*.py[cod]
39+
*$py.class
40+
41+
## Node
42+
node_modules
43+
package-lock.json
44+
45+
# Tools
46+
## Kani
47+
*.out
48+
49+
50+
# Added by cargo
51+
#
52+
# already existing elements were commented out
53+
54+
#/target

‎doc/book.toml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright Kani Contributors
2+
# SPDX-License-Identifier: Apache-2.0 OR MIT
3+
[book]
4+
title = "Verify Rust Std Lib Contest"
5+
description = "Contest Rules and Challenges"
6+
authors = ["Kani Developers"]
7+
language = "en"
8+
multilingual = false
9+
10+
[build]
11+
build-dir = "../book"
12+
13+
[output.html]
14+
site-url = "/verify-rust-std/"
15+
git-repository-url = "https://github.com/model-checking/verify-rust-std"
16+
edit-url-template = "https://github.com/model-checking/verify-rust-std/edit/main/doc/{path}"
17+
18+
[output.html.playground]
19+
runnable = false
20+
21+
[output.linkcheck]
22+
23+
24+
[rust]
25+
edition = "2021"

‎doc/src/SUMMARY.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Verify Rust Std Lib
2+
3+
[Introduction](intro.md)
4+
5+
- [General Rules](./general-rules.md)
6+
- [Challenge Template](./template.md)
7+
8+
- [Verification Tools](./tools.md)
9+
- [Kani](./tools/kani.md)
10+
11+
12+
---
13+
14+
# Challenges
15+
- [Coming soon](./todo.md)

‎doc/src/general-rules.md

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# General Rules
2+
3+
## Terms / Concepts
4+
5+
**Verification Target:** [Our repository](https://github.com/model-checking/verify-rust-std) is a fork of the original Rust repository,
6+
and we kept a copy of the Rust standard library inside the `library/` folder that shall be used as the verification target for all our challenges.
7+
We will periodically update the `library/` folder to track newer versions of the [official Rust standard library](https://github.com/rust-lang/rust/).
8+
NOTE: This work is not officially affiliated, or endorsed by the Rust project or Rust Foundation.
9+
**Challenges:** Each challenge will be documented in the contest book in the Challenges chapter, and they will have a
10+
tracking issue where participants can add comments and ask clarification questions.
11+
You can find the list of [open challenges here](https://github.com/model-checking/verify-rust-std/labels/Challenge).
12+
13+
**Solutions:** Solutions to a challenge should be submitted as a single Pull Request (PR) to the contest repository.
14+
The solution should run as part of the CI.
15+
See more details about [minimum requirements for each solution](general-rules.md#solution-requirements).
16+
17+
18+
## Basic Workflow
19+
20+
1. A challenge will be published in the contest book with details of the challenge,
21+
and a tracking issue labeled with “Challenge” will be opened, so it can be used for clarifications and questions,
22+
as well as to track the status of the challenge.
23+
2. Participants should create a fork of the contest repository where they will implement their proposed solution.
24+
3. Once they are to submit their solution for analysis, participants should create a PR against the contest repository for analysis.
25+
Please make sure your solution meets [the minimum requirements described here](general-rules.md#solution-requirements).
26+
4. Each contribution will be reviewed on a first come, first served basis.
27+
Acceptance will be based on a unanimous affirmative vote from the review committee.
28+
5. Once approved by the review committee, the change will be merged into the repository.
29+
30+
## Solution Requirements
31+
32+
A proposed solution to a contest will only **be reviewed** if all the minimum requirements below are met:
33+
34+
* Each contribution or attempt should be submitted via a pull request to be analyzed by the committee.
35+
* By submitting the solution, participants confirm that they can use, modify, copy, and redistribute their contribution,
36+
under the terms of their choice.
37+
* The contribution must be automated and should be checked and pass as part of the PR checks.
38+
* All tools used by the solution must be in [the list of accepted tools](tools.md#approved-tools),
39+
and previously integrated in the contest repository.
40+
If that is not the case, please submit a separate [tool application first](todo.md).
41+
* There is no restriction on the number of contributors for a solution.
42+
Make sure you have the rights to submit your solution and that all contributors are properly mentioned.
43+
* The solution cannot impact the runtime logic of the standard library unless the change is proposed and incorporated
44+
into the Rust standard library.
45+
46+
Any exception to these requirements will only be considered if it is specified as part of the acceptance criteria of the
47+
challenged being solved.
48+
49+
## Call for Challenges
50+
51+
The goal of the contest is to enable the verification of the entire Rust standard library.
52+
The type of obstacles users face may depend on which part of the standard library you would like to verify. Thus, our challenges are developed with the target of verifying a specific section of the standard library or strengthening existing verification.
53+
54+
Everyone is welcome to submit new challenge proposals for review by our committee.
55+
Follow the following steps to create a new proposal:
56+
57+
1. Create a tracking issue using the Issue template [Challenge Proposal](todo.md) for your challenge.
58+
2. In your fork of this repository do the following:
59+
1. Copy the template file (`book/src/challenge_template.md`) to `book/src/challenges/<ID_NUMBER>-<challenge-name>.md`.
60+
2. Fill in the details according to the template instructions.
61+
3. Add a link to the new challenge inside `book/src/SUMMARY.md`
62+
4. Submit a pull request.
63+
3. Address any feedback in the pull request.
64+
4. If approved, we will publish your challenge and add the “Challenge” label to the tracking issue.
65+
66+
## Tool Applications
67+
68+
Solutions must be automated using one of the tools previously approved and listed [here](tools.md#approved-tools):
69+
70+
* Any new tool that participants want to enable will require an application using the Issue template [Tool application](todo.md).
71+
* The tool will be analyzed by an independent committee consisting of members from the Rust open-source developers and AWS
72+
* A new tool application should clearly specify the differences to existing techniques and provide sufficient background
73+
of why this is needed.
74+
* The tool application should also include mechanisms to audit its implementation and correctness.
75+
* Once the tool is approved, the participant needs to create a PR that creates a new action that runs the
76+
std library verification using the new tool, as well as an entry to the “Approved Tools” section of this book.
77+
* Once the PR is merged, the tool is considered integrated.
78+
* The contest repository will be updated periodically, which can impact the tool capacity to analyze the new version of the repository.
79+
I.e., the action may no longer pass after an update.
80+
This will not impact the approval status of the tool, however,
81+
new solutions that want to employ the tool may need to ensure the action is passing first.

‎doc/src/intro.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Verify Rust Standard Library Contest
2+
3+
The Verify Rust Standard Library contest is an ongoing contest that targets the verification of the [Rust standard library](https://doc.rust-lang.org/std/). The goal of this contest is to provide automated verification that can be used to verify that a given Rust standard library implementation is safe.
4+
5+
The contest will contain several challenges that can be solved by participants. These challenges can take on one of many forms such as:
6+
7+
1. Contributing to the core mechanism of verifying the rust standard library
8+
2. Creating new techniques to perform scalable verification
9+
3. Apply techniques to verify previously unverified parts of the standard library.
10+
11+
12+
We encourage everyone to watch this repository to be notified of any changes.
13+
14+
In this book you can find more details about the contest such as: General Rules, Challenges, Verification Tools.

‎doc/src/template.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Challenge Template

‎doc/src/todo.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 🚧 Under Construction 🚧
2+
3+
This section is still under construction. Please check it back again soon and we’ll have more details for you.

‎doc/src/tools.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Verification Tools
2+
3+
The verification tool ecosystem for Rust is rapidly growing, and we welcome the usage of different tools to solve our challenges.
4+
In this chapter, you can find a list of tools that have already been approved for new solutions,
5+
what is their CI current status, as well as more details on how to use them.
6+
7+
If the tool you would like to add a new tool to the list of tool applications,
8+
please see the [Tool Application](general-rules.md#tool-applications) section.
9+
10+
## Approved tools:
11+
12+
| Tool | CI Status |
13+
|-----------|-----------|
14+
| Kani | TODO |
15+
16+
17+
18+

‎doc/src/tools/kani.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Kani Rust Verifier

0 commit comments

Comments
 (0)
Please sign in to comment.