<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/146974>146974</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[DirectX] Validation failure: Invalid record
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Icohedron
</td>
</tr>
</table>
<pre>
157 DML shaders are failing to validate due to a validation error simply reported as "Invalid record" with no additional details
```
Invalid record
Validation failed.
```
One such DML shader failing to validate is `CumulativeOperationProduct_256_int64_native_8.hlsl`
```bash
clang-dxc /DirectML/Product/Shaders/Generated/CumulativeOperationProduct_256_int64_native_8.hlsl -E CSMain -T cs_6_0 -O3 -D DXC_COMPILER=1 -D __SHADER_TARGET_MAJOR=6 -D __SHADER_TARGET_MINOR=0 -I /DirectML/Product/Shaders/ -Fo validation/CumulativeOperationProduct_256_int64_native_8.dat
```
A small test shader that can reproduce the "Invalid record" validation error is shown below, but it may or may not be due to the same reason(s).
```hlsl
uint2 Foo(uint2 a[2], uint i) {
return a[i];
}
cbuffer Constants {
uint2 arr[2];
}
RWStructuredBuffer<uint> output;
[numthreads(1, 1, 1)]
void CSMain(uint3 Tid : SV_DispatchThreadID) {
output[0] = Foo(arr, Tid.x).x;
}
```
https://godbolt.org/z/3Wx8zsn1e
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVMtu2zgU_Rpqc2GDph62F1rIVtTxIJkUSdB2J1DijcUBTRp8OEm_fkBFnrpuFi0gWBZ5zzn3cUjunNxrxJLkG5LXCQ9-MLbc9WZAYY1OOiPeykW-hPruFtzABVoH3CI8c6mk3oM3cOJKCu4RRMD4zc8r0mhAa40FJw9H9QYWj8Z6FMAdEMZ2egwEi72xgjAGL9IPoA1wIWSEcwUCPZfKEVrFp6DTQ6srNK2-_FCN2aGYXyEIre41ggv9cFHPh6VIB6Sg23AIint5wvsj2pH6szUi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