Merge "Fix ioc in trellis optimization with hbd" into nextgenv2