feat(sim): pool topology and disaggregation decision pipeline#599
Merged
sriumcp merged 2 commits intoinference-sim:pdfrom Mar 11, 2026
Merged
feat(sim): pool topology and disaggregation decision pipeline#599sriumcp merged 2 commits intoinference-sim:pdfrom
sriumcp merged 2 commits intoinference-sim:pdfrom
Conversation
…ference-sim#591) Establishes PD (Prefill-Decode) disaggregation foundation: pool topology as a first-class cluster concept and the disaggregation decision point in the event pipeline. When pools are not configured (--prefill-instances=0 --decode-instances=0), output is byte-identical to pre-PR1 behavior (BC-PD-1 verified at seeds 42, 123, 999). - Add DisaggregationDecider interface with NeverDisaggregate and AlwaysDisaggregate implementations (sim/disaggregation.go) - Add PoolRole type, ValidatePoolTopology, BuildPoolMembership (sim/cluster/pool.go) - Add DisaggregationDecisionEvent (priority 3) to cluster event pipeline - Conditional branch in AdmissionDecisionEvent.Execute: pools configured → DisaggregationDecisionEvent, otherwise → RoutingDecisionEvent - Add PrefillInstances, DecodeInstances, PDDecider fields to DeploymentConfig (zero-value = disabled, all existing construction sites backward-compatible per R4 audit) - Add --prefill-instances, --decode-instances, --pd-decider CLI flags - Update CLAUDE.md with new files and flags Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Address 4 IMPORTANT findings from pr-code convergence review:
1. PoolMembership() now returns a defensive copy instead of the
internal map, complying with R8 (no exported mutable maps)
2. CLI now calls ValidatePoolTopology at the boundary for clean
error messages instead of relying on library panic
3. Factory test verifies concrete type via fmt.Sprintf("%T"),
fixing unused wantType field
4. Integration tests verify INV-1 (request conservation) and
INV-5 (causality) after simulation with disaggregation enabled
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Collaborator
|
@claude summarize this PR |
|
I'll analyze this and get back to you. |
1 similar comment
|
I'll analyze this and get back to you. |
Collaborator
|
@claude summarize this PR |
|
I'll analyze this and get back to you. |
Collaborator
|
@claude What does this PR do? |
|
I'll analyze this and get back to you. |
This was referenced Mar 11, 2026
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
Establishes PD (Prefill-Decode) disaggregation foundation for issue #591:
sim/disaggregation.go):NeverDisaggregateandAlwaysDisaggregateimplementations with factory and validation mapsim/cluster/pool.go):PoolRoletype,ValidatePoolTopology(),BuildPoolMembership()— pool membership built once at init, never mutated (INV-PD-5)sim/cluster/cluster_event.go): Priority 3 event inserted between admission and routing when pools are configured; conditional branch inAdmissionDecisionEvent.Execute()--prefill-instances,--decode-instances,--pd-deciderwith validationDeploymentConfigconstruction sites are automatically backward-compatible (R4 audit confirmed)Behavioral Contracts
TestValidatePoolTopology(11 cases)TestBuildPoolMembership_ImmutabilityTestAdmissionDecisionEvent_NoPools_SchedulesRoutingTest plan
go build ./...— exit 0go test ./... -count=1— all 9 packages passgo vet ./...— exit 0--prefill-instances 0 --decode-instances 0--num-instances 4 --prefill-instances 2 --decode-instances 2 --pd-decider alwayscompletes successfully🤖 Generated with Claude Code