fix(memory): propagate configured Benna-Fusi rates through extract_and_store#4722
Merged
Conversation
This was
linked to
issues
May 30, 2026
Closed
2bb24d4 to
cb385f6
Compare
…d_store extract_and_store created a bare GraphStore::new(pool) without calling .with_benna_rates(), causing all Benna-Fusi synaptic updates in the primary graph extraction path to use hardcoded defaults (fast=0.5, slow=0.05) instead of the operator-configured values from [memory.graph.spreading_activation]. Thread benna_fast_rate and benna_slow_rate through GraphExtractionConfig and call .with_benna_rates() in extract_and_store and in the backfill path in agent_access_impl.rs. Also apply two related memory-subsystem improvements from the same review pass: - perf(memory): replace Vec::contains with HashSet in HELA BFS hop loop, reducing O(F^2) comparisons to O(1) per edge (#4698) - perf(memory): replace to_lowercase() allocations in is_low_signal_relation with eq_ignore_ascii_case, eliminating ~30 short-string allocs per extraction pass (#4699) Closes #4711, #4698, #4699
Replace assert_ne!/assert_eq! on f32 values with epsilon-based assert!((a - b).abs() > f32::EPSILON) comparisons. CI runs clippy with --all-targets which includes test code, and -D clippy::float-cmp is implied by -D warnings.
cb385f6 to
7f196e9
Compare
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.
Summary
extract_and_storecreated a bareGraphStore::new(pool)without.with_benna_rates(), silently ignoringbenna_fast_rate/benna_slow_ratefrom[memory.graph.spreading_activation]. Fixed by threading both rates throughGraphExtractionConfigand calling.with_benna_rates()at all extraction callsites.Vec::contains()for frontier membership, O(F) per edge = O(F²) total. Replaced with a parallelHashSet<i64>for O(1) dedup; Vec preserved for traversal order.is_low_signal_relation()allocated ~30 short Strings per extraction pass viato_lowercase(). Replaced witheq_ignore_ascii_case()— zero allocation, same ASCII semantics.Changed files
crates/zeph-memory/src/semantic/graph.rs— bug(memory): extract_and_store uses hardcoded Benna-Fusi rates — config values ignored #4711 fix, perf(memory): unnecessary String allocation in write-gate relation check #4699 fix, two regression testscrates/zeph-memory/src/graph/activation.rs— perf(memory): O(F²) BFS in HELA spreading activation — replace Vec::contains with HashSet #4698 fixcrates/zeph-agent-persistence/src/graph.rs— bug(memory): extract_and_store uses hardcoded Benna-Fusi rates — config values ignored #4711: update extraction callsitecrates/zeph-core/src/agent/agent_access_impl.rs— bug(memory): extract_and_store uses hardcoded Benna-Fusi rates — config values ignored #4711: update backfill callsiteTests
zeph-memory: 1447 passed (2 new regression tests for bug(memory): extract_and_store uses hardcoded Benna-Fusi rates — config values ignored #4711)zeph-agent-persistence: 20 passedcargo clippy --workspace -- -D warnings: cleanRUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --locked: cleanCloses #4711, #4698, #4699