Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R4R simulator bugfix for multisim 7601778 #4365

Merged
merged 2 commits into from
May 17, 2019

Conversation

rigelrozanski
Copy link
Contributor

@rigelrozanski rigelrozanski commented May 17, 2019

closes #4362

For the record what was happening is all three integers set in InitialLivenessWeightings were set to 0 making the "total" of that equal to zero which caused an error for rand here:

randNum := r.Intn(total)

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote tests
  • Updated relevant documentation (docs/)
  • Added a relevant changelog entry: clog add [section] [stanza] [message]
  • rereviewed Files changed in the github PR explorer

For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

ACK

@codecov
Copy link

codecov bot commented May 17, 2019

Codecov Report

Merging #4365 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4365   +/-   ##
=======================================
  Coverage   58.11%   58.11%           
=======================================
  Files         235      235           
  Lines       14880    14880           
=======================================
  Hits         8647     8647           
  Misses       5605     5605           
  Partials      628      628

@alexanderbez alexanderbez merged commit cef7880 into master May 17, 2019
@alexanderbez alexanderbez deleted the rigel/4362-simulation-bugfix branch May 17, 2019 23:45
@@ -134,7 +134,7 @@ func RandomParams(r *rand.Rand) Params {
PastEvidenceFraction: r.Float64(),
NumKeys: RandIntBetween(r, 2, 250),
EvidenceFraction: r.Float64(),
InitialLivenessWeightings: []int{r.Intn(80), r.Intn(10), r.Intn(10)},
InitialLivenessWeightings: []int{RandIntBetween(r, 1, 80), r.Intn(10), r.Intn(10)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to "protect" the last two parameters to be above 0 as well? If not, maybe another sampling procedure would be required to insure that the sum > 0. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

What I mean by that is that any of these values (single one or two of them) being 0 is valid, what is not is if they are all 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope I don't think it matters, As long as there is "some" liveliness we're good aka "protecting" just one of the weightings is fine. I think it's good to simulate with a liveliness weighting of 0 as it's a valid value.

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.

Random Fuzzer panic: invalid argument to Intn
3 participants