Repository navigation
Rank the same candidates in the replacement peer pre-check as the frame selector - #2017
Merged
Merged
Conversation
…me selector The frame-peer pre-check in `_capacity_hold` decides whether a replacement may go to the successful peer instead of waiting for the original harness's limit. It ranked every currently enabled harness, but the ordinary frame selector (dispatch-owner) only ranks the route's sealed depth-1 evidence, drops harnesses that do not declare `top` for a `top` leg, and applies the allocation's `owner_order`. With recent attempts X 3 and O 0 the pre-check picked O, which the selector never sees, and returned `replacement-capacity-wait` although the selector would pick X (the peer). The pre-check now applies the same filters and `preference_order`. The `top` declaration is one shared `model_profile.declares_runtime_profile`, which dispatch-owner's `_declares_top` now calls (same answer as before). Extracted from the folded PR #2007 (commit 2375618). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The replacement pre-check split out of the folded #2007 (commit 2375618): only the
_capacity_holdpeer pre-check piece, nothing else from that PR.When a frame leg's original harness is at a real usage limit,
_capacity_holddecides whether the replacement may go to the same-role successful peer or must wait (replacement-capacity-wait). Its ranking considered every currently enabled harness, but the ordinary frame selector (dispatch-owner) ranks only:route_authority.depth1_supported_harnesses(route, worker_type='frame')),topleg, harnesses that declaretop,owner_order(preference_order).Counter-example (recent attempts X 3, O 0, no list order involved): the pre-check picks O, which is outside the sealed evidence, returns
replacement-capacity-wait, while the real selector would pick X, the successful peer.Changes
utilities/dispatch_replacement.py: the pre-check filters candidates like the selector (sealed evidence,topdeclaration) and passespreference_order=allocation.get('owner_order').utilities/model_profile.py: newdeclares_runtime_profile(adapter, profile);dispatch-owner._declares_topcalls it (same answer, one place).utilities/dispatch_replacement.test.py:test_peer_precheck_ranks_the_candidates_the_frame_selector_ranks(fails onorigin/main5088ccb at the sealed-evidence,top, andowner_ordercases; passes here).Pin, explicit harness, original retry (no peer) and the legacy allocation strategy path are unchanged.
What changes for users
🤖 Generated with Claude Code