Minor flaky behavior in codegen, assets switch positions sometimes

Only a minor issue, but I think there’s a flaky behaviour in codegen. Assets switch their position from time to time.