Bug 200413 - [WHLSL] Store the short names of variables used by Metal generation directly in VariableDeclaration
Summary: [WHLSL] Store the short names of variables used by Metal generation directly ...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Robin Morisset
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-02 17:18 PDT by Robin Morisset
Modified: 2019-08-07 11:48 PDT (History)
3 users (show)

See Also:


Attachments
Patch (4.71 KB, patch)
2019-08-02 17:21 PDT, Robin Morisset
saam: review+
rmorisset: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews212 for win-future (13.75 MB, application/zip)
2019-08-02 19:22 PDT, EWS Watchlist
no flags Details
Patch (4.73 KB, patch)
2019-08-05 14:15 PDT, Robin Morisset
commit-queue: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Morisset 2019-08-02 17:18:18 PDT
Currently the metal generation pass keeps a HashMap from variable declarations to string.
But variable declarations already have a name field which is unused by that point. So we can just reuse it.
Comment 1 Robin Morisset 2019-08-02 17:21:54 PDT
Created attachment 375470 [details]
Patch
Comment 2 EWS Watchlist 2019-08-02 19:22:02 PDT
Comment on attachment 375470 [details]
Patch

Attachment 375470 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/12855509

New failing tests:
fast/block/float/float-with-anonymous-previous-sibling.html
Comment 3 EWS Watchlist 2019-08-02 19:22:04 PDT
Created attachment 375476 [details]
Archive of layout-test-results from ews212 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews212  Port: win-future  Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Comment 4 Saam Barati 2019-08-05 13:41:29 PDT
Comment on attachment 375470 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=375470&action=review

r=me

> Source/WebCore/ChangeLog:9
> +        This appears to be a small perf improvement but my system is too noisy to say exactly how much, and the patch is sufficiently simple I don't think it deserves hours of super careful benchmarking.

nit: you should say the improvement is expected in WHLSL compile times
Comment 5 Robin Morisset 2019-08-05 14:04:17 PDT
Comment on attachment 375470 [details]
Patch

The windows failure seems completely unrelated (some missing fonts and things like that).
Comment 6 Robin Morisset 2019-08-05 14:04:45 PDT
Comment on attachment 375470 [details]
Patch

Missed the nit.
Comment 7 Robin Morisset 2019-08-05 14:15:56 PDT
Created attachment 375553 [details]
Patch
Comment 8 WebKit Commit Bot 2019-08-05 14:25:36 PDT
Comment on attachment 375553 [details]
Patch

Rejecting attachment 375553 [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', 'apply-attachment', '--no-update', '--non-interactive', 375553, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Logging in as commit-queue@webkit.org...
Fetching: https://bugs.webkit.org/attachment.cgi?id=375553&action=edit
Fetching: https://bugs.webkit.org/show_bug.cgi?id=200413&ctype=xml&excludefield=attachmentdata
Processing 1 patch from 1 bug.
Processing patch 375553 from bug 200413.
Fetching: https://bugs.webkit.org/attachment.cgi?id=375553
Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Parsed 2 diffs from patch file(s).
patching file Source/WebCore/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp
Hunk #1 FAILED at 223.
Hunk #2 succeeded at 248 (offset -5 lines).
Hunk #3 succeeded at 262 (offset -5 lines).
Hunk #4 succeeded at 543 (offset -5 lines).
Hunk #5 succeeded at 713 (offset -4 lines).
1 out of 5 hunks FAILED -- saving rejects to file Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp.rej

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: https://webkit-queues.webkit.org/results/12865055
Comment 9 Robin Morisset 2019-08-05 14:53:36 PDT
https://trac.webkit.org/changeset/248266/webkit is a direct conflict with this patch, solving the same problem in a different way.
I think my patch is a tad more space-efficient, but a bit less time-efficient, so I'm dropping it.