Skip to content

fix(bench): canonicalise paths in cross-tool diff (trailing dir slash)#392

Open
githubrobbi wants to merge 1 commit into
mainfrom
fix/cross-tool-benchmark-path-normalization
Open

fix(bench): canonicalise paths in cross-tool diff (trailing dir slash)#392
githubrobbi wants to merge 1 commit into
mainfrom
fix/cross-tool-benchmark-path-normalization

Conversation

@githubrobbi

Copy link
Copy Markdown
Collaborator

Problem

cross-tool-benchmark.rs compared each tool's raw output, but uffs.com (C++) emits a trailing \ on directories while Everything (es) and UFFS-Rust do not. Every directory hit became a spurious only-in-cpp / only-in-es pair — the bulk of the reported 11226 / 3736 diff was just c:\dir\ vs c:\dir.

Fix

  • canon_path()/\, lowercase, strip a trailing separator; drive-root guard keeps c: / c:\ / c:\\ all collapsing to c:\ (never c:).
  • first_csv_field() — quote-aware first-field extraction so a path containing a comma stays one field (the old naive comma split mis-parsed those).
  • normalise_paths() now uses both. The real cross-tool residual (cpp enumerates more rows; es has the ~2 GB IPC export cap) is no longer buried under slash noise.

Tests

5 unit tests incl. trailing_slash_difference_no_longer_creates_false_diffs which reconstructs the exact cpp-vs-es mismatch and asserts an empty diff. Compiles native and cargo xwin (Windows) target.

🤖 Generated with Claude Code

cross-tool-benchmark.rs compared each tool's raw output, but uffs.com (C++)
emits a trailing \ on directories while Everything and UFFS-Rust do not, so
every directory hit became a spurious only-in-cpp / only-in-es pair (the bulk
of the reported 11226 / 3736 diff was just c:\dir\ vs c:\dir).

- canon_path(): /->\, lowercase, strip a trailing separator; drive-root guard
  keeps c: / c:\ / c:\\ all collapsing to c:\ (never degrades to c:).
- first_csv_field(): quote-aware first-field extraction so a path containing a
  comma stays one field (the old naive comma split mis-parsed those).
- normalise_paths() now uses both; the real cross-tool residual (cpp enumerates
  more rows; es has the ~2GB IPC export cap) is no longer buried under slash noise.

5 unit tests incl. a regression that reconstructs the exact cpp-vs-es mismatch
and asserts an empty diff. Compiles native + cargo xwin (Windows) target.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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