Skip to content

Dev#32

Merged
CrackedPoly merged 25 commits intomainfrom
dev
Nov 19, 2025
Merged

Dev#32
CrackedPoly merged 25 commits intomainfrom
dev

Conversation

@CrackedPoly
Copy link
Owner

@CrackedPoly CrackedPoly commented Nov 19, 2025

Regular release

Summary by CodeRabbit

Release Notes

New Features

  • Added optional "arc" feature flag for thread-safe shared ownership modes
  • New methods for clearing rule monitors, checking predicates, and resizing inverse models
  • New FIB loader for ingesting forwarding table entries

Bug Fixes

  • Fixed documentation typos and InfiniBand capitalization

Dependencies

  • Updated GitHub Actions and development tools to latest versions

Documentation

  • Expanded README with Rust-focused overview and workspace details
  • Added comprehensive development guide covering build, testing, and extension workflows

CrackedPoly and others added 25 commits June 4, 2025 17:55
Signed-off-by: Luo Jian <crackedpoly@outlook.com>
Signed-off-by: Luo Jian <crackedpoly@outlook.com>
Signed-off-by: Luo Jian <crackedpoly@outlook.com>
Signed-off-by: Luo Jian <crackedpoly@outlook.com>
Signed-off-by: Luo Jian <crackedpoly@outlook.com>
Signed-off-by: Luo Jian <crackedpoly@outlook.com>
Updates the requirements on [peak_alloc](https://github.com/xgillard/peak_alloc) to permit the latest version.
- [Commits](xgillard/peak_alloc@v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: peak_alloc
  dependency-version: 0.3.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Updates the requirements on [phf_codegen](https://github.com/rust-phf/rust-phf) to permit the latest version.
- [Release notes](https://github.com/rust-phf/rust-phf/releases)
- [Changelog](https://github.com/rust-phf/rust-phf/blob/main/RELEASE_PROCESS.md)
- [Commits](rust-phf/rust-phf@phf_codegen-v0.11.1...v0.13.1)

---
updated-dependencies:
- dependency-name: phf_codegen
  dependency-version: 0.13.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Updates the requirements on [phf](https://github.com/rust-phf/rust-phf) to permit the latest version.
- [Release notes](https://github.com/rust-phf/rust-phf/releases)
- [Changelog](https://github.com/rust-phf/rust-phf/blob/main/RELEASE_PROCESS.md)
- [Commits](rust-phf/rust-phf@phf-v0.11.1...v0.13.1)

---
updated-dependencies:
- dependency-name: phf
  dependency-version: 0.13.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](actions/upload-pages-artifact@v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Updates the requirements on [oxidd](https://github.com/OxiDD/oxidd) to permit the latest version.
- [Commits](OxiDD/oxidd@v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: oxidd
  dependency-version: 0.11.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v4...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Luo Jian <crackedpoly@outlook.com>
Signed-off-by: Luo Jian <crackedpoly@outlook.com>
…oc-0.3.0

chore(deps): update peak_alloc requirement from 0.2.0 to 0.3.0
…/actions/checkout-5

chore(deps): bump actions/checkout from 4 to 5
…gen-0.13.1

chore(deps): update phf_codegen requirement from 0.11.1 to 0.13.1
…/actions/upload-pages-artifact-4

chore(deps): bump actions/upload-pages-artifact from 3 to 4
…11.0

chore(deps): update oxidd requirement from 0.10.0 to 0.11.0
…/actions/upload-artifact-5

chore(deps): bump actions/upload-artifact from 4 to 5
…/actions/download-artifact-6

chore(deps): bump actions/download-artifact from 4 to 6
Signed-off-by: Jian Luo <crackedpoly@outlook.com>
chore(deps): update phf requirement from 0.11 to 0.13
@CrackedPoly CrackedPoly merged commit 874b3b1 into main Nov 19, 2025
1 check failed
@coderabbitai
Copy link

coderabbitai bot commented Nov 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR introduces an optional arc feature flag for thread-safe shared ownership across the workspace, conditionally switching between Arc and Rc. It also updates GitHub Actions to newer versions, bumps key dependencies (oxidd 0.10→0.11, phf 0.11→0.13), removes the trait-based FamilyDecl/MatchFamily lookup pattern in favor of a free function API, refactors RuleMonitorLike implementations, and adds new data structures (RawRule, UncodedRule, DefaultFibLoader).

Changes

Cohort / File(s) Summary
GitHub Actions version updates
.github/workflows/{docs,image,release,tests}.yml
Bumped action versions: actions/checkout v4→v5; actions/upload-pages-artifact v3→v4; actions/upload-artifact v4→v5; actions/download-artifact v4→v6. No logic changes.
Arc/Rc feature flag infrastructure
Cargo.toml, crates/rapimt_{core,im,io,internal,ver}/Cargo.toml
Added new arc feature that enables thread-safe shared ownership via Arc; when disabled, uses Rc. Feature propagates across workspace.
Dependency updates
crates/rapimt_core/Cargo.toml, crates/rapimt_tpt/Cargo.toml
Bumped oxidd 0.10.0→0.11.0, phf 0.11→0.13 (and build-deps phf_codegen 0.11.1→0.13.1); peak_alloc 0.2.0→0.3.0.
CLI dependencies
crates/rapimt_cli/Cargo.toml
Enabled arc feature for rapimt_core, rapimt_io, rapimt_ver. Added clap, tokio, axum, tower-http with specific features.
Family lookup refactoring
crates/rapimt_core/src/match/{family.rs,engine/mod.rs}, crates/rapimt_core/src/lib.rs
Removed public FamilyDecl trait and MatchFamily struct; replaced with free function get_field_declaration(name: &str). Updated all call sites. Removed OxiddPredicate, RuddyPredicate, MatchFamily from prelude exports.
MatchEncoder trait updates
crates/rapimt_core/src/match/engine/mod.rs
MatchEncoder<'a> now extends Default; added associated type P: PredicateInner + 'a; added methods gc(), one(), zero(), _encode(); changed encode_matches signature to accept &'b FieldMatch<'b, U> references instead of owned values.
Engine Default impls
crates/rapimt_core/src/match/engine/{no_engine,oxidd_engine,ruddy_engine}.rs
Implemented Default for NoPredicateEngine, OxiddPredicateEngine (via init(1000, 100)), and RuddyPredicateEngine. Changed BDDFunction::exist()exists() in oxidd engine.
Action impl changes
crates/rapimt_core/src/action/mod.rs
Introduced conditional Rc alias (Arc when arc feature enabled); removed public Arc<A> impls for Action<Multiple> and Actions traits; retained Rc<A> impls.
Predicate methods
crates/rapimt_core/src/match/predicate.rs
Added pub fn non_empty(&self) -> bool method; fixed doc typos ("prediate"→"predicate").
Monitor and rule structures
crates/rapimt_im/src/default/{monitor.rs,rule.rs}, crates/rapimt_im/src/ib/monitor.rs
Added public RawRule and UncodedRule structs. Moved clear() from trait to inherent methods in FastRuleMonitor and IbRuleMonitor. Introduced conditional Rc/Arc imports.
InverseModel resize
crates/rapimt_im/src/im.rs
Added two new pub fn resize_(&mut self, to, offset) methods for InverseModel<_, _, Multiple, _> variants (MapMonoid and IbVecMonoid).
RuleMonitorLike trait
crates/rapimt_im/src/lib.rs
Removed required clear(&mut self) method from RuleMonitorLike trait; now impls provide inherent clear() methods instead. Re-exported RawRule in prelude.
IO loader refactoring
crates/rapimt_io/src/default/loader.rs
Changed PortInfoBase.dev from String to Rc<str>; added get_dev() and neighbors() methods; introduced DefaultFibLoader struct with _load() and load() methods for parsing raw rules.
CSV parser Arc→Rc
crates/rapimt_io/src/ib/{loader.rs,db_csv_parser/csv_parser.rs}, crates/rapimt_io/src/ib/cmd_parser/ibfar_parser.rs
Replaced Arc<NodeCommon>, Arc<LinkSpec>, Arc<[PortIdx]> with conditional Rc alias throughout loader infrastructure. Updated cache types and return signatures.
Import path updates
crates/rapimt_io/src/{error.rs,ib/cmd_parser/ibroute_parser.rs}, crates/rapimt_io/src/lib.rs
Moved imports from crate::prelude to crate::prelude::ib::loader for GroupIdx, Guid, PortIdx, RawIbFibRule. Changed prelude export from ib::{db_csv_parser::csv_parser, loader::*} to ib.
Verification snapshot
crates/rapimt_ver/src/ib/snapshot.rs
Feature-gated Arc/Rc usage; updated Edge associated type in SnapshotQuery to Rc<LinkSpec>; conditional parallel iteration (par_iter_mut when arc enabled).
Documentation
README.md, docs/{development.md,ib_server.md}, src/lib.rs
Rewrote README with workspace layout and typical workflow; added comprehensive development guide; fixed capitalization ("Infiniband"→"InfiniBand"); crate-level docs now use include_str!(README.md).
Tests and examples
crates/rapimt_tpt/{src/patricia.rs,tests/no_memory_leak.rs}
Added end-to-end Patricia Tree test with insert/delete/visualize sequence; fixed typos ("mannually"→"manually", "forth"→"fourth").

Sequence Diagrams

sequenceDiagram
    participant Code
    participant Lookup
    
    rect rgb(220, 240, 255)
    Note over Code,Lookup: OLD: Trait-based (FamilyDecl)
    Code->>Lookup: MatchFamily::get_field_declaration(name)
    Lookup->>Lookup: GLOBAL_FAMILY.get_field_declaration(name)
    Lookup-->>Code: Option<FieldDeclaration>
    end
    
    rect rgb(220, 255, 230)
    Note over Code,Lookup: NEW: Function-based
    Code->>Lookup: constant::get_field_declaration(name)
    Lookup-->>Code: Option<FieldDeclaration>
    end
Loading
sequenceDiagram
    participant Crate
    participant Feature
    participant Types
    
    rect rgb(240, 230, 255)
    Note over Crate,Types: arc feature DISABLED
    Crate->>Feature: Check arc feature
    Feature-->>Types: Use std::rc::Rc
    Types->>Types: Rc<T> (single-threaded)
    end
    
    rect rgb(255, 240, 230)
    Note over Crate,Types: arc feature ENABLED
    Crate->>Feature: Check arc feature
    Feature-->>Types: Use std::sync::Arc as Rc
    Types->>Types: Arc<T> (thread-safe)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Areas requiring extra attention:

  • crates/rapimt_core/src/match/engine/mod.rs: Significant trait refactoring with new Default bound, associated type P, and signature changes to encode_matches; verify all implementers follow new contract.
  • crates/rapimt_io/src/ib/loader.rs, crates/rapimt_io/src/ib/db_csv_parser/csv_parser.rs: Widespread Arc→Rc replacements across complex data structures (IbDataPlane, SwitchSpec, CaSpec, PortSpec, GroupSpec); ensure thread-safety assumptions align with feature flag intent.
  • crates/rapimt_im/src/lib.rs, monitor implementations: Removal of clear() from trait and migration to inherent methods; verify all trait implementations updated and call sites correct.
  • crates/rapimt_core/src/match/family.rs: Public API removal of FamilyDecl trait and MatchFamily struct; confirm no downstream breakage and all references updated.
  • Feature-flag conditional paths (Rc/Arc aliasing): Test both arc enabled and disabled to verify correct type substitution across all affected files.

Possibly related PRs

  • Oxidd #3: Modifies oxidd predicate engine (oxidd_engine.rs) and trait implementations for MatchEncoder, directly overlapping with core engine refactoring in this PR.
  • Docs enhance #7: Introduces/modifies FamilyDecl, MatchFamily, and GLOBAL_FAMILY in the same file that this PR removes them from—conflicting changes to family lookup pattern.
  • Regular merge #18: Overlaps on RuleMonitor/InverseModel type changes (MapMonoid, IbVecMonoid, monoid-based rule representations) and monitor implementation refactoring.

Poem

🐰 Behold the Arc, or Rc so small,
A feature flag to choose them all!
Families now are functions free,
No traits to haunt—just clarity!
The monitors are cleaner now,
Default and predicate take a bow! 🎉

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c6b923 and d6abe4a.

⛔ Files ignored due to path filters (1)
  • docs/flash-sigcomm22.pdf is excluded by !**/*.pdf
📒 Files selected for processing (41)
  • .github/workflows/docs.yml (2 hunks)
  • .github/workflows/image.yml (3 hunks)
  • .github/workflows/release.yml (1 hunks)
  • .github/workflows/tests.yml (1 hunks)
  • Cargo.toml (1 hunks)
  • README.md (1 hunks)
  • crates/rapimt_cli/Cargo.toml (1 hunks)
  • crates/rapimt_core/Cargo.toml (2 hunks)
  • crates/rapimt_core/src/action/mod.rs (1 hunks)
  • crates/rapimt_core/src/lib.rs (1 hunks)
  • crates/rapimt_core/src/match/engine/mod.rs (5 hunks)
  • crates/rapimt_core/src/match/engine/no_engine.rs (1 hunks)
  • crates/rapimt_core/src/match/engine/oxidd_engine.rs (7 hunks)
  • crates/rapimt_core/src/match/engine/ruddy_engine.rs (3 hunks)
  • crates/rapimt_core/src/match/family.rs (2 hunks)
  • crates/rapimt_core/src/match/mod.rs (1 hunks)
  • crates/rapimt_core/src/match/predicate.rs (4 hunks)
  • crates/rapimt_im/Cargo.toml (1 hunks)
  • crates/rapimt_im/src/default/monitor.rs (4 hunks)
  • crates/rapimt_im/src/default/rule.rs (1 hunks)
  • crates/rapimt_im/src/ib/monitor.rs (1 hunks)
  • crates/rapimt_im/src/im.rs (3 hunks)
  • crates/rapimt_im/src/lib.rs (1 hunks)
  • crates/rapimt_internal/Cargo.toml (1 hunks)
  • crates/rapimt_io/Cargo.toml (1 hunks)
  • crates/rapimt_io/src/default/loader.rs (9 hunks)
  • crates/rapimt_io/src/error.rs (1 hunks)
  • crates/rapimt_io/src/ib/cmd_parser/ibfar_parser.rs (2 hunks)
  • crates/rapimt_io/src/ib/cmd_parser/ibroute_parser.rs (1 hunks)
  • crates/rapimt_io/src/ib/db_csv_parser/csv_parser.rs (6 hunks)
  • crates/rapimt_io/src/ib/loader.rs (8 hunks)
  • crates/rapimt_io/src/lib.rs (1 hunks)
  • crates/rapimt_tpt/Cargo.toml (1 hunks)
  • crates/rapimt_tpt/src/patricia.rs (1 hunks)
  • crates/rapimt_tpt/tests/no_memory_leak.rs (3 hunks)
  • crates/rapimt_ver/Cargo.toml (2 hunks)
  • crates/rapimt_ver/src/ib/snapshot.rs (4 hunks)
  • docker/flash/README.md (1 hunks)
  • docs/development.md (1 hunks)
  • docs/ib_server.md (1 hunks)
  • src/lib.rs (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant