/experimental:deterministic

hi Eipc,

i have enabled the msvc flag /experimental:deterministic

but the exe still non-deterministic

engine: 5.7.2

// Copyright Epic Games, Inc. All Rights Reserved.
 
using UnrealBuildTool;
using System.Collections.Generic;
 
public class ElectricDreamsSampleTarget : TargetRules
{
	public ElectricDreamsSampleTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Game;
    DefaultBuildSettings = BuildSettingsVersion.Latest;
    IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
 
#if UE_5_6_OR_LATER
    IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
#endif
 
    bDeterministic = true;
 
    ExtraModuleNames.AddRange( new string[] { "ElectricDreamsSample" } );
	}
}

Hello,

The “deterministic” feature of MSVC is still experimental. As such, we are not actively working on validating the output of the builds for determinism and are waiting for the feature to mature before investing in it.

There are a few known ways that can improve the output of this feature at the cost of longer compilation times.

  • Deactivate the usage of precompiled headers in your target rules:
  • Deactivate the usage of PDBs
public class YourGameTarget : TargetRules
{
    public YourGameTarget(TargetInfo Target) : base(Target)
    {
        bUsePCHFiles = false;        // disable per-module PCHs globally
        bUseSharedPCHs = false;      // disable shared PCHs globally
 
        bUsePDBFiles = false; //Disable PDB and use /Z7 option
        bSupportEditAndContinue = false; //Disable PDB and use /Z7 option
    }
}

Feel free to share your findings so we can integrate them in future releases.

Regards,

Martin