One bug class, four fusion modes: finding cache corruption in QueryFusionRetriever
What happened On 2026-10-03, michaelswissa filed a bug in llama_index : QueryFusionRetriever corrupts rankings when a caching retriever returns shared NodeWithScore wrappers. Relative and distance-based fusion normalize scores in place , so a wrapper shared across queries gets normalized for one result set and then read back as if it were another's. His patch ( #23333 ) fixes two of the four…
On October 3, 2026, developer michaelswissa reported a bug in llama_index's QueryFusionRetriever causing cache corruption when a caching retriever returns shared NodeWithScore objects. The issue affects four fusion modes, but the simple_fusion mode appears to work correctly at first glance. However, the corruption occurs when the same node hash arrives via distinct wrappers with different scores, as can happen with per-query caching mechanisms like BM25.
The bug affects how scores are normalized and written back to the retriever's cache. In relative and distance-based fusion, shared wrappers get normalized for one result set and then read back as if it were another, leading to incorrect scores being returned from the cache. The corruption is subtle and may only be revealed when asserting on the cache itself, such as the ranking not matching the expected values.
The simplest fix is to deduplicate wrappers by identity rather than just value. This ensures that each wrapper is a separate object, even if they have the same node hash. By doing this, the bug is avoided, and the fusion modes work correctly. The patch was completed and verified against llama-index-core 0.14.25, with all tests passing.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.