refactor(hydro_test): migrate paxos cross_singleton to by_ref() singleton mechanism [ci-bench]#2983
refactor(hydro_test): migrate paxos cross_singleton to by_ref() singleton mechanism [ci-bench]#2983MingweiSamuel wants to merge 2 commits into
Conversation
Deploying hydro with
|
| Latest commit: |
0d4d8e0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://db99e348.hydroflow.pages.dev |
| Branch Preview URL: | https://mingwei-paxos-ref-2.hydroflow.pages.dev |
…eton mechanism
Converted 6 out of 8 cross_singleton usages in paxos.rs to use the
by_ref() singleton reference mechanism:
- recommit_after_leader_election: 3 cross_singleton calls replaced with
by_ref() captures in filter_map and map closures (p_ballot and
p_p1b_max_checkpoint captured as refs)
- sequence_payload: 1 cross_singleton replaced with by_ref() in map
(p_ballot captured as ref)
- index_payloads (sliced!): 1 cross_singleton replaced with by_ref() in
map (base_slot captured as ref)
- acceptor_p2: 2 cross_singleton calls replaced with by_ref() captures
in filter_map and map closures (a_max_ballot captured as ref)
Left unchanged:
- acceptor_p1: 2 cross_singleton calls remain because the a_log parameter
comes from a forward_ref cycle, and by_ref() on cycle sources causes a
graph partitioning error ("Handoff succ not in subgraph")
Added + 'a lifetime bounds where required by by_ref() usage:
- PaxosLike::build, PaxosLike::with_client (paxos_with_client.rs)
- paxos_core, index_payloads (paxos.rs)
- compartmentalized_paxos_core, CoreCompartmentalizedPaxos::build
(compartmentalized_paxos.rs)
Updated IR snapshots (both stable and nightly) to reflect the new
reference nodes replacing cross_singleton patterns.
Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #2983
…_ref() The original PR #2903 left acceptor_p1's 2 cross_singleton calls unconverted because a_log came from a forward_ref cycle and caused a graph partitioning error. This issue has since been fixed in the framework, so both a_max_ballot and a_log can now use by_ref() successfully. - acceptor_p1: both cross_singleton(a_max_ballot) and cross_singleton(a_log) replaced with by_ref() captures in the map closure - Added + 'a bounds on L in acceptor_p1 and leader_election signatures All 8 cross_singleton usages in paxos.rs are now converted. Co-authored-by: Infinity 🤖 <infinity@hydro.run> PR: #2983
e417761 to
0d4d8e0
Compare
📊 Benchmark Results✅ Benchmark completed! You can download the results from the links below. Run History:
Last updated: 2026-06-26T20:55:34.185Z |
There was a problem hiding this comment.
Pull request overview
This PR refactors the Paxos dataflow construction in hydro_test to replace cross_singleton(...) usage patterns with the newer by_ref() singleton reference capture mechanism, and updates the IR snapshot outputs accordingly.
Changes:
- Migrates multiple Paxos pipeline joins from
cross_singletontoby_ref()captures inpaxos.rs(proposer and acceptor paths). - Adds
+ 'abounds to several generic parameters to satisfyby_ref()capture requirements. - Updates stable and nightly Mermaid IR snapshots to match the new reference nodes and resulting graph structure.
Reviewed changes
Copilot reviewed 5 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| hydro_test/src/cluster/paxos.rs | Replaces cross_singleton joins with by_ref() captures; adjusts generic bounds. |
| hydro_test/src/cluster/paxos_with_client.rs | Adds P: 'a bounds to the PaxosLike trait methods for by_ref() compatibility. |
| hydro_test/src/cluster/compartmentalized_paxos.rs | Adds P: 'a bounds to compartmentalized Paxos entrypoints. |
| hydro_test/src/cluster/snapshots/paxos_ir@proposer_mermaid.snap | Updates stable proposer IR snapshot after refactor. |
| hydro_test/src/cluster/snapshots/paxos_ir@acceptor_mermaid.snap | Updates stable acceptor IR snapshot after refactor. |
| hydro_test/src/cluster/snapshots-nightly/paxos_ir@acceptor_mermaid.snap | Updates nightly acceptor IR snapshot after refactor. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .map(q!(|ballot| { | ||
| let max_ballot = a_max_ballot_ref.clone(); | ||
| let log = a_log_ref.clone(); | ||
| ( | ||
| ballot.clone(), | ||
| if ballot == max_ballot { | ||
| Ok(log) | ||
| } else { | ||
| Err(max_ballot) | ||
| } | ||
| ballot.proposer_id.clone(), |
There was a problem hiding this comment.
Might be correct? Although the performance should be no worse than before.
| .map(q!(|ballot| { | ||
| let max_ballot = a_max_ballot_ref.clone(); | ||
| let log = a_log_ref.clone(); | ||
| ( | ||
| ballot.clone(), | ||
| if ballot == max_ballot { | ||
| Ok(log) | ||
| } else { | ||
| Err(max_ballot) | ||
| } | ||
| ballot.proposer_id.clone(), |
There was a problem hiding this comment.
Might be correct? Although the performance should be no worse than before.
Converted 8 out of 8 cross_singleton usages in paxos.rs to use the
by_ref() singleton reference mechanism:
by_ref() captures in filter_map and map closures (p_ballot and
p_p1b_max_checkpoint captured as refs)
(p_ballot captured as ref)
map (base_slot captured as ref)
in filter_map and map closures (a_max_ballot captured as ref)
replaced with by_ref() captures in the map closure
Added + 'a lifetime bounds where required by by_ref() usage:
(compartmentalized_paxos.rs)
Updated IR snapshots (both stable and nightly) to reflect the new
reference nodes replacing cross_singleton patterns.