Skip to content

Add a note about word size to the MersenneTwisterEngine changelog entry #5141

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

Merged
merged 1 commit into from
Feb 16, 2017

Conversation

WebDrake
Copy link
Contributor

This was an oversight when finalizing #5011.

Handling of the word size `w` has been fixed so that the generator will
now properly handle cases where it is less than the number of bits in
the chosen `UIntType`. This has been validated against the behaviour
of the C++11 standard implementation.
Copy link
Member

Choose a reason for hiding this comment

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

Is there an implementation in the C++ standard? Otherwise, the wording here is slightly confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, good point. Obviously I compared against an implementation of the C++11 standard. However the standard itself does mandate the expected behaviour (which is really only re-stating the expected behaviour of the algorithm itself). See p. 899 (numbers; p. 913 in your PDF browser) of http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll rephrase to an implementation of the C++11 standard.

@WebDrake
Copy link
Contributor Author

Amused to see that code coverage metrics can change because of a tweak to a changelog entry ... :-P

@WebDrake WebDrake force-pushed the mersenne-twister-changelog branch from d021e2e to c0d7271 Compare February 16, 2017 19:52
@WebDrake
Copy link
Contributor Author

Updated to improve the wording:

diff --git a/changelog/std-random-MersenneTwisterEngine.dd b/changelog/std-random-MersenneTwisterEngine.dd
index 7d97481..0fa3d23 100644
--- a/changelog/std-random-MersenneTwisterEngine.dd
+++ b/changelog/std-random-MersenneTwisterEngine.dd
@@ -5,7 +5,7 @@ tempering parameter `d` and the initialization multiplier `f`).
 Handling of the word size `w` has been fixed so that the generator will
 now properly handle cases where it is less than the number of bits in
 the chosen `UIntType`.  This has been validated against the behaviour
-of the C++11 standard implementation.
+of a widely-used implementation of the C++11 standard.
 
 For anyone using the standard template instantiation `Mt19937` this will
 have no noticeable effect.  However, these will be breaking changes for

@WebDrake
Copy link
Contributor Author

... and now it's somehow gained code coverage, despite not touching any actual code :-P

There must be a rounding error out there somewhere ...

@JackStouffer assuming you're happy with the new wording, dlang-bot seemed to dislike your tag ;-)

@wilzbach
Copy link
Member

dlang-bot seemed to dislike your tag ;-)

Well, that's a feature that auto-merge gets disabled once the approved diff changes as otherwise I would be a potential hole to slip in unreviewed code ;-)
@JackStouffer simply re-add it then

@WebDrake
Copy link
Contributor Author

Well, that's a feature

Ah, good point :-) Thanks for the clarification!

@dlang-bot dlang-bot merged commit b5e76a2 into dlang:master Feb 16, 2017
@WebDrake WebDrake deleted the mersenne-twister-changelog branch February 16, 2017 22:20
wilzbach pushed a commit to wilzbach/phobos that referenced this pull request Feb 17, 2017
Add a note about word size to the MersenneTwisterEngine changelog entry
merged-on-behalf-of: Jack Stouffer <jack@jackstouffer.com>
@wilzbach
Copy link
Member

... and now it's somehow gained code coverage, despite not touching any actual code :-P
There must be a rounding error out there somewhere ...

The problem is that CircleCi merges the PR with upstream/master before it runs the coverage tests. Thus a change in master in the meanwhile (aka from the ref your PR is based on) will yield a different project result. I contacted the guys from CircleCi to accommodate this behavior in their pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants