Bug 200312 - [WHLSL Remove char/short/half types
Summary: [WHLSL Remove char/short/half types
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks: 200315
  Show dependency treegraph
 
Reported: 2019-07-31 12:52 PDT by Saam Barati
Modified: 2019-07-31 15:38 PDT (History)
11 users (show)

See Also:


Attachments
patch (2.35 MB, patch)
2019-07-31 14:09 PDT, Saam Barati
mmaxfield: review+
Details | Formatted Diff | Diff
patch for landing (2.35 MB, patch)
2019-07-31 14:35 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
patch for landing (2.35 MB, patch)
2019-07-31 14:38 PDT, Saam Barati
commit-queue: commit-queue-
Details | Formatted Diff | Diff
patch for landing (2.35 MB, patch)
2019-07-31 15:03 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2019-07-31 12:52:59 PDT
...
Comment 1 Saam Barati 2019-07-31 14:04:46 PDT
The JS script I wrote to modify the stdlib:


function assert(b) {
    if (!b)
        throw new Error;
}

const ignore = ["char", "short", "short", "half"];

let lines = readFile("/Volumes/Data/Desktop/stdlib.wsl").split("\n");

let result = "";
let currentFunction = null;
let blockNest = 0;
for (let line of lines) {
    if (!currentFunction) {
        if (line.indexOf("{") >= 0) {
            currentFunction = [line];
            blockNest = 1;
        } else {
            let ok = true;
            if (line.indexOf("/*") < 0) {
                for (let word of ignore) {
                    if (line.indexOf(word) >= 0)
                        ok = false;
                }
            }
            if (ok)
                result += `${line}\n`;
        }

        continue;
    }

    currentFunction.push(line);

    if (line.indexOf("{") >= 0) {
        ++blockNest;
        assert(line.indexOf("}") < 0);
    }

    if (line.indexOf("}") >= 0) {
        assert(line.indexOf("{") < 0);
        --blockNest;
        if (!blockNest) {
            let functionText = currentFunction.join("\n");
            let ok = true;
            for (let word of ignore) {
                if (functionText.indexOf(word) >= 0)
                    ok = false;
            }
            if (ok)
                result += `${functionText}\n`;
            currentFunction = null;
        }
    }
}

print(result);
Comment 2 Saam Barati 2019-07-31 14:09:55 PDT
Created attachment 375242 [details]
patch
Comment 3 Myles C. Maxfield 2019-07-31 14:15:52 PDT
I can't make inline comments, so I'll comment here.

We need to keep the TextureFormats, but make sure that whenever they're read, they get padded out to wider types. It's not immediately obvious how to do this, so let's not modify this patch but file a follow-up to make sure that all the texture types work properly.

Can we add a non-exhaustive test to make sure that the types don't exist and don't work?
Comment 4 Saam Barati 2019-07-31 14:35:53 PDT
Created attachment 375246 [details]
patch for landing
Comment 5 Saam Barati 2019-07-31 14:38:34 PDT
Created attachment 375247 [details]
patch for landing
Comment 6 WebKit Commit Bot 2019-07-31 14:53:46 PDT
Comment on attachment 375247 [details]
patch for landing

Rejecting attachment 375247 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'validate-changelog', '--check-oops', '--non-interactive', 375247, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in LayoutTests/ChangeLog contains OOPS!.

Full output: https://webkit-queues.webkit.org/results/12843123
Comment 7 Saam Barati 2019-07-31 15:03:13 PDT
Created attachment 375257 [details]
patch for landing
Comment 8 WebKit Commit Bot 2019-07-31 15:37:32 PDT
Comment on attachment 375257 [details]
patch for landing

Clearing flags on attachment: 375257

Committed r248078: <https://trac.webkit.org/changeset/248078>
Comment 9 WebKit Commit Bot 2019-07-31 15:37:34 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2019-07-31 15:38:26 PDT
<rdar://problem/53784301>