Idea: "Group Labels" in Instrument Box and Samples Box

How would the Lua function for swapping instruments affect these labels? What are the labels tied to on the data level? (I suspect this would be somewhat inconsistent with the “organize instruments” tool https://forum.renoise.com/t/updated-tool-3-1-sort-instruments/34208 )