facebook/openzl/openzl-gpu-test-frames
Claude Code and agent skill by facebook/openzl
- community
Checking that the SKILL.md file is still in the repository.
How to mint real OpenZL frames and chunks for GPU decoder tests using the contrib/gpu/testkit utilities (frame_factory, multichunk_frame, frame_verifier), and how to extract a codec's encoded streams via reflection for differential GPU decode. USE when writing or reviewing GPU-decoder tests that need OpenZL-encoded fixtures.
Install
npx vskill@latest install facebook/openzl/openzl-gpu-test-framesSKILL.md
The same SKILL.md was published earlier as facebook/openzl/openzl-gpu-test-frames.
Minting OpenZL test frames/chunks for GPU decoder tests
contrib/gpu/testkit mints real OpenZL frames by driving the actual encoder, so every frame/chunk header and checksum is correct by construction — it never hand-serializes header bytes. Use it for all GPU-decoder test fixtures instead of crafting bytes by hand.
- Buck dep: add a relative dep to
testkit(e.g.../../testkit:testkitfrom
src/decompress/BUCK) — absolute //openzl/dev/... deps are forbidden in OpenZL.
- Namespace:
openzl::gpu::testkit. - Headers:
frame_factory.h,frame_verifier.h,multichunk_frame.h.
Always build your test Input with the C++ helpers (openzl/cpp/Input.hpp):
1. Single-graph frames — frame_factory.h
Always pin the format version so you get chunk-capable (v21+) frames:
Example — a single bitpack-of-numeric frame:
Example — a float_deconstruct frame:
2. Verifying which codecs landed — frame_verifier.h
standardCodecsInFrame and frameHasExactlyCodecs use the public reflection API, which only exposes the last chunk of a frame. For multi-chunk fixtures, use standardCodecsPerChunk: it drives the real decompression path with introspection hooks, disables codec fusion on its throwaway DCtx, and returns one inner vector per frame chunk. You do not need to re-mint slices just to verify per-chunk codec coverage.
3. Multi-chunk frames — multichunk_frame.h
Constraints: chunk numElts must sum to input.numElts(), and each chunk must clear `ZL_MIN_CHUNK_SIZE` = 32768 bytes of content (so "small" chunks can't be tiny — a bf16 chunk needs ≥ 16384 elts). makeMultiChunkFrame pins FormatVersion = ZL_MAX_FORMAT_VERSION.
Need finer-grained segments than a 32 KB chunk? Frame chunks can't be smaller thanZL_MIN_CHUNK_SIZE. When a test needs many small, arbitrarily-sized runs, mint one frame andsliceInputits stream into as many pieces as you need rather than relying on frame chunks.
4. Extracting a codec's encoded streams (for differential decode)
To feed a GPU decode kernel the real encoded bytes and compare against OpenZL's own decoder, decode the frame with the public reflection API (openzl/zl_reflection.h) and pull the codec's streams — the same reflection path frame_verifier uses for last-chunk codec inspection.
Gotchas that will bite you (learned the hard way):
- Reflection is encoder-oriented. A codec's outputs (
ZL_CodecInfo_getOutput) are the decoder's inputs (the stored streams you feed the kernel); its input (ZL_CodecInfo_getInput) is the decoder's regenerated output — use it fornbElts. - Classify streams by type, not index. Reflection reports a codec's outputs in the reverse of the encoder's stream order. Use
ZL_DataInfo_getType(ZL_Type_serial=1, ZL_Type_struct=2, ZL_Type_numeric=4, ZL_Type_string=8) to identify each stream. Forfloat_deconstruct:struct= signFrac,serial= exponent. - The codec-header byte is unreliable for element type.
float_deconstruct(codec id 33) is shared by float32/bfloat16/float16;ZL_CodecInfo_getHeaderPtrdoes not reliably surface the element-type enum. Detect the variant by stream widths instead: signFrac eltWidth 3/1/2 and output eltWidth 4/2/2 for float32/bf16/float16. makeFrameNodeToStoreinserts aconvert_struct_to_serial(codec id 6) before STORE for any Struct output — expected; just find the codec you care about among the list.
5. Building & running
If the test launches CUDA, run with sanitizers OFF (CUDA can't init under ASAN):
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcontrib/gpu/.claude/skills/openzl-gpu-test-frames/SKILL.md
Popularity
- Repository stars
- 3,168
- Repository forks
- 162
- 7-day trend score
- 40
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/facebook/openzl/openzl-gpu-test-frames)