Skip to content

Tweak distribution of diskann-wide float tests. - #1305

Open
Mark Hildebrand (hildebrandmw) wants to merge 6 commits into
mainfrom
mhildebr/distribution
Open

Tweak distribution of diskann-wide float tests.#1305
Mark Hildebrand (hildebrandmw) wants to merge 6 commits into
mainfrom
mhildebr/distribution

Conversation

@hildebrandmw

Copy link
Copy Markdown
Contributor

The Finite distribution for generating floating point numbers in the diskann-wide random tests is slightly biased: the same value is used to select the kind of floating-point number and the value of that number. Practically speaking, the bias is relatively small - but it does mean that some valid floating-point bit patterns cannot be created.

This PR fixes that by splitting the kind generation from the value generation. As a side-effect, it also removes the tiny bias introduced by the modulo. This does mean that normal numbers have a slightly higher fraction of the generated values, but not significantly.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the diskann-wide floating-point Finite test distribution to remove an unintended bias caused by reusing the same random bits for both “kind selection” (normal/subnormal/zero) and the generated value’s bit-pattern.

Changes:

  • Split “kind selection” entropy from the generated float’s bit-pattern by sampling a wider integer and partitioning it into upper/lower bits.
  • Replace the old non-power-of-two modulo weighting (100) with a power-of-two bucket count (128) to eliminate modulo-induced bias.
  • Update the distribution tests’ expected weights to match the adjusted bucket thresholds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread diskann-wide/src/test_utils/distribution.rs
@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.27%. Comparing base (bea135b) to head (f2ca48a).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1305      +/-   ##
==========================================
- Coverage   91.46%   91.27%   -0.20%     
==========================================
  Files         516      517       +1     
  Lines       98200    98517     +317     
==========================================
+ Hits        89820    89919      +99     
- Misses       8380     8598     +218     
Flag Coverage Δ
miri 91.27% <100.00%> (-0.20%) ⬇️
unittests 90.94% <100.00%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
diskann-wide/src/test_utils/distribution.rs 100.00% <100.00%> (ø)

... and 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings August 3, 2026 21:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comment thread diskann-wide/src/test_utils/distribution.rs Outdated
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.

5 participants