Skip to content

test(search): measured file-dedup - removes repeats, moves no score - #112

Merged
ManSio merged 3 commits into
mainfrom
exp/file-dedup
Nov 10, 2026
Merged

ManSio merged 3 commits into
mainfrom
exp/file-dedup

Conversation

@ManSio

@ManSio ManSio commented Nov 10, 2026

Copy link
Copy Markdown
Owner

test(search): measured file-dedup — removes repeats, moves no score

The external benchmark said the tool answers with chunks while grep ranks whole
files, and 22-29% of the answer rows repeated a file already shown. This tests
whether that is the gap: one row per file first, leftover rows fill the tail,
behind MSCODEBASE_FILE_DEDUP=file, off by default.

Frozen spec, written before the code: experiments/file_dedup_2026_11/frozen/PLAN.md

sqlalchemy, 40 commits      hit@5
  flag off                     11     neighbours 19 · search 18 · grep 20
  flag on                      11     (bar >=14: FAILED)
B1 dev, 71 commits        19/71 both ways (bar 19: PASS)
usage probes (P3)         5/20 kept   (bar 3 of 4 groups = 15/20: FAILED)
flag off, 10 answers      sha256-identical to HEAD (P4: PASS)

The flag did work: on the same 20 commits duplicate rows went 25 -> 0, and 10 of
those 25 sat at ranks 1-5. The swaps were real and neutral. What limits the tool
is which distinct files rank where, not that one file filled several slots.

The cost is real for "where is X used": once 8 distinct files are found the
second pass never runs, so same-file call sites collapse to one row.

Side finding, recorded rather than fixed: 6 of 20 sqlalchemy commits get an empty
answer (0 rows) with and without the flag.

Verdict: negative result. The switch stays experimental and off and is documented
as such in all three CONFIGURATION.md files. "Dedup by file" is not the
explanation for the grep gap and must not be shipped as one.

P4 needed a second run: the first pair was measured while the sqlalchemy
benchmark held the same SQLite index, one baseline answer carried
"degraded: impact:InterfaceError", and the two files differed - the harness, not
the code.

The external benchmark said the tool answers with chunks while grep ranks whole
files, and 22-29% of the answer rows repeated a file already shown. This tests
whether that is the gap: one row per file first, leftover rows fill the tail,
behind MSCODEBASE_FILE_DEDUP=file, off by default.

Frozen spec, written before the code: experiments/file_dedup_2026_11/frozen/PLAN.md

    sqlalchemy, 40 commits      hit@5
      flag off                     11     neighbours 19 · search 18 · grep 20
      flag on                      11     (bar >=14: FAILED)
    B1 dev, 71 commits        19/71 both ways (bar 19: PASS)
    usage probes (P3)         5/20 kept   (bar 3 of 4 groups = 15/20: FAILED)
    flag off, 10 answers      sha256-identical to HEAD (P4: PASS)

The flag did work: on the same 20 commits duplicate rows went 25 -> 0, and 10 of
those 25 sat at ranks 1-5. The swaps were real and neutral. What limits the tool
is which distinct files rank where, not that one file filled several slots.

The cost is real for "where is X used": once 8 distinct files are found the
second pass never runs, so same-file call sites collapse to one row.

Side finding, recorded rather than fixed: 6 of 20 sqlalchemy commits get an empty
answer (0 rows) with and without the flag.

Verdict: negative result. The switch stays experimental and off and is documented
as such in all three CONFIGURATION.md files. "Dedup by file" is not the
explanation for the grep gap and must not be shipped as one.

P4 needed a second run: the first pair was measured while the sqlalchemy
benchmark held the same SQLite index, one baseline answer carried
"degraded: impact:InterfaceError", and the two files differed - the harness, not
the code.
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fdbbf176-49aa-4d2a-9a49-57b8b378c9fc
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

MSCodeBase Agent added 2 commits November 11, 2026 00:43
…t-rate numbers

The report's "6 of 20 empty answers" and "22-29% repeated rows" came from
duplicate_positions.py, which at the time sampled raw commits from git log. That
sample includes docs-only commits with no .py gold - a different population than
the benchmark's 40-task panel, where the bar is measured.

Re-measured on the benchmark's own task list, flag off:

    rows=216  duplicate_rows=70 (0.32)  empty_answers=13
    duplicates at ranks 1-5: 34 of 70

The E72 verdict does not change (the flag removes every duplicate and hit@5
stays at 11/40), but the motivation is now stated on the right denominator, and
the 13 empty answers point at E73 rather than at "a small-repo effect".

duplicate_positions.py now applies the same task filter as the benchmark and
exits 2 when the population size does not match, so the share cannot be printed
against a different denominator again.
@ManSio
ManSio merged commit 74191a5 into main Nov 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant