(13) feat(cascade): in-memory LSM match-action store + real-shape ACL tests#1567
Draft
daniel-noland wants to merge 2 commits into
Draft
(13) feat(cascade): in-memory LSM match-action store + real-shape ACL tests#1567daniel-noland wants to merge 2 commits into
daniel-noland wants to merge 2 commits into
Conversation
45262b6 to
df3cbd7
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
The PR title explicitly says "(ignore for now) acl design test" — this is a large design-exploration PR introducing a new match-action / ACL framework spanning many new workspace crates, plus supporting changes to existing crates.
Changes:
- Introduces several new workspace crates:
fixed-size,lookup,match-action,match-action-derive,cascade,acl,dpdk-test-macros, and a scratch ACL module underdpdk. - Adds a
MatchKeyderive (with#[exact]/#[prefix]/#[mask]/#[range]field attributes), parallel<Name>Rulestruct emission, and lowering into a reference and DPDKrte_aclbackend, plus extensive property/differential tests and Criterion benches. - Adds infrastructure: a
dpdk::test_supportEAL bootstrap +#[with_eal]attribute macro, acascadecrate (LSM-style match-action storage withUpsert/MergeInto/drain subscription), abench-builderNix target, and acompute_min_input_sizeconst fnonAclBuildConfig.
Reviewed changes
Copilot reviewed 66 out of 67 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Registers new workspace members, deps, and per-package miri/wasm metadata |
| fixed-size/** | New no_std crate defining FixedSize trait with primitive/IpAddr impls |
| lookup/** | New crate with Lookup/Projection traits and BTreeMap/HashMap impls |
| match-action/, match-action-derive/ | New backend-agnostic match-key vocabulary + #[derive(MatchKey)] |
| net/src/fixed_size.rs, net/src/lib.rs, net/Cargo.toml | FixedSize impls for TcpPort/UdpPort/UnicastIpv4Addr/Vni |
| cascade/** | New LSM-style cascade primitive with Upsert/MergeInto/drain subscription |
| dpdk/Cargo.toml, dpdk/src/lib.rs, dpdk/src/test_support.rs | Optional test feature exposing shared EAL bootstrap + #[with_eal] macro |
| dpdk-test-macros/** | New proc-macro crate providing the #[with_eal] attribute |
| dpdk/src/acl/config.rs | Makes compute_min_input_size a public const fn; doc/spelling cleanup |
| dpdk/src/acl/scratch.rs | Scratch/sketch file with non-compiling design notes |
| acl/** | New crate: DPDK rte_acl backend, reference linear-scan oracle, tests, benches |
| default.nix, justfile | New benches Nix target and just bench recipe to build/run benches |
1d88968 to
5109431
Compare
137d9d9 to
af41ab0
Compare
daniel-noland
commented
May 28, 2026
| clippy::expect_used, | ||
| clippy::panic | ||
| )] | ||
| #![allow(missing_docs)] // shape settling; doc once stable |
Collaborator
Author
There was a problem hiding this comment.
this no longer applies
c347061 to
592cd9d
Compare
de5a2c1 to
fd80413
Compare
800f5dc to
2021414
Compare
Introduces dataplane-cascade. Models a small in-memory LSM: writes land in a concurrent multi-writer head, periodically frozen into immutable intermediate layers, eventually compacted into an immutable tail. Readers walk head -> frozen[] -> tail and stop at the first definitive answer. The same primitive serves three problems via one Upsert trait: match-action table updates (atomic publish under load), hardware offload programming (drain output feeds the HW backend), and active-active state replication (serialized drain output ships to peer dataplanes). freeze / fuse / compact / merge are all the same Upsert operation applied to different operands. Layout: - lib.rs publishes the surface: Cascade / DrainEvent / FrozenEntry / Snapshot, the Upsert / MergeInto / MutableHead traits, Generation, and re-exports Lookup / Projection from the lookup crate. - cascade.rs is the central type plus the rotate / drain / publish state machine. Cascade::subscribe is feature-gated under `subscribe` (tokio broadcast). - head.rs / merge.rs / upsert.rs are the trait definitions plus LastWriteWins as a stock blanket-friendly Upsert impl. - generation.rs carries the monotonic Generation counter that orders layers within a cascade. - property_tests.rs is a reusable bolero harness (under the bolero feature) consumer crates use to verify their own Upsert impls against the cascade's algebraic laws. Exercised by a self-test in the next PR. tests/smoke.rs is the trait-shape end-to-end with a trivial concrete implementation: head shadows sealed shadows tail, tombstones in the head suppress lower-layer hits, rotate seals and publishes. Uses the shared tests/common/mod.rs helpers that subsequent tests also share. Cascade is independent of every other PR in this stack: no acl dep, no match-action dep. Real-shape consumer pressure plus bolero / subscribe integration tests land in the next PR. just fmt; cargo check --workspace --all-targets passes.
Three integration tests that round out the cascade's test surface -- each exercises a different part of the design pressure that shaped the trait surface in the previous PR. tests/acl_consumer.rs is the first real-shaped consumer: a minimal ACL classifier built on top of the cascade with no upfront ACL crate dep -- the toy ACL is built inline using only Cascade / MergeInto / MutableHead. Purpose: surface design pressure on the trait surface against a use case that is NOT exact-match-keyed. ACL classification looks up packets by header match expressions, not by a single key, and rules carry their own identity (priority) separate from the lookup input. If the cascade trait shape works for ACL it almost certainly works for anything simpler. Scope intentionally tight: rules install-only (no shadow-rule removal yet), match expressions src/dst IPv4 with optional single port, head Lookup always returns None (writes visible only after a rotation seals the head). Comment block at the end captures the open question about removal under cascade semantics. tests/upsert_properties.rs is the self-test of the property harness landed in the previous PR. Exercises check_upsert_order_independent against the provided LastWriteWins -- known correct by construction. If it fails, the harness itself is broken; if it passes, it's a useful black-box check for downstream Upsert impls. tests/subscribe.rs is the drain-subscription integration under tokio. Exercises Cascade::subscribe end-to-end -- gated by the cascade `subscribe` feature (enabled in dev-deps via the self-path override on Cargo.toml). just fmt; cargo check --workspace --all-targets passes.
592cd9d to
70afa5a
Compare
This was referenced May 31, 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.
Stack (13), this PR (retargeted). Base:
pr/daniel-noland/acl-dpdk.In-memory LSM-shaped match-action storage primitive, plus tests that drive it
with a real ACL-shaped consumer.
feat(cascade): in-memory LSM-shaped match-action storage primitive.test(cascade): real-shape ACL consumer + bolero + subscribe tests.Review stack (merge bottom -> top):