[mmu probing] Add UT for lower bound upper_bound=1 edge case#24356
Open
yyynini wants to merge 1 commit intosonic-net:masterfrom
Open
[mmu probing] Add UT for lower bound upper_bound=1 edge case#24356yyynini wants to merge 1 commit intosonic-net:masterfrom
yyynini wants to merge 1 commit intosonic-net:masterfrom
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
When upper_bound=1, start value (upper_bound//2) is 0, which falls below the loop guard (current >= 1). The loop never executes and the algorithm falls through to the max_iterations error path. This test verifies that edge case behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Yawen Ni <yawenni@microsoft.com>
dbb4e15 to
241116e
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Add unit test verifying LowerBoundProbingAlgorithm behavior when upper_bound=1.
Problem: When upper_bound=1, the start value (upper_bound//2) is 0, which falls below the loop guard (current >= 1). The while loop never executes, and the algorithm falls through to the max_iterations error path returning (None, phase_time). No existing test covers this edge case.
Test added:
test_run_upper_bound_one_skips_loop(order 8360) - verifies no executor.check calls are made and the algorithm correctly reports max_iterations exceeded.Type of change
Approach
What is the motivation for this PR?
Coverage gap: no test validates behavior when upper_bound=1 causes the initial current to be 0.
How did you do it?
Added 1 unit test to
test_lower_bound_probing_algorithm.pyHow did you verify/test it?
Test passes against current implementation (loop guard prevents execution, falls through to error path).