Cudf Query Engine Builder
NVIDIAOfficialCreated by Joe SackDistributed by NVIDIA
- Skill
- Workflow
- Software development
- Apache-2.0
- Medium risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured workflow for query-engine engineers to integrate cuDF into their existing systems. It focuses on building a functional, single-GPU proof of concept (POC) that demonstrates native execution, correct buffer management, and proper asynchronous cleanup. The process emphasizes maintaining clear boundaries between the engine's orchestration responsibilities and cuDF's device-wide algorithms, ensuring that memory ownership, lifetime management, and producer-consumer dependencies are handled safely.
What it does
- Maps query engine semantics to version-matched cuDF APIs.
- Defines buffer ownership, lifetime, and release strategies for GPU data.
- Implements adapter glue code to bridge the engine and libcudf or cuDF Java.
- Establishes correct asynchronous execution patterns and completion synchronization.
- Validates POC correctness against CPU-based reference implementations.
- Provides a framework for reporting native execution evidence and identifying blockers.
When to use it
- When you need to integrate cuDF into a query engine for the first time.
- When developing a new native adapter for libcudf C++ or cuDF Java.
- When you need to resolve buffer ownership or asynchronous cleanup issues in an existing integration.
- When you need to verify that a query engine is correctly offloading work to a single GPU.
Advantages
- Ensures safe memory management and exception handling in asynchronous GPU workflows.
- Maintains separation of concerns between engine orchestration and cuDF algorithms.
- Provides a clear path for validating native execution versus CPU simulations.
- Reduces integration risks by focusing on incremental, verifiable POCs.
Usage examples
- “Build a POC for a single-GPU filter operator in our C++ query engine using libcudf.”
- The agent will guide you through mapping the filter semantics to cuDF, implementing the adapter glue, managing the buffer ownership, and verifying the result against your CPU reference implementation.
- “How do I safely handle buffer cleanup in my cuDF adapter when an asynchronous call might throw?”
- The agent will provide a pattern for retaining owners outside of throwing scopes and establishing completion before releasing resources, as detailed in the asynchronous cleanup guidelines.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/nvidia/cudf-query-engine-builder/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip cudf-query-engine-builder.zip -d .agents/skills
Documentation by Joe Sack
cuDF query-engine POC builder
Outcome and scope
Build the first native cuDF proof of concept in the target engine for a query-engine engineer. Produce working target-engine code, a runnable single-GPU program, and a correctness result, not only advice.
The POC may cover one operator, a sequence of operators, or a query selected for the POC. Do not reduce it to one operator by default. If a smaller increment is needed for feasibility or safe implementation, explain why and preserve the path to the requested POC.
For a request limited to an initial adapter correction or source review, deliver that requested work and state which build, native execution and comparison steps remain unperformed. Source review and CPU simulation cannot establish acceptance of the native POC.
Gather inputs and choose sources
Before editing, identify:
the target engine or adapter code and build entry point;
the data source or fixture, its schema, and how the engine reads it today (its own scan layer, or none);
the query, operator sequence, or CPU implementation;
the expected output or CPU/reference result and target-engine semantics; and
the target-engine language, any existing libcudf C++ or cuDF Java integration code, and the cuDF version when identifiable from the code or build environment.
Determine the cuDF entry and exit interfaces from the supplied engine code. Define schema conversion, buffer ownership and release, lifetime, and producer/consumer readiness as part of the POC. Ask the engineer only when the code and tests cannot establish a required choice.
Ask only when a missing input changes the code, correctness, safety, or ability to build and run. Gather only the environment facts needed for this POC.
If the supplied query, CPU behavior, target-engine semantics, and expected result disagree, ask which behavior controls. Do not choose silently.
Use target-engine code and tests, installed public headers, and version-matched official cuDF documentation and source. Treat partner discussions as problem signals, not technical authority.
Build the POC
Establish the named CPU or reference result. Run the reference implementation when it is executable.
Map the requested semantics to public, version-matched cuDF APIs. Handle relevant null, type, order, error, ownership, lifetime, and stream behavior. When native calls can leave GPU work pending, read cleanup after asynchronous work before implementing ownership and exception paths.
Implement the requested operators and minimal engine or adapter glue without changing cuDF mainline. If the required public cuDF API is missing, preserve any buildable engine-side work, document the smallest cuDF gap, and report
BLOCKEDwhen the POC cannot proceed safely.Build a runnable program and execute the workload on one GPU. Record exact commands and working directories.
State the applicable row-order handling, null and type equality, and floating-point tolerance before comparing the output with the named CPU or reference result.
Fix evidenced defects, then rebuild, rerun, and recompare. Continue until the checks pass or a named blocker remains. Report unsafe boundaries, missing prerequisites, unresolved semantics, and larger engine changes.
Before accepting an asynchronous path, inspect every operation that can throw after submission, including native calls, output allocation and result-wrapper construction. C++ destroys objects declared inside a try block before entering its catch handler: a wait in that handler cannot protect those destroyed owners. Keep input, intermediate and output owners outside the throwing scope, and establish completion before releasing them on failure. On success, wait after the last queued operation, including a device-to-host copy, before the caller reads the result. A wait before the copy does not make its destination ready.
Honor the supplied caller's completion promise even when filtering produces no rows. An empty result can still follow queued work or depend on input readiness. For a result handed between workers, retain its buffer, stream and resource owners and establish the producer-to-consumer dependency. Follow the ownership patterns and validation steps in cleanup after asynchronous work.
Exercise a recoverable allocation failure while work is pending, assert that no owner is released early, and check a subsequent valid call when the engine promises recovery. Treat a failed ownership or readiness check as a failed POC even when normal output values match.
If a required codebase, toolchain, compatible cuDF runtime, GPU, or reference result is unavailable and prevents a required step, report BLOCKED, name the missing prerequisite, preserve completed work, and give the exact next command or check. Do not report the blocked step as run or passed.
POC acceptance criteria and handoff
POC passes only when the source change builds, the program exits successfully, its output matches the named CPU or reference result under the stated comparison policy, and a reliable engine signal or runtime observation confirms that the requested result-producing work ran through cuDF.
Report the native-execution evidence separately from numerical agreement. If reliable confirmation is unavailable, mark native execution unresolved and do not report an overall POC pass. Do not infer native execution from GPU availability or elapsed time. A profiler is not required when another reliable engine signal or runtime observation establishes native cuDF execution.
Return:
the patch and runnable program path;
exact build and run commands with their working directories;
the inputs, selected binding and cuDF version, named CPU or reference result, comparison policy, and observed result;
any available cuDF-path observation; and
unresolved questions and larger engine work, with facts separated from inference.
Keep cuDF and engine responsibilities separate
cuDF provides device-wide algorithms for one GPU. The engine owns query-plan and pipeline orchestration, spill, production fallback, multi-GPU coordination, and distributed execution.
I/O sits on the boundary, and the POC must pick one of two paths and say which. cuDF ships data sources that read local files, remote files, and remote objects directly. The engine can either pass cuDF a path or data source and let cuDF perform the read, or keep its own I/O stack and hand cuDF the bytes in host buffers, usually pinned. Choose the path that matches the supplied engine code: if the engine already has a scan or storage layer that produces host buffers, feed those buffers to cuDF; if it does not, use a cuDF data source. Record the choice, the buffer type (pinned or pageable), and who frees each buffer in the handoff. Caching, prefetch, retries, credentials, and format negotiation stay with the engine and are out of scope.
Write the engine or adapter code needed for the requested POC, including who owns and releases each buffer and how consumers wait for producer work to complete. Report larger engine work separately; do not implement it in the POC.
Performance and profiling
Profiling is optional for an initial POC and is never a blocker: if Nsight Systems cannot be installed or run, report that and continue. When it is available, capture one nsys profile of the run and check that the GPU is busy in the timed region. Report idle gaps, host-side stalls, and synchronous copies; do not fix them in the POC unless asked. Preserve the exact run command and workload inputs so the run can be profiled later.
When performance work is requested, profiling belongs in the same tuning loop. Benchmark the same logical work under stated conditions. Obvious code changes may be validated with benchmark results, but broader diagnosis and performance claims require profile evidence. If profiling cannot run, report the blocker rather than inferring bottlenecks from code alone.
A GPU result that remains slower than the CPU result is not automatically a failed POC. Preserve the implementation and report the measurements, profile evidence collected, observed bottlenecks, and remaining engine work.
Evaluation files
The evals/ directory is for maintainers evaluating this skill. It contains incomplete adapter starters and CPU models used to test host ownership and readiness; these are not cuDF implementations or native-execution evidence. Do not run these fixtures as part of an engineer's POC unless the user requested skill evaluation. Read evals/EVAL.md before evaluating them and use its isolated execution procedure.
Files
- ATTRIBUTION.mdAdded by AutoGineer977 B
- BENCHMARK.md10.7 KiB
- LICENSE29.8 KiB
- LICENSE-APACHE11.2 KiB
- LICENSE-CC-BY-4.018.3 KiB
- SKILL.md9.1 KiB
- THIRD_PARTY_NOTICES.md3.2 KiB
- evals/.reference/Dockerfile.cudf-cpp272 B
- evals/EVAL.md7.4 KiB
- evals/config.yml505 B
- evals/evals.json19.7 KiB
- evals/files/async-copy-cleanup/TASK.md3.1 KiB
- evals/files/async-copy-cleanup/adapter.hpp683 B
- evals/files/async-copy-cleanup/run_checks.pyScript4.9 KiB
- evals/files/async-copy-cleanup/sim_backend.hpp6.2 KiB
- evals/files/async-copy-cleanup/test_adapter.cpp3.6 KiB
- evals/files/worker-result-handoff/TASK.md3.3 KiB
- evals/files/worker-result-handoff/adapter.hpp1.4 KiB
- evals/files/worker-result-handoff/run_checks.pyScript4.9 KiB
- evals/files/worker-result-handoff/sim_backend.hpp6.2 KiB
- evals/files/worker-result-handoff/test_adapter.cpp4.1 KiB
- evals/grader.pyScript11.4 KiB
- references/asynchronous-cleanup.md7.7 KiB
- skill-card.md5.1 KiB
- skill.oms.sig9.1 KiB
evals/EVAL.md
Evaluate query-engine adapter behavior
The dataset contains eight tasks. Two require repairing and executing C++ host adapters, four require concrete source-level corrections or decisions, and two check prerequisite handling and out-of-scope routing. Compare the same task with and without the skill. Preserve baseline successes and skill-assisted failures when reporting results.
Tasks and checks
| Task | Required result |
|---|---|
| async-copy-cleanup | Repair and run a host adapter that keeps queued consumers safe through normal completion, allocation failure and a later valid call. |
| worker-result-handoff | Repair and run a host adapter that respects worker readiness, result ownership and the actual returned result. |
| owning-result-context | Correct the result's destruction order and exceptional cleanup while retaining an owning result. |
| engine-buffer-read-path | Correct the adapter's host-buffer lifetime while preserving the engine's existing scan interface. |
| conflicting-query-reference | Compute the conflicting outputs and ask which semantics control before choosing the native predicate. |
| native-result-acceptance | Replace a CPU answer plus unrelated CUDA marker with a result-producing native call chain and define evidence needed for acceptance. |
| missing-engine-input | Identify the inputs needed to implement and test the requested native POC without fabricating execution. |
| dataframe-negative | Answer the CPU-only dataframe request without activating this native query-engine skill. |
Run the C++ fixtures
run_checks.py compiles and executes submitted C++ code. Run it in a disposable Linux evaluation environment whose runner restricts filesystem access, network access and resources. Do not mount credentials, the Docker socket or unrelated host directories into the compiler/test environment. Provider credentials needed by an agent must remain outside the environment that executes the submitted code. The checker and dependency Dockerfile do not establish that isolation. Verify the runner configuration before executing code from an untrusted source.
The checker selects the image-supplied compiler at /usr/bin/g++ or /usr/bin/clang++, supplies a small explicit child environment instead of inheriting provider credentials or compiler overrides, and builds in a private temporary directory. It limits compilation to 60 seconds and execution to 20 seconds, constrains CPU time, address space and output files, bounds captured output, and terminates the command process group on completion or timeout. These controls reduce accidental exposure and resource exhaustion. They cannot prevent submitted native code from reading accessible files, opening network connections, or escaping process-group cleanup; the execution runner must enforce those boundaries.
The two fixtures are staged into /workspace/input/async-copy-cleanup and /workspace/input/worker-result-handoff. Each TASK.md defines the editable implementation and protected engine contract. From the relevant directory run:
# Run CPU ownership checks inside the isolated evaluation environment.
python3 run_checks.pyThe command compiles the candidate with a C++20 compiler and runs the supplied checks. The checker requires Linux and uses only Python's standard library. File selections are explicit in evals.json so unrelated fixtures are not staged into a task.
NVCARPS CI uses signed sandbox images selected by harbor.sandbox.templates in evals/config.yml. The images provide Python and g++ for the CPU tests. The reference recipe is retained at evals/.reference/Dockerfile.cudf-cpp, outside the automatic image-build path. Maintainers changing the required packages must update the recipe and arrange corresponding signed images and template updates before running CI. Other runners must provide equivalent dependencies and isolation.
These fixtures simulate asynchronous backend work deterministically on the CPU. A passing simulator test establishes only the checked host-side ordering and lifetime behavior. It does not establish CUDA execution, actual libcudf correctness, native allocator behavior or query speed. Native validation must separately build and run a real cuDF adapter, compare the returned values with an independent CPU/reference result, and establish that the result came from the required cuDF operations.
The inline source tasks have no attached native build environment. Their expected result is a concrete source correction or a specific unresolved decision. They must not be scored as an executed native POC.
Compare the two conditions
Keep the task prompt, task files, model, tools, environment and budget the same. Only skill availability changes. Use fresh isolated workspaces, and do not expose expected_output or assertions to the agent as task inputs. Skill discovery is assessed separately from whether the answer or implementation meets the task's requirements.
Record exact commands and observed outputs for executable tasks. For independent grading, restore protected caller, engine and checker files before rerunning the submitted implementation. Validate the checker with correct implementations and deliberately defective controls; reject defects for the intended violated requirement, not a missing compiler or unrelated build failure. Accept valid synchronous completion, preallocation and safe asynchronous ownership where the interface permits them.
Report paired task outcomes, model/harness versions, elapsed time and token usage when available. The signing pipeline controls its agent/model versions; separately run native trials must identify their own harness and model. Native lab results and CPU simulator results are different measurements. A larger dataset does not guarantee measurable lift, and a single trial per task does not establish a stable improvement estimate.
Do not infer a native pass from a GPU backend label, matching CPU values alone, device availability or unrelated GPU activity. Do not infer a query speedup from correctness, and do not fail a correct first POC solely because it is slower than its CPU reference. Missing profiling may be recorded separately when another reliable observation proves the native result-producing path.
Independent compiled-fixture grading
The configuration uses SkillEvaluator's default_plus_custom mode. The standard graders retain their scores and overall verdict. After those graders run, evals/grader.py independently compiles and executes the two C++ adapter repairs and adds compiled_fixture_correctness as a separate result. It does not replace the standard verdict or infer native execution. Source-review and routing tasks have no compiled-fixture score.
The custom grader verifies the hashes of the protected fixture files, snapshots the submitted adapter, and reruns the fixed checks in a fresh temporary directory. A changed test or a claimed pass in the agent's answer is insufficient. The expected six check names, individual results and process exit must agree. If a maintainer intentionally changes a protected fixture, update its hash in the grader after validating the revised tests. The runner isolation requirements above also apply to this independent execution.
The custom grader targets Linux containers and writes only direct JSON files under /logs/verifier, which the standard verifier must create first. Other HARBOR_REWARD_JSON directories, including local-mode log directories, are unsupported. Output replacement does not follow symlinks or write through existing hard links.
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.
Needs: Needs Python
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
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
- Joe Sack
- Publisher
- NVIDIA (Official)
- Distributed by
- NVIDIA
- Source
- NVIDIA/skills · skills/cudf-query-engine-builder · commit fce3cca
- Licence
- Apache License 2.0 (redistribution allowed)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Joe Sack or NVIDIA.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download cudf-query-engine-builder.zip