Account for shared producer lifecycle demand once per workload - #519
Merged
Merged
Conversation
zzylol
changed the base branch from
feat/unified-workload-entrypoints
to
main
September 8, 2026 20:17
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.
Before this PR
Lifecycle selection constructed a single-query WorkloadDemand, even for a producer shared across registered roots. Per-query lifecycle snapshots could disagree without an explicit joint-evidence rejection.
After this PR
The physical binding pass associates each producer with its unique consumers and supplies their combined recurrence to the existing ASAPPlanner lifecycle planner. Source updates, build, retention and retirement are charged once; consumer reads accumulate. Conflicting lifecycle evidence fails closed. Publication reports lifecycle estimates keyed by materialization and implementation identity.
Example: over 300 seconds, reads every 10 and 20 seconds produce 45 reads and 30,000 source updates at 100 updates/second. With the test unit costs, lifecycle cost is 45.8; the second consumer adds 1.5, not another producer build/update stream.
Verification
647 control-plane library tests, 28 binary tests, one integration test; three production-process tests pass. Focused tests verify added-read cost, unchanged update count and conflicting evidence rejection.
Explicit limit
These are lifecycle component estimates, not a complete physical-workload comparison. Existing opaque per-query window costs cannot establish whole-workload scan, transmission, materialization and output-operator costs. Full provider-backed alternative ranking remains a separate gate; no unknown cost is reported as zero. Stacked on #518; no automatic merge.