Bug 199093

Summary: [WHLSL] Import bitwise bool tests
Product: WebKit Reporter: Justin Fan <justin_fan>
Component: WebGPUAssignee: Saam Barati <saam>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, mmaxfield, saam, tsavell, webkit-bug-importer
Priority: P1 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 195681    
Attachments:
Description Flags
WIP
none
patch none

Description Justin Fan 2019-06-20 17:24:39 PDT
The following code fails to compile in the checker:

[numthreads(1, 1, 1)]
compute void _compute_main(device bool[] result : register(u0))
{
     result[0] = true;
}

However, it works if int/uint/uchar/float or float4 is substituted for bool (with a matching literal assignment).
Comment 1 Justin Fan 2019-06-20 17:28:13 PDT
Neither replacing the 'true' literal with '0 == 0' or the body with:

bool b = 0 == 0;
result[0] = b;

were successful past the checker.
Comment 2 Justin Fan 2019-06-25 16:31:32 PDT
The following code also fails in the checker:

[numthreads(1, 1, 1)]
compute void _compute_main(device bool[] result : register(u0)) {}

However, replacing 'bool' with 'int' successfully compiles.
Comment 3 Saam Barati 2019-06-26 16:27:41 PDT
Have a fix. We're failing in PODChecker.
Comment 4 Saam Barati 2019-06-26 16:35:47 PDT
This is on purpose for various reasons. The main one being we aren't specifying bool's bit pattern. So we are going to make the harness work around this.
Comment 5 Saam Barati 2019-06-27 15:12:35 PDT
Created attachment 373056 [details]
WIP
Comment 6 Saam Barati 2019-07-01 12:29:15 PDT
Created attachment 373248 [details]
patch
Comment 7 WebKit Commit Bot 2019-07-02 12:06:50 PDT
Comment on attachment 373248 [details]
patch

Clearing flags on attachment: 373248

Committed r247067: <https://trac.webkit.org/changeset/247067>
Comment 8 WebKit Commit Bot 2019-07-02 12:06:52 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2019-07-02 12:07:16 PDT
<rdar://problem/52537914>
Comment 10 Truitt Savell 2019-07-03 10:16:31 PDT
Looks like the new test webgpu/whlsl-bitwise-bool-ops.html

added in https://trac.webkit.org/changeset/247067/webkit

is timing out on Mojave Debug WK2

History: https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=webgpu%2Fwhlsl-bitwise-bool-ops.html