Repository navigation
Add kani-slow feature gate and lower CI parallelism to 2 #2751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d11b7e0
c57b2f6
c8040bc
5764b94
0c77ab2
c92fc41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -893,6 +893,9 @@ mod verification { | |
| } | ||
|
|
||
| /// Prove the configurable plain-text field wrapper path never panics. | ||
| /// | ||
| /// Gated behind `kani-slow`: [u8; 48] symbolic + unwind 52 takes >60s. | ||
| #[cfg(feature = "kani-slow")] | ||
| #[kani::proof] | ||
| #[kani::unwind(52)] | ||
| #[kani::solver(kissat)] | ||
|
|
@@ -1128,6 +1131,9 @@ mod verification { | |
| /// - verify_write_json_line_no_prefix_quote_escape | ||
| /// - verify_write_json_line_no_prefix_backslash_escape | ||
| /// - verify_write_json_line_no_prefix_control_escape | ||
| /// | ||
| /// Gated behind `kani-slow`: unwind 52 through JSON escaping takes >30s. | ||
| #[cfg(feature = "kani-slow")] | ||
| #[kani::proof] | ||
| #[kani::unwind(52)] | ||
| fn verify_write_json_line_parametric() { | ||
|
Comment on lines
+1134
to
1139
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: wc -l crates/ffwd-core/src/cri.rsRepository: strawgate/fastforward Length of output: 98 🏁 Script executed: sed -n '1130,1145p' crates/ffwd-core/src/cri.rsRepository: strawgate/fastforward Length of output: 733 🏁 Script executed: sed -n '1232,1255p' crates/ffwd-core/src/cri.rsRepository: strawgate/fastforward Length of output: 1156 Add Both 🤖 Prompt for AI Agents |
||
|
|
@@ -1228,19 +1234,24 @@ mod verification { | |
| } | ||
|
|
||
| /// Oracle equivalence: `json_escape_bytes` matches `ffwd_kani::bytes::json_escape_oracle` | ||
| /// for all byte-slice inputs of length at most 16. | ||
| /// for all byte-slice inputs of length at most 8. | ||
| /// | ||
| /// # Oracle Design Note | ||
| /// The oracle is a golden copy (see `ffwd_kani::bytes::json_escape_oracle` docs). | ||
| /// This proof provides no-panic and output-bound guarantees, but would not detect | ||
| /// shared logic bugs in both implementations. | ||
| /// Bounded to 8 bytes (from 16) to keep solver under 30s. Each byte can | ||
| /// expand to 6 chars (\uXXXX), so worst case = 48 output bytes. | ||
| /// | ||
| /// Gated behind `kani-slow`: [u8; 8] + unwind 50 through escape logic ~30s. | ||
| #[cfg(feature = "kani-slow")] | ||
| #[kani::proof] | ||
| #[kani::unwind(100)] | ||
| #[kani::unwind(50)] | ||
| pub(super) fn verify_json_escape_bytes_vs_oracle() { | ||
| let src: [u8; 16] = kani::any(); | ||
| let len: usize = kani::any_where(|&l| l <= 16); | ||
| let src: [u8; 8] = kani::any(); | ||
| let len: usize = kani::any_where(|&l| l <= 8); | ||
|
|
||
| let mut prod_dst = Vec::with_capacity(16 * 6); | ||
| let mut prod_dst = Vec::with_capacity(8 * 6); | ||
| let ora_result = json_escape_oracle(&src[..len]); | ||
| json_escape_bytes(&src[..len], &mut prod_dst); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default PRs stop compiling the slow proof set.
With
--features kani-slowonly on push-to-main orci:full, edits under the new#[cfg(feature = "kani-slow")]harnesses never typecheck on ordinary PRs. A helper rename or signature drift in those proofs now lands as a post-merge failure onmain. Please auto-enable the feature when a PR touches one of the slow-proof files, even without the label.Suggested workflow shape
jobs: changes: name: Detect changed paths runs-on: ubuntu-latest outputs: kani_required: ${{ steps.filter.outputs.kani_required }} + kani_slow_required: ${{ steps.filter.outputs.kani_slow_required }} tla: ${{ steps.filter.outputs.tla }} frontend: ${{ steps.filter.outputs.frontend }} miri: ${{ steps.filter.outputs.miri }} rust: ${{ steps.filter.outputs.rust }} steps: - uses: actions/checkout@v6 - uses: dorny/paths-filter@f3ceefdc7ef57bc2d8560787d4b6c33e44044cec id: filter with: filters: | kani_required: - 'crates/ffwd-kani/**' - 'crates/ffwd-core/**' - 'crates/ffwd-arrow/**' - 'crates/ffwd-types/**' - 'crates/ffwd-io/**' - 'crates/ffwd-output/**' - 'crates/ffwd-runtime/**' - 'crates/ffwd-diagnostics/**' - 'crates/ffwd/**' - 'Cargo.toml' - 'Cargo.lock' - 'dev-docs/verification/kani-boundary-contract.toml' - 'scripts/verify_kani_boundary_contract.py' - '.github/workflows/ci.yml' + kani_slow_required: + - 'crates/ffwd-core/src/structural.rs' + - 'crates/ffwd-core/src/structural_iter.rs' + - 'crates/ffwd-core/src/json_scanner.rs' + - 'crates/ffwd-core/src/framer.rs' + - 'crates/ffwd-kani/src/bytes.rs' kani-core: ... with: args: >- --solver kissat --jobs 2 --output-format terse -Z function-contracts -Z mem-predicates -Z stubbing -p ffwd-kani -p ffwd-core - ${{ (github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:full')) && '--features kani-slow' || '' }} + ${{ (github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:full') || needs.changes.outputs.kani_slow_required == 'true') && '--features kani-slow' || '' }}Also applies to: 420-432
🤖 Prompt for AI Agents