[PR #2584] [MERGED] parity: a crate split's manifest changes don't select every harness #4446

Closed
opened 2026-11-03 04:17:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2584
Author: @ludovic111
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: perf/parity-manifest-aware


📝 Commits (4)

  • 1b1571e parity: a crate split's manifest changes don't select every harness
  • 1af4d0e parity: a workspace crate's features count through the sources they gate
  • b6dd6c3 Merge remote-tracking branch 'origin/main' into perf/parity-manifest-aware
  • 8444418 docs: workspace crate features in a split

📊 Changes

3 files changed (+163 additions, -2 deletions)

View changed files

📝 docs/parity-workflow.md (+1 -1)
📝 tests/test_parity_runner.py (+62 -0)
📝 tools/parity.py (+100 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

A crate split (#2160, #2215) changes Cargo.lock and several Cargo.toml files. Cargo.lock is a shared input, and every manifest is a dependency of every harness that links the crate, so parity.py --changed selected all ~354 harnesses for these PRs. That is why they need full-parity.

With --changed (not --by-crate), the manifests and the lock are now left out when the change only adds, removes or moves workspace crates. Concretely, all of these must hold:

  • Cargo.lock: its registry and git packages are identical, including versions and checksums.
  • The changed Cargo.toml files, taken together:
    • the union of their dependency lines, features and build settings is unchanged against the merge base;
    • it doesn't count package identity, targets, lints, workspace path dependencies or [workspace] members.
  • Workspace crate features: a feature that the change defines or turns on is allowed only when every source naming it, or a feature it implies, changed too. In a split those are the new crate's own files.

When the manifests are left out, the moved code is selected through its sources, which the reach analysis narrows as usual. Anything else (a version bump, a new external dependency, a feature reaching an external crate, a resolver or profile change) still selects everything.

Measured with PARITY_SHARED set, --changed <merge base> --list:

before after
#2160 (horizon-client-core, horizon-command) 354 209
#2215 (+ horizon-items with a test-support feature) 354 209

Other PRs:

  • Of the last 60 merges, only 2 touched manifests, both workspace-only and both left out: #2446 (a new official mod crate) and #1895 (a new SDK example).
  • PRs that touch no manifest select exactly as before: the new code only runs when a Cargo.* file changed.

Tests: WorkspaceManifestTests covers four cases: a split, dependency/feature/resolver changes that still count, workspace features, and no merge base. python3 -m unittest discover -s tests passes.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2584 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/parity-manifest-aware` --- ### 📝 Commits (4) - [`1b1571e`](https://github.com/horizon-rust/horizon/commit/1b1571ed6a731d574a30e0bfef224b8e6c5d1fc3) parity: a crate split's manifest changes don't select every harness - [`1af4d0e`](https://github.com/horizon-rust/horizon/commit/1af4d0e432dda2c68c295d3eb00411cb316b1d64) parity: a workspace crate's features count through the sources they gate - [`b6dd6c3`](https://github.com/horizon-rust/horizon/commit/b6dd6c35ae42af2d5dcd655905a5c34fcf196887) Merge remote-tracking branch 'origin/main' into perf/parity-manifest-aware - [`8444418`](https://github.com/horizon-rust/horizon/commit/844441874a8b77d3a4185024650c293f49674a5d) docs: workspace crate features in a split ### 📊 Changes **3 files changed** (+163 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/parity-workflow.md` (+1 -1) 📝 `tests/test_parity_runner.py` (+62 -0) 📝 `tools/parity.py` (+100 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. A crate split (#2160, #2215) changes `Cargo.lock` and several `Cargo.toml` files. `Cargo.lock` is a shared input, and every manifest is a dependency of every harness that links the crate, so `parity.py --changed` selected all ~354 harnesses for these PRs. That is why they need `full-parity`. With `--changed` (not `--by-crate`), the manifests and the lock are now left out when the change only adds, removes or moves workspace crates. Concretely, all of these must hold: - **`Cargo.lock`:** its registry and git packages are identical, including versions and checksums. - **The changed `Cargo.toml` files, taken together:** - the union of their dependency lines, features and build settings is unchanged against the merge base; - it doesn't count package identity, targets, lints, workspace path dependencies or `[workspace] members`. - **Workspace crate features:** a feature that the change defines or turns on is allowed only when every source naming it, or a feature it implies, changed too. In a split those are the new crate's own files. When the manifests are left out, the moved code is selected through its sources, which the reach analysis narrows as usual. Anything else (a version bump, a new external dependency, a feature reaching an external crate, a resolver or profile change) still selects everything. Measured with `PARITY_SHARED` set, `--changed <merge base> --list`: | | before | after | |---|---|---| | #2160 (horizon-client-core, horizon-command) | 354 | 209 | | #2215 (+ horizon-items with a `test-support` feature) | 354 | 209 | Other PRs: - Of the last 60 merges, only 2 touched manifests, both workspace-only and both left out: #2446 (a new official mod crate) and #1895 (a new SDK example). - PRs that touch no manifest select exactly as before: the new code only runs when a `Cargo.*` file changed. Tests: `WorkspaceManifestTests` covers four cases: a split, dependency/feature/resolver changes that still count, workspace features, and no merge base. `python3 -m unittest discover -s tests` passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:17:13 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4446
No description provided.