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 precision difference for sketch mode running on different architectures #921

Closed
alixander opened this issue Feb 27, 2023 · 6 comments
Closed

Comments

@alixander
Copy link
Collaborator

alixander commented Feb 27, 2023

there's something inside here that's causing sketch tests to be different when run on amd and arm architectures (e.g. M1 macbook and intel macbook).

To reproduce:

Requires a machine that can run both architectures (I'm on M1 macbook which can run both), or VM environments or such

Run
GOARCH=arm64 TESTDATA_ACCEPT=1 ./ci/test.sh ./d2renderers/d2sketch/ -count=1

Notice nothing changes. (the red asterisk in my terminal means changed files). This is the architecture that our CI runs on.

Run
GOARCH=amd64 TESTDATA_ACCEPT=1 ./ci/test.sh ./d2renderers/d2sketch/ -count=1

Notice there are changes!

Screen Shot 2023-04-02 at 3 03 42 PM

I'm not sure if this issue is in rough.js, the JS engine (goja), rounding on architectures, or something in our code reading/writing data from/to rough.js.

@alixander
Copy link
Collaborator Author

was a go compiler bug, nonissue after bumping to 1.20 #1020

@github-project-automation github-project-automation bot moved this to Done in D2 Mar 13, 2023
@alixander
Copy link
Collaborator Author

sad, it was not.

@alixander alixander reopened this Mar 13, 2023
@alixander
Copy link
Collaborator Author

alixander commented Apr 2, 2023

/bounty $220

(trying out this new service i saw on HN. it's an experiment to try to incentivize someone to solve this annoying thing no one wants to do. just a one-time thing for now)

@algora-pbc
Copy link

algora-pbc bot commented Apr 2, 2023

💎 $220.00 bounty created by alixander
👉 To claim this bounty, submit a pull request that includes the text /claim #921 somewhere in its body
📝 To receive payouts, join Algora and complete the relevant onboarding steps
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to terrastruct/d2!

@alixander alixander changed the title fix floating point precision from rough.js fix precision difference for sketch mode running on different architectures Apr 2, 2023
@algora-pbc
Copy link

algora-pbc bot commented Apr 3, 2023

💡 ifndev submitted a pull request that claims the bounty. You can visit your org dashboard to reward.

@algora-pbc
Copy link

algora-pbc bot commented Apr 3, 2023

🎉🎈 @ifndev has been awarded $220.00! 🎈🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant