Skip to content

refactor: テストを整理しCandid処理を最適化 - #15

Merged
humandebri merged 1 commit into
mainfrom
refactor/streamline-tests-and-candid-processing
Sep 12, 2026
Merged

humandebri merged 1 commit into
mainfrom
refactor/streamline-tests-and-candid-processing

Conversation

@humandebri

Copy link
Copy Markdown
Owner

目的

重複したテストと実装依存のassertion、不要な内部処理を整理し、検出すべき不具合を維持しながら実行時間と修正負担を減らします。

変更

  • 認証・V2/V4・Keychain・Candid・生成器のテストを削除・統合し、ポーリングの実待機を除去。
  • 委任数・対象数・Canister鍵のOID制約を、他の条件が正常な入力で検証。共有デコード予算は内部限定の注入を使って小さい入力で検証。
  • 未使用の引数・関数、到達不能な分岐を除去。
  • Candidエンコード時の再検証を除去し、record変換のフィールド探索を線形化。生成器の予約語判定で毎回集合を生成する処理を除去。
  • arm64・x86_64の生成器を再ビルド。別名checkoutでのCIをコンパイル検証に絞り、READMEの削除済みベンチマークへの記述を更新。

検証

  • macOS 60テスト、iOS Simulator 61テスト、plugin fixture 5テスト、Rust 7テストが成功。
  • Swift 6 strict concurrency、Rust fmt/clippy、Xcode plugin fixture、別名ディレクトリでのビルドが成功。
  • 委任数上限、対象数上限、OID制約、共有予算を個別に外した作業用コピーで、置き換えたテストが不具合を検出することを確認。
  • 両アーキテクチャのartifact一致・古いartifact検出を確認。既存2種類のfixtureの生成結果は変更前と一致。
  • 未コミット差分のレビューと git diff --check を実施。

同一入力でのローカル測定(SwiftはDebug、生成器はRelease):

処理 変更前 変更後
Candidエンコード:1万要素×10回 0.371秒 0.333秒
record変換:1,000フィールド×100回 7.80秒 1.06秒
コード生成:1,000フィールド 60ms 30ms

影響

公開API、通信動作、入力の受理条件、既定の処理上限、生成されるSwiftコードを維持します。生成器のバージョンは0.1.3のままです。測定値はローカル環境での比較であり、CIの時間閾値には使用しません。

Consolidate redundant tests and replace ineffective delegation and decoding-budget cases with focused counterexamples. Remove unused internals, avoid redundant Candid validation, linearize record projection, and eliminate repeated keyword-set allocation.

Rebuild both bundled generator architectures and retain compile checks for renamed checkouts. Verified macOS and iOS tests, Swift 6, plugin fixtures, Rust checks, and artifact consistency.
@humandebri
humandebri merged commit b879820 into main Sep 12, 2026
7 checks passed
@humandebri
humandebri deleted the refactor/streamline-tests-and-candid-processing branch September 12, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant