#Non deterministic codegen in GO SDK

1 messages ยท Page 1 of 1 (latest)

drifting walrus
#

Hi team I raised this github issue on this a little while back.
We are seeing that the MarshalJSON and UnmarshalJSON functions for one of the module types is reordered every now and then.
Wondering if we can get someone to look into it.

GitHub

Automation engine to build, test and ship any codebase. Runs locally, in CI, or directly in the cloud - dagger/dagger

drifting walrus
#

@errant lagoon tagging you for brevity ๐Ÿ™‚

errant lagoon
drifting walrus
#

Thanks Guillaume ๐Ÿ™‚

drifting walrus
#

thank you!!

#

will review it later today but I'm sure you've covered it

errant lagoon
drifting walrus
#

A Guillame a few questions on your PR just to confirm my understanding... the issue is caused because several tokens have the same position ? In my tests I thought it was because the token position was unstable - but it is very likely that I was doing something wrong ๐Ÿ™‚

#

The other question, if the order of the objects is already presorted by name, would a StableSort achieve the same result as the tie breaker method you proposed ?

#

Thanks!

errant lagoon
errant lagoon
#

Update: re-pushed with the proper fix, the one you suggested, and added a similar integration test, as your repro (and fully tested against your repro ahah ๐Ÿ‘ผ) ๐Ÿ™

drifting walrus
#

Ahh amazing Guillaume! Thank you so much ๐Ÿ™‚

errant lagoon
#

Updating the integration test to have a deterministic repro (needed to add more elements to always trigger the fail evey 2 runs, but I think I got it). Tibor made some good comments on how to cleanly fix it, I'll update the PR again ๐Ÿ™

drifting walrus
#

Yeah very nice work ๐Ÿ™‚

errant lagoon