Question regarding pipeline barriers in Dynamic Rendering

I found Vulkan has weir behaviours when using Dynamic Rendering with Barriers.
In my understanding, Vulkan commands should always excute in undefine order(unless specified) if no barrier is added. Therefore, there should be no gurantee that there is synchonization between 2 render pass(dynamic).
For example:
1, 2 Barriers, 3, 4 ,Barriers, 5.
In that case, pass 1, 2 may be excuted at the same time and 3 has to be excuted after 1, 2.

The question is, If pass 3 depends on color attachment outputs from pass 1, pass 4 depends on depth attachment from pass 2. and pass 5 depends on both 3 and 4. When I add a barrier between the first group and the second group, will pass 4 start earlier than pass 3 in excution order if pass 2 reaches the srcStage?
In the specification, 4 should never start earlier than 3 because all barriers must be reached befor emoving forward. But I am not sure if that’s how it works.

The other question is pass 3 and pass 4 rely on different resources that use in different previous pass before. When I specify srcStage in the barrier info, will Vulkan tracks those resources individually to the pass that they are in? or it has to be previous pass in submission order?

Barriers are not necessary; synchronization is necessary. Barriers are just one tool for synchronization.

If operation 3 depends on the result from operation 1 but has no dependency on operation 2, the best way to represent that is with an event, not a barrier. Operation 3 waits on an event set by the end of operation 1.