Cosmos icon indicating copy to clipboard operation
Cosmos copied to clipboard

Guid Implementation

Open MishaTy opened this issue 2 years ago • 7 comments

Same as: #942

MishaTy avatar May 23 '22 22:05 MishaTy

xD is this still not in it was started in 2017

zarlo avatar May 24 '22 02:05 zarlo

and it looks like it still have te same issues with the guids been the same in the tests

zarlo avatar May 24 '22 02:05 zarlo

I think thats a problem with how we seed the random number generators currently. Making the random static should fix the issue.

quajak avatar May 26 '22 09:05 quajak

mmm that a bit more of a hack then a fix

zarlo avatar May 27 '22 06:05 zarlo

Yeah, the correct fix would be to improve the seeding of the random number generator.

quajak avatar May 27 '22 07:05 quajak

We could try use the TimestampCounter from the CPU as a seed for the RandomImpl. https://github.com/CosmosOS/Cosmos/blob/3600701b876f978ab866e89ee06dffc60ba53a4b/source/Cosmos.Core_Asm/CPUImpl.cs#L46

quajak avatar May 27 '22 07:05 quajak

@MishaTY The issue is that https://github.com/CosmosOS/Cosmos/blob/a1c4011cbfadcec5a8b61fac56d1d1a4de739462/source/Cosmos.System2_Plugs/System/RandomImpl.cs#L30-L33 does not use GenerateGlobalSeed.

quajak avatar May 31 '22 15:05 quajak