Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 21, 2025

The F2T (FactorToThreshold) function lacked test coverage despite comprehensive testing patterns throughout the codebase.

Changes

  • TestF2T: 14 test cases covering edge cases

    • Invalid inputs: zero, negative, NaN (all return NaN)
    • Infinity: +Inf returns 1.0, -Inf returns NaN
    • Common speedups: 1x (0.0), 2x (0.5), 3x (~0.667), 10x (0.9)
    • Slowdowns: values in (0,1) return negative thresholds
    • Extreme values: very large multipliers, near-zero inputs
  • TestF2TEdgeCases: Boundary conditions and mathematical consistency

    • Exact behavior at timesFaster=1.0
    • Values just above/below 1.0
    • Formula validation: threshold = 1 - 1/timesFaster
// Examples of expected behavior
F2T(2.0)    // 0.5 (50% reduction, 2x speedup)
F2T(1.0)    // 0.0 (no speedup)
F2T(0.5)    // -1.0 (negative threshold, slowdown)
F2T(0.0)    // NaN (invalid)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 21, 2025 12:28
Co-authored-by: TomTonic <20836927+TomTonic@users.noreply.github.com>
Co-authored-by: TomTonic <20836927+TomTonic@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues from review on Add CPRNG PR Add test coverage for F2T function Dec 21, 2025
Copilot AI requested a review from TomTonic December 21, 2025 12:30
Copy link
Owner

@TomTonic TomTonic left a comment

Choose a reason for hiding this comment

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

as expected

@TomTonic TomTonic marked this pull request as ready for review December 22, 2025 15:51
@TomTonic TomTonic merged commit 050706c into new_cprng Dec 22, 2025
1 of 2 checks passed
@TomTonic TomTonic deleted the copilot/sub-pr-28 branch December 22, 2025 15:51
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.

2 participants