Udon does not calculate double math properly on pico
complete
Happyrobot33
Users on quest and PC hardware do proper double math. However, when doing double math on the pico in udon, incorrect values like Infinity, NaN and very low scientific values are generated. This can be tested in this world https://vrchat.com/home/world/wrld_a59ea2d0-375d-431e-b6e8-ca0fa2c3a8a5
On PC and a quest all of these values should be normal, but on a pico they are all over the place. Attached is a image of the PC version compared to the PICO version of the output. I have also attached the script used to generate this output. I hope this gets fixed fairly fast as its kind of a major issue right now since all worlds that use math like this are seeing garbled values. The reason we can tell its just double math and not float math is because when we force a float with 3.3f, we get the proper value
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using TMPro;
public class test : UdonSharpBehaviour
{
public TextMeshProUGUI text;
void Start()
{
//get the text component
text = GetComponent<TextMeshProUGUI>();
const float testvar1value = 1.190284f;
float testvar1 = testvar1value;
const float testvar2value = 0.2982327f;
float testvar2 = testvar2value;
//start the tests
text.text =
$@"Testing variables:
{nameof(testvar1)}: {testvar1}f
{nameof(testvar2)}: {testvar2}f
Equation Tests:
Runtime:
{nameof(testvar1)} / 3.3 = {testvar1 / 3.3}
{nameof(testvar1)} / 1.65 = {testvar1 / 1.65}
{nameof(testvar1)} / 3.3
2 = {testvar1 / 3.3
2}{nameof(testvar1)} / 3.3f = {testvar1 / 3.3f}
{nameof(testvar1)} / 1.65f = {testvar1 / 1.65f}
{nameof(testvar1)} / 3.3f
2f = {testvar1 / 3.3f
2f}({nameof(testvar1)} / 3.3) + {nameof(testvar2)} = {(testvar1 / 3.3) + testvar2}
({nameof(testvar1)} / 3.3
2) + {nameof(testvar2)} = {(testvar1 / 3.3
2) + testvar2}({nameof(testvar1)} / 1.65) + {nameof(testvar2)} = {(testvar1 / 1.65) + testvar2}
({nameof(testvar1)} / 3.3f) + {nameof(testvar2)} = {(testvar1 / 3.3f) + testvar2}
({nameof(testvar1)} / 3.3f
2f) + {nameof(testvar2)} = {(testvar1 / 3.3f
2f) + testvar2}({nameof(testvar1)} / 1.65f) + {nameof(testvar2)} = {(testvar1 / 1.65f) + testvar2}
Constants:
{testvar1value} / 3.3 = {testvar1value / 3.3}
{testvar1value} / 1.65 = {testvar1value / 1.65}
{testvar1value} / 3.3
2 = {testvar1value / 3.3
2}{testvar1value} / 3.3f = {testvar1value / 3.3f}
{testvar1value} / 1.65f = {testvar1value / 1.65f}
{testvar1value} / 3.3f
2f = {testvar1value / 3.3f
2f}({testvar1value} / 3.3) + {testvar2value} = {(testvar1value / 3.3) + testvar2value}
({testvar1value} / 3.3
2) + {testvar2value} = {(testvar1value / 3.3
2) + testvar2value}({testvar1value} / 1.65) + {testvar2value} = {(testvar1value / 1.65) + testvar2value}
({testvar1value} / 3.3f) + {testvar2value} = {(testvar1value / 3.3f) + testvar2value}
({testvar1value} / 3.3f
2f) + {testvar2value} = {(testvar1value / 3.3f
2f) + testvar2value}({testvar1value} / 1.65f) + {testvar2value} = {(testvar1value / 1.65f) + testvar2value}
";
}
}
Log In
syncpulse
I can confirm this is fixed now
_
_tau_
complete
This post was marked as
available in future release
StormRel
tracked
syncpulse
I've also received a report of issues on Pico in a block of code that uses DateTime and does some math on Doubles. I have unfortunately not been able to get a simple repro because I don't have a Pico, and troubleshooting with the person who reported the bug to me has been difficult due to timezone and technical reasons. They claim it started happening around approximately September 6.
Just wanted to add my voice here as another person experiencing Udon code that hasn't been touched for months suddenly failing to work on Pico, and only on Pico.
Happyrobot33
syncpulseI will add to this that the user that informed me encountered this problem on the 10th of this month