Skip to content

Conversation

laanwj
Copy link
Member

@laanwj laanwj commented Nov 24, 2020

Aplies a patch to Qt that fixes the non-determinism by modifying Qt. The
source of the non-determinism is how LLVM 8 optimizes qt_intersect_spans
when compiling. The particular optimization that seems to be causing the
problems is that a temp variable is being added for spans->y. For some
reason, when it does this, it chooses different instructions to use when
making that variable. We bypass this problem by patching
qt_intersect_spans to always make and use this local variable.

Github-Pull: #20447
Rebased-From: 8f7d1b3
Tree-SHA512: 558da5c2bb0373e2a89f2c219170f802036e0e87cc8e808336b23d074152cb893007a440f46ec957156b0921355cd18502710f2d224f27bc26e934c50ebebc41

Aplies a patch to Qt that fixes the non-determinism by modifying Qt. The
source of the non-determinism is how LLVM 8 optimizes qt_intersect_spans
when compiling. The particular optimization that seems to be causing the
problems is that a temp variable is being added for spans->y. For some
reason, when it does this, it chooses different instructions to use when
making that variable. We bypass this problem by patching
qt_intersect_spans to always make and use this local variable.

Github-Pull: bitcoin#20447
Rebased-From: 8f7d1b3
Tree-SHA512: 558da5c2bb0373e2a89f2c219170f802036e0e87cc8e808336b23d074152cb893007a440f46ec957156b0921355cd18502710f2d224f27bc26e934c50ebebc41
@laanwj laanwj added this to the 0.21.0 milestone Nov 24, 2020
@laanwj laanwj changed the title Fix QPainter non-determinism on macOS (0.21) Fix QPainter non-determinism on macOS (0.21 backport) Nov 24, 2020
@jonasschnelli
Copy link
Contributor

Thanks.
codereview ACK ab23a83

@achow101
Copy link
Member

ACK ab23a83

@laanwj
Copy link
Member Author

laanwj commented Nov 24, 2020

fwiw this is my gitian output for commit ab23a83:

9df7d246f4b55910bd97aa5b010f78d5c9ffd7ca44950230df39a22205d7fe2f  bitcoin-ab23a83400d5-osx-unsigned.dmg
5a51563c3bf09248f5bce66a690a1773e964d649c45b6f6aaf82748fa5caff7d  bitcoin-ab23a83400d5-osx-unsigned.tar.gz
d894452b461b9b9e779b6868a0c1d9ea0c33339694470646082234217ddcc05d  bitcoin-ab23a83400d5-osx64.tar.gz
d671af2ac2b9ec021c1cbb4614209b504d5bb4e1b1ddc922c7f0adcd99f529b6  src/bitcoin-ab23a83400d5.tar.gz

@achow101
Copy link
Member

I have different gitian results:

4470b43908a988448b2f2ea3f52fe70e21eecb22e5b1ec41e4537e7a4973a5fa  bitcoin-ab23a83400d5-osx-unsigned.dmg
ed3981d167801ec0202bd6a6ebbc4cd3cebed4ce5a7967a10668bf0fc1157f75  bitcoin-ab23a83400d5-osx-unsigned.tar.gz
e6d77e825cb102c9d3092c9d04493182acb2e9fd3223fde1a2ee327f3aadea1c  bitcoin-ab23a83400d5-osx64.tar.gz
d671af2ac2b9ec021c1cbb4614209b504d5bb4e1b1ddc922c7f0adcd99f529b6  src/bitcoin-ab23a83400d5.tar.gz

@laanwj Did you clean the cache before building?

@laanwj
Copy link
Member Author

laanwj commented Nov 24, 2020

No, I did not clean the cache before building. Will try…

@laanwj
Copy link
Member Author

laanwj commented Nov 24, 2020

Unfortunately I still get the same output after cleaning my cache (deleting cache/bitcoin-core-osx-0.21)

9df7d246f4b55910bd97aa5b010f78d5c9ffd7ca44950230df39a22205d7fe2f  bitcoin-ab23a83400d5-osx-unsigned.dmg
5a51563c3bf09248f5bce66a690a1773e964d649c45b6f6aaf82748fa5caff7d  bitcoin-ab23a83400d5-osx-unsigned.tar.gz
d894452b461b9b9e779b6868a0c1d9ea0c33339694470646082234217ddcc05d  bitcoin-ab23a83400d5-osx64.tar.gz
d671af2ac2b9ec021c1cbb4614209b504d5bb4e1b1ddc922c7f0adcd99f529b6  src/bitcoin-ab23a83400d5.tar.gz

@fanquake
Copy link
Member

I'm seeing the same result as @laanwj:

Generating report
9df7d246f4b55910bd97aa5b010f78d5c9ffd7ca44950230df39a22205d7fe2f  bitcoin-ab23a83400d5-osx-unsigned.dmg
5a51563c3bf09248f5bce66a690a1773e964d649c45b6f6aaf82748fa5caff7d  bitcoin-ab23a83400d5-osx-unsigned.tar.gz
d894452b461b9b9e779b6868a0c1d9ea0c33339694470646082234217ddcc05d  bitcoin-ab23a83400d5-osx64.tar.gz
d671af2ac2b9ec021c1cbb4614209b504d5bb4e1b1ddc922c7f0adcd99f529b6  src/bitcoin-ab23a83400d5.tar.gz
4dc65a795df2c40c086ddcc76990d9c623325480a0b30e59b12157289a881180  bitcoin-core-osx-0.21-res.yml

@dongcarl
Copy link
Contributor

Same here:

9df7d246f4b55910bd97aa5b010f78d5c9ffd7ca44950230df39a22205d7fe2f  bitcoin-ab23a83400d5-osx-unsigned.dmg
5a51563c3bf09248f5bce66a690a1773e964d649c45b6f6aaf82748fa5caff7d  bitcoin-ab23a83400d5-osx-unsigned.tar.gz
d894452b461b9b9e779b6868a0c1d9ea0c33339694470646082234217ddcc05d  bitcoin-ab23a83400d5-osx64.tar.gz
d671af2ac2b9ec021c1cbb4614209b504d5bb4e1b1ddc922c7f0adcd99f529b6  src/bitcoin-ab23a83400d5.tar.gz

@achow101
Copy link
Member

Cleaned up everything and now I get the matching result:

9df7d246f4b55910bd97aa5b010f78d5c9ffd7ca44950230df39a22205d7fe2f  bitcoin-ab23a83400d5-osx-unsigned.dmg
5a51563c3bf09248f5bce66a690a1773e964d649c45b6f6aaf82748fa5caff7d  bitcoin-ab23a83400d5-osx-unsigned.tar.gz
d894452b461b9b9e779b6868a0c1d9ea0c33339694470646082234217ddcc05d  bitcoin-ab23a83400d5-osx64.tar.gz
d671af2ac2b9ec021c1cbb4614209b504d5bb4e1b1ddc922c7f0adcd99f529b6  src/bitcoin-ab23a83400d5.tar.gz
47b50f5aed729f71cafadf49e4f000a1a78ac6f8b01e88d67e17d80b486cde3b  bitcoin-core-osx-0.21-res.yml

@fanquake fanquake merged commit 17294c1 into bitcoin:0.21 Nov 25, 2020
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants