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

hoon: minor improvement to +mod and +dvr #6355

Merged
merged 1 commit into from Mar 1, 2023
Merged

Conversation

ashelkovnykov
Copy link
Contributor

@ashelkovnykov ashelkovnykov commented Feb 23, 2023

Unify logic for div and mod in dvr, instead of splitting the logic and repeating the same calculation twice on a dvr call.

Also add default sample to dvr, mirroring div and mod.

Tested changes successfully against latest code from develop (both urbit/urbit and urbit/vere).

@joemfb
Copy link
Member

joemfb commented Feb 23, 2023

With this change, the +mod jet should also be updated to use u3m_error() as the other two do.

@ashelkovnykov
Copy link
Contributor Author

@joemfb Good catch - added a companion PR to urbit/vere: #257. They must be released together.

@philipcmonk
Copy link
Contributor

Is this a semantic change? Is it possible that the old code would give a different result than the new code? If so, it must be released in a hoon kelvin update so the jet never fires with the wrong nock

@ashelkovnykov
Copy link
Contributor Author

@philipcmonk The only difference should be the one Joe pointed out: the new code gives a different result in the case of "divide by zero" error.

Old code = bail: exit
New code = u3t_mean("divide-by-zero"), then bail: exit

What's the protocol for explicitly marking this PR as requiring a hoon kelvin update? Should I dump the kelvin version in this PR, and then all other such changes nicely merge together since they also dump the kelvin version?

Copy link
Member

@joemfb joemfb left a comment

Choose a reason for hiding this comment

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

Will it's technically true that this code must be released at the same time as the paired jet changes to avoid a mismatch, it's an utterly trivial mismatch (the error string in the trace when dividing by zero). The livenet version of this code already contains such a mismatch -- the +dvr jet includes the error string, while the hoon does not. And stack traces are already subject to such mismatches anytime the set of actual jets changes relative to execution history (ie, on replay) -- a problem for another day. I don't think we have to worry about kelvins for this PR specifically.

this will do

@ashelkovnykov
Copy link
Contributor Author

@belisarius222 @jalehman Ready for merge

@jalehman jalehman merged commit e4f5a92 into urbit:develop Mar 1, 2023
jalehman added a commit to urbit/vere that referenced this pull request Mar 1, 2023
Companion PR for [#6355](urbit/urbit#6355) in
`urbit/urbit` - **they must be released together**.

Required changes to `mod` jet to match bail condition of new `mod` logic
in Arvo.

Tested changes successfully against latest code from `develop` (both
`urbit/urbit` and `urbit/vere`).
@ashelkovnykov ashelkovnykov deleted the dvr branch March 11, 2023 10:33
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.

None yet

4 participants