Skip to content

Module bus embedder advertises non-zero dimensions while embedding to empty vectors, so recall silently returns nothing #84

Description

@YellowSnnowmann

Summary

BusEmbeddingHost::default_embedding_provider returns a provider that advertises a real embedder — name = "module-bus", the configured cloud model, and non-zero dimensions — while the host on the far side of the bus answers one empty vector per input. An embedder that reports non-zero dimensions and returns nothing is describing itself incorrectly, and every consumer that branches on dimensions() is entitled to believe it.

The visible effect is that recall silently returns nothing.

Evidence

OpenCompany runs the same facade round-trip against the same engine two ways — in-process (namespace driver) and over the bus (module driver). One passes and one does not:

the_namespace_driver_round_trips_the_facades ... ok
the_module_driver_upholds_the_contract      ... FAILED
    assertion `left == right` failed: context must be recallable through the engine
      left: 0
     right: 1

Same engine, same store a moment earlier, same absence of a real embedder. put succeeds in both. Only recall differs.

The difference is what the two embedders say about themselves:

NoopEmbedding (in-process) BusEmbeddingProvider (module)
name() "none" "module-bus"
model_id() "none" the configured cloud model
dimensions() 0 cloud_dimensions (non-zero)
embed() empty vectors empty vectors

Only the last row matches. With dims = 0 the engine skips vector search and the chunk is found; with non-zero dims it embeds the query to an empty vector, searches, and matches nothing.

The host's callback is not the problem — its provider/model/dimensions parameters are inputs it ignores, and returning empty vectors is the intended no-op. What the engine sees is the advertised identity, and that comes from default_embedding_provider.

Why it is worth fixing rather than documenting

It fails in the shape that is hardest to notice. There is no error, no warning, and no empty-store symptom — writes work, reads work, and recall returns an empty list that is indistinguishable from "nothing matched". A host embedding this module gets an engine that believes it can do semantic recall and quietly cannot.

It also breaks the property the module seam is supposed to have: the same engine, reached over the bus, answering the same sequence identically. That is exactly what OpenCompany's differential test exists to check, and it caught this.

Suggested fix

When the far side embeds to nothing, advertise that: report dims = 0 and a "none"-style name, so the engine takes the same path the in-process no-op does. Alternatively, refuse to construct a provider whose declared dimensions cannot be honoured — but silently advertising capability the bus cannot deliver is the case to remove.

Either way the fix belongs in the advertised identity, not in the callback.

Related

Found while running OpenCompany's module conformance step against the pinned artifact (opencompany#1550). That step is currently red on this, and correctly so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions