Skip to content

fix: report zero-threshold query benchmarks as safe - #651

Open
appleweiping wants to merge 1 commit into
pisa-engine:mainfrom
appleweiping:upgrade/queries-safe-summary-598-20261116
Open

appleweiping wants to merge 1 commit into
pisa-engine:mainfrom
appleweiping:upgrade/queries-safe-summary-598-20261116

Conversation

@appleweiping

Copy link
Copy Markdown
Contributor

What changed

Fixes #598 by making the queries benchmark summary describe zero-threshold runs accurately.

When no thresholds file is supplied, every query starts with threshold 0, so pruning cannot exclude a candidate. The benchmark still keeps the existing --safe corrective-rerun behavior for explicit threshold files, but its JSON summary now reports "safe": true for the zero-threshold case.

The change is isolated behind tools/query_safety.hpp, adds a regression test, and documents the distinction in the CLI guide. Retrieval algorithms, ranking, threshold-file behavior, and timing logic are unchanged.

Validation

  • Header smoke test with g++ C++20: compile and run passed.
  • git diff --check: passed.
  • Added Catch2 regression test: zero-threshold summary is safe, explicit-threshold summary remains unsafe unless corrective rerun is enabled.

The full CMake/Catch2 suite was not run because this checkout does not have CMake or initialized Catch2 headers. No index, model, or dataset was downloaded.

Signed-off-by: appleweiping <vipinapple986@gmail.com>

@elshize elshize left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but it fails to compile on CI, I think you may need to use a different include for the catch2 version we use, see other test files for examples.

This branch has not been deployed

No deployments
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.

queries should say "safe=true" by default if no thresholds are provided

2 participants