anchor.diff:                      | EndingMode.Open -> 'O'B
                       | EndingMode.Closed -> 'C'B
                       |> Entry.Byte)
  +
                   arr.Add <| Entry.Int group.Nesting.Count
                   group.Nesting
                   |> Seq.sort
                   |> Seq.iter(Entry.UInt32 >> arr.Add)
   
  -            let arr = arr.ToArray()
  -            writeRecord w (ReadOnlySpan arr)
  +            writeResizeArray w arr
  +
  +        let writeProductions w (productions: ImmutableArray<Production>) =
  +            let arr = ResizeArray()
  +
  +            arr.Add <| Entry.String productionsHeader
  +            arr.Add <| Entry.Int productions.Length
  +
  +            for i = 0 to productions.Length - 1 do
  +                let prod = productions.[i]
  +
  +                arr.Add <| Entry.Int prod.Head.Index
  +                arr.Add <| Entry.Int prod.Handle.Length
  +                prod.Handle
  +                |> Seq.iter (
  +                    function
  +                    | LALRSymbol.Terminal term ->
  +                        arr.Add <| Entry.Byte 'T'B
  +                        arr.Add <| Entry.Int term.Index
  +                    | LALRSymbol.Nonterminal nont ->
  +                        arr.Add <| Entry.Byte 'N'B
  +                        arr.Add <| Entry.Int nont.Index)
  +
  +            writeResizeArray w arr
  
positive.code: 
              for i = 0 to groups.Length - 1 do
                  let group = groups.[i]
                  arr.Add <| Entry.String group.Name
                  arr.Add <| Entry.Boolean group.IsTerminal
                  arr.Add <|
  
negative.code:             indexOf "Start symbol" nonterminals startSymbol
              |> writeSingleValued w startSymbolHeader
  
          let writeResizeArray w (xs: ResizeArray<_>) =
              let count = xs.Count
              let mem = ArrayPool.Shared.Rent count
              try
                  xs.CopyTo(mem)
                  writeRecord w (ReadOnlySpan(mem, 0, count))
              finally
                  ArrayPool.Shared.Return mem
  
          let writeGroups w noiseSymbols (groups: ImmutableArray<Group>) =
              let arr = ResizeArray()
  
  