Bug: resolve issue aarch64-darwin hash mismatch
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 66
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
@winterqt discovered that all the FOD branding assets failed to build on aarch64-darwin due to hash mismatches. After comparing their output with my own builds on x86_64-linux, we found that it was due to floating point differences.
The easiest fix might be to add a simple function that can round to significant figures. This implementation should work.
def round_to_sigfig(x, s):
return round(x, s - 1 - int(floor(log10(abs(x)))))
After some basic testing, it appears to work. Also not shown is it working for negative numbers.
>>> def round_to_sigfig(x, s):
... return round(x, s - 1 -int(floor(log10(abs(x)))))
...
>>> round_to_sigfig(1111.1111, 8)
1111.1111
>>> round_to_sigfig(1111.1111, 7)
1111.111
>>> round_to_sigfig(1111.1111, 4)
1111.0
>>> round_to_sigfig(1111.1111, 2)
1100.0
Double precision in IEEE 754 should give between 15-17 digits of precision. Using 12 significant figures should be sufficient. It will solve the rounding differences, give us a few digits of padding in case anything weird happens, but still have enough precision that we will never have to worry about a lack of co-linear lines.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named; start by tracing the FOD branding asset build and reproducing the hash mismatch on aarch64-darwin versus x86_64-linux. Evaluate the proposed significant-figure rounding approach, including negative values, and consider the issue done when the generated assets have matching hashes across both platforms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100