Commit graph

9 commits

Author SHA1 Message Date
Loric ANDRE 801d1ab036 docs: update benchmarks
Some checks failed
Pull request update / autoupdate (push) Has been cancelled
Release PR / prepare (push) Has been cancelled
Release PR / tag (push) Has been cancelled
Release PR / update-pr (push) Has been cancelled
2026-09-06 22:47:38 +02:00
LoricAndre 5f4798325a
tests: improve coverage on matchers & algos (#1100)
* test(engine,fuzzy_matcher): add unit tests for branch coverage; fix use_cache(false) double-borrow

Add targeted unit tests to exercise every reachable branch in the `engine`
and `fuzzy_matcher` modules, measured with cargo-llvm-cov's branch coverage
on nightly. Tests use realistic inputs and assert concrete behaviour:

- engine: empty/offset/byte-range matching ranges in the fuzzy engine, the
  Frizbee and typo Arinae build paths, AND/OR empty-term filtering, and
  split-engine byte-range char exclusion.
- arinae: typo substitutions and deletions, non-ASCII dispatch, prefilter
  rejection paths, and direct kernel tests for the DP guards / band-skip /
  dead-row pruning that compute_banding makes unreachable through the API.
- clangd/fzy/skim/util: typo-DP substitution, deletion, gap and length-guard
  paths; ASCII/non-ASCII dispatch; single-char and score-only paths; and the
  assert_order failure diagnostics.

Fix a latent double-borrow bug: `use_cache(false)` in the clangd, skim and
fzy matchers called `RefCell::replace` on cache cells whose `RefMut` guards
were still alive, panicking on every match. Drop the guards before clearing
the caches so the option works (and is now covered by tests).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q93ttrw4JoXCjBezV2Skmm

* test(fuzzy_matcher): thread guard paths by isolating callees

Cover branches that are reachable only when the inner helper is invoked
directly with inputs the public matchers can never produce:

- clangd `match_bonus` with `Action::Miss` (callers always pass `Match`) —
  asserts the 30-point in-segment-after-miss penalty.
- fzy `internal_to_skim_score(SCORE_MIN)` sentinel mapping; the empty-pattern
  slow-path `n == 0` guard; and `fzy_score` driven with a non-subsequence
  needle so the position backtrace hits the column-0 fallback.

The branches that remain uncovered are now confirmed structurally
unreachable even via direct callee calls: const-generic monomorphization
artifacts, M-cell `!= SCORE_MIN` checks (an M-cell is never exactly the
sentinel after gap accumulation), a match cell at (i>0, j==0) that is always
SCORE_MIN, and short-circuit operands excluded by upstream invariants.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q93ttrw4JoXCjBezV2Skmm

* test(fuzzy_matcher/skim): thread arg-reachable guards in skim helpers

build_in_place_bonus's `b.len() > 1` and calculate_score_with_pos's
`op.is_none()` are unreachable through the public matcher (the real caller
never passes an empty choice or an over-wide column range), but they ARE
reachable by calling the private helpers directly with such arguments.
Cover both, leaving only genuinely argument-independent dead branches.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q93ttrw4JoXCjBezV2Skmm

* chore: misc checks & fixes

* fix: default bench arg

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: remove magic number

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-27 00:16:15 +02:00
Loric ANDRE 0de1a2acbb chore: format imports 2026-06-17 13:58:44 +02:00
Loric ANDRE c7860a1a16 chore: crate-level lints 2026-05-21 18:19:40 +02:00
LoricAndre e361a8dec0
chore(ci): readd PR check (#1068)
* chore(ci): readd PR check

* fix(ci): use pull_request event

* fix(ci): bash syntax

* fix(ci): pass git cliff context as jq-generated file

* fix(ci): simpler check for changes

* fix(ci): output message if no diff too

* fix(ci): rerun on edit

* fix(ci): exit codes

* chore: fix typos (ci should fail)

* chore: generate files
2026-05-07 12:20:49 +00:00
Loric ANDRE 797ca70da5 docs: add bench graphs [skip ci] 2026-04-07 20:02:23 +02:00
Loric ANDRE e227cafda2 feat: better performance on small datasets 2026-04-07 10:34:12 +02:00
LoricAndre 91e090e813
chore: better CI caching (#1026)
* chore: better CI caching

* chore: generate completions & manpage

* chore: add platform based key

* cache by runner os

* chore: trigger ci

* feat(bench): measure startup time

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-04-02 19:29:46 +02:00
LoricAndre 1a10e405f1
feat: improve matcher & reader performance (#1020)
* chore: migrate bench.py to rust to remove python deps

* feat: replace rayon with a custom thread pool manager

* wip: insert into item_list processed_items directly from matcher

* wip: perf optimizations

* wip: perf optimizations

* wip: reader perf optimizations

* fix: skip --bench injected in bench args

* chore: add ARCHITECTURE.md

* Update src/helper/item_reader.rs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update src/matcher.rs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: use the same pool between reader and matcher

* chore: misc

* fix: tests

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-03-31 18:05:20 +02:00