I test the Specializes composition arc. I reference the box inline code to stage. I expect the size will keep 1.0, but the result is 4.0 ( same as inherits arc ). Where did I make a wrong?
I think you are misunderstanding the composition happening here. The /_class_box prim is the only thing you are overriding here, and you are doing so with a sublayer arc. So /_class_box has a size of 4. /box specializes from this prim, so it gets the value 4. If you put the “size=1” opinion inside /box or inside a file referenced by /box, then the 4.0 value would not override the 1.0 value. The only scenario in which inherit and specialize behave differently here is if the size=1.0 is coming in through a reference at /box, in which case the inherit will be stronger than the opinion in the reference, whereas a specialize will be weaker than the opinion inside the reference.
I may have messed that up somewhat, because this stuff can get complicated, but I think I'm describing things accurately there.