Alex CoulombePresents
← all repos

gputrace

0

Read an Xcode GPU capture from the command line — the format Apple never documented.

The story

Xcode's Metal GPU debugger writes a .gputrace package to disk, then makes you click through a GUI to ask it anything — is this array texture populated for both eyes, which encoder actually wrote that render target. gputrace parses the capture's record format directly, so the answer is a one-line command instead of a click-through session. Apple documents none of the format; the layout was derived byte-by-byte from a visionOS 26 capture and has since been exercised against UE 5.8.1 Metal captures. The README leads with the two ways a pixel dump silently lies to you — the payload sits at the tail of the file rather than a fixed offset, and depth+stencil dumps are planar, not row-interleaved, which produces a coherent-looking depth image whose bottom fifth is exactly zero.

Highlights

  • textures, encoders, records, descriptors, dump — five subcommands over one capture
  • Named texture inventory: joins setLabel: records to the pixel-dump manifest by object pointer
  • PNG pixel dumps straight out of a capture; multi-slice textures stack top-to-bottom
  • Structured text an agent can grep and diff across captures — not a GUI it has to screenshot
  • Single-file Python 3, stdlib only except dump (numpy + Pillow)
$ git clone https://github.com/ibrews/gputrace.git