MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Switch to ARM caused silent breaking changes

Open jackiebecker opened this issue 7 years ago • 3 comments

Trace found cause was casting negative float to uint, which is handled differently in ARM: https://www.embeddeduse.com/2013/08/25/casting-a-negative-float-to-an-unsigned-int/

Undefined result raised no error but cause breaking changes in app.

Problem affected two partners.

Setup:

  • Unity Version 2019.1
  • MRTK Version v2.0

Target Platform:

  • HoloLens 2

jackiebecker avatar Jun 12 '19 23:06 jackiebecker

@jackie could you please provide a call stack or pointer to the method? that was casting float to uint?

julenka avatar Jun 13 '19 05:06 julenka

Cast was done in client written code. Behavior was essentially that object could not be moved in a certain direction, the cause of which was not immediately apparent but after much stepping was found to be a value being set as "undefined" instead of a valid uint. The other partner affected by this (that I'm aware of, it's apparently cropped up a few other times in previous hacks?) also had done this casting in their own code. So it's really just that the switch to ARM introduced some problems that weren't flagged or warned for.

jackiebecker avatar Jun 13 '19 07:06 jackiebecker

So it's really just that the switch to ARM introduced some problems that weren't flagged or warned for.

Hm, I'm not sure this is something that we can respond to in MRTK directly, doing a static analysis looking for casts from float to uint seems like something that the compiler / linter should be doing. But it's good to have this filed in case other people run into this issue and can work around it.

julenka avatar Jun 13 '19 22:06 julenka