Generated banner for Doca Compress
Generated logo for Doca Compress

Doca Compress

NVIDIAOfficialCreated by NVIDIA

  • Skill
  • Tool integration
  • Software development
  • Apache-2.0
  • Medium risk

From the author

Hardware compression offload with DOCA Compress on a BlueField DPU, ConnectX NIC, or host: DEFLATE compress and decompress, plus LZ4 decompress (stream and block; LZ4 encode is NOT supported), instead of CPU zlib / zstd. Trigger on "offload this gzip", "decompress incoming network data on the NIC", "compress task returns INVALID_VALUE on alloc_init", "submitted a task but no completion arrives", or "decompress LZ4 on the BlueField", even without naming DOCA Compress. Covers enabling compress-deflate, decompress-deflate, decompress-lz4-stream and decompress-lz4-block tasks on a doca_compress context, sizing source / destination doca_buf against the per-task cap query, mmap permissions, offload vs CPU decisions, a round-trip smoke, and DOCA_ERROR_* from Compress calls. Refuse and route elsewhere for zstd / Snappy / brotli, LZ4 encode (a CPU LZ4 library), pure mmap-to-mmap copies (doca-dma), or DOCA Core lifecycle internals.
— the description by NVIDIA

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides guidance for developers integrating the NVIDIA DOCA Compress library into applications to offload bulk DEFLATE compression/decompression and LZ4 decompression tasks. It covers the lifecycle of a doca_compress context, capability discovery for specific hardware, buffer management, and error handling. It is designed for developers working on Linux systems with a compatible NVIDIA DPU or NIC, focusing on when to use hardware offload versus CPU-based compression.

What it does

  • Configures and manages doca_compress contexts for DEFLATE and LZ4 tasks.
  • Provides capability discovery to check supported tasks and buffer size limits on specific hardware.
  • Guides developers on setting correct mmap permissions for source and destination buffers.
  • Assists in debugging DOCA_ERROR_* codes related to compression tasks.
  • Implements path-selection logic to decide between hardware offload and CPU-based compression.
  • Facilitates round-trip smoke testing to validate compression and decompression workflows.

When to use it

  • When implementing bulk DEFLATE compression or decompression on BlueField DPUs or ConnectX NICs.
  • When you need to decompress LZ4 streams or blocks using hardware acceleration.
  • When troubleshooting performance or configuration issues with DOCA Compress tasks.
  • When determining if a specific data workload is large enough to benefit from hardware offload.
  • When integrating DOCA Compress into C/C++ applications or building language-specific bindings.

Advantages

  • Reduces CPU overhead by offloading intensive compression tasks to dedicated hardware.
  • Provides clear guidance on hardware-specific capability and buffer size constraints.
  • Standardizes error handling and debugging procedures for DOCA Compress.
  • Ensures efficient memory management through proper mmap and buffer sizing practices.

Usage examples

“Should I offload a 4 MiB log buffer compression to DOCA Compress or use zlib on the CPU?”
The agent will evaluate the size-threshold rule to determine if the data volume justifies the DMA-to-accelerator overhead compared to CPU-based processing.
“My doca_compress_task_compress_deflate returns DOCA_ERROR_NOT_PERMITTED.”
The agent will guide you through the mmap permission checklist to ensure source and destination buffers are correctly configured for the hardware.
“How do I check if my BlueField DPU supports decompressing LZ4 streams?”
The agent will direct you to use the per-task capability-query functions to verify support on your specific device.
“I need to decompress incoming network data; do I need to enable the compress task?”
The agent will confirm that decompression-only workflows are valid and explain how to configure the context for that specific requirement.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/nvidia/doca-compress/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip doca-compress.zip -d .agents/skills

Documentation by NVIDIA

DOCA Compress

Examples

  • "Offload this gzip on the BlueField." — this is in scope if the codec is DEFLATE (or LZ4 decompress). Do not invent LZ4 encode or zstd offload.

  • "Compress task returns INVALID_VALUE on alloc_init." — size the doca_buf against the per-task cap query before changing the algorithm.

Instructions

Follow Loading order below. Open the tasks companion for configure / test / debug. Open the capabilities companion for codec support and buffer-size policy. Do not open every companion file.

Where to start: This skill assumes DOCA is already installed and the user is doing hands-on Compress work (bulk DEFLATE compression or decompression) on a BlueField / ConnectX / host with DOCA. Open the tasks companion if the user wants to do something (configure / build / modify / run / test / debug); open the capabilities companion when the question is what can DOCA Compress express on this version. If the user has not installed DOCA yet, route to doca-setup/SKILL.md first. If the user is asking "should I even offload this compression to the accelerator?", the size-threshold path-selection rule in

Capabilities and modes

is the first stop — bulk compress is the canonical fit, tiny one-shot is not.

Example questions this skill answers well

The CLASSES of DOCA Compress questions this skill is built to answer, each with one worked example. The agent should treat the class as the load-bearing piece — the worked example is a single instance.

  • "Should I offload this compression to DOCA Compress, or just zlib/zstd on the CPU?" — worked example: "I am compressing a 4 MiB log buffer before writing it to storage; is doca-compress worth the setup vs zlib on the CPU?". Answered by the size-threshold path-selection rule in

    Capabilities and modes

    • the "when NOT to use doca-compress" bullets in

    Safety policy.

  • "Does my device support the compress (or decompress) task I want, and how big a buffer can it move per submission?" — worked example: "is doca_compress_task_compress_deflate on this BlueField, and what is the max source size per task?". Answered by the per-task capability-query rule (doca_compress_cap_task_compress_deflate_is_supported, _decompress_deflate_is_supported, the matching _get_max_buf_size queries) in

    Capabilities and modes

    • the discovery step in

    configure.

  • "I just need to decompress incoming network data — is that a valid standalone use of doca-compress?" — worked example: "my client receives DEFLATE-compressed payloads and never produces any compressed output of its own". Answered by the "decompression-only" note in

    Capabilities and modes

    task-type table + the per-task configuration matrix in

    configure step 5.

  • "What permissions does the source / destination mmap need?" — worked example: "my doca_compress_task_compress_deflate returns DOCA_ERROR_NOT_PERMITTED". Answered by the permission matrix in

    Safety policy

    • the mmap-set-permissions checklist in

    test.

  • "Is this DOCA Compress API available on my installed DOCA version?" — worked example: "is doca_compress_task_decompress_deflate in the DOCA I have installed?". Answered by the version-compatibility overlay in

    Version compatibility,

    which cross-links the canonical detection chain in doca-version/SKILL.md and adds the Compress-specific "discover per-task support, do not assume" bullets.

  • "What does this DOCA_ERROR_* from a Compress call mean and which layer caused it?" — worked example: "DOCA_ERROR_INVALID_VALUE on doca_compress_task_compress_deflate_alloc_init". Answered by the Compress overlay on the cross-library taxonomy in

    Error taxonomy

    • the layered ladder in

    debug that escalates to

    doca-debug/SKILL.md.

Audience

This skill serves external developers building applications that consume the DOCA Compress library — i.e., users whose code calls doca_compress_* (directly in C/C++, or through FFI/bindings from another language) to offload bulk DEFLATE compression or decompression onto a BlueField DPU or ConnectX accelerator. It is not for NVIDIA developers contributing to DOCA Compress itself.

Language scope. DOCA Compress ships as a C library with pkg-config module name doca-compress. The shipped samples are written in C. C and C++ consumers are the canonical case and the worked examples in the tasks companion assume that path. Other-language consumers (Rust, Go, Python, …) consume the same *.so through FFI or language-specific bindings; the skill's contribution in that case is to keep the lifecycle, capability-discovery, permission, error-taxonomy, and compress-vs-decompress guidance language-neutral, and to route the agent to the public C ABI as the authoritative surface that any wrapper will eventually call.

When to load this skill

Load this skill when the user is doing hands-on DOCA Compress work, in any language. Concretely:

  • Initializing a doca_compress context on a doca_dev and configuring at least one task type (doca_compress_task_compress_deflate and/or doca_compress_task_decompress_deflate) before doca_ctx_start().

  • Choosing between the compress task and the decompress task for the user's data flow. The two task types are independent: a consumer that only decompresses inbound DEFLATE payloads is a valid shape and does not need to enable the compress task.

  • Setting permissions on doca_mmap correctly for the source buffer (DOCA_ACCESS_FLAG_LOCAL_READ_ONLY at minimum) and the destination buffer (DOCA_ACCESS_FLAG_LOCAL_READ_WRITE).

  • Sizing the source buffer against the per-task doca_compress_cap_task_*_get_max_buf_size(devinfo) ceiling and the destination buffer against the worst-case output size the algorithm can produce on this input.

  • Checking which task types this device's accelerator advertises via doca_compress_cap_task_compress_deflate_is_supported and doca_compress_cap_task_decompress_deflate_is_supported against the active doca_devinfo.

  • Validating against a round-trip (compress → decompress, or decompress → compare against a known DEFLATE-encoded fixture) before pushing bulk input through the accelerator.

  • Deciding whether to offload at all — the size-threshold rule in ## Capabilities and modes says doca-compress is the right answer only for bulk inputs (rule of thumb: ≥ a few KiB); below that, CPU compression beats the DMA-to-accelerator round-trip.

  • Debugging a DOCA_ERROR_* returned from a Compress call (lifecycle vs. buffer-sizing vs. permission vs. unsupported-task) and the task-completion event on the progress engine.

  • Designing or extending non-C bindings (Rust, Go, Python, …) that wrap the Compress C ABI — for the lifecycle, permission, capability, and compress-vs-decompress rules the wrapper must honor.

Do not load this skill for general DOCA orientation, install of DOCA itself, non-DEFLATE compression libraries on CPU (use zlib / zstd / similar), or other DOCA libraries. For those, use doca-public-knowledge-map/SKILL.md.

What this skill provides

This is a thin loader. The body keeps only the orientation needed to pick the right next file. The substantive Compress-specific material lives in two companion files:

  • the capabilities companion — what DOCA Compress can express on this version: the four task types (compress-deflate, decompress-deflate, decompress-lz4-stream, and decompress-lz4-block, each independently capability-gated), the per-task capability-query surface (doca_compress_cap_* for task support and per-submission max buffer size), the Compress error taxonomy (mapped onto the cross-library DOCA_ERROR_* set), the observability surface (per-task completion events on the progress engine), the safety policy that gates source / destination mmap permission decisions, and the size-threshold path-selection rule (when to use doca-compress versus CPU compression or doca-dma for the no-compression copy case).

  • the tasks companion — step-by-step workflows for the six in-scope Compress verbs: configure, build, modify, run, test, debug. Plus a ## rollback overlay (Compress-specific five-step teardown that drains in-flight tasks before doca_ctx_stop, unregisters mmap regions in reverse-register order, and re-verifies the device path with the round-trip smoke) and the 5-phase universal debug-loop instantiation appended to ## debug. Plus a Deferred task verbs block that points out-of-scope questions at the right next skill.

The skill assumes a host or BlueField where DOCA is already installed at the standard location and the user has the privileges their public install profile expects. It does not cover installing DOCA — that path goes through doca-setup/SKILL.md.

What this skill deliberately does not ship

This skill is agent guidance, not a samples or templates bundle. To keep the boundary clean, it deliberately does not contain — and pull requests should not add:

  • Pre-written DOCA Compress application source code, in any language. The verified Compress source code is the shipped C samples at /opt/mellanox/doca/samples/doca_compress/, plus the File Compression reference application linked from the public DOCA Compress guide. The agent's job is to route the user to those files and prescribe a minimum-diff modification on them via the universal modify-a-sample workflow in doca-programming-guide/SKILL.md, layered with the Compress-specific overrides in

    modify.

  • Pre-encoded DEFLATE fixtures for arbitrary inputs. The skill tells the agent to use a round-trip validation (compress → decompress and compare to the original, or decompress a known DEFLATE blob produced by a published CPU encoder like zlib) as the known-good smoke; it does not ship a fixture bank of its own.

  • Standalone build manifests (meson.build, CMakeLists.txt, Cargo.toml, …) parked inside the skill. The agent constructs the build manifest in the user's project directory against the user's installed DOCA, where pkg-config --modversion doca-compress is the source of truth.

  • A samples/, bindings/, or reference/ subtree of any kind. A mock or incomplete artifact in this skill's tree, even one labeled "reference", is misleading: users will read it as buildable.

Loading order

  1. Read this skill first to confirm the user's question is in scope.

  2. For the Compress capability matrix, the compress / decompress task split (including decompression-only as a standalone shape), per-task capability-query rules, permission matrix, error taxonomy, observability, and safety / path-selection policy, see the capabilities companion.

  3. For step-by-step workflows — configure, build, modify, run, test, debug — see the tasks companion.

Both companion files cross-link to each other, doca-version/SKILL.md for the canonical version-handling rules, and doca-public-knowledge-map/SKILL.md whenever the right answer is "look it up in the public docs or the installed package layout" rather than "Compress-specific guidance".

  • doca-public-knowledge-map/SKILL.md — the routing table for every public DOCA documentation source and the on-disk layout of an installed DOCA package. The DOCA Compress page lives at docs.nvidia.com/doca/sdk/DOCA-Compress/; the File Compression reference application is the canonical worked example.

  • doca-setup/SKILL.md — env preparation, install verification, and the I have no install yet path with the public NGC DOCA container. This skill assumes its preconditions are satisfied.

  • doca-version/SKILL.md — canonical DOCA version-handling rules. This skill's ## Version compatibility cross-links the four-way match rule and adds only the Compress-specific "discover per-task support + per-task max buffer size via cap query" overlay.

  • doca-structured-tools-contract/SKILL.md — the bundle's structured-tools precedence rule (detect / prefer / fall back / report). The Command appendix in the tasks companion honors this contract.

  • doca-programming-guide/SKILL.md — general DOCA programming patterns shared by every library: the canonical pkg-config + meson build pattern, the universal modify-a-shipped-sample first-app workflow, the universal lifecycle, the cross-library DOCA_ERROR_* taxonomy, and the program-side debug order. This skill layers Compress specifics on top.

  • doca-dma/SKILL.md — the right library when the data flow is a pure mmap-to-mmap copy with no compression required. This skill's path-selection rule routes to DMA when Compress is not the answer (e.g. the user only wants to move bytes, not encode them).

  • doca-debug/SKILL.md — the cross-cutting debug ladder (install / version / build / link / runtime / program / driver). Compress-specific debug (task-not-supported, source-buffer-too-large, destination-buffer-too-small) overlays on top of that ladder.

Files

TASKS.md

DOCA Compress workflows

Where to start: The verbs run configure → build → modify → run → test → debug. Skip ahead only when the user is already past a verb. The ## test verb is an iterative loop (cap check → permission cross-check → round-trip smoke → small-bulk → full-bulk → loop back if a task-type or buffer-sizing assumption changed), not a one-shot pass — see the eval-loop overlay in ## test below.

Read this file when the loader sent you here from SKILL.md. For the underlying capability surface, the compress-vs-decompress task split (including decompression-only as a standalone shape), per-task capability-query rules, error taxonomy, observability, and safety / path-selection policy, see CAPABILITIES.md. For the cross-library DOCA patterns layered under everything below (the universal lifecycle, the cross-library DOCA_ERROR_* taxonomy, the modify-a-shipped-sample workflow), see doca-programming-guide/SKILL.md.

Each verb below describes the shape of the workflow, not a copy-paste recipe. The agent's job is to walk the user through the steps in order, verifying preconditions before recommending the next call.

configure

Goal: bring up a DOCA Compress context on a host or BlueField and confirm the device's accelerator supports the task type(s) the user actually intends to use, with buffer sizing that respects the per-task max.

Steps the agent should walk the user through:

  1. Confirm the installed DOCA version. Use the procedure in doca-version TASKS.md ## configure (doca-version/TASKS.md#configure). Quote the version observed (pkg-config --modversion doca-compress, then doca_caps --version); do not assume "latest". The four-way match rule lives in doca-version CAPABILITIES.md ## Version compatibility (doca-version/CAPABILITIES.md#version-compatibility); if the observed sources disagree, route there before any Compress diagnosis.

  2. Discover the device capability surface for Compress. Run doca_caps --list-devs (per doca-caps/SKILL.md) to see which devices are visible, then run the per-doca_devinfo doca_compress_cap_* queries against the candidate device. Record the support and maximum-source-size result for every requested mode: doca_compress_cap_task_compress_deflate_is_supported(devinfo), doca_compress_cap_task_decompress_deflate_is_supported(devinfo), doca_compress_cap_task_decompress_lz4_stream_is_supported(devinfo), doca_compress_cap_task_decompress_lz4_block_is_supported(devinfo), and their matching doca_compress_cap_task_compress_deflate_get_max_buf_size(devinfo) / doca_compress_cap_task_decompress_deflate_get_max_buf_size(devinfo) / doca_compress_cap_task_decompress_lz4_stream_get_max_buf_size(devinfo) / doca_compress_cap_task_decompress_lz4_block_get_max_buf_size(devinfo) queries. For either LZ4 decode mode, also record its matching _get_max_buf_list_len result. Query only the modes the user intends to enable. The capability surface to compare against lives in CAPABILITIES.md ## Capabilities and modes.

  3. Decide whether to offload at all. Per the size-threshold path-selection bullets in CAPABILITIES.md ## Safety policy, doca-compress is the right answer only when the input is bulk (rule of thumb: ≥ a few KiB), repeated, or already pinned in doca_mmap memory. For a tiny one-shot input (e.g. a 64-byte buffer), recommend CPU zlib / zstd — do not invent a doca-compress use case the user did not ask for. For outbound encoding in a non-DEFLATE algorithm, doca-compress is not the answer. Inbound decode supports DEFLATE plus the independently gated LZ4 stream and LZ4 block modes.

  4. Pick the task type(s) to enable. DEFLATE compress (doca_compress_task_compress_deflate) for outbound encoding; DEFLATE decompress (doca_compress_task_decompress_deflate), LZ4 stream decompress (doca_compress_task_decompress_lz4_stream), or LZ4 block decompress (doca_compress_task_decompress_lz4_block) for inbound decoding; both DEFLATE directions for a round-trip flow. A decompress-only consumer is a fully valid shape — do not auto-enable the compress task on a user who only described an inbound decoding need. The trade-off table lives in CAPABILITIES.md ## Capabilities and modes.

  5. Configure the Compress instance. Mandatory before doca_ctx_start(): enable at least one task type (the matching task configuration for DEFLATE encode, DEFLATE decode, LZ4 stream decode, and/or LZ4 block decode, each with its success and error completion callbacks plus its max-num-tasks budget); set source mmap permissions (doca_mmap_set_permissions to include DOCA_ACCESS_FLAG_LOCAL_READ_ONLY); set destination mmap permissions (DOCA_ACCESS_FLAG_LOCAL_READ_WRITE); size the source buffer to ≤ the matching _get_max_buf_size and the destination buffer to the worst-case output size (a compress destination may need to be slightly larger than the source for poorly-compressible inputs; a decompress destination may need to be substantially larger than the compressed source). Per the matrix in CAPABILITIES.md ## Safety policy.

  6. Sanity check before any task submission. Confirm with the user: which task type(s), source-buffer size, destination-buffer size, and whether the intended source size is within the per-task _get_max_buf_size (and, for LZ4, the matching maximum buffer-list length). Run a round-trip smoke for DEFLATE encode plus decode, or for a decode-only consumer use a known matching CPU-produced fixture in the exact requested format (DEFLATE, LZ4 stream, or LZ4 block) together with its retained original. Verify the decoded result matches that original byte-for-byte before any user data flows. If any step fails with a DOCA_ERROR_*, route through the error taxonomy in CAPABILITIES.md ## Error taxonomy before retrying.

For the canonical DOCA universal lifecycle that underlies steps 4-6, see doca-programming-guide TASKS.md ## configure (doca-programming-guide/TASKS.md#configure). This skill adds the Compress overlay; do not re-explain the lifecycle here.

build

Goal: produce a binary that links DOCA Compress against the user's installed DOCA, using the canonical cross-library build pattern.

The build pattern for any DOCA C/C++ consumer is identical across libraries — pkg-config for include + link flags, meson or CMake as the build system — and is fully documented in doca-programming-guide TASKS.md ## build (doca-programming-guide/TASKS.md#build). This skill carries only the Compress-specific overlay:

SlotValue for CompressWhy it matters
pkg-config module namedoca-compressThe library's .pc file installed by the DOCA host packages. Wrong module name = pkg-config: Package 'doca-compress' was not found
Required runtime libslibdoca-common, libdoca-compress, plus whatever pkg-config --libs doca-compress resolves transitivelyCompress depends on Core; the link line should not pull in unrelated DOCA libraries
Header checkThe public header that pkg-config --cflags for this artifact resolves to actually exists on disk at the path pkg-config reports (do not hardcode the include path)If pkg-config --cflags doca-compress resolves but the include is missing, the install is partial — route to doca-version TASKS.md ## debug (doca-version/TASKS.md#debug) layer 2
Minimum required DOCA versionQuery with pkg-config --modversion doca-compress; never hardcode in build filesCross-version build/runtime mixing breaks per CAPABILITIES.md ## Version compatibility

For non-C consumers (Rust, Go, Python), the link surface is the same *.so files; the FFI wrapper layer is the language-specific binding and is out of scope for this skill — but the four slots above are still the load-bearing inputs the wrapper needs.

modify

Goal: take a shipped DOCA Compress sample (or the File Compression reference application) as the verified starting point and apply a minimum-diff modification to express the user's intent.

The universal modify-a-shipped-sample workflow lives in doca-programming-guide TASKS.md ## modify (doca-programming-guide/TASKS.md#modify). Use it as-is. The Compress-specific overlay is the modify-from-sample schema fill — the slots the agent must elicit from the user before recommending any code-level edit:

SlotWhat the agent asks the userCompress-specific consideration
1. Starting sampleWhich sample under /opt/mellanox/doca/samples/doca_compress/? Or the File Compression reference application under /opt/mellanox/doca/applications/?Pick the closest in direction (compress vs decompress vs both) to the user's intent. Do NOT bridge across both directions — a smaller diff is always safer than a re-architecture; a decompress-only consumer should start from a decompress sample, not from a compress sample with the encoding ripped out
2. Task type(s) added or removedWhich of the four task types?Each enabled task needs its own doca_compress_task_*_set_conf call before doca_ctx_start(), plus its matching cap-query in ## configure step 2. A decompress-only consumer should remove the compress-task setup the sample wires up, not leave it dangling
3. Buffer-size changesSource or destination buffer size changing?Source must be ≤ the matching _get_max_buf_size for the task type; destination must be sized for the worst-case output (compress: input that does not compress well can produce slightly more bytes than the input; decompress: output can be substantially larger than the compressed input). Over-broad permissions are a silent security regression
4. Round-trip vs one-way pipelineIs the user running a round-trip (compress → decompress in the same process) or a one-way pipeline (compress here, decompress elsewhere; or decompress only)?Round-trip enables both tasks on the same context and round-trip-validates locally; one-way pipelines enable only the matching task and validate against a CPU reference (zlib for the missing side)
5. Build manifestKeep the sample's existing meson.build (which already wires pkg-config doca-compress)?Yes. Do not switch to a hand-rolled Makefile for "simplicity" — it removes the version-check rail

The agent emits an intent description + the filled slots; the actual unified diff against the sample source is produced by the user (this bundle has no diff renderer; see doca-programming-guide TASKS.md ## modify (doca-programming-guide/TASKS.md#modify)). The agent must walk the user through the diff line-by-line against the sample source they read on disk, and have the user paste back the result for validation.

run

Goal: actually execute the built binary against the user's installed DOCA on a host or BlueField, with a real input.

Steps the agent should walk the user through:

  1. Confirm the device is reachable. Compress runs on a single side (no peer); the only env-side requirement is that the doca_dev the binary opens corresponds to a device whose accelerator the user expects. Mismatched doca_dev selection (opening a NIC without the requested Compress task on its accelerator) returns DOCA_ERROR_NOT_SUPPORTED at task submit, not at open. Re-quote the output of doca_caps --list-devs (doca-caps/SKILL.md) and confirm the device the binary opens is the same one the cap-query ran against.

  2. Run the round-trip (or decompress-known-fixture) smoke first. A binary that compresses one short input and decompresses the output, comparing to the original — or, for a decompress-only consumer, decompresses one small DEFLATE fixture produced by zlib and compares to the original — is the cheapest correctness signal. Do not bulk-encode or bulk-decode before this passes.

  3. Capture the structured log. Set DOCA_LOG_LEVEL=trace for the first run (see doca-debug CAPABILITIES.md ## Observability (doca-debug/CAPABILITIES.md#observability)). This is the cheapest way to make the lifecycle and task-submit transitions visible on first failure.

  4. Capture the completion events on the PE. A run that produces no completion events but doesn't error is almost always a missed doca_pe_progress() call. Confirm the progress engine is being driven on the main thread.

test

Goal: prove the configured Compress context can actually produce correct encoded / decoded output at the user's intended throughput, on the user's hardware, and that the task selection, buffer sizing, and permission set were right.

Performance harness routing. For throughput / latency measurement on the configured Compress context (or for cross-library comparison against the other DOCA crypto primitives), route the user to doca-bench TASKS.md ## test (doca-bench/TASKS.md#test) — doca-bench is the cross-library performance harness with documented warm-up / steady-state / outlier semantics, and it explicitly supports Compress. The iteration loop below stays the correctness harness; doca-bench is the performance harness.

This is a loop, not a one-shot pass. Each iteration narrows either the task type, the buffer sizing, the permission set, or the path-selection assumption. The loop terminates when either (a) the user's intended workload produces correct output end-to-end with acceptable throughput, or (b) the agent has narrowed the failure cause to a layer outside DOCA Compress itself (driver / firmware / device) and escalated to the matching skill.

Iteration identity: compare the tuple of requested task / algorithm mode, support and max-size query results, mmap permission map, submitted/completed counts, and byte-comparison outcome. Two consecutive iterations with the same tuple are unchanged and trigger escalation; unchanged is never a green result.

Iteration shape:

  1. Capability re-check. Re-run the exact support and _get_max_buf_size queries selected in ## configure for DEFLATE encode, DEFLATE decode, LZ4 stream decode, and/or LZ4 block decode against the active doca_devinfo; include the matching _get_max_buf_list_len result for LZ4. If any required task type returns false / unexpected → that's the answer; the user's device or DOCA version does not support the requested config. Update the intent or update the install.

  2. Permission cross-check. Compare the configured source + destination mmap permissions against the matrix in CAPABILITIES.md ## Safety policy. Mismatches surface as DOCA_ERROR_NOT_PERMITTED on the first task submission, not at configure time.

  3. Round-trip smoke (or decode-known-fixture smoke). Compress one short fixed input and decompress the output, comparing to the original byte-for-byte; OR, for a decode-only consumer, decode one known matching CPU-produced DEFLATE, LZ4 stream, or LZ4 block fixture and compare to its retained original byte-for-byte. If the comparison fails, the configuration is wrong — do not proceed to bulk input.

  4. Completion drain. Confirm completion events arrive on the PE for every submitted task. Submitted but no completion is the most expensive class of bug to discover late; confirm it on the round-trip smoke before bulk submissions.

  5. Small-bulk test. Submit a small series of tasks at sizes approaching the per-task _get_max_buf_size but staying under it; verify the outputs decompress back to the inputs (round-trip) or match a CPU reference. Throughput numbers come from this step; correctness comes from step 3.

  6. Full-bulk run. Once the small-bulk passes, scale up to the user's intended size and submission rate. Watch for DOCA_ERROR_AGAIN (drain the PE before retrying) and for DOCA_ERROR_INVALID_VALUE (a per-task source-size or destination-size boundary was crossed — re-narrow to the cap-query axis or to the worst-case-output-sizing axis).

  7. Negative test. Once the positive path works, intentionally request a task type the device should NOT support (per step 1), or submit a source buffer larger than _get_max_buf_size for the configured task, and confirm the failure is the expected DOCA_ERROR_NOT_SUPPORTED / DOCA_ERROR_INVALID_VALUE. This validates the agent's capability-discovery is itself correct.

Eval-loop overlay — why this is a loop, not a one-shot pass:

Iteration triggerWhat it looks likeWhat changes next iteration
DOCA_ERROR_NOT_SUPPORTED on a task we expected to workThe doc page lists the task but the cap query returns falseThe agent quoted the library surface; the device capability per doca_devinfo is the real gate. Re-narrow to the device-level query for the specific task type.
DOCA_ERROR_INVALID_VALUE on first submitSource buffer is larger than _get_max_buf_size for the task, OR destination buffer is too small for the worst-case outputRe-size the buffer using the cap-query output (source) or against a worst-case calculation (destination). The error is sizing-vs-cap mismatch, not corruption.
Round-trip smoke produces wrong outputConfiguration accepted but the decompressed output does not match the originalWrong task enabled (asked for decompress, configured compress), wrong buffer wired (source / destination swapped), or the smoke fixture is corrupt. Re-check the task type in the _alloc_init call and the source / destination buffer wiring before any other diagnosis.
Submitted task produces no completiondoca_task_submit() returned DOCA_SUCCESS; the PE produces nothingThe PE is not being progressed. Add a doca_pe_progress() call in the main loop.
Bulk submit returns DOCA_ERROR_AGAINFirst N submissions succeed, then AGAINThe task queue is full. Drain completions between bursts via doca_pe_progress(), or raise the configured queue depth at configure time.
Smoke passes; small-bulk is slower than CPU zlib end-to-endThe per-call DMA-to-accelerator round-trip dominates per-input time at this sizeRe-walk the size-threshold path-selection rule in CAPABILITIES.md ## Capabilities and modes. At small input sizes, CPU compression is the right answer; the cap query reports max input but not the min-input floor.

Loop termination: stop iterating once two consecutive iterations have the same task / algorithm mode, cap results, permission map, submitted/completed counts, and byte-comparison outcome. That unchanged identity means the cause is below DOCA Compress and is never success. Escalate to doca-debug TASKS.md ## debug (doca-debug/TASKS.md#debug) with the captured cap-query snapshot + round-trip diff as evidence.

debug

Goal: when a DOCA Compress call returns a DOCA_ERROR_* (or the program produces no completion event), narrow the cause to a specific layer and act on it.

The cross-library debug ladder lives in doca-debug TASKS.md ## debug (doca-debug/TASKS.md#debug). Walk through it in order — install → version → build → link → runtime → program → driver — before recommending Compress-specific fixes. This skill's overlay names the Compress-specific manifestation at layers 5 (runtime) and 6 (program):

Layer 5 (runtime) — Compress overlay.

  • Walk the lifecycle: was the context started? Were the task(s) enabled before start (doca_compress_task_*_set_conf before doca_ctx_start())? Submitting before the requested task is enabled returns DOCA_ERROR_BAD_STATE, not a clear symptom.

  • Confirm the PE is being progressed. No completion events is almost always a missing doca_pe_progress() in the user's main loop.

  • Confirm both the source mmap and the destination mmap are still alive at submit time. Destroying either before doca_ctx_destroy is a use-after-free that surfaces as DOCA_ERROR_BAD_STATE from subsequent calls.

Layer 6 (program) — Compress overlay.

  • Buffer-sizing matrix: the most common Compress program-layer bugs are (a) a source buffer larger than the matching _get_max_buf_size for the enabled task — surfaces as DOCA_ERROR_INVALID_VALUE at submit; fragment at the application layer — and (b) a destination buffer too small for the worst-case output. For compress, worst-case output can be slightly larger than the input on incompressible data; for decompress, the decompressed output can be substantially larger than the compressed input.

  • Task-type drift: an _alloc_init call that asks for a task type the cap query returns false for returns DOCA_ERROR_NOT_SUPPORTED. Re-run the matching doca_compress_cap_task_*_is_supported against the active doca_devinfo; do not assume from prior installs.

  • Source / destination swap: a configuration that wires the encoded buffer as the source of a compress task (or the raw buffer as the source of a decompress task) will produce a completion that decodes back to garbage on round-trip. Walk the buffer wiring against the task direction in CAPABILITIES.md ## Capabilities and modes before any other diagnosis.

  • Round-trip mismatch: if the decompressed output is the wrong length, the task type is likely wrong (asked for compress, configured decompress, or vice versa). If the length is right but the bytes don't match the original, the source / destination wiring is wrong or the fixture used for the smoke is itself corrupt.

Once the layer is identified, route to the matching debug verb on the matching skill: install / build / link / driver to doca-setup ## debug (doca-setup/TASKS.md#debug); version to doca-version ## debug (doca-version/TASKS.md#debug); cross-cutting runtime to doca-debug ## debug (doca-debug/TASKS.md#debug); program-layer Core-context patterns to doca-programming-guide TASKS.md ## debug (doca-programming-guide/TASKS.md#debug).

5-phase universal debug-loop instantiation (Compress). Layer identification above is phase 1 of the universal debug-loop contract (doca-debug/CAPABILITIES.md#universal-debug-loop-contract). The agent MUST walk the remaining four phases on every Compress debug answer before declaring done:

  1. Layer identification — above (capability / lifecycle / data-path).

  2. Triple capture (READ-ONLY). Capture (a) capability map: doca_compress_cap_task_compress_deflate_is_supported(devinfo)

    • doca_compress_cap_* max buffer / algorithm support on the actual devinfo, (b) submitted-task vs completed-task counters from doca_pe_progress callback log, (c) DOCA log at DOCA_LOG_LEVEL=DEBUG for the offending task with the request / response buffer addresses. The triple is the rollback target.

  3. Single-variable mutation SMALLER than the original change. Examples: shrink the input buffer to a single compressible payload (not the production batch); switch doca_mmap to a fresh pinned region (not the production pool); reduce parallelism to one outstanding task (not the pipeline depth). Larger mutations void the experiment.

  4. Re-capture and compare. Re-run the triple; the request/response counter diff IS the evidence.

  5. Exit with named green signal OR escalate. Green = one round-trip (compress → decompress) returns bytes-equal at the source. If two consecutive iterations don't change anything, escalate via the layer route table above with the captured triple.

rollback

Compress contexts are stateful (started context + registered mmap regions + in-flight tasks on the progress engine) and the agent's failure mode is to leave in-flight tasks dangling on a context that is being torn down, returning DOCA_ERROR_BAD_STATE on the next program run. The universal verification contract (doca-setup/CAPABILITIES.md#universal-verification-contract) step 1 (preconditions) requires "the rollback path is documented" on every change-recommending answer; this is the Compress instantiation.

Snapshot before mutate. Before any change-recommending Compress answer, capture (a) the started-context registration map (mmap region IDs + task-type conf flags from ## configure step 3), (b) the outstanding-task count from doca_pe_progress, and (c) the input/output buffer ownership list. The triple IS the rollback target.

  1. Drain outstanding tasks FIRST. Walk doca_pe_progress until the outstanding-task counter is zero. Do NOT submit new tasks after rollback intent is declared. If the drain stalls (counter not decrementing within the bounded debug-loop window), fire the deploy-loop bridge (doca-setup/CAPABILITIES.md#deploy-loop-bridge--step-5-not-green-is-the-debug-loop-trigger) on the stalled-drain symptom before continuing the rollback.

  2. doca_ctx_stop on the Compress context. Returns DOCA_ERROR_BAD_STATE if step 1 was skipped — that is diagnostic, not a retry trigger; re-walk step 1 with a higher-resolution drain log.

  3. Destroy the stopped Compress context. doca_compress_destroy before destroying either mmap. The underlying doca_dev remains valid and must not be torn down by this step.

  4. Unregister mmap regions in reverse-register order. doca_mmap_destroy on every region created with doca_mmap_create_*; the underlying host buffers may be freed after this step.

  5. Re-verify with the shipped round-trip smoke. Re-run the round-trip from ## test step 1 against a fresh context to confirm the device + driver path is intact post-rollback. Green is exactly a byte-equal result. If the first fresh-context smoke is not byte-equal, permit one bounded debug-loop single-variable mutation and then one fresh-context recheck. If that recheck is still not byte-equal, surface the unresolved residual gap and do not retry.

  6. Document the rollback verb in the verification contract preconditions block. The step 1 line for a Compress add reads: "the rollback path is the five-step reversal in ## rollback; the agent has captured the started-context registration map and outstanding-task count." Without that line, the contract is incomplete and the agent is NOT eligible to declare done.

The rollback is bounded to the initial fresh-context recheck plus one debug mutation and one final fresh-context recheck. Only a byte-equal comparison is green; a second non-green result is the unresolved residual gap.

Deferred task verbs

The following verbs are out of scope for this skill but are commonly asked in the same conversations. Route them as follows so the agent does not invent guidance:

  • install. Installing DOCA, choosing packages, post-install verification, pkg-config wiring — defer to doca-setup/SKILL.md and to the install-tree layout in doca-public-knowledge-map ## Layout of an installed DOCA package (doca-public-knowledge-map/SKILL.md#layout-of-an-installed-doca-package). This skill assumes DOCA is already installed.

  • deploy. Deploying Compress-using applications at scale (compress-before-write storage workers across many hosts, decompress-on-read network receivers, Kubernetes operator workflows) — out of scope for this skill. For single-host first-run testing, the right verb in this skill is ## run; do not invent a "deploy" workflow.

  • rollback. Coordinated rollback of Compress-using applications across many hosts — out of scope. For a single in-session Compress configuration rollback, the right verb in this skill is destroying the context (doca_ctx_stop → doca_ctx_destroy) and re-running ## configure with corrected parameters.

  • kernel-level driver install / firmware burn. Compress depends on the underlying ConnectX firmware and BlueField BFB; if the debug ladder lands on a driver-layer issue (DOCA_ERROR_DRIVER from a Compress submit, repeated accelerator errors in dmesg), the fix is via mlxconfig / mlxfwreset / re-imaging the BFB, all of which belong to doca-setup ## debug (doca-setup/TASKS.md#debug) layer

Command appendix

Every command below is cross-cutting on DOCA Compress — it answers a recurring class of question that comes up in the verbs above. The agent should treat the class as load-bearing; the worked example is a single instance. Run-as user is the unprivileged user unless noted. Rows that need elevated privileges call that out explicitly.

Infra-aware preamble (every row below). Per the bundle's detect → prefer → fall back → report contract documented in doca-structured-tools-contract ## The agent behavior contract (doca-structured-tools-contract/SKILL.md#the-agent-behavior-contract), the agent should:

  1. Probe for the matching structured helper FIRST (doca-env --json for version + devices + libraries + drivers + hugepages in one shot; doca-capability-snapshot for per-device capability flags; version-matrix.json for "available since" lookups).

  2. If the probe succeeds, the structured tool's output is the authoritative answer and the agent SHOULD NOT also run the manual command in the row below. Report "using structured <tool>".

  3. If the probe fails, fall back to the manual command in the row. Report "falling back to manual chain".

  4. The schemas the structured tools emit are defined in doca-structured-tools-contract ## Schemas (doca-structured-tools-contract/SKILL.md#schemas); the version-handling semantics (four-way match, NGC, headers-win) are owned by doca-version/SKILL.md.

Command (worked example)Owning stepClass of question it answersWhat healthy output looks like
pkg-config --modversion doca-compress## configure step 1; ## build slot 4What is the build-time DOCA Compress version?A semver string matching doca_caps --version. Disagreement = partial install (route to doca-version TASKS.md ## debug (doca-version/TASKS.md#debug) layer 2)
pkg-config --cflags --libs doca-compress## buildWhat include + link flags does the linker need?Trust whatever pkg-config --cflags --libs produces on this install. Do not hardcode either the -I include path or the -l<name> flag form — both can drift between DOCA install profiles and DOCA majors; the on-disk .so basenames use underscores, while the .pc package names use hyphens, and pkg-config is the only thing that resolves both correctly. Hand-crafted -l lines silently break when DOCA upgrades.
doca_caps --list-devs## configure step 2; ## run step 1Which devices on this host can be used as a doca_dev for Compress?One row per visible device with PCIe address and capability flags; the agent must still run doca_compress_cap_* per-device to confirm per-task support
doca_caps --version## configure step 1; ## test step 1What is the runtime DOCA version on this host?A semver string matching pkg-config --modversion doca-compress
ls /opt/mellanox/doca/samples/doca_compress/## modify slot 1Which Compress samples ship in this install, and which is the closest starting point?A list of sample directories named after the task direction they demonstrate (compress, decompress, or both)
ls /opt/mellanox/doca/applications/ (then locate the File Compression reference app)## modify slot 1Is the File Compression reference application present as a fuller worked example?A directory whose contents include a DEFLATE-based file-compression flow
cat /opt/mellanox/doca/applications/VERSION## configure step 1; ## debug layer 1What does the install tree itself claim its version is?A semver string matching the other two version sources
printf 'abcabcabcabcabcabc' | python3 -c 'import sys, zlib; sys.stdout.buffer.write(zlib.compress(sys.stdin.buffer.read()))' | xxd## test step 3What is the CPU-reference DEFLATE encoding for the round-trip smoke fixture?A short DEFLATE-encoded byte sequence the agent can compare against the doca-compress compress output, or feed into doca-compress decompress for a decompress-only smoke
dmesg | tail -n 40 (sudo)## debug layer 7What did the kernel / driver log around the last Compress call?Empty or recent benign messages. Repeated mlx5 / accelerator errors → driver-layer bug; route to doca-setup ## debug (doca-setup/TASKS.md#debug)
DOCA_LOG_LEVEL=trace ./<binary>## run step 3What did the structured DOCA logger emit for the first failing call?A trace-level line on every lifecycle transition and every task submission. Silence after submission = PE not progressed

For commands shared across libraries (pkg-config --modversion, doca_caps, cat /opt/mellanox/doca/applications/VERSION, DOCA_LOG_LEVEL) the cross-library overlay is in doca-debug TASKS.md ## Command appendix (doca-debug/TASKS.md#command-appendix); this table adds the Compress-specific rows on top.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

The author says: Requires DOCA SDK installed at /opt/mellanox/doca on Linux (Ubuntu 22.04/24.04 or RHEL/SLES) with a BlueField DPU or ConnectX NIC attached. Reads the user's local install via `pkg-config doca-compress` and inspects /opt/mellanox/doca/{lib,include,samples,applications}. The validation steps require a live DOCA install.

Security

What our scanner noticed· Medium risk

  • Large base64-encoded blobs

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
NVIDIA
Publisher
NVIDIA (Official)
Source
NVIDIA/skills · skills/doca-compress · commit fce3cca
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE-APACHE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by NVIDIA.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download doca-compress.zip