-
Notifications
You must be signed in to change notification settings - Fork 60
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
Implement guardrails for Fibonacci benchmark utilities #995
Conversation
2d5fdd7
to
cbb9984
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't want to make fibonacci utilities part of the public API of Lurk.
If this was just for benches, a better approach here is to open another crate in our workspace (which already has several) , make it non-publishable, and make this crate a dev-dependency
. Unfortunately, this would not work for examples.
One approach we could envision is to have an unpublished application crate in the workspace that contains essentially the code of the example (and example is morally a public external module anyway), and that crate could have a benchmark. This would work because both bench and example are supposed to only call into the lurk public functions, which is something they can do from an external crate.
This will require some CI support (/cc @samuelburnham for visibility) and has no downside I can see besides being quite a bit of work: perhaps not our first priority atm, to save a few lines of duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some details I'm not very happy about the latest commit.
Also, it needs the changes so CI doesn't break, since this moves benches/fibonacci.rs
to lurk-fibonacci/benches/throughput.rs
@samuelburnham I need your help on this one
Right so in the grand scheme of things the question is: was this worth it? If we had a grand benchmark such that say the Lurk function is hard to maintain in two places, maybe. In our case, maybe the status quo is enough? |
For the sake of correctness and simplicity, I'd rather revert the latest commit and have |
80d3baa
to
bb6d6e3
Compare
bb6d6e3
to
cab9d6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thank you so much!
This PR implements an automatic computation of the linear and angular coefficients for the iteration count formula and uses that to assert that the hardcoded constants are correct. These assertions run in the beginning of the benchmark routine.
It also removes
examples/fibonacci.rs
as its main purpose was to validate the constants that we hardcoded. The function to extract the Fibonacci result was factored out tobenches/common/fib.rs
and is used for the tests mentioned above.Closes #990