Thanks for looking into this, @zoecarver!
In this post, you'll find a proof that the mutating slice CoW problem can't be solved purely with information that is tracked at compile-time. You need one bit of information that is tracked at runtime. So while adding a parameter to alloc_ref instructions might mesh nicely with a solution to that problem, it's neither necessary nor sufficient to solve the problem on its own.
I wonder if the property of uniqueness is really the most useful thing to represent, because it's so easily destroyed: all it takes is a copy. CoW buffers have the property that they're immutable unless uniquely-referenced, a durable property that can be encoded into the type system and used for many of the same optimizations. Oh I see you're mostly concerned with optimizations for types with reference semantics. Not my department, I suppose ![]()