app-policy: policyscale, a shared generator for the large-policy-set benchmarks - #13895
Draft
dimitri-nicolo wants to merge 1 commit into
Draft
app-policy: policyscale, a shared generator for the large-policy-set benchmarks#13895dimitri-nicolo wants to merge 1 commit into
dimitri-nicolo wants to merge 1 commit into
Conversation
Contributor
CI triage — CalicoRecommendation: Dig deeper before merging Likely caused by this PR
workflow_id: e5ee616e-99b6-4bc6-bc8d-65b7d6de3355 |
…benchmarks Lift the two synthetic policy sets out of the checker benchmarks into a package that renders the same set three ways: a policystore.PolicyStore and endpoint for engine and collector benchmarks, the ToDataplane updates that load it through ProcessUpdate, and Calico resources (Tier, GlobalNetworkPolicy, GlobalNetworkSet) for applying it to a cluster. A number measured at the engine, in the collector and on a node then describes the same policy set. The fixture also carries an oracle: Fixture.Expect computes the trace the engine must report for a flow from the generator's own model of each rule, independently of the matching code, and MatchingFlow / DeniedFlow / Sampler produce flows aimed at chosen depths of the walk or following a flow model (miss fraction, repeat fraction). Later changes to the engine (compiled policies, a verdict cache, evaluation off the collector's main loop) are gated on differential tests built on these. Composite applies both measured shapes to one endpoint: 19,992 ingress rules, 18,662 egress rules, 7,571 IP sets. BenchmarkEvaluateComposite measures it in the three cases that matter for the collector; the two existing benchmarks keep their cases and their numbers. hack/cmd/policyscale renders a preset as YAML, or prints sampled flows with their expected verdicts, for node-level runs. Tracking: CORE-13316.
dimitri-nicolo
force-pushed
the
dimitri-pmreq954-policygen
branch
from
September 12, 2026 03:02
8af9c8d to
5de13ed
Compare
This was referenced Sep 12, 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.
Description
First of a stack for the collector policy-evaluation work tracked in CORE-13316 (target: 10k flows/s per node on very large policy sets, without changing verdicts). This PR is the yardstick the rest is measured with; it changes no production code.
app-policy/policyscalelifts the two synthetic policy sets out of the checker benchmarks (bench_test.go,bench_egress_test.go) into a package that renders the same set three ways:policystore.PolicyStoreplusproto.WorkloadEndpoint, for engine and collector benchmarks;ToDataplaneupdates that load it throughPolicyStore.ProcessUpdate;Tier,GlobalNetworkPolicy,GlobalNetworkSet) for applying it to a cluster, viahack/cmd/policyscale.So a number measured at the engine, in the collector and on a node describes the same policy set.
The fixture also carries an oracle.
Fixture.Expectcomputes the trace the engine must report for a flow from the generator's own model of each rule, independently of the matching code inmatch.go, andMatchingFlow,DeniedFlowandSamplerproduce flows aimed at chosen depths of the walk or following a flow model (miss fraction, repeat fraction). The next PRs in the stack use these for differential tests that gate the compile-once change (#13267), a verdict cache, and evaluation off the collector's main loop.Compositeapplies both measured shapes to one endpoint: 19,992 ingress rules, 18,662 egress rules, 7,571 IP sets.BenchmarkEvaluateCompositemeasures it in the three cases that matter for the collector (ingress miss-all, egress miss-all, egress match on a tail port). The two existing benchmarks keep their cases; their fixtures are built by the shared generator with the same seed and the same draw order, so their numbers are unchanged.Two things worth knowing:
DefaultBaselineand pinned by a test rather than silently changed. The composite YAML is ~26 MB for that reason.protocol: TCP(every generated flow is TCP, so verdicts are unchanged) and policy names carry the tier prefix.Testing
Release note:
AI assistance: Written with Claude Code (Claude Fable 5.1); the author reviewed the diff and ran the tests and benchmarks above.
By opening this PR you take responsibility for every line in it, and you agree to explain the change yourself during review rather than routing review comments back through an agent. See AI_POLICY.md.
🤖 Generated with Claude Code