Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Issue 546873002: Start to rework DM JSON handling. (Closed)

Created:
6 years, 3 months ago by mtklein_C
Modified:
6 years, 3 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Start to rework DM JSON handling. DM's striking off into its own JSON world. This gets strawman implementations in place for writing and reading a JSON file mapping test name to hashes. For what it's worth, I basically want to change _all_ these pieces, - MD5 is slow and we can replace it with something faster, - JSON schema needs room to grow more data, - it'd be nice to hash once instead of twice when reading and writing, - this code wants lots of refactoring, but this gives us a starting platform to work on these bits at our leisure. E.x. file for now: mtklein@mtklein ~/skia (dm)> cat good/dm.json { "3x3bitmaprect_565" : "fc70d985fbfbe70e3a3c9dc626d4f5bc", "3x3bitmaprect_8888" : "df1591dde35907399734ea19feb76663", "3x3bitmaprect_gpu" : "df1591dde35907399734ea19feb76663", "aaclip_565" : "1862798689b838a7ab0dc0652b9ace3a", "aaclip_8888" : "47bb314329f0ce243f1d83fd583decb7", "aaclip_gpu" : "75f72412d0ef4815770202d297246e7d", ... BUG=skia: Committed: https://skia.googlesource.com/skia/+/1d0f1642e8bc0fda200972926e2eaa99744e4d93

Patch Set 1 #

Total comments: 1

Patch Set 2 : multiple hashes #

Patch Set 3 : back to one hash #

Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -139 lines) Patch
M dm/DM.cpp View 3 chunks +11 lines, -10 lines 0 comments Download
M dm/DMExpectations.h View 2 chunks +2 lines, -29 lines 0 comments Download
M dm/DMWriteTask.h View 2 chunks +10 lines, -5 lines 0 comments Download
M dm/DMWriteTask.cpp View 2 6 chunks +113 lines, -95 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
mtklein
6 years, 3 months ago (2014-09-05 16:01:48 UTC) #2
jcgregorio
https://codereview.chromium.org/546873002/diff/1/dm/DMWriteTask.cpp File dm/DMWriteTask.cpp (right): https://codereview.chromium.org/546873002/diff/1/dm/DMWriteTask.cpp#newcode211 dm/DMWriteTask.cpp:211: root[gJsonData[i].name.c_str()] = md5Ascii; Can we make this an array ...
6 years, 3 months ago (2014-09-05 17:54:21 UTC) #3
mtklein
> https://codereview.chromium.org/546873002/diff/1/dm/DMWriteTask.cpp#newcode211 > dm/DMWriteTask.cpp:211: root[gJsonData[i].name.c_str()] = md5Ascii; > Can we make this an array of ...
6 years, 3 months ago (2014-09-05 18:27:43 UTC) #4
jcgregorio
On 2014/09/05 18:27:43, mtklein wrote: > > https://codereview.chromium.org/546873002/diff/1/dm/DMWriteTask.cpp#newcode211 > > dm/DMWriteTask.cpp:211: root[gJsonData[i].name.c_str()] = md5Ascii; > ...
6 years, 3 months ago (2014-09-05 18:31:41 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/mtklein@chromium.org/546873002/40001
6 years, 3 months ago (2014-09-08 14:58:46 UTC) #7
commit-bot: I haz the power
Committed patchset #3 (id:40001) as 1d0f1642e8bc0fda200972926e2eaa99744e4d93
6 years, 3 months ago (2014-09-08 15:05:22 UTC) #8
stephana
On 2014/09/08 14:58:46, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
6 years, 3 months ago (2014-09-08 15:19:29 UTC) #9
mtklein
6 years, 3 months ago (2014-09-08 15:28:19 UTC) #10
Message was sent while issue was closed.
On 2014/09/08 15:19:29, stephana wrote:
> On 2014/09/08 14:58:46, I haz the power (commit-bot) wrote:
> > CQ is trying da patch. Follow status at
> > 
https://skia-tree-status.appspot.com/cq/mtklein@chromium.org/546873002/40001
> 
> I am putting the following in a design doc, but thought I bring it up in
> context. 
> 
> My preference for the output JSON would be the following:
> 
> [
>       {
>         "key": {
>           "test": "tablecolorfilter",
>           "config": "565"
>         },
>         hash: "95c22801675e8b1e33ed88d78da86878",
>         image: "relative/path/to/image.png"
>       },
>       {
>         "key": {
>           "test": "strokes_poly",
>           "config": "gpu"
>         },
>         hash: "95c22801675e8b1e33ed88d78da86878",
>         image: "relative/path/to/image.png"
>       }
>       ...
>   ]
> 
> This is based on the the input format that perf uses
> (see
>
https://github.com/google/skia-buildbot/blob/master/perf/go/ingester/ingester...)
> and this output would be the "results" field in a bigger JSON doc (see again
> perf format) 
> that is uploaded by the buildbots. 
> 
> The "key" map allows us to uniquely identify this combination of (test,config)
> and should 
> naturally extend to SKPs and any other testing scheme we come up with. 
> That we should not have DM or GM or SKPs or whatever show up in the tool
itself,
> but only 
> the data that drive it. 
> 
> I think there is a problem with the current hashing scheme and multiple hashes
> might address
> this.
> My understanding is that you are hashing the internal representation of the
> bitmap (prior to
> writing it to a PNG), because there is information loss in the conversion to
> PNG. 
> IMHO, the problem with that approach is that we have no way of verifying that
> hash later, 
> because the internal bitmap is gone and cannot be reconstructed from PNG. 
> We could add another hash to the above entry for each image, to distinguish
> between 
> internal hash and PNG hash. But the PNG hash should be used to address the PNG
> image.

SGTM.  Joe and I were thinking of adding a --hashAsName flag (or similar) that'd
dump out the .pngs in a flat directory with names based on the hash of the
bitmap.  That way we don't need to associate the pngs and hashes after the fact;
they're already together.  But totally agreed on splitting up the key data.

Powered by Google App Engine
This is Rietveld 408576698