fi-0092: Table ordinal too large {:#fi-0092}

FIDL table ordinals cannot be greater than 64:

{% include “docs/reference/fidl/language/error-catalog/label/_bad.md” %}

{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0092.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}

In order to allow growth beyond 64 ordinals, FIDL requires the last field of a table to be another table. Any table fields beyond 64 must be placed in a nested table.

{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}

{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0092.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}

Every field in a table incurs the overhead of a FIDL envelope in order to allow the field to be optional. This allows every field of a table to be present or absent and enables tables to be evolved by adding or removing fields, but at the cost of much greater memory overhead than structs.

In general you can both avoid this error and reduce overhead by avoiding having small, granular fields in tables. Instead you can group together elements that you expect will need to be added or removed simultaneously into structs and use those as the fields of the table. This reduces overhead and avoid running out of ordinals at the cost of some evolvability.

This became an error in RFC-0132: FIDL table size limit, which was intended to prevent users from accidentally incurring the overhead of very large tables. This extra cost isn't obvious in the schema, especially when there are only a few fields (with large ordinals), or where there are many fields but only a few are used at a time.