When releasing a product should cooks be versioned or unversioned?

I’m having trouble finding out exactly why there are versioned and unversioned cooks. I haven’t found any real documentation on why I should use a versioned cook but going through the code I receive some mixed signals about it.

The cook commandlet defaults to versioned cooks unless -unversioned is passed in. I would normally take that to mean that versioned is preferred normally. The mixed signals come in when I see that everywhere I look including UAT/BuildGraph, Project Launcher (new), and ushell all do everything they can to make the default pass -unversioned tot the cook commandlet calls. That makes me think unversioned is maybe preferred. Then I see this comment in the commandlet:

/** Save all cooked packages without versions. These are then assumed to be current version on load. This is dangerous but results in smaller patch sizes. */

So now I am really uncertain of the correct thing to do. Of course we want smaller patch sizes and more consistent cook output but what is the dangerous part, is there some extra validation we should be using when using unversioned? We do already test our determinism and are also beginning to run the cookincremental validations, is there something more we should be looking for if we move from versioned to unversioned cooks.

[Attachment Removed]

That comment was added early in the development of UE4, and is now obsolete. Cooking unversioned is the recommendation.

Dangerous refers to the difficulty of diagnosis of the bugs with mismatched binaries; if you try to run with unversioned content and the binary verison does not match the cooked version, then the game will crash in chaotic ways during serialization, without any clues that the problem is mismatched versioning; this can take a while to diagnose as you have to reproduce, step through the code, and notice that the data being serialized doesn’t match, and then remember the possibility of version mismatch and check whether the format changed.

That danger never occurs if you always cook with matching binaries before running the game, and once your project is used to that process you can enjoy the benefits without the danger.

We use unversioned cooking exclusively for our builds inside Epic, and recommend it for all licensees.

[Attachment Removed]

Thank you for the write up, we always cook and run with matching binaries already so it sounds we are safe to be using unversioned cooks.

[Attachment Removed]