Skip to content

Fix diversity check by excluding loss outcome#2

Merged
mnemoo merged 5 commits intomnemoo:mainfrom
AshladBP:main
Jan 22, 2026
Merged

Fix diversity check by excluding loss outcome#2
mnemoo merged 5 commits intomnemoo:mainfrom
AshladBP:main

Conversation

@AshladBP
Copy link
Copy Markdown
Contributor

Summary

This PR updates the simulation diversity check to avoid evaluating the loss outcome as part of the "most frequent outcome" diversity threshold.

Background

The project enforces:

  • a hit rate constraint (hit rate must be between 5% and 33%)
  • a simulation diversity check, warning when the most frequent outcome exceeds 1%

When the loss outcome is included in the diversity evaluation, the warning becomes effectively unavoidable in valid cases, since:

  • loss_rate = 1 - hit_rate
  • with hit_rate = 5% -33% -> loss_rate = 67% - 95%

So the loss outcome will naturally dominate frequency distribution.

Change

  • If the most frequent outcome is loss, the diversity check now evaluates the next most frequent non-loss outcome instead.
  • The loss outcome is still shown in results, only the diversity threshold evaluation skips it.

Benefit

This avoids systematic false warnings while preserving the goal of the diversity check: detecting cases where a specific non loss outcome becomes overly dominant.

Refactor calculateMostFrequentProbability to return both most frequent and zero probabilities. Update related logic to handle the new return values and improve check reason formatting.
Refactor DistributionTable to allow multiple expanded buckets instead of one. Update related state management and rendering logic accordingly.
Updated ShortConfig type to include input format and modified related functions to handle conversion between absolute and normalized values. Enhanced UI to allow users to select input format for bucket ranges.
@mnemoo mnemoo merged commit 51c14b8 into mnemoo:main Jan 22, 2026
mnemoo added a commit that referenced this pull request Jan 22, 2026
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