Skip to content

bug: table output prints EncodedSid debug repr for IRI bindings when a join-bound subject's triples are novelty-only #1466

Closed

Description

@bplatz

Observed

fluree query with the default table format prints the raw Rust debug representation of an internal binding instead of the IRI:

| content       | kind                                                       |
+============================================================================+
| probe content | EncodedSid { s_id: 799670408834973892, t: None, op: None } |

The engine's result is correct — the same query with --format json, --format csv, or --format ndjson decodes (and prefix-compacts) the value properly:

"kind": { "type": "uri", "value": "mem:JoinProbe" }   # json
mem:JoinProbe,probe content                            # csv

Repro (narrow shape required)

The bug needs the combination of (a) the SELECTed IRI's triples living only in novelty (commit ahead of index) and (b) the subject being bound through a join against indexed data. A simple bound-subject lookup over the same novelty triples renders correctly even in table format.

  1. On a ledger with an existing indexed dataset (any triples with a string property to join on, e.g. ex:path):
    fluree insert -l <ledger> -e '<urn:m1> a <urn:Probe> ; <urn:ref> "some/indexed/value" ; <urn:content> "probe" .'
    # do NOT run `fluree index`
    
  2. Query joining through the indexed string into the novelty subject and select its type:
    SELECT ?kind ?content WHERE {
      ?x <urn:indexed-prop> ?v .          # bound from the base index
      ?m <urn:ref> ?v ; <urn:content> ?content ; a ?kind .   # novelty-only
    }
  3. --format table → EncodedSid { … }; --format json|csv|ndjson → correct IRI. Running fluree index also clears it.

Diagnosis pointer

The table renderer's display path appears to have its own binding-materialization step that, for this operator shape, receives an EncodedSid it cannot resolve — plausibly a graph view constructed without the novelty dict routed in (BinaryGraphView/graph_with_novelty invariant) — and falls through to the Debug impl. The serialization formats share a materialization that is novelty-aware, so the fix is likely to route the table renderer through the same path (or at minimum replace the Debug fallback with an explicit placeholder so internal structs never reach user output).

Possibly related to the late-materialized EncodedSid family in #1443 / #1320, but distinct: results here are semantically correct; only the table presentation is wrong.

Severity: low (interactive default format only, novelty-only window, self-heals on index) — but a raw debug struct in user-facing output warrants a fix or guard.

Activity

  1. added
    bug
    on Jul 11, 2026
  2. aaj3f commented on Aug 25, 2026

    @aaj3f
    Contributor

    Sweep verification at 47e96b7b6: the reported repro no longer reproduces — verified live across five query shapes with the fused fast path confirmed engaged (debug markers), and the novelty subject renders correctly every time. I couldn't pinpoint the exact fixing change (it's somewhere in the engine emit-path work since v4.1.2), so I'm not comfortable calling it deliberately fixed — but the symptom is gone.

    That said, the diagnosis here was right and the hardening ask is still open: the CLI table fast path resolves EncodedSid via the non-novelty-aware gv.store().resolve_subject_iri (output.rs:188) instead of the novelty-aware BinaryGraphView::resolve_subject_iri the API formatters use, and it falls back to format!("{b:?}") — so internal structs remain one failed resolve away from user-visible output.

    Proposing we rescope rather than close: retitle to "cli: table renderer should use novelty-aware encoded-binding resolution and never Debug-print bindings" — a 2-line resolver swap plus replacing the six {b:?} fallbacks with an explicit placeholder like <unresolved>. S-effort, and it turns a recurred-bug class into an impossible one.

  3. added
    P3
    area:query
    on Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area:querybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions