lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


'luai_hashnum'  FAILS to generate a DETERMINISTIC hash value for identical keys when executed non-concurrently on separate threads.

It is the fault of different precision controls being set on different threads, one of which is automatically set to 24 bits when using DirectX without 
the D3DCREATE_FPU_PRESERVE flag.  (But not strictly limited to DX, anyone wanting to increase floating point performance 
with the sacrifice of precision).

Another scenario is where the LuaVM is created and setup before DirectX (or anyone) resets the precision control and the resulting LuaVM 
appears empty (because of hash misses)

Here is the code to demonstrate - http://pastebin.com/xzDiTFj1

Andrei,
Rumbic Studio