SBE ref tag edge cases

Hi Folks,

We have some SBE questions. Are the following allowed per SBE standard?

  1. Two composites referencing each other, so the referred type in one “Engine” is actually declared after the first usage. Since the booster field could be optional, the nestedness could stop at any arbitrary depth with the null value for “booster_val_field”
<composite name="Booster">
    <type name="booster_val_field" primitiveType="int64"/>
    <ref name="Engine">type="Engine"/>
    </composite>
    <composite name="Engine">
    <type name="engine_val_field" primitiveType="int64"/>
    <ref name="booster" type="Booster" presence="optional"/>
 </composite>
  1. Assuming nested ref tag is allowed (please kindly point out if it’s not or unlikely in practice), a composite referencing itself. It could stop following the same null value logic as above.
 <composite name="Engine">
    <type name="value" primitiveType="int64"/>
    <ref name="booster" type=" Engine" presence="optional"/>
 </composite>
  1. (not related to ref tag) Is it okay for a spec to have a composite/type that is completely unreferenced in any message? For example <field name="modelYear" id="2" type="ModelYear"/> is removed from the “Car” message, but remains declared inside “types”.

I sincerely appreciate your help!

Corrected the formatting to display XML snippets (please always enclose in 3 backticks before and after the XML code).

Regards,
FIX GTC Management.

Added to SBE discussions on GitHub: https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/discussions/163.