coopgame-py 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- coopgame_py-0.1.0/.github/workflows/python-publish.yml +145 -0
- coopgame_py-0.1.0/.gitignore +24 -0
- coopgame_py-0.1.0/CONTRIBUTING.md +138 -0
- coopgame_py-0.1.0/Cargo.lock +370 -0
- coopgame_py-0.1.0/Cargo.toml +40 -0
- coopgame_py-0.1.0/LICENSE +21 -0
- coopgame_py-0.1.0/PKG-INFO +94 -0
- coopgame_py-0.1.0/README.md +100 -0
- coopgame_py-0.1.0/examples/assumption_study.rs +127 -0
- coopgame_py-0.1.0/examples/auto_threshold.rs +44 -0
- coopgame_py-0.1.0/examples/convex_scaling.rs +108 -0
- coopgame_py-0.1.0/examples/counterexample_search.rs +107 -0
- coopgame_py-0.1.0/examples/data_valuation.rs +262 -0
- coopgame_py-0.1.0/examples/exact_scaling.rs +41 -0
- coopgame_py-0.1.0/examples/merge_segments.rs +97 -0
- coopgame_py-0.1.0/examples/oracle_scaling.rs +81 -0
- coopgame_py-0.1.0/examples/prekernel_study.rs +162 -0
- coopgame_py-0.1.0/pyproject.toml +27 -0
- coopgame_py-0.1.0/python/Cargo.lock +464 -0
- coopgame_py-0.1.0/python/Cargo.toml +21 -0
- coopgame_py-0.1.0/python/README.md +77 -0
- coopgame_py-0.1.0/python/src/lib.rs +1495 -0
- coopgame_py-0.1.0/python/tests/test_coopgame.py +406 -0
- coopgame_py-0.1.0/src/auto.rs +87 -0
- coopgame_py-0.1.0/src/bankruptcy.rs +146 -0
- coopgame_py-0.1.0/src/bargaining.rs +219 -0
- coopgame_py-0.1.0/src/bin/coopgame.rs +912 -0
- coopgame_py-0.1.0/src/coalition.rs +202 -0
- coopgame_py-0.1.0/src/convex.rs +207 -0
- coopgame_py-0.1.0/src/cost.rs +102 -0
- coopgame_py-0.1.0/src/error.rs +45 -0
- coopgame_py-0.1.0/src/exact/mod.rs +556 -0
- coopgame_py-0.1.0/src/exact/nucleolus.rs +406 -0
- coopgame_py-0.1.0/src/exact/simplex.rs +298 -0
- coopgame_py-0.1.0/src/explain.rs +358 -0
- coopgame_py-0.1.0/src/game.rs +222 -0
- coopgame_py-0.1.0/src/generators.rs +285 -0
- coopgame_py-0.1.0/src/guarantee.rs +99 -0
- coopgame_py-0.1.0/src/io.rs +546 -0
- coopgame_py-0.1.0/src/kernel.rs +185 -0
- coopgame_py-0.1.0/src/kernel_set.rs +911 -0
- coopgame_py-0.1.0/src/kohlberg.rs +201 -0
- coopgame_py-0.1.0/src/lib.rs +91 -0
- coopgame_py-0.1.0/src/linalg.rs +189 -0
- coopgame_py-0.1.0/src/lp.rs +79 -0
- coopgame_py-0.1.0/src/nucleolus.rs +567 -0
- coopgame_py-0.1.0/src/oracle/airport.rs +87 -0
- coopgame_py-0.1.0/src/oracle/bankruptcy.rs +104 -0
- coopgame_py-0.1.0/src/oracle/graph.rs +58 -0
- coopgame_py-0.1.0/src/oracle/mod.rs +385 -0
- coopgame_py-0.1.0/src/oracle/nucleolus.rs +359 -0
- coopgame_py-0.1.0/src/oracle/production.rs +141 -0
- coopgame_py-0.1.0/src/oracle/spanning_tree.rs +102 -0
- coopgame_py-0.1.0/src/oracle/subsets.rs +151 -0
- coopgame_py-0.1.0/src/oracle/voting.rs +179 -0
- coopgame_py-0.1.0/src/partition.rs +165 -0
- coopgame_py-0.1.0/src/plot.rs +760 -0
- coopgame_py-0.1.0/src/properties.rs +116 -0
- coopgame_py-0.1.0/src/sampled.rs +275 -0
- coopgame_py-0.1.0/src/search.rs +241 -0
- coopgame_py-0.1.0/src/solution.rs +34 -0
- coopgame_py-0.1.0/src/structure.rs +148 -0
- coopgame_py-0.1.0/src/submodular.rs +251 -0
- coopgame_py-0.1.0/src/surplus.rs +133 -0
- coopgame_py-0.1.0/src/uncertainty.rs +329 -0
- coopgame_py-0.1.0/src/values.rs +237 -0
- coopgame_py-0.1.0/src/variants.rs +499 -0
- coopgame_py-0.1.0/src/verify.rs +298 -0
- coopgame_py-0.1.0/tests/bankruptcy.rs +96 -0
- coopgame_py-0.1.0/tests/common/mod.rs +70 -0
- coopgame_py-0.1.0/tests/consistency.rs +160 -0
- coopgame_py-0.1.0/tests/cost_games.rs +159 -0
- coopgame_py-0.1.0/tests/exact.rs +178 -0
- coopgame_py-0.1.0/tests/guarantees.rs +336 -0
- coopgame_py-0.1.0/tests/kernel_set.rs +195 -0
- coopgame_py-0.1.0/tests/literature.rs +313 -0
- coopgame_py-0.1.0/tests/oracle.rs +134 -0
- coopgame_py-0.1.0/tests/partition.rs +134 -0
- coopgame_py-0.1.0/tests/sampled.rs +65 -0
- coopgame_py-0.1.0/tests/variants.rs +190 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Python バインディング (coopgame-py) の wheel と sdist を作り、PyPI に公開する。
|
|
2
|
+
# - `py-v*` のタグを push すると、ビルドしてから PyPI に公開する (Trusted Publishing、environment `pypi`)。
|
|
3
|
+
# - 手動で起動 (workflow_dispatch) した時はビルドだけを行い、公開はしない。
|
|
4
|
+
name: python-publish
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
tags: ["py-v*"]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
check-version:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v5
|
|
19
|
+
- name: タグと pyproject.toml の版が一致するか確かめる
|
|
20
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
21
|
+
run: |
|
|
22
|
+
version=$(sed -n 's/^version = "\(.*\)"$/\1/p' python/pyproject.toml)
|
|
23
|
+
if [ "py-v${version}" != "${GITHUB_REF_NAME}" ]; then
|
|
24
|
+
echo "タグ ${GITHUB_REF_NAME} と python/pyproject.toml の版 ${version} が一致しない" >&2
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
linux:
|
|
29
|
+
needs: check-version
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
strategy:
|
|
32
|
+
matrix:
|
|
33
|
+
target: [x86_64, aarch64]
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v5
|
|
36
|
+
- uses: PyO3/maturin-action@v1
|
|
37
|
+
with:
|
|
38
|
+
working-directory: python
|
|
39
|
+
target: ${{ matrix.target }}
|
|
40
|
+
manylinux: auto
|
|
41
|
+
rust-toolchain: stable
|
|
42
|
+
args: --release --out dist
|
|
43
|
+
- uses: actions/upload-artifact@v4
|
|
44
|
+
with:
|
|
45
|
+
name: wheels-linux-${{ matrix.target }}
|
|
46
|
+
path: python/dist
|
|
47
|
+
|
|
48
|
+
macos:
|
|
49
|
+
needs: check-version
|
|
50
|
+
runs-on: macos-14
|
|
51
|
+
strategy:
|
|
52
|
+
matrix:
|
|
53
|
+
target: [x86_64, aarch64]
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@v5
|
|
56
|
+
- uses: actions/setup-python@v6
|
|
57
|
+
with:
|
|
58
|
+
python-version: "3.12"
|
|
59
|
+
- uses: PyO3/maturin-action@v1
|
|
60
|
+
with:
|
|
61
|
+
working-directory: python
|
|
62
|
+
target: ${{ matrix.target }}
|
|
63
|
+
rust-toolchain: stable
|
|
64
|
+
args: --release --out dist
|
|
65
|
+
- uses: actions/upload-artifact@v4
|
|
66
|
+
with:
|
|
67
|
+
name: wheels-macos-${{ matrix.target }}
|
|
68
|
+
path: python/dist
|
|
69
|
+
|
|
70
|
+
windows:
|
|
71
|
+
needs: check-version
|
|
72
|
+
runs-on: windows-latest
|
|
73
|
+
steps:
|
|
74
|
+
- uses: actions/checkout@v5
|
|
75
|
+
- uses: actions/setup-python@v6
|
|
76
|
+
with:
|
|
77
|
+
python-version: "3.12"
|
|
78
|
+
- uses: PyO3/maturin-action@v1
|
|
79
|
+
with:
|
|
80
|
+
working-directory: python
|
|
81
|
+
target: x64
|
|
82
|
+
rust-toolchain: stable
|
|
83
|
+
args: --release --out dist
|
|
84
|
+
- uses: actions/upload-artifact@v4
|
|
85
|
+
with:
|
|
86
|
+
name: wheels-windows-x64
|
|
87
|
+
path: python/dist
|
|
88
|
+
|
|
89
|
+
sdist:
|
|
90
|
+
needs: check-version
|
|
91
|
+
runs-on: ubuntu-latest
|
|
92
|
+
steps:
|
|
93
|
+
- uses: actions/checkout@v5
|
|
94
|
+
- uses: PyO3/maturin-action@v1
|
|
95
|
+
with:
|
|
96
|
+
working-directory: python
|
|
97
|
+
command: sdist
|
|
98
|
+
args: --out dist
|
|
99
|
+
- uses: actions/upload-artifact@v4
|
|
100
|
+
with:
|
|
101
|
+
name: sdist
|
|
102
|
+
path: python/dist
|
|
103
|
+
|
|
104
|
+
# できた wheel を各 OS でインストールし、テストを通す (Linux x86_64・macOS arm64・Windows x64)。
|
|
105
|
+
test:
|
|
106
|
+
needs: [linux, macos, windows]
|
|
107
|
+
strategy:
|
|
108
|
+
matrix:
|
|
109
|
+
include:
|
|
110
|
+
- os: ubuntu-latest
|
|
111
|
+
artifact: wheels-linux-x86_64
|
|
112
|
+
- os: macos-14
|
|
113
|
+
artifact: wheels-macos-aarch64
|
|
114
|
+
- os: windows-latest
|
|
115
|
+
artifact: wheels-windows-x64
|
|
116
|
+
runs-on: ${{ matrix.os }}
|
|
117
|
+
steps:
|
|
118
|
+
- uses: actions/checkout@v5
|
|
119
|
+
- uses: actions/setup-python@v6
|
|
120
|
+
with:
|
|
121
|
+
python-version: "3.9"
|
|
122
|
+
- uses: actions/download-artifact@v4
|
|
123
|
+
with:
|
|
124
|
+
name: ${{ matrix.artifact }}
|
|
125
|
+
path: dist
|
|
126
|
+
- name: wheel をインストールしてテストする
|
|
127
|
+
shell: bash
|
|
128
|
+
run: |
|
|
129
|
+
python -m pip install pytest
|
|
130
|
+
python -m pip install --no-index --find-links dist coopgame-py
|
|
131
|
+
python -m pytest python/tests
|
|
132
|
+
|
|
133
|
+
publish:
|
|
134
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
135
|
+
needs: [linux, macos, windows, sdist, test]
|
|
136
|
+
runs-on: ubuntu-latest
|
|
137
|
+
environment: pypi
|
|
138
|
+
permissions:
|
|
139
|
+
id-token: write
|
|
140
|
+
steps:
|
|
141
|
+
- uses: actions/download-artifact@v4
|
|
142
|
+
with:
|
|
143
|
+
path: dist
|
|
144
|
+
merge-multiple: true
|
|
145
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Generated by Cargo
|
|
2
|
+
# will have compiled files and executables
|
|
3
|
+
debug
|
|
4
|
+
target
|
|
5
|
+
|
|
6
|
+
# These are backup files generated by rustfmt
|
|
7
|
+
**/*.rs.bk
|
|
8
|
+
|
|
9
|
+
# MSVC Windows builds of rustc generate these, which store debugging information
|
|
10
|
+
*.pdb
|
|
11
|
+
|
|
12
|
+
# Generated by cargo mutants
|
|
13
|
+
# Contains mutation testing data
|
|
14
|
+
**/mutants.out*/
|
|
15
|
+
|
|
16
|
+
# RustRover
|
|
17
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
18
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
19
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
20
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
21
|
+
#.idea/
|
|
22
|
+
__pycache__/
|
|
23
|
+
.pytest_cache/
|
|
24
|
+
*.so
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# コントリビューターガイド
|
|
2
|
+
|
|
3
|
+
coopgame の開発に参加する人向けに、開発環境、コミット前の確認、テストと文書の方針、計測の再現、リリースの手順をまとめる。
|
|
4
|
+
ライブラリと CLI の使い方は [README.md](README.md) と [docs/](docs/README.md) を参照。
|
|
5
|
+
|
|
6
|
+
## 開発環境
|
|
7
|
+
|
|
8
|
+
- Rust 1.88 以上 (edition 2024)。
|
|
9
|
+
- Python バインディングを変更する場合は、Python 3.9 以上と [maturin](https://www.maturin.rs/)、pytest。
|
|
10
|
+
- 計測結果を他の実装と比べ直す場合は、R と比較対象のパッケージ (`scripts/compare/setup.sh` が用意する)。
|
|
11
|
+
|
|
12
|
+
CLI は feature `cli` を有効にしたときだけビルドされる。
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
cargo build --release --features cli # target/release/coopgame
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## リポジトリの構成
|
|
19
|
+
|
|
20
|
+
| 場所 | 内容 |
|
|
21
|
+
|---|---|
|
|
22
|
+
| `src/` | ライブラリ |
|
|
23
|
+
| `src/bin/coopgame.rs` | CLI (feature `cli`) |
|
|
24
|
+
| `tests/` | 結合テスト。`tests/common/mod.rs` は独立に実装した基準 (タルムード則など) と補助関数で、examples からも `#[path]` で読み込む |
|
|
25
|
+
| `examples/` | 計測と分析のプログラム。文書が引用する出力は `data/` に保存している |
|
|
26
|
+
| `python/` | PyO3 による Python バインディング (配布名 `coopgame-py`、import 名 `coopgame`) |
|
|
27
|
+
| `data/` | 文書が引用する計測 (`bench/`)・他の実装との比較 (`compare/`)・分析 (`analysis/`) のデータ。`data/SHA256SUMS` で照合する |
|
|
28
|
+
| `docs/` | 利用者と、現状を理解したい人向けの文書 (チュートリアル、CLI と入力形式、性能と制約、保証の設計、他の実装との比較、文献と根拠、再現の手順)。一覧は `docs/README.md` |
|
|
29
|
+
| `scripts/` | 文書の数値の照合 (`verify_claims.py`) と、他の実装との比較のスクリプト (`compare/`) |
|
|
30
|
+
|
|
31
|
+
`data/`、`docs/`、`scripts/` は crates.io のパッケージに含めない (`Cargo.toml` の `exclude`)。
|
|
32
|
+
|
|
33
|
+
## コミット前の確認
|
|
34
|
+
|
|
35
|
+
CI は使っていないので、コミット前に次を実行する。
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
cargo fmt --check
|
|
39
|
+
cargo clippy --all-targets --all-features -- -D warnings
|
|
40
|
+
cargo test --release --all-features
|
|
41
|
+
# Python バインディングを変更した場合
|
|
42
|
+
(cd python && cargo fmt --check && cargo clippy -- -D warnings && maturin develop --release && pytest tests)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
テストは release ビルドで実行する。
|
|
46
|
+
debug ビルドでは、大きいゲームを解くテスト (`tests/oracle.rs` など) に時間がかかる。
|
|
47
|
+
|
|
48
|
+
公開 API や rustdoc を変更した場合は、次も実行する。
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps
|
|
52
|
+
cargo test --doc # rustdoc とチュートリアルのコード例
|
|
53
|
+
cargo build --no-default-features # feature なしでビルドできること
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
コミットメッセージは [Conventional Commits](https://www.conventionalcommits.org/ja/v1.0.0/) の形式で書く (説明は日本語でよい)。
|
|
57
|
+
公開 API を壊す変更は `refactor!:` のように `!` を付け、本文に `BREAKING CHANGE:` を書く。
|
|
58
|
+
|
|
59
|
+
## テストの方針
|
|
60
|
+
|
|
61
|
+
計算結果は、独立した基準どうしで突き合わせている。
|
|
62
|
+
同じ実装の結果どうしを比べても誤りは見つからないので、手計算、文献の値、閉じた形の解、別の解法、有理数による厳密な検証のいずれかを基準にする。
|
|
63
|
+
|
|
64
|
+
- 手計算できるゲームの仁・最小コア・カーネル
|
|
65
|
+
- 破産ゲームの仁がタルムード則 (Aumann–Maschler 1985) と一致すること
|
|
66
|
+
- 空港ゲーム(費用ゲーム)の仁
|
|
67
|
+
- 教科書・論文の数値例 (Peleg–Sudhölter Example 5.5.12 など) と、ランダムな破産問題 300 個でのタルムード則との一致 (`tests/literature.rs`)
|
|
68
|
+
- BNF タイプ 1-5 のランダムゲームで、仁が Kohlberg 基準を満たし、カーネルに属すること
|
|
69
|
+
- 仁を少し動かすと Kohlberg 基準が不成立になること
|
|
70
|
+
- transfer scheme の結果がカーネル条件を満たすこと
|
|
71
|
+
- 凸ゲームで transfer scheme の結果が仁と一致すること (Maschler–Peleg–Shapley 1971)
|
|
72
|
+
- 制約生成と全行の LP で仁が一致すること、部分ソートと定義どおりの走査で最大余剰が一致すること
|
|
73
|
+
- オラクル版の仁が明示版と一致すること、破産ゲームで n = 100 までタルムード則と一致すること (`tests/oracle.rs`)
|
|
74
|
+
- Shapley 値・Banzhaf 値が文献の例 (Ibn Ezra の相続問題、空港ゲーム、手袋ゲームなど) と一致すること
|
|
75
|
+
- タルムード則が、別実装・LP の仁 (n = 60)・有理数で検証した仁 (分数として完全一致) と一致すること (`tests/bankruptcy.rs`)
|
|
76
|
+
- サンプリングした仁が、サンプルを増やすと厳密なプレ仁に近づき、全提携で一致すること (`tests/sampled.rs`)
|
|
77
|
+
- per capita 仁・modiclus が文献の例と一致し、modiclus が定和ゲームでプレ仁に一致し凸ゲームでコアに属すること (Sudhölter 1997)、
|
|
78
|
+
仁・カーネルの点が交渉集合に属し、凸ゲームで交渉集合がコアに一致すること (`tests/variants.rs`)
|
|
79
|
+
- Owen 値・Aumann–Drèze 値・提携構造つきの仁を、Shapley 値・仁・商ゲームとの関係で確かめる (`tests/partition.rs`)
|
|
80
|
+
- 費用ゲーム・空港ゲーム・最小全域木ゲーム・線形生産ゲームを、明示ゲームの計算とコアの定理で確かめる (`tests/cost_games.rs`)
|
|
81
|
+
- 保証の種類・分離オラクル・性質の宣言・凸ゲームの手法・事後検証・有理数で構築したゲーム (`tests/guarantees.rs`)
|
|
82
|
+
- 仁が厳密な検証に合格し、ずらした配分は不合格になること (`tests/exact.rs`)。有理数の単体法の判定が浮動小数点の LP と一致することは `exact::simplex` の単体テストで確かめる
|
|
83
|
+
- カーネル全体: 凸ゲームでは仁の 1 点になること、各多面体の頂点と重心がカーネル条件を満たすこと(健全性)、
|
|
84
|
+
仁とランダムな初期点からの transfer scheme の到達点が和集合に含まれること(網羅性)
|
|
85
|
+
- チュートリアル (`docs/tutorial/`) のコード例が、論文の値と一致すること (doctest。`src/lib.rs` の `#[cfg(doctest)]` で読み込む)
|
|
86
|
+
|
|
87
|
+
## 公開 API の方針
|
|
88
|
+
|
|
89
|
+
crates.io で公開しているので、公開 API の変更は semver に従う。
|
|
90
|
+
|
|
91
|
+
- 内部でしか使わない関数やモジュールは `pub(crate)` にする。テストのためだけに公開しない (結合テストで足りなければ、単体テストに移す)。
|
|
92
|
+
- 後から変種を足しうる enum (`Error`、`Guarantee` など) と、後からフィールドを足しうる設定と結果の構造体には `#[non_exhaustive]` を付ける。
|
|
93
|
+
三択で状態が確定している `Verified` と `Check`、2 値の `Domain` には付けない。
|
|
94
|
+
- 設定の構造体は、`Default` か `::new` で作ってからフィールドに代入する形で使う (`#[non_exhaustive]` の構造体は、クレートの外では構造体リテラルで作れない)。
|
|
95
|
+
- 既定の feature は空にし、ライブラリの依存を増やす機能は feature の後ろに置く。
|
|
96
|
+
今は `serde_json` を使う `io` と、CLI の `cli` がある。
|
|
97
|
+
- 公開している型に出てくる依存 (`num-bigint`、`num-rational`、`num-traits`) は、lib.rs で再公開する。
|
|
98
|
+
|
|
99
|
+
## 文書と文献の方針
|
|
100
|
+
|
|
101
|
+
- `docs/` には、利用者と、現状を理解したい人向けの文書だけを置く。研究としての分析や開発の判断のための調査はリポジトリに置かない。
|
|
102
|
+
- 文献に依拠する主張は、[docs/references.md](docs/references.md) に文献と確認元を書き、計算で確かめられるものはテストかデータで確かめる。
|
|
103
|
+
- 文献の数値例を使うときは、出典と、答えを裏付けた方法 (原典、引用元、手計算) を書く ([docs/literature-cases.md](docs/literature-cases.md))。
|
|
104
|
+
- 保証つきのアルゴリズムは、原論文の本文で手順と保証を確かめてから実装する。
|
|
105
|
+
要旨だけで実装すると、保証が成り立つことを確認できないからである。
|
|
106
|
+
Pashkovich (2022)、Könemann, Pashkovich, Toth (2020)、Könemann & Toth (2020) は、本文を確認できていないため未実装にしている。
|
|
107
|
+
Elkind & Pasechnik (2009) は、仁を計算する保証がないと後続研究で指摘されているので、実装の対象にしない。
|
|
108
|
+
- 文書に書いた計測と分析の数値は、`scripts/verify_claims.py` で CSV から計算し直して照合する。
|
|
109
|
+
数値を変えたら、このスクリプトの期待値も更新する。
|
|
110
|
+
|
|
111
|
+
## 計測と再現
|
|
112
|
+
|
|
113
|
+
計測と分析のデータがどのコードと環境から作られたか、どう再現して照合するかは [docs/reproducibility.md](docs/reproducibility.md) にまとめている。
|
|
114
|
+
すぐにできる照合は次の 2 つである。
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
sha256sum -c data/SHA256SUMS # 保存したデータが改変されていないか
|
|
118
|
+
python3 scripts/verify_claims.py # 文書の数値を CSV から計算し直して照合
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`data/` のデータを作り直したら、`data/SHA256SUMS` も更新する。
|
|
122
|
+
ベンチマークの記録 (`data/compare/*.csv` など) にある実装名 `coopgame-rs` は、リポジトリ名を変える前の名前だが、過去の計測結果の記録なので書き換えない。
|
|
123
|
+
|
|
124
|
+
## リリース
|
|
125
|
+
|
|
126
|
+
1. `Cargo.toml` と `python/pyproject.toml` の版を上げる。
|
|
127
|
+
2. 公開するファイルと、パッケージからビルドできることを確かめる。
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
cargo package --list
|
|
131
|
+
cargo publish --dry-run
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
3. `cargo publish` で crates.io に公開する。
|
|
135
|
+
4. Python バインディングは、`py-v<版>` のタグ (例: `py-v0.1.0`) を push すると GitHub Actions (`.github/workflows/python-publish.yml`) が PyPI に `coopgame-py` として公開する。
|
|
136
|
+
Linux・macOS・Windows の wheel と sdist を作り、テストを通してから、Trusted Publishing (environment `pypi`) でアップロードする。
|
|
137
|
+
タグと `python/pyproject.toml` の版が一致しないと公開しない。
|
|
138
|
+
workflow を手動で起動すると、公開せずにビルドとテストだけを行う。
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "autocfg"
|
|
7
|
+
version = "1.5.1"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "bumpalo"
|
|
13
|
+
version = "3.20.3"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "cfg-if"
|
|
19
|
+
version = "1.0.5"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
|
|
22
|
+
|
|
23
|
+
[[package]]
|
|
24
|
+
name = "coopgame"
|
|
25
|
+
version = "0.1.0"
|
|
26
|
+
dependencies = [
|
|
27
|
+
"microlp",
|
|
28
|
+
"num-bigint",
|
|
29
|
+
"num-rational",
|
|
30
|
+
"num-traits",
|
|
31
|
+
"serde_json",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[[package]]
|
|
35
|
+
name = "futures-core"
|
|
36
|
+
version = "0.3.34"
|
|
37
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
38
|
+
checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
|
|
39
|
+
|
|
40
|
+
[[package]]
|
|
41
|
+
name = "futures-task"
|
|
42
|
+
version = "0.3.34"
|
|
43
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
44
|
+
checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
|
|
45
|
+
|
|
46
|
+
[[package]]
|
|
47
|
+
name = "futures-util"
|
|
48
|
+
version = "0.3.34"
|
|
49
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
50
|
+
checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
|
|
51
|
+
dependencies = [
|
|
52
|
+
"futures-core",
|
|
53
|
+
"futures-task",
|
|
54
|
+
"pin-project-lite",
|
|
55
|
+
"slab",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
[[package]]
|
|
59
|
+
name = "itoa"
|
|
60
|
+
version = "1.0.18"
|
|
61
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
62
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
63
|
+
|
|
64
|
+
[[package]]
|
|
65
|
+
name = "js-sys"
|
|
66
|
+
version = "0.3.106"
|
|
67
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
68
|
+
checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5"
|
|
69
|
+
dependencies = [
|
|
70
|
+
"cfg-if",
|
|
71
|
+
"futures-util",
|
|
72
|
+
"wasm-bindgen",
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
[[package]]
|
|
76
|
+
name = "log"
|
|
77
|
+
version = "0.4.34"
|
|
78
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
79
|
+
checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
|
|
80
|
+
|
|
81
|
+
[[package]]
|
|
82
|
+
name = "matrixmultiply"
|
|
83
|
+
version = "0.3.11"
|
|
84
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
85
|
+
checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7"
|
|
86
|
+
dependencies = [
|
|
87
|
+
"autocfg",
|
|
88
|
+
"rawpointer",
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
[[package]]
|
|
92
|
+
name = "memchr"
|
|
93
|
+
version = "2.8.3"
|
|
94
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
95
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
96
|
+
|
|
97
|
+
[[package]]
|
|
98
|
+
name = "microlp"
|
|
99
|
+
version = "0.6.0"
|
|
100
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
101
|
+
checksum = "a8f19803f918039a07f3c32b23716824d8f073543417bdac5b1b8619817e3674"
|
|
102
|
+
dependencies = [
|
|
103
|
+
"log",
|
|
104
|
+
"sprs",
|
|
105
|
+
"web-time",
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
[[package]]
|
|
109
|
+
name = "ndarray"
|
|
110
|
+
version = "0.17.2"
|
|
111
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
112
|
+
checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d"
|
|
113
|
+
dependencies = [
|
|
114
|
+
"matrixmultiply",
|
|
115
|
+
"num-complex",
|
|
116
|
+
"num-integer",
|
|
117
|
+
"num-traits",
|
|
118
|
+
"portable-atomic",
|
|
119
|
+
"portable-atomic-util",
|
|
120
|
+
"rawpointer",
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
[[package]]
|
|
124
|
+
name = "num-bigint"
|
|
125
|
+
version = "0.4.8"
|
|
126
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
127
|
+
checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367"
|
|
128
|
+
dependencies = [
|
|
129
|
+
"num-integer",
|
|
130
|
+
"num-traits",
|
|
131
|
+
]
|
|
132
|
+
|
|
133
|
+
[[package]]
|
|
134
|
+
name = "num-complex"
|
|
135
|
+
version = "0.4.6"
|
|
136
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
137
|
+
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
|
|
138
|
+
dependencies = [
|
|
139
|
+
"num-traits",
|
|
140
|
+
]
|
|
141
|
+
|
|
142
|
+
[[package]]
|
|
143
|
+
name = "num-integer"
|
|
144
|
+
version = "0.1.47"
|
|
145
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
146
|
+
checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
|
|
147
|
+
dependencies = [
|
|
148
|
+
"num-traits",
|
|
149
|
+
]
|
|
150
|
+
|
|
151
|
+
[[package]]
|
|
152
|
+
name = "num-rational"
|
|
153
|
+
version = "0.4.2"
|
|
154
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
155
|
+
checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
|
|
156
|
+
dependencies = [
|
|
157
|
+
"num-bigint",
|
|
158
|
+
"num-integer",
|
|
159
|
+
"num-traits",
|
|
160
|
+
]
|
|
161
|
+
|
|
162
|
+
[[package]]
|
|
163
|
+
name = "num-traits"
|
|
164
|
+
version = "0.2.19"
|
|
165
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
166
|
+
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
|
|
167
|
+
dependencies = [
|
|
168
|
+
"autocfg",
|
|
169
|
+
]
|
|
170
|
+
|
|
171
|
+
[[package]]
|
|
172
|
+
name = "once_cell"
|
|
173
|
+
version = "1.21.4"
|
|
174
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
175
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
176
|
+
|
|
177
|
+
[[package]]
|
|
178
|
+
name = "pin-project-lite"
|
|
179
|
+
version = "0.2.17"
|
|
180
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
181
|
+
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
|
|
182
|
+
|
|
183
|
+
[[package]]
|
|
184
|
+
name = "portable-atomic"
|
|
185
|
+
version = "1.15.0"
|
|
186
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
187
|
+
checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
|
|
188
|
+
|
|
189
|
+
[[package]]
|
|
190
|
+
name = "portable-atomic-util"
|
|
191
|
+
version = "0.2.8"
|
|
192
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
193
|
+
checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715"
|
|
194
|
+
dependencies = [
|
|
195
|
+
"portable-atomic",
|
|
196
|
+
]
|
|
197
|
+
|
|
198
|
+
[[package]]
|
|
199
|
+
name = "proc-macro2"
|
|
200
|
+
version = "1.0.107"
|
|
201
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
202
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
203
|
+
dependencies = [
|
|
204
|
+
"unicode-ident",
|
|
205
|
+
]
|
|
206
|
+
|
|
207
|
+
[[package]]
|
|
208
|
+
name = "quote"
|
|
209
|
+
version = "1.0.47"
|
|
210
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
211
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
212
|
+
dependencies = [
|
|
213
|
+
"proc-macro2",
|
|
214
|
+
]
|
|
215
|
+
|
|
216
|
+
[[package]]
|
|
217
|
+
name = "rawpointer"
|
|
218
|
+
version = "0.2.1"
|
|
219
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
220
|
+
checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
|
|
221
|
+
|
|
222
|
+
[[package]]
|
|
223
|
+
name = "rustversion"
|
|
224
|
+
version = "1.0.23"
|
|
225
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
226
|
+
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
|
|
227
|
+
|
|
228
|
+
[[package]]
|
|
229
|
+
name = "serde"
|
|
230
|
+
version = "1.0.229"
|
|
231
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
232
|
+
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
|
|
233
|
+
dependencies = [
|
|
234
|
+
"serde_core",
|
|
235
|
+
]
|
|
236
|
+
|
|
237
|
+
[[package]]
|
|
238
|
+
name = "serde_core"
|
|
239
|
+
version = "1.0.229"
|
|
240
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
241
|
+
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
|
|
242
|
+
dependencies = [
|
|
243
|
+
"serde_derive",
|
|
244
|
+
]
|
|
245
|
+
|
|
246
|
+
[[package]]
|
|
247
|
+
name = "serde_derive"
|
|
248
|
+
version = "1.0.229"
|
|
249
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
250
|
+
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
251
|
+
dependencies = [
|
|
252
|
+
"proc-macro2",
|
|
253
|
+
"quote",
|
|
254
|
+
"syn",
|
|
255
|
+
]
|
|
256
|
+
|
|
257
|
+
[[package]]
|
|
258
|
+
name = "serde_json"
|
|
259
|
+
version = "1.0.151"
|
|
260
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
261
|
+
checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
|
|
262
|
+
dependencies = [
|
|
263
|
+
"itoa",
|
|
264
|
+
"memchr",
|
|
265
|
+
"serde",
|
|
266
|
+
"serde_core",
|
|
267
|
+
"zmij",
|
|
268
|
+
]
|
|
269
|
+
|
|
270
|
+
[[package]]
|
|
271
|
+
name = "slab"
|
|
272
|
+
version = "0.4.12"
|
|
273
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
274
|
+
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
|
275
|
+
|
|
276
|
+
[[package]]
|
|
277
|
+
name = "smallvec"
|
|
278
|
+
version = "1.16.2"
|
|
279
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
280
|
+
checksum = "f9395f0f0eee849a9b707b2f06bb92a6a422090e2123bb2ef8e87a0e61892a8e"
|
|
281
|
+
|
|
282
|
+
[[package]]
|
|
283
|
+
name = "sprs"
|
|
284
|
+
version = "0.11.5"
|
|
285
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
286
|
+
checksum = "70d5a5663aa9f18d287877b8a889ee6cc2314e3a3778193ccc580d048d7d4abc"
|
|
287
|
+
dependencies = [
|
|
288
|
+
"ndarray",
|
|
289
|
+
"num-complex",
|
|
290
|
+
"num-traits",
|
|
291
|
+
"smallvec",
|
|
292
|
+
]
|
|
293
|
+
|
|
294
|
+
[[package]]
|
|
295
|
+
name = "syn"
|
|
296
|
+
version = "3.0.6"
|
|
297
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
298
|
+
checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee"
|
|
299
|
+
dependencies = [
|
|
300
|
+
"proc-macro2",
|
|
301
|
+
"quote",
|
|
302
|
+
"unicode-ident",
|
|
303
|
+
]
|
|
304
|
+
|
|
305
|
+
[[package]]
|
|
306
|
+
name = "unicode-ident"
|
|
307
|
+
version = "1.0.26"
|
|
308
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
309
|
+
checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
|
|
310
|
+
|
|
311
|
+
[[package]]
|
|
312
|
+
name = "wasm-bindgen"
|
|
313
|
+
version = "0.2.129"
|
|
314
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
315
|
+
checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409"
|
|
316
|
+
dependencies = [
|
|
317
|
+
"cfg-if",
|
|
318
|
+
"once_cell",
|
|
319
|
+
"rustversion",
|
|
320
|
+
"wasm-bindgen-macro",
|
|
321
|
+
"wasm-bindgen-shared",
|
|
322
|
+
]
|
|
323
|
+
|
|
324
|
+
[[package]]
|
|
325
|
+
name = "wasm-bindgen-macro"
|
|
326
|
+
version = "0.2.129"
|
|
327
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
328
|
+
checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535"
|
|
329
|
+
dependencies = [
|
|
330
|
+
"quote",
|
|
331
|
+
"wasm-bindgen-macro-support",
|
|
332
|
+
]
|
|
333
|
+
|
|
334
|
+
[[package]]
|
|
335
|
+
name = "wasm-bindgen-macro-support"
|
|
336
|
+
version = "0.2.129"
|
|
337
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
338
|
+
checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7"
|
|
339
|
+
dependencies = [
|
|
340
|
+
"bumpalo",
|
|
341
|
+
"proc-macro2",
|
|
342
|
+
"quote",
|
|
343
|
+
"syn",
|
|
344
|
+
"wasm-bindgen-shared",
|
|
345
|
+
]
|
|
346
|
+
|
|
347
|
+
[[package]]
|
|
348
|
+
name = "wasm-bindgen-shared"
|
|
349
|
+
version = "0.2.129"
|
|
350
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
351
|
+
checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6"
|
|
352
|
+
dependencies = [
|
|
353
|
+
"unicode-ident",
|
|
354
|
+
]
|
|
355
|
+
|
|
356
|
+
[[package]]
|
|
357
|
+
name = "web-time"
|
|
358
|
+
version = "1.1.0"
|
|
359
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
360
|
+
checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
|
|
361
|
+
dependencies = [
|
|
362
|
+
"js-sys",
|
|
363
|
+
"wasm-bindgen",
|
|
364
|
+
]
|
|
365
|
+
|
|
366
|
+
[[package]]
|
|
367
|
+
name = "zmij"
|
|
368
|
+
version = "1.0.23"
|
|
369
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
370
|
+
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|