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

Report precision with result #15

Open
davidsiska-vega opened this issue Mar 16, 2021 · 2 comments
Open

Report precision with result #15

davidsiska-vega opened this issue Mar 16, 2021 · 2 comments

Comments

@davidsiska-vega
Copy link
Contributor

davidsiska-vega commented Mar 16, 2021

It is well known that floating point calcs can be non-deterministic across architectures / compilers etc.

Each call to the quant lib should report the precision to which it can be trusted. E.g. for risk factor short return:

  1. rf e.g. 0.123456789
  2. precision e.g. 1e-5.

This would mean that up to 5th decimal place we don't expect any floating point non-determinism to creep in.
Users can then round the result to 0.12345000 ignoring the remaining digits if they want to play safe.

Another example:

  1. probability of trading 0.000000911
  2. precision 1e-7
    Core should use probability of trading 0.000000900

Another example:

  1. probability of trading 0.000000911
  2. precision 1e-3
    Core should use probability of trading 0.

@jeremyletang @peterbarrow @witgaw

(I also have a strong feeling that I've written this somewhere already so if anyone knows where the issue is let me know) and link it here or delete this one...

@edd
Copy link
Contributor

edd commented Mar 16, 2021

This came up because I mentioned to @davidsiska-vega that there was a discussion and incoming ticket about this

@davidsiska-vega
Copy link
Contributor Author

davidsiska-vega commented Mar 16, 2021

The other part of this discussion was to send the values coming out of floating-point calculations back through the consensus layer... so any floating point discrepancy is agreed upon as part of consensus and then the core is again working with the same values.

We can do this both with risk factors and with probability of trading. The core will simply have to have a cached view of all of all these numbers...

We should do both

  1. the update to quant library here and
  2. sending any float calc results via consensus (this would be a ticket in core).

Without 1) there is more chance of consensus failing... so 1) is needed even if we do 2).

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

No branches or pull requests

2 participants