"Principled v2" feedback/discussion thread

When rendering with the Metal GPU backend, there are some errors that result in the kernel not compiling, and some warnings (which may be useful to investigate). You can find them below. Sorry for not having file names and line numbers.

Just for reference, this is a commit from an Apple Engineer fixing the pointer type must have explicit address space qualifier error in Cycles when initially adding Metal to Cycles: rBa0f269f682da

Error messages
program_source:120817:53: error: pointer type must have explicit address space qualifier
    float cosTheta1, float eta1, float eta2, float2 *R, float2 *phi)
                                                    ^
program_source:120817:64: error: pointer type must have explicit address space qualifier
    float cosTheta1, float eta1, float eta2, float2 *R, float2 *phi)
                                                               ^
program_source:130633:48: error: pointer type must have explicit address space qualifier
                                         float *reflect_pdf)
                                               ^
program_source:132563:70: error: pointer type must have explicit address space qualifier
sheen_v2_eval(float3 N, float3 V, float3 L, float3 H, float r, float *pdf)
                                                                     ^
program_source:145512:52: error: pointer type must have explicit address space qualifier
                                               int *offset)
                                                   ^
program_source:145564:49: error: pointer type must have explicit address space qualifier
                                            int *offset)
                                                ^
program_source:120517:7: error: value of type 'bool __attribute__((ext_vector_type(3)))' (vector of 3 'bool' values) is not contextually convertible to 'bool'
  if (F82 == one_spectrum()) {
      ^~~~~~~~~~~~~~~~~~~~~
program_source:120836:10: error: no matching function for call to 'sqr'
    *R = sqr(make_float2(rx, ry));
         ^~~
program_source:3564:26: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'float3' (vector of 3 'float' values) for 1st argument
ccl_device_inline float3 sqr(float3 a)
                         ^
program_source:4441:28: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'const float8_t' for 1st argument
ccl_device_inline float8_t sqr(const float8_t a)
                           ^
program_source:6520:25: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'float' for 1st argument
ccl_device_inline float sqr(float a)
                        ^
program_source:120871:15: error: no matching function for call to 'sqr'
  float2 Rs = sqr(T121) * R23 / (one_float2() - R123);
              ^~~
program_source:3564:26: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'float3' (vector of 3 'float' values) for 1st argument
ccl_device_inline float3 sqr(float3 a)
                         ^
program_source:4441:28: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'const float8_t' for 1st argument
ccl_device_inline float8_t sqr(const float8_t a)
                           ^
program_source:6520:25: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'float' for 1st argument
ccl_device_inline float sqr(float a)
                        ^
program_source:120878:14: error: no matching function for call to 'average'
  float3 I = average(R12 + Rs) * thin_film_sensitivity(0.0f, 0.0f);
             ^~~~~~~
program_source:3589:25: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'const float3' (vector of 3 'float' values) for 1st argument
ccl_device_inline float average(const float3 a)
                        ^
program_source:4451:25: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'const float8_t' for 1st argument
ccl_device_inline float average(const float8_t a)
                        ^
program_source:120950:23: error: pointer type must have explicit address space qualifier
    MicrofacetExtrav2 *extra = (MicrofacetExtrav2 *)bsdf->extra;
                      ^
program_source:120950:51: error: pointer type must have explicit address space qualifier
    MicrofacetExtrav2 *extra = (MicrofacetExtrav2 *)bsdf->extra;
                                                  ^
program_source:121063:21: error: pointer type must have explicit address space qualifier
  MicrofacetExtrav2 *extra = (MicrofacetExtrav2 *)bsdf->extra;
                    ^
program_source:121063:49: error: pointer type must have explicit address space qualifier
  MicrofacetExtrav2 *extra = (MicrofacetExtrav2 *)bsdf->extra;
                                                ^
program_source:130720:7: error: value of type 'bool __attribute__((ext_vector_type(3)))' (vector of 3 'bool' values) is not contextually convertible to 'bool'
  if (F == one_spectrum()) {
      ^~~~~~~~~~~~~~~~~~~
program_source:145307:7: error: value of type 'bool __attribute__((ext_vector_type(3)))' (vector of 3 'bool' values) is not contextually convertible to 'bool'
  if (tint != one_spectrum()) {
      ^~~~~~~~~~~~~~~~~~~~~~
program_source:145457:34: error: pointer type must have explicit address space qualifier
  bsdf->extra = (MicrofacetExtra *)extra;