Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/lydite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ name: lydite
# linted, and unit-tested by ci.yml; this workflow runs lydite's own gates.

on:
# Queue drafts run these gates on combined changes. Ordinary PRs skip all
# jobs; the weekly run catches drift between merges.
# Queue drafts run editor/replay checks on combined changes. Ordinary PRs
# skip all jobs; the expensive Veryl proof gates run only weekly or manually.
push:
branches: [develop]
paths:
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
retention-days: 14

veryl-fv:
if: github.event_name != 'pull_request' || startsWith(github.head_ref, 'mergify/merge-queue/')
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-26.04
timeout-minutes: 30
steps:
Expand All @@ -147,7 +147,7 @@ jobs:
retention-days: 14

veryl-proof-corpus:
if: github.event_name != 'pull_request' || startsWith(github.head_ref, 'mergify/merge-queue/')
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-26.04
# Cold builds plus the sequential proof/mutation gates can exceed one hour.
timeout-minutes: 120
Expand Down
11 changes: 7 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,12 @@ This does not prioritize jobs inside GitHub Actions or preempt occupied runners.
See [Mergify priorities](https://docs.mergify.com/merge-queue/priority/) and
[Mergify queue modes](https://docs.mergify.com/merge-queue/queue-modes/).

The separate lydite proof/editor gates run on queue drafts rather than ordinary
PRs; develop pushes, weekly runs, and manual dispatch remain enabled.
The `Queue validation` merge condition requires those pre-merge checks to pass;
The separate lydite documentation, editor, and Celox replay checks run on queue
drafts rather than ordinary PRs; develop pushes, weekly runs, and manual dispatch
remain enabled. The expensive `veryl-fv` and `veryl-proof-corpus` jobs run only
weekly (Monday at 03:41 UTC / 12:41 JST) or on manual dispatch, never on queue
drafts or develop pushes. These separate lydite checks are not merge requirements.
The `Queue validation` merge condition requires the selected checks in `ci.yml` to pass;
ordinary PR checks cannot satisfy it. The `ci:full` label opts a PR into the
same coverage on its next push. Unrelated paths may still skip jobs.

Expand Down Expand Up @@ -208,7 +211,7 @@ uses the finer behavior-based matrix above.
| Daily at 02:17 UTC (11:17 JST) | `codspeed.yml` measures compile time on the default branch using CPU simulation. Execution failures and CodSpeed performance-check failures open or update a branch issue; the next healthy run closes it. Manual dispatch supports branch measurements. PRs, merge groups, and pushes do not run CodSpeed. |
| Daily at 02:37 UTC (11:37 JST) | `heliodor-bench.yml` runs the complete master Linux suite on x86-64 and AArch64. Explicit manual selections retain focused suite runs and ARM64 profiling. PRs run only the benchmark tooling tests when those files change. |
| Every full CI run | Run every shared Veryl and SystemVerilog case against both Verilator and Icarus, with locked Nix tools. Run the live adapter tests normally marked ignored because they need external tools. Preserve reports and per-case diagnostics as artifacts for 14 days, including on failure; matrix failures do not cancel the other comparisons. |
| Weekly, and on pull requests with relevant changes | Existing `lydite.yml` proof, conformance, editor, and mutation gates. |
| Weekly Monday at 03:41 UTC (12:41 JST), or manual dispatch | All `lydite.yml` checks, including Veryl formal verification and proof/mutation corpus gates. The two Veryl jobs run only at this cadence; documentation, editor, and Celox replay checks also run on queue drafts and develop pushes with relevant changes. |
| On demand | Dispatch `ci.yml` on the desired branch to run full CI and external comparisons, regardless of its diff. |
| Pull requests that cut a release | A `master` pull request or legacy merge group whose diff changes `.release-please-manifest.json` (only the release pull request does there; syncing it into `develop` is not a release) runs full CI and the external comparisons. `Rust Test & NAPI Build` then requires the comparisons to pass, so a release cannot merge after only change-based checks. Daily and manual full runs do not gate on the comparisons; their failures reach the full CI issue below. A `master` pull request or legacy merge group whose diff cannot be determined is treated the same way. |

Expand Down
60 changes: 32 additions & 28 deletions lydite/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
# lydite

Rustで実装したハードウェア状態対応チェッカー。仕様と実装のreset・遷移・bindingを検査し、commit時の仕様ステップと、それ以外のstutterを対応づけます。入力は `.lyd` または宣言的JSONです。
A hardware refinement checker written in Rust. It checks the reset, transitions and
bindings of an implementation against a specification, matching each implementation
commit to one specification step and everything else to a stutter. Input is `.lyd`
or declarative JSON.

## はじめに
## Getting started

リポジトリの Rust ツールチェーン(`rust-toolchain.toml`)と Python 3.12 を使用します。既定のsolver経路にはZ3が必要です。有限Bool/BV経路は `LYDITE_SOLVER=finite` で選択し、外部solverへfallbackしません。
Use the repository Rust toolchain (`rust-toolchain.toml`) and Python 3.12. The default
solver route needs Z3; `LYDITE_SOLVER=finite` selects the finite Bool/BV route, which
never falls back to an external solver.

```sh
cargo build --release --locked
# 構文・名前・型だけを検査(証明ではありません)
# Check syntax, names and types only (not a proof)
../target/release/lydite audit/lemma_candidates/counter.lyd --check --out /tmp/lydite-check
# 小さな例を検証。出力先には新しいディレクトリを指定してください
# Verify a small example; --out must be a new directory
LYDITE_SOLVER=finite ../target/release/lydite audit/lemma_candidates/counter.lyd --out /tmp/lydite-counter
```

## ドキュメント
## Documentation

| 目的 | 参照先 |
| Topic | See |
|---|---|
| VS Codeで編集・補題の明示的な検査 | [Editor / LSP](docs/usage.md#editor-and-language-server) |
| 実行方法、終了コード、開発・CIチェック | [使い方](docs/usage.md) |
| `.lyd` の記法とJSONへの対応 | [言語](docs/language.md)、[JSON v2](docs/schema.md) |
| 関係仕様と再利用可能なモジュール | [v3仕様](docs/specifications.md)、[v4 scoped仕様](docs/scoped-specifications.md)、[expectationとtrace](docs/expectations.md) |
| 受理した要求の条件付き応答期限 | [v3/v4 bounded response](docs/specifications.md#conditional-bounded-response) |
| プログラムの不変条件・停止性 | [program契約](docs/program-contracts.md) |
| 補題を `.lyd` で書き、検査して使う | [補題](docs/lemmas.md) |
| 自動証明探索、分割、予算 | [証明エンジン](docs/automatic-proofs.md) |
| 何を証明し、何を信頼しているか | [信頼境界](docs/trust.md) |
| CPU例と現在のRV32I対象 | [小さなCPUモデル](docs/models.md)、[RV32I](docs/rv32i.md)、[メモリ合成](docs/memory-composition.md) |
| 再現テストと保存証跡 | [検査・証跡の入口](audit/README.md) |
| FPGA計測の再現と制限 | [合成・配置配線](https://github.com/tignear/hwverify/blob/ae8f84cca8859097ac2b0a7a4f6e311355c2b48d/synthesis/README.md) |

## 現在の検証範囲

- 選択した4段RV32I実装は、手動補題を含む経路で **436/436の保存条件と7個のglobal義務**、4/16/64語メモリとの合成を検査します。元の単一queryはUnknownのままです。
- 補題を与えない自動経路は **431/436**。5個のUnknownを含むため、全体の証明成功とは扱いません。
- Celox の再利用可能なVeryl テストスイート737件を証明付きで実行し、**713件通過+24件の記録済み例外**(Veryl の言語制約6件、証明バックエンド未対応のテストベンチ12件、Celox 自身も ignore している既知の失敗5件、Celox が Unsupported として拒否する構文1件)を CI の coverage contract としています。全737件成功という意味ではありません。
- `.lyd` の補題も自動探索も同じ型付き候補APIを使います。候補や保存済みレポートは証明ではなく、現在のqueryに対する新しい検査が必要です。

実際のcheckoutの合否は[CI](../.github/workflows/lydite.yml)と新しい実行結果で確認してください。過去の集計やハッシュは現在の証明を代替しません。Rustの変換・義務生成・カーネル・選択したsolverを信頼しており、処理系全体の形式的な正しさは証明していません。
| Running, exit codes, development and CI checks | [Usage](docs/usage.md), [Editor / LSP](docs/usage.md#editor-and-language-server) |
| `.lyd` syntax and its JSON mapping | [Language](docs/language.md), [JSON v2](docs/schema.md) |
| Relational and scoped specifications | [v3](docs/specifications.md), [v4 scoped](docs/scoped-specifications.md), [Expectations and traces](docs/expectations.md) |
| Program invariants and termination | [Program contracts](docs/program-contracts.md) |
| Lemmas and automatic proof search | [Lemmas](docs/lemmas.md), [Proof engine](docs/automatic-proofs.md) |
| What is proved and what is trusted | [Trust boundary](docs/trust.md) |
| CPU models | [Small CPU models](docs/models.md), [RV32I](docs/rv32i.md), [Memory composition](docs/memory-composition.md) |
| Reproduction tests and archived evidence | [Audit index](audit/README.md) |

## Current scope

- The selected 4-stage RV32I implementation passes all 436 preservation conditions
and 7 global obligations with hand-written lemmas, including composition with
4/16/64-word memories. Without lemmas, automatic search reaches 431/436.
- The reusable Celox Veryl test suite (745 cases) runs proof-backed in CI: 721 pass and
24 are recorded exceptions (see `conformance/veryl-proof/case-exceptions.json`).

The Rust translation, obligation generation, kernel and selected solver are trusted;
see the [trust boundary](docs/trust.md). Current results come from
[CI](../.github/workflows/lydite.yml), not archived reports.
2 changes: 1 addition & 1 deletion lydite/audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ contribute to closure, along with successful guarded use and source diagnostics.
| Concrete CPU oracle and counterexample replay | `cpu_simulation.py`, `replay_counterexamples.py`, `interpreter.py`; `cpu_simulation_results.json`, `counterexample_replay_results.json` |
| Structural/finite solver campaigns | `structural_solver`, `structural_independent`, `finite_solver_independent`, `finite_speed_independent`, `branch_solver_scaling*`, `branch_solver_decomposition*`, `expected_result_search*`; corresponding JSON/log/query trees under `results/` |
| Physical implementation | [Synthesis reproduction](https://github.com/tignear/hwverify/blob/ae8f84cca8859097ac2b0a7a4f6e311355c2b48d/synthesis/README.md), [emitted-SV differential/mutation instructions](veryl_scaling/split_candidate_tests/README.md) |
| Small memory-law formalization | [Lean proof and Rust comparison](../proof/README-ja.md) |
| Small memory-law formalization | [Lean proof and Rust comparison](../proof/README.md) |

Independent integer interpretation and SAT replay supplement the checker; they do
not certify UNSAT. The old counterexample-first policy under `counterexample_search*`
Expand Down
22 changes: 0 additions & 22 deletions lydite/audit/automatic_proof/phase1-evidence/validation.json

This file was deleted.

Loading
Loading