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

Klein 2.0 API changes inbound #4

Closed
jeremyong opened this issue Mar 3, 2020 · 2 comments
Closed

Klein 2.0 API changes inbound #4

jeremyong opened this issue Mar 3, 2020 · 2 comments

Comments

@jeremyong
Copy link
Owner

I hate breaking compatibility. Especially frequently. This issue is my attempt to explain what the issue is, what I’m doing to fix it, and what assurances can be afforded about API breakages in the future.

First, the issues:

  1. On some compilers, inheritance is causing subclasses of entity to be passed on the stack instead of in registers.
  2. On some compilers, branch optimization limits are being hit causing certain loops over constexpr variables to not get optimized out at runtime.

For Klein whose primary goal is realtime PGA, both of these problems are unacceptable. As a result, the entity base class needs to go. This will have the following consequences:

  1. Implicit conversions using the entity as a medium will go away. All conversions will be explicit
  2. Because of (1), most operators will move to separate headers (one per operation) to avoid circular dependencies while maintaining type safety
  3. All the underlying implementation structure will remain the same.

As for testing, I have vetted that the changes outlined above solve all the issues mentioned and checked assembly/perf against all major compilers. All that remains is to finalize the implementation. The internal SSE code does not need to be changed as it is just the “outer shell” that has this problem. Personally, I much prefer the new API, but it is nevertheless a breaking change. As a result, Klein will get a 2.0 label despite the 1.0 being released relatively recently.

Feel free to comment with suggestions or feedback below.

@jeremyong
Copy link
Owner Author

FYI most geometric operations (meet, join, GP, etc) will work as they currently do (they might just require a header change if you didn't include klein.hpp. The only operations that need to be lifted out are operators that change the argument types (mainly exp/log)

@jeremyong
Copy link
Owner Author

RC checkin d447c5d

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

1 participant