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

Fix rounding accumulation bug #521

Merged
merged 8 commits into from
Jul 23, 2023
Merged

Conversation

nicoburns
Copy link
Collaborator

Objective

Notes

  • This fix is a bit hacky. I think ideally we'd want to differentiate between rounded and unrounded values in the public API. But the advantage of this implementation is that it's backwards compatible and can be released as a patch to the 0.3.x series. We can of course always improve upon this in the 0.4 release.
  • It requires us to store both rounded and unrounded values, adding (I believe) 20 bytes per node. This is not ideal, but it seems like the simplest way to fix the issue. Perhaps in future we could improve upon this on future too.

Feedback wanted

General code review

@nicoburns nicoburns added the bug Something isn't working label Jul 22, 2023
@nicoburns nicoburns added this to the 0.3.13 milestone Jul 22, 2023
Copy link
Collaborator

@TimJentzsch TimJentzsch left a comment

Choose a reason for hiding this comment

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

The approach looks reasonable to me, I left some comments regarding documentation.

src/compute/taffy_tree.rs Outdated Show resolved Hide resolved
src/compute/taffy_tree.rs Outdated Show resolved Hide resolved
src/tree/node.rs Outdated Show resolved Hide resolved
@nicoburns nicoburns merged commit 25ffaee into main Jul 23, 2023
16 checks passed
@nicoburns nicoburns deleted the fix-rounding-accumulation-bug branch July 23, 2023 11:44
nicoburns added a commit that referenced this pull request Aug 13, 2023
(cherry picked from commit 25ffaee)
nicoburns added a commit that referenced this pull request Aug 13, 2023
(cherry picked from commit 25ffaee)
nicoburns added a commit that referenced this pull request Aug 13, 2023
(cherry picked from commit 25ffaee)
nicoburns added a commit that referenced this pull request Aug 14, 2023
(cherry picked from commit 25ffaee)
nicoburns added a commit that referenced this pull request Aug 14, 2023
(cherry picked from commit 25ffaee)
nicoburns added a commit that referenced this pull request Aug 14, 2023
(cherry picked from commit 25ffaee)
nicoburns added a commit that referenced this pull request Aug 14, 2023
(cherry picked from commit 25ffaee)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rounding errors can accumulate and cause nodes to expand each time a layout is recomputed
3 participants