)]}'
{
  "commit": "02433568af277324e6d7fe4582b663f14165c563",
  "tree": "6c4379e311699fe62efb61e39058229538f55c50",
  "parents": [
    "d426fc53bbdac559456f2f626b71ff2709e59290"
  ],
  "author": {
    "name": "Shahbaz Youssefi",
    "email": "syoussefi@google.com",
    "time": "Mon Nov 04 09:57:37 2024 -0500"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon Nov 04 09:57:37 2024 -0500"
  },
  "message": "tools: Accept hex representation as binary input (#5870)\n\nSometimes when debugging or logging, SPIR-V may be dumped as a stream of\r\nhex values.  There are tools to convert such a stream to binary\r\n(such as [1]) but they create an inconvenient extra step when for\r\nexample the disassembly of that hex stream is needed.\r\n\r\n[1]: https://www.khronos.org/spir/visualizer/hexdump.html\r\n\r\nIn this change, the binary reader used by the tools is enhanced to\r\ndetect when the binary is actually a hex stream, and parse that instead.\r\nThe following formats are accepted, detected based on how the SPIR-V\r\nmagic number is output:\r\n\r\n\u003d\u003d\u003d Words\r\n\r\nIf the first token of the hex stream is one of 0x07230203, 0x7230203,\r\nx07230203, or x7230203, the hex stream is expected to consist of 32-bit\r\nhex words prefixed with 0x or x.  For example:\r\n\r\n    0x7230203, 0x10400, 0x180001, 0x79, 0x0\r\n\r\nis parsed as:\r\n\r\n    0x07230203 0x00010400 0x00180001 0x00000079 0x00000000\r\n\r\nNote that `,` is optional in the stream, but the hex values are expected\r\nto be delimited by either `,` or whitespace.\r\n\r\n\u003d\u003d\u003d Bytes With Prefix\r\n\r\nIf the first token of the hex stream is one of 0x07, 0x7, x07, x7, 0x03,\r\n0x3, x03, or x3, the hex stream is expected to consist of 8-bit hex\r\nbytes prefixed with 0x or x.  If the first token has a value of 7, the\r\nstream is big-endian.  Otherwise it\u0027s little-endian.  For example:\r\n\r\n    0x3, 0x2, 0x23, 0x7, 0x0, 0x4, 0x1, 0x0, 0x1, 0x0, 0x18, 0x0, 0x79, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0\r\n\r\nis parsed as:\r\n\r\n    0x07230203 0x00010400 0x00180001 0x00000079 0x00000000\r\n\r\nSimilar to \"Words\", `,` is optional in the stream, but the hex values\r\nare expected to be delimited by either `,` or whitespace.\r\n\r\n\u003d\u003d\u003d Bytes Without Prefix\r\n\r\nIf the first two characters of the hex stream is 07, or 03, the hex\r\nstream is expected to consist of 8-bit hex bytes of 2 characters each.\r\nIf the first token is 07, the stream is big-endian.  Otherwise it\u0027s\r\nlittle-endian.  Unlike the other modes, delimiter is optional (which\r\nautomatically handles 32-bit word streams), but no 0-padding is done.\r\nFor example, all of the following:\r\n\r\n    03, 02, 23, 07, 00, 04, 01, 00, 01, 00, 18, 00, 79, 00, 00, 00, 00, 00, 00, 00\r\n    03 02 23 07 00 04 01 00 01 00 18 00 79 00 00 00 00 00 00 00\r\n    03022307 00040100 01001800 79000000 00000000\r\n    07,23,02,03,00,01,04,00,00,18,00,01,00,00,00,79,00,00,00,00\r\n    07230203, 00010400, 00180001, 00000079, 00000000\r\n\r\nare parsed as:\r\n\r\n    0x07230203 0x00010400 0x00180001 0x00000079 0x00000000",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e6ff97dd6e8d438c52c7f9450c8c0957600f27a1",
      "old_mode": 33188,
      "old_path": "BUILD.bazel",
      "new_id": "526d08e39f32cb8491270b026d926e745b6bc965",
      "new_mode": 33188,
      "new_path": "BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "533cca37fd25b5310682bdbc41081eb0ef0df6c6",
      "old_mode": 33188,
      "old_path": "BUILD.gn",
      "new_id": "7c361f0337d751af726d160effe827b176aab3cb",
      "new_mode": 33188,
      "new_path": "BUILD.gn"
    },
    {
      "type": "modify",
      "old_id": "7db5bd42a7c1cab17ca26201d835909788a69506",
      "old_mode": 33188,
      "old_path": "README.md",
      "new_id": "d1ce2fbed8372d4503470e7a276b6a55456ceb3b",
      "new_mode": 33188,
      "new_path": "README.md"
    },
    {
      "type": "modify",
      "old_id": "76940ce1f2e680c9772a8841a4318c14bdf6bfd9",
      "old_mode": 33188,
      "old_path": "test/CMakeLists.txt",
      "new_id": "119e9c9f25e88c8c1b895acd86fec50fbbe52b05",
      "new_mode": 33188,
      "new_path": "test/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "3b63c69c7c2ac23a4a72db0e2cf2d200fbd2686d",
      "old_mode": 33188,
      "old_path": "test/diff/diff_test.cpp",
      "new_id": "da869315dad455addeb31058474897ece2824742",
      "new_mode": 33188,
      "new_path": "test/diff/diff_test.cpp"
    },
    {
      "type": "modify",
      "old_id": "14bb821536ceaa6b0cd305adf8434e50c858b2f0",
      "old_mode": 33188,
      "old_path": "test/diff/diff_test_utils.cpp",
      "new_id": "3bea9c3b1849b7ec1f2c0973a39b7e17e5690c55",
      "new_mode": 33188,
      "new_path": "test/diff/diff_test_utils.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "cc5c673f8d0eb6c67ea5b7fae8de958dd6c12ef1",
      "new_mode": 33188,
      "new_path": "test/hex_to_text_test.cpp"
    },
    {
      "type": "modify",
      "old_id": "6b8a1ae637571d1e02125666cc25cffef19eb3bf",
      "old_mode": 33188,
      "old_path": "tools/dis/dis.cpp",
      "new_id": "c294d039ce3636ed6d2e4a45478da54e95fb7632",
      "new_mode": 33188,
      "new_path": "tools/dis/dis.cpp"
    },
    {
      "type": "modify",
      "old_id": "288f380ad8fc53dcbbe651bdb7edece877fe00fb",
      "old_mode": 33188,
      "old_path": "tools/io.cpp",
      "new_id": "9c7d21f7238b0895fce1c212536626196fa2f9f7",
      "new_mode": 33188,
      "new_path": "tools/io.cpp"
    },
    {
      "type": "modify",
      "old_id": "3c87fcc0d12844ad95d3d4dae8a9d2352ee0353a",
      "old_mode": 33188,
      "old_path": "tools/io.h",
      "new_id": "536009d5312de55fca4b9b160d5a4369396fa0ae",
      "new_mode": 33188,
      "new_path": "tools/io.h"
    }
  ]
}
