Repository navigation
perf(merge): pre-index base facts for O(1) lookup in collaborate (SCALE-P2-4 / #46) - #68
Merged
Merged
Conversation
…LE-P2-4 / #46) - In scylla_merge::collaborate, pre-build HashMap<(StableId, Discriminant<FactKind>), usize> over base.facts - Replace O(F_incoming * F_base) linear scan with O(1) indexed lookup for existing fact matching and confidence replacement - Add unit test collaborate_handles_many_facts_with_indexed_lookup verifying correct multi-fact merging and confidence resolution - Update BACKLOG.md and ARCHITECTURE_REVIEW.md tracking SCALE-P2-4 / #46 - Bump workspace package version to 0.7.9 and record release in CHANGELOG.md - Verification: cargo fmt, cargo clippy, cargo test, cargo audit, check-wasm.sh, and verify.mjs pass cleanly
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 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. Comment |
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
Resolves #46 (SCALE-P2-4 / Codeberg #161).
In$O(F_{\text{incoming}} \cdot F_{\text{base}})$ scans.
scylla_merge::collaborate, matching existing base facts for each incoming fact previously executedbase.facts.iter().find(...)insidefor fact in &incoming.facts, and post-loop confidence replacement executedbase.facts.iter_mut().find(...). For large fact sets, this created quadraticKey Changes
(StableId, Discriminant<FactKind>) -> usizeprior to iterating through incoming facts.collaborate_handles_many_facts_with_indexed_lookupincrates/scylla-merge/src/lib.rs.BACKLOG.mdandARCHITECTURE_REVIEW.md.0.7.9and updatedCHANGELOG.md.Verification Results
cargo fmt --all -- --check: Passedcargo clippy --workspace --all-targets -- -D warnings: Passedcargo test --workspace: Passed (all 28 tests in scylla-merge passed, workspace green)cargo audit: Passed (0 vulnerabilities, 6 allowed warnings)./scripts/check-wasm.sh: Passednode crates/scylla-wasm/web/verify.mjs: Passed (browser round-trip green)