2.5 BAT
BAT is a region consisting of a single array of 64-bit values, with an entry for each block that determines the state and file offset of that block. The entries for the payload block and sector bitmap block are interleaved in a way that the sector bitmap block entry associated with a chunk follows the entries for the payload blocks in that chunk. For example, if the chunk ratio is 4, the table's interleaving would look like the following figure.

Figure 6: BAT layout example
The BAT for a dynamic VHDX is laid out identically to a differencing VHDX; BAT entries for sector bitmap blocks exist for dynamic VHDX, even though the sector bitmap block will never be allocated in a dynamic VHDX file. The presence of the entries avoids the need to insert or remove the interleaving sector bitmap entries during conversion between dynamic and differencing virtual hard disk types.
The BAT region MUST be at least large enough to contain as many entries as required to describe the possible blocks for a given virtual disk size (see section 2.6.2.2 for more information on VirtualDiskSize).
The number of data blocks can be calculated as
The number of sector bitmap blocks can be
calculated as
For a dynamic VHDX, the last BAT entry MUST
locate the last payload block of the virtual disk. The total number of BAT
entries can be calculated as
For a differencing VHDX, the last BAT entry
must be able to locate the last sector bitmap block that contains the last
payload sector. The total number of BAT entries can be calculated as
