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.
#Non deterministic codegen in GO SDK
1 messages ยท Page 1 of 1 (latest)
@errant lagoon tagging you for brevity ๐
tking a look first thing tomorrow ๐
Thanks Guillaume ๐
please do ๐
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!
Mmmh, I think you're right, on both points !
I should have fully tested on your repro and better read your text, I was multitasking, my bad, you already did all the debugging work ahah, thanks for all this amazing work you did ๐
Let me update tomorrow and retry on your repro, with an integration test out of it ๐
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 ๐ผ) ๐
Ahh amazing Guillaume! Thank you so much ๐
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 ๐
Yeah very nice work ๐
PR has been merged ๐โ