Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dgraph-io/dgraph
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v25.1.0
Choose a base ref
...
head repository: dgraph-io/dgraph
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v25.2.0
Choose a head ref
  • 15 commits
  • 71 files changed
  • 6 contributors

Commits on Dec 29, 2025

  1. feat(vector/hnsw): add per‑query ef and distance_threshold to similar…

    …_to, fix early termination (#9514)
    
    Hugely appreciative of the Dgraph team’s work. Native vector search
    integrated directly into a graph database is kind of a no brainer today.
    Deployed Dgraph (both vanilla and customised) in systems with 1M+
    vectors guiding deep traversal queries across 10M+ nodes -- tight
    coupling of vector search with graph traversal at massive scale gets us
    closer to something that could represent the fuzzy nuances of everything
    in an enterprise. Certainly not the biggest deployment your team will
    have seen, but this PR fixes an under‑recall edge case in HNSW and
    introduces opt‑in, per‑query controls that let users dial recall vs
    latency safely and predictably. I’ve had this running in production for
    a while and thought it worth proposing to main.
    
    - Summary
    - Fix incorrect early termination in the HNSW bottom layer that could
    stop before collecting k neighbours.
    - Extend similar_to with optional per‑query `ef` and
    `distance_threshold` (string or JSON‑like fourth argument).
    - Backwards compatible: default 3‑arg behaviour of similar_to is
    unchanged.
    
    - Motivation
    - In narrow probes, the bottom‑layer search could exit at a local
    minimum before collecting k, hurting recall.
    - No per‑query `ef` meant recall vs latency trade‑offs required global
    tuning or inflating k (and downstream work).
    - This PR corrects the termination logic and adds opt‑in knobs so users
    can increase exploration only when needed.
    
    - Changes (key files)
    - `tok/hnsw/persistent_hnsw.go`: fix early termination, add
    `SearchWithOptions`/`SearchWithUidAndOptions`, apply `ef` override at
    upper layers and `max(k, ef)` at bottom layer, apply
    `distance_threshold` in the metric domain (Euclidean squared internally,
    cosine as 1 − sim).
    - `tok/index/index.go`: add `VectorIndexOptions` and
    `OptionalSearchOptions` (non‑breaking).
    - `worker/task.go`: parse optional fourth argument to `similar_to`
    (`ef`, `distance_threshold`), thread options, route to optional methods
    when provided, guard zero/negative k.
      - `tok/index/search_path.go`: add `SearchPathResult` helper.
      - Tests: `tok/hnsw/ef_recall_test.go` adds
        - `TestHNSWSearchEfOverrideImprovesRecall`
        - `TestHNSWDistanceThreshold_Euclidean`
        - `TestHNSWDistanceThreshold_Cosine`
      - `CHANGELOG.md`: Unreleased entry for HNSW fix and per‑query options.
    
    - Backwards compatibility
    - No default behaviour changes. The three‑argument `similar_to(attr, k,
    vector_or_uid)` is unchanged.
    - `ef` and `distance_threshold` are optional, unsupported metrics safely
    ignore the threshold.
    
    - Performance
      - No overhead without options.
    - With `ef`, bottom‑layer candidate size becomes `max(k, ef)` (as in
    HNSW), cost scales accordingly.
    - Threshold filtering is a cheap pass over candidates, squaring
    Euclidean thresholds avoids extra roots.
    
    - Rationale and alignment
    - Matches HNSW semantics: `ef_search` controls exploration/recall, `k`
    controls output size.
    - Aligns with
    [Typesense](https://typesense.org/docs/29.0/api/vector-search.html#vector-search-parameters)’s
    per‑query `ef` and `distance_threshold` semantics for familiarity.
    
    Checklist
    - [x] Code compiles correctly and linting passes locally
    - [x] For all code changes, an entry added to the `CHANGELOG.md`
    describing this PR
    - [x] Tests added for new functionality / regression tests for the bug
    fix
    - [ ] For public APIs/new features, docs PR will be prepared and linked
    here after initial review
    joelamming authored Dec 29, 2025
    Configuration menu
    Copy the full SHA
    2c84a01 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2025

  1. fix(zero): make zero shutdown cleanly (#9525)

    Zero currently has several issues related to shutdown:
    
    - #9367 removed a call to
    `updateEnterpriseState()` without decreasing the wait group counter.
    This makes zero wait indefinitely, or exit with a return code other than
    zero after it has been forced to terminate.
    - Pools never get shutdown, which keeps the pool's health check alive,
    resulting in logs with connection failures.
    - The pool health check uses `time.Sleep`, so even if pools would get
    shutdown, the shutdown would be delayed by the remaining sleep duration.
    
    This PR sets the appropriate wait group counter, implements a function
    which removes pools on shutdown and switches from `time.Sleep` to
    `time.Tick` in the health check.
    
    ---------
    
    Co-authored-by: Matthew McNeely <[email protected]>
    xqqp and matthewmcneely authored Dec 30, 2025
    Configuration menu
    Copy the full SHA
    a3d33ee View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2026

  1. chore(core): use Tick() instead of NewTicker() (#9548)

    **Description**
    
    - Replaces all uses of `time.NewTicker()` with `time.Tick()`. Since Go
    1.23 the garbage collector can automatically clean up unreferenced
    tickers. Therefore, we can just use `Tick()` instead of `NewTicker()`
    and remove all `defer ticker.Stop()`.
    - Removes all calls to stop a timer. Similar to tickers, since Go 1.23
    timers can also be garbage collected automatically without calling
    `timer.Stop()`.
    - Remove two ticker member variables that were only used in a single
    function.
    - Changes the function `PollTillPassOrTimeout()` to use the `timeout`
    argument
    xqqp authored Jan 2, 2026
    Configuration menu
    Copy the full SHA
    6929c8e View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2026

  1. fix(cmd): store correct CA verification status (#9554)

    **Description**
    
    If `CheckSignatureFrom()` returns an error, the `verifiedCA` property of
    `certInfo` should be set to `"FAILED"`. However, currently `verifiedCA`
    is always set to `"PASSED"`, ignoring the result of
    `CheckSignatureFrom()`. This PR sets the correct status.
    xqqp authored Jan 5, 2026
    Configuration menu
    Copy the full SHA
    ed39971 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2026

  1. Configuration menu
    Copy the full SHA
    c5de8a7 View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2026

  1. fix(vector): Fix similarity-based HNSW search for cosine and dot prod…

    …uct metrics (#9559)
    
    ### Summary
    
    This PR fixes a critical bug in HNSW vector search where **cosine
    similarity and dot product metrics returned incorrect results**. The
    search algorithm was treating all metrics as distance metrics (lower is
    better), causing similarity metrics (higher is better) to return the
    *worst* matches instead of the best.
    
    ### Problem
    
    The HNSW implementation had two issues with similarity-based metrics:
    
    1. **Search phase**: The candidate heap in
    persistent_hnsw.go::searchPersistentLayer always used a min-heap, which
    pops the lowest value first. For similarity metrics where higher values
    are better, this caused the algorithm to explore the worst candidates
    first and terminate prematurely.
    
    2. **Edge pruning phase**: The helper.go::addNeighbors function used a
    fixed comparison (`>`) when pruning edges, which is correct for distance
    metrics but inverted for similarity metrics. This resulted in keeping
    the worst edges instead of the best.
    
    ### Root Cause
    
    The original code assumed all metrics behave like distance metrics:
    
    ```go
    // Always used min-heap (pops lowest first)
    candidateHeap := *buildPersistentHeapByInit(elements)
    
    // Edge pruning always used > comparison
    compare: func(i, j uint64) bool {
        return ph.distance_betw(..., i, ...) > ph.distance_betw(..., j, ...)
    }
    ```
    
    For **Euclidean distance**, lower values = better matches → min-heap is
    correct.
    For **Cosine/DotProduct similarity**, higher values = better matches →
    need max-heap.
    
    ### Solution
    
    #### 1. Added candidateHeap interface with metric-aware heap selection
    
    ```go
    type candidateHeap[T c.Float] interface {
        Len() int
        Pop() minPersistentHeapElement[T]
        Push(minPersistentHeapElement[T])
        PopLast() minPersistentHeapElement[T]
    }
    
    func buildCandidateHeap[T c.Float](array []minPersistentHeapElement[T], isSimilarityMetric bool) candidateHeap[T] {
        if isSimilarityMetric {
            return &maxHeapWrapper[T]{...}  // Pops highest first
        }
        return &minHeapWrapper[T]{...}      // Pops lowest first
    }
    ```
    
    #### 2. Added isSimilarityMetric flag to SimilarityType
    
    ```go
    type SimilarityType[T c.Float] struct {
        // ... existing fields
        isSimilarityMetric bool  // true for cosine, dotproduct; false for euclidean
    }
    ```
    
    #### 3. Fixed edge pruning comparison in addNeighbors
    
    ```go
    compare: func(i, j uint64) bool {
        distI := ph.distance_betw(ctx, tc, uuid, i, &inVec, &outVec)
        distJ := ph.distance_betw(ctx, tc, uuid, j, &inVec, &outVec)
        return !ph.simType.isBetterScore(distI, distJ)
    }
    ```
    
    ### Files Changed
    
    | File | Changes |
    |------|---------|
    | tok/hnsw/heap.go | Added candidateHeap interface, minHeapWrapper,
    maxHeapWrapper, and buildCandidateHeap factory |
    | tok/hnsw/helper.go | Added isSimilarityMetric field to SimilarityType;
    fixed edge pruning comparison |
    | tok/hnsw/persistent_hnsw.go | Updated searchPersistentLayer to use
    metric-aware candidate heap |
    | tok/hnsw/persistent_hnsw_test.go | Added comprehensive unit tests for
    heap behavior and search correctness |
    
    ### Testing
    
    Added new tests covering:
    
    - TestCandidateHeapMinHeap: Verifies min-heap pops in ascending order
    - TestCandidateHeapMaxHeap: Verifies max-heap pops in descending order
    - TestCandidateHeapPushPop: Tests Push/Pop operations for both heap
    types
    - TestCandidateHeapPopLast: Tests PopLast for both types
    - TestSimilarityTypeIsSimilarityMetric: Verifies flag is set correctly
    for each metric
    - TestSearchReturnsCorrectOrderForAllMetrics: End-to-end test for
    Euclidean, Cosine, and DotProduct
    - TestEdgePruningKeepsBestEdges: Verifies edge pruning keeps best edges
    for each metric
    
    ### Performance Note
    
    This fix builds on PR #9514 which corrected the early termination
    condition. Together, these changes ensure HNSW search explores the
    correct number of candidates and returns properly ordered results.
    
    Users experiencing slower insert/search times compared to v25.1.0 can
    tune performance by lowering efConstruction and efSearch parameters when
    creating your vector indexes.
    
    Lower values trade recall for speed. The default values
    (efConstruction=128, efSearch=64) prioritize recall.
    
    ### GenAI Notice
    
    Parts of this implementation and all of the testing was generated using
    Claude Opus 4.5 (thinking).
    
    ### Checklist
    
    - [x] The PR title follows the
    [Conventional
    Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) syntax,
    leading
          with `fix:`, `feat:`, `chore:`, `ci:`, etc.
    - [x] Code compiles correctly and linting (via trunk) passes locally
    - [x] Tests added for new functionality, or regression tests for bug
    fixes added as applicable
    
    Fixes #9558
    
    ### Benchmarks
    
    Our BEIR SciFact Information Retrieval Benchmarks now show recall rates
    close to or exceeding acceptable and excellent performance for all
    metrics.
    
    ```
    ============================================================================================================================================
    NDCG@k Comparison
    ============================================================================================================================================
    
    NDCG@1:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ██████████████████░░░░░░░░░░░░ 0.6200
      BEIR Acceptable (Acceptable baseline (384-dim))      ███████████████░░░░░░░░░░░░░░░ 0.5200
      Dgraph v25.1.0 (euclidean)                           ███████████████░░░░░░░░░░░░░░░ 0.5000
      Dgraph v25.1.0 (cosine)                              ████████░░░░░░░░░░░░░░░░░░░░░░ 0.2767
      Dgraph v25.1.0 (dotproduct)                          ████████░░░░░░░░░░░░░░░░░░░░░░ 0.2867
      Dgraph staged-fix (euclidean)                        ███████████████░░░░░░░░░░░░░░░ 0.5233
      Dgraph staged-fix (cosine)                           ███████████████░░░░░░░░░░░░░░░ 0.5300
      Dgraph staged-fix (dotproduct)                       ███████████████░░░░░░░░░░░░░░░ 0.5167
    
    NDCG@3:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ████████████████████░░░░░░░░░░ 0.6700
      BEIR Acceptable (Acceptable baseline (384-dim))      ██████████████████░░░░░░░░░░░░ 0.6000
      Dgraph v25.1.0 (euclidean)                           ████████████████░░░░░░░░░░░░░░ 0.5588
      Dgraph v25.1.0 (cosine)                              █████████░░░░░░░░░░░░░░░░░░░░░ 0.3043
      Dgraph v25.1.0 (dotproduct)                          █████████░░░░░░░░░░░░░░░░░░░░░ 0.3164
      Dgraph staged-fix (euclidean)                        █████████████████░░░░░░░░░░░░░ 0.5918
      Dgraph staged-fix (cosine)                           █████████████████░░░░░░░░░░░░░ 0.5957
      Dgraph staged-fix (dotproduct)                       █████████████████░░░░░░░░░░░░░ 0.5830
    
    NDCG@5:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ████████████████████░░░░░░░░░░ 0.6900
      BEIR Acceptable (Acceptable baseline (384-dim))      ██████████████████░░░░░░░░░░░░ 0.6300
      Dgraph v25.1.0 (euclidean)                           █████████████████░░░░░░░░░░░░░ 0.5858
      Dgraph v25.1.0 (cosine)                              █████████░░░░░░░░░░░░░░░░░░░░░ 0.3197
      Dgraph v25.1.0 (dotproduct)                          █████████░░░░░░░░░░░░░░░░░░░░░ 0.3290
      Dgraph staged-fix (euclidean)                        ██████████████████░░░░░░░░░░░░ 0.6168
      Dgraph staged-fix (cosine)                           ██████████████████░░░░░░░░░░░░ 0.6240
      Dgraph staged-fix (dotproduct)                       ██████████████████░░░░░░░░░░░░ 0.6081
    
    NDCG@10:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) █████████████████████░░░░░░░░░ 0.7000
      BEIR Acceptable (Acceptable baseline (384-dim))      ███████████████████░░░░░░░░░░░ 0.6500
      Dgraph v25.1.0 (euclidean)                           ██████████████████░░░░░░░░░░░░ 0.6118
      Dgraph v25.1.0 (cosine)                              █████████░░░░░░░░░░░░░░░░░░░░░ 0.3305
      Dgraph v25.1.0 (dotproduct)                          ██████████░░░░░░░░░░░░░░░░░░░░ 0.3423
      Dgraph staged-fix (euclidean)                        ███████████████████░░░░░░░░░░░ 0.6461
      Dgraph staged-fix (cosine)                           ███████████████████░░░░░░░░░░░ 0.6505
      Dgraph staged-fix (dotproduct)                       ███████████████████░░░░░░░░░░░ 0.6369
    
    NDCG@100:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) █████████████████████░░░░░░░░░ 0.7200
      BEIR Acceptable (Acceptable baseline (384-dim))      ████████████████████░░░░░░░░░░ 0.6800
      Dgraph v25.1.0 (euclidean)                           ███████████████████░░░░░░░░░░░ 0.6418
      Dgraph v25.1.0 (cosine)                              ██████████░░░░░░░░░░░░░░░░░░░░ 0.3445
      Dgraph v25.1.0 (dotproduct)                          ██████████░░░░░░░░░░░░░░░░░░░░ 0.3555
      Dgraph staged-fix (euclidean)                        ████████████████████░░░░░░░░░░ 0.6794
      Dgraph staged-fix (cosine)                           ████████████████████░░░░░░░░░░ 0.6849
      Dgraph staged-fix (dotproduct)                       ████████████████████░░░░░░░░░░ 0.6707
    
    ============================================================================================================================================
    MAP@k Comparison
    ============================================================================================================================================
    
    MAP@1:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ██████████████████░░░░░░░░░░░░ 0.6000
      BEIR Acceptable (Acceptable baseline (384-dim))      ███████████████░░░░░░░░░░░░░░░ 0.5000
      Dgraph v25.1.0 (euclidean)                           ██████████████░░░░░░░░░░░░░░░░ 0.4812
      Dgraph v25.1.0 (cosine)                              ███████░░░░░░░░░░░░░░░░░░░░░░░ 0.2586
      Dgraph v25.1.0 (dotproduct)                          ████████░░░░░░░░░░░░░░░░░░░░░░ 0.2747
      Dgraph staged-fix (euclidean)                        ███████████████░░░░░░░░░░░░░░░ 0.5046
      Dgraph staged-fix (cosine)                           ███████████████░░░░░░░░░░░░░░░ 0.5112
      Dgraph staged-fix (dotproduct)                       ██████████████░░░░░░░░░░░░░░░░ 0.4979
    
    MAP@3:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ███████████████████░░░░░░░░░░░ 0.6400
      BEIR Acceptable (Acceptable baseline (384-dim))      █████████████████░░░░░░░░░░░░░ 0.5700
      Dgraph v25.1.0 (euclidean)                           ████████████████░░░░░░░░░░░░░░ 0.5357
      Dgraph v25.1.0 (cosine)                              ████████░░░░░░░░░░░░░░░░░░░░░░ 0.2883
      Dgraph v25.1.0 (dotproduct)                          █████████░░░░░░░░░░░░░░░░░░░░░ 0.3022
      Dgraph staged-fix (euclidean)                        ████████████████░░░░░░░░░░░░░░ 0.5663
      Dgraph staged-fix (cosine)                           █████████████████░░░░░░░░░░░░░ 0.5707
      Dgraph staged-fix (dotproduct)                       ████████████████░░░░░░░░░░░░░░ 0.5579
    
    MAP@5:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ███████████████████░░░░░░░░░░░ 0.6600
      BEIR Acceptable (Acceptable baseline (384-dim))      █████████████████░░░░░░░░░░░░░ 0.5900
      Dgraph v25.1.0 (euclidean)                           ████████████████░░░░░░░░░░░░░░ 0.5544
      Dgraph v25.1.0 (cosine)                              ████████░░░░░░░░░░░░░░░░░░░░░░ 0.2993
      Dgraph v25.1.0 (dotproduct)                          █████████░░░░░░░░░░░░░░░░░░░░░ 0.3113
      Dgraph staged-fix (euclidean)                        █████████████████░░░░░░░░░░░░░ 0.5838
      Dgraph staged-fix (cosine)                           █████████████████░░░░░░░░░░░░░ 0.5902
      Dgraph staged-fix (dotproduct)                       █████████████████░░░░░░░░░░░░░ 0.5755
    
    MAP@10:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ████████████████████░░░░░░░░░░ 0.6700
      BEIR Acceptable (Acceptable baseline (384-dim))      ██████████████████░░░░░░░░░░░░ 0.6000
      Dgraph v25.1.0 (euclidean)                           █████████████████░░░░░░░░░░░░░ 0.5676
      Dgraph v25.1.0 (cosine)                              █████████░░░░░░░░░░░░░░░░░░░░░ 0.3045
      Dgraph v25.1.0 (dotproduct)                          █████████░░░░░░░░░░░░░░░░░░░░░ 0.3175
      Dgraph staged-fix (euclidean)                        █████████████████░░░░░░░░░░░░░ 0.5987
      Dgraph staged-fix (cosine)                           ██████████████████░░░░░░░░░░░░ 0.6035
      Dgraph staged-fix (dotproduct)                       █████████████████░░░░░░░░░░░░░ 0.5900
    
    MAP@100:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ████████████████████░░░░░░░░░░ 0.6800
      BEIR Acceptable (Acceptable baseline (384-dim))      ██████████████████░░░░░░░░░░░░ 0.6100
      Dgraph v25.1.0 (euclidean)                           █████████████████░░░░░░░░░░░░░ 0.5746
      Dgraph v25.1.0 (cosine)                              █████████░░░░░░░░░░░░░░░░░░░░░ 0.3074
      Dgraph v25.1.0 (dotproduct)                          █████████░░░░░░░░░░░░░░░░░░░░░ 0.3203
      Dgraph staged-fix (euclidean)                        ██████████████████░░░░░░░░░░░░ 0.6060
      Dgraph staged-fix (cosine)                           ██████████████████░░░░░░░░░░░░ 0.6113
      Dgraph staged-fix (dotproduct)                       █████████████████░░░░░░░░░░░░░ 0.5977
    
    ============================================================================================================================================
    RECALL@k Comparison
    ============================================================================================================================================
    
    Recall@1:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ██████████████████░░░░░░░░░░░░ 0.6000
      BEIR Acceptable (Acceptable baseline (384-dim))      ███████████████░░░░░░░░░░░░░░░ 0.5000
      Dgraph v25.1.0 (euclidean)                           ██████████████░░░░░░░░░░░░░░░░ 0.4812
      Dgraph v25.1.0 (cosine)                              ███████░░░░░░░░░░░░░░░░░░░░░░░ 0.2586
      Dgraph v25.1.0 (dotproduct)                          ████████░░░░░░░░░░░░░░░░░░░░░░ 0.2747
      Dgraph staged-fix (euclidean)                        ███████████████░░░░░░░░░░░░░░░ 0.5046
      Dgraph staged-fix (cosine)                           ███████████████░░░░░░░░░░░░░░░ 0.5112
      Dgraph staged-fix (dotproduct)                       ██████████████░░░░░░░░░░░░░░░░ 0.4979
    
    Recall@3:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) █████████████████████░░░░░░░░░ 0.7300
      BEIR Acceptable (Acceptable baseline (384-dim))      ███████████████████░░░░░░░░░░░ 0.6500
      Dgraph v25.1.0 (euclidean)                           █████████████████░░░░░░░░░░░░░ 0.5984
      Dgraph v25.1.0 (cosine)                              █████████░░░░░░░░░░░░░░░░░░░░░ 0.3248
      Dgraph v25.1.0 (dotproduct)                          ██████████░░░░░░░░░░░░░░░░░░░░ 0.3377
      Dgraph staged-fix (euclidean)                        ███████████████████░░░░░░░░░░░ 0.6384
      Dgraph staged-fix (cosine)                           ███████████████████░░░░░░░░░░░ 0.6401
      Dgraph staged-fix (dotproduct)                       ██████████████████░░░░░░░░░░░░ 0.6284
    
    Recall@5:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ███████████████████████░░░░░░░ 0.7900
      BEIR Acceptable (Acceptable baseline (384-dim))      █████████████████████░░░░░░░░░ 0.7200
      Dgraph v25.1.0 (euclidean)                           ███████████████████░░░░░░░░░░░ 0.6638
      Dgraph v25.1.0 (cosine)                              ██████████░░░░░░░░░░░░░░░░░░░░ 0.3632
      Dgraph v25.1.0 (dotproduct)                          ███████████░░░░░░░░░░░░░░░░░░░ 0.3697
      Dgraph staged-fix (euclidean)                        ████████████████████░░░░░░░░░░ 0.6988
      Dgraph staged-fix (cosine)                           █████████████████████░░░░░░░░░ 0.7088
      Dgraph staged-fix (dotproduct)                       ████████████████████░░░░░░░░░░ 0.6888
    
    Recall@10:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) █████████████████████████░░░░░ 0.8400
      BEIR Acceptable (Acceptable baseline (384-dim))      ███████████████████████░░░░░░░ 0.7800
      Dgraph v25.1.0 (euclidean)                           ██████████████████████░░░░░░░░ 0.7368
      Dgraph v25.1.0 (cosine)                              ███████████░░░░░░░░░░░░░░░░░░░ 0.3950
      Dgraph v25.1.0 (dotproduct)                          ████████████░░░░░░░░░░░░░░░░░░ 0.4074
      Dgraph staged-fix (euclidean)                        ███████████████████████░░░░░░░ 0.7808
      Dgraph staged-fix (cosine)                           ███████████████████████░░░░░░░ 0.7834
      Dgraph staged-fix (dotproduct)                       ███████████████████████░░░░░░░ 0.7701
    
    Recall@100:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ████████████████████████████░░ 0.9500
      BEIR Acceptable (Acceptable baseline (384-dim))      ███████████████████████████░░░ 0.9000
      Dgraph v25.1.0 (euclidean)                           ██████████████████████████░░░░ 0.8717
      Dgraph v25.1.0 (cosine)                              █████████████░░░░░░░░░░░░░░░░░ 0.4589
      Dgraph v25.1.0 (dotproduct)                          █████████████░░░░░░░░░░░░░░░░░ 0.4658
      Dgraph staged-fix (euclidean)                        ████████████████████████████░░ 0.9350
      Dgraph staged-fix (cosine)                           ████████████████████████████░░ 0.9417
      Dgraph staged-fix (dotproduct)                       ███████████████████████████░░░ 0.9250
    
    ============================================================================================================================================
    PRECISION@k Comparison
    ============================================================================================================================================
    
    Precision@1:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ██████████████████░░░░░░░░░░░░ 0.6200
      BEIR Acceptable (Acceptable baseline (384-dim))      ███████████████░░░░░░░░░░░░░░░ 0.5200
      Dgraph v25.1.0 (euclidean)                           ███████████████░░░░░░░░░░░░░░░ 0.5000
      Dgraph v25.1.0 (cosine)                              ████████░░░░░░░░░░░░░░░░░░░░░░ 0.2767
      Dgraph v25.1.0 (dotproduct)                          ████████░░░░░░░░░░░░░░░░░░░░░░ 0.2867
      Dgraph staged-fix (euclidean)                        ███████████████░░░░░░░░░░░░░░░ 0.5233
      Dgraph staged-fix (cosine)                           ███████████████░░░░░░░░░░░░░░░ 0.5300
      Dgraph staged-fix (dotproduct)                       ███████████████░░░░░░░░░░░░░░░ 0.5167
    
    Precision@3:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ██████████████████████████████ 0.2700
      BEIR Acceptable (Acceptable baseline (384-dim))      █████████████████████████░░░░░ 0.2300
      Dgraph v25.1.0 (euclidean)                           ████████████████████████░░░░░░ 0.2178
      Dgraph v25.1.0 (cosine)                              █████████████░░░░░░░░░░░░░░░░░ 0.1211
      Dgraph v25.1.0 (dotproduct)                          █████████████░░░░░░░░░░░░░░░░░ 0.1211
      Dgraph staged-fix (euclidean)                        █████████████████████████░░░░░ 0.2311
      Dgraph staged-fix (cosine)                           █████████████████████████░░░░░ 0.2322
      Dgraph staged-fix (dotproduct)                       █████████████████████████░░░░░ 0.2278
    
    Precision@5:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ██████████████████████████████ 0.1800
      BEIR Acceptable (Acceptable baseline (384-dim))      ██████████████████████████░░░░ 0.1600
      Dgraph v25.1.0 (euclidean)                           ████████████████████████░░░░░░ 0.1480
      Dgraph v25.1.0 (cosine)                              █████████████░░░░░░░░░░░░░░░░░ 0.0827
      Dgraph v25.1.0 (dotproduct)                          █████████████░░░░░░░░░░░░░░░░░ 0.0807
      Dgraph staged-fix (euclidean)                        █████████████████████████░░░░░ 0.1553
      Dgraph staged-fix (cosine)                           ██████████████████████████░░░░ 0.1573
      Dgraph staged-fix (dotproduct)                       █████████████████████████░░░░░ 0.1533
    
    Precision@10:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ██████████████████████████████ 0.1000
      BEIR Acceptable (Acceptable baseline (384-dim))      ██████████████████████████░░░░ 0.0900
      Dgraph v25.1.0 (euclidean)                           █████████████████████████░░░░░ 0.0837
      Dgraph v25.1.0 (cosine)                              █████████████░░░░░░░░░░░░░░░░░ 0.0453
      Dgraph v25.1.0 (dotproduct)                          █████████████░░░░░░░░░░░░░░░░░ 0.0447
      Dgraph staged-fix (euclidean)                        ██████████████████████████░░░░ 0.0887
      Dgraph staged-fix (cosine)                           ██████████████████████████░░░░ 0.0887
      Dgraph staged-fix (dotproduct)                       ██████████████████████████░░░░ 0.0873
    
    Precision@100:
    --------------------------------------------------------------------------------------------------------------------------------------------
      BEIR Excellent (State-of-the-art baseline (768-dim)) ████████████████████████████░░ 0.0100
      BEIR Acceptable (Acceptable baseline (384-dim))      ████████████████████████████░░ 0.0100
      Dgraph v25.1.0 (euclidean)                           ███████████████████████████░░░ 0.0100
      Dgraph v25.1.0 (cosine)                              ██████████████░░░░░░░░░░░░░░░░ 0.0053
      Dgraph v25.1.0 (dotproduct)                          ██████████████░░░░░░░░░░░░░░░░ 0.0051
      Dgraph staged-fix (euclidean)                        █████████████████████████████░ 0.0106
      Dgraph staged-fix (cosine)                           ██████████████████████████████ 0.0107
      Dgraph staged-fix (dotproduct)                       █████████████████████████████░ 0.0105
    ```
    
    ---------
    
    Co-authored-by: Joe Lamming <[email protected]>
    matthewmcneely and joelamming authored Jan 15, 2026
    Configuration menu
    Copy the full SHA
    4a5187d View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2026

  1. fix(txn): for lossy indexes, change comparison function to first chec…

    …k the txn cache (#9567)
    
    **Description**
    
    Fixes #9556 
    
    This PR fixes an issue where comparison functions invoked in
    transactions would miss un-committed values. This change ensure the
    transaction cache is first searched, before resuming the old flow
    through posting.GetNoStore and fetchValue.
    
    A test was also added.
    
    **Checklist**
    
    - [x] The PR title follows the
    [Conventional
    Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) syntax,
    leading
          with `fix:`, `feat:`, `chore:`, `ci:`, etc.
    - [x] Code compiles correctly and linting (via trunk) passes locally
    - [x] Tests added for new functionality, or regression tests for bug
    fixes added as applicable
    matthewmcneely authored Jan 16, 2026
    Configuration menu
    Copy the full SHA
    c2c4f2d View commit details
    Browse the repository at this point in the history
  2. chore(test): replace deprecated docker struct types in testing harness (

    #9549)
    
    **Description**
    
    `types.Container` and `types.ContainerJSON` from the docker page are
    deprecated. The documentation says they are going to be removed in the
    next release. This MR replaces the deprecated types throughout the code
    base with their modern equivalents.
    
    Also changed `container` to `c` in `GetContainer()`, so the variable
    doesn't collide with the package name.
    xqqp authored Jan 16, 2026
    Configuration menu
    Copy the full SHA
    4e881c0 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2026

  1. feat(graphql): Add support for ef and distance_threshold in generated…

    … GraphQL queries for similarity search (#9562)
    
    **Description**
    
    This PR adds support for the new effort and distance threshold in
    generated GraphQL queries for types that have embedding vectors.
    
    Note. There's a breaking change in the resulting computed distance in
    that for cosine and dotproduct indexes, the computed distance is no
    longer divided by 2. The results now correctly represent the distances
    stored in the index.
    
    **Checklist**
    
    - [x] The PR title follows the
    [Conventional
    Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) syntax,
    leading
          with `fix:`, `feat:`, `chore:`, `ci:`, etc.
    - [x] Code compiles correctly and linting (via trunk) passes locally
    - [x] Tests added for new functionality, or regression tests for bug
    fixes added as applicable
    - [ ] For public APIs, new features, etc., a PR on the
    [docs repo](https://github.com/dgraph-io/dgraph-docs) staged and linked
    here. This process can
    be simplified by going to the [public docs
    site](https://docs.dgraph.io/) and clicking the
    "Edit this page" button at the bottom of page(s) relevant to your
    changes. Ensure that you
    indicate in the PR that this is an **unreleased** feature so that it
    does not get merged into
          the main docs prematurely.
    matthewmcneely authored Jan 23, 2026
    Configuration menu
    Copy the full SHA
    96f976d View commit details
    Browse the repository at this point in the history
  2. chore(ci): update go toolchain version (#9568)

    **Description**
    
    This PR updates the go version to 1.25.6. Subsequently, a number of
    module dependencies are also updated.
    
    This action along with some changes to our Dockerfile removes all high
    and medium CVEs (according to docker scout).
    
    **Checklist**
    
    - [x] The PR title follows the
    [Conventional
    Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) syntax,
    leading
          with `fix:`, `feat:`, `chore:`, `ci:`, etc.
    - [x] Code compiles correctly and linting (via trunk) passes locally
    matthewmcneely authored Jan 23, 2026
    Configuration menu
    Copy the full SHA
    5bc2925 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2026

  1. fix(ci): update trunk go runtime to match go.mod version (#9575)

    ## Summary
    
    - Updates trunk's Go runtime from `1.24.3` to `1.25.6` to match the
    `go.mod` version
    
    ## Context
    
    Commit 5bc2925 updated `go.mod` to Go 1.25.6, but the trunk runtime
    configuration was not updated. This causes the Trunk Code Quality CI
    check to fail with:
    
    ```
    Error: can't load config: the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.25.6)
    ```
    
    ## Test plan
    
    - [x] Verified `trunk check` passes locally after the change
    mlwelles authored Jan 25, 2026
    Configuration menu
    Copy the full SHA
    d2a1bd4 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2026

  1. docs: fix typos in comments (#9569)

    ## Summary
    
    Fix duplicated word typos in comments:
    
    - `the the` → `the`
    - `is is` → `it is`
    - `to to` → `to`
    - `it it` → `it`
    
    ## Files Changed
    
    - dql/parser.go
    - lex/lexer.go
    - graphql/resolve/mutation_rewriter.go
    - worker/sort.go
    NAM-MAN authored Jan 26, 2026
    Configuration menu
    Copy the full SHA
    df3e9d9 View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2026

  1. chore(ci): update GOPATH in CI workflow configuration (#9580)

    **Description**
    
    Fix the GOPATH in the jepsen workflow
    matthewmcneely authored Jan 28, 2026
    Configuration menu
    Copy the full SHA
    094628b View commit details
    Browse the repository at this point in the history
  2. chore(ci): enable manual trigger for ci-dgraph-jepsen-tests (#9581)

    **Description**
    
    Added manual trigger option for the workflow.
    matthewmcneely authored Jan 28, 2026
    Configuration menu
    Copy the full SHA
    f1dfa53 View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2026

  1. Configuration menu
    Copy the full SHA
    1d4b617 View commit details
    Browse the repository at this point in the history
Loading