agentleFS
NVIDIAKnown publisherNVIDIA/TensorRT-Edge-LLM/skills/edge-llm-cpp-test/SKILL.md

edge-llm-cpp-test

Skill631 starsChanged 3 days agoApache-2.0View on GitHub

Write or change a C++ test under unittests/. Covers the BDD comment contract, mutation testing, and the substitute engines that drive LLMInferenceRuntime without a serialized engine. Apply whenever adding, migrating, or repairing a GTest case in this repository.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the full group before reporting, not just your filter: a substitute or fixture shared with other suites can break them.

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. --><!-- SPDX-License-Identifier: Apache-2.0 -->

EdgeLLM C++ Tests

C++ tests live in unittests/. Build them with -DBUILD_UNIT_TESTS=ON; they need a GPU but no model files.

Non-negotiable

  1. Every test case carries a Given/When/Then comment. That comment is the specification. The test body is one rendering of it.
  2. Every new assertion is mutation-tested, and the mutation is confirmed to have changed the observed value before any conclusion is drawn from it.
  3. Writing or changing a Given/When/Then comment is a human decision. Propose it; do not decide it.

The reasoning behind all three, and the failure modes they exist to prevent, is in references/test-discipline.md. Read it before writing a test.

Workflow

  1. State the behavior you intend to protect as Given/When/Then, in plain language, before writing any assertion. If you cannot state it without describing the implementation, you do not yet know what the test is for.
  2. Render assertions from that statement. Prefer asserting the observable consequence over the bookkeeping that reports it — see "Assert the work, not the accounting" in the discipline reference.
  3. For runtime tests, assemble LLMInferenceRuntime around a substitute engine rather than a serialized engine. Which substitute, and how to observe through it, is in references/runtime-test-infra.md. For EAGLE or MTP draft substitutes, use FakeEngineExecutor::actAsDraftEngine() or makeLogProbDraftEngine(): draft logits must be log-probabilities, unlike a base engine's raw logits.
  4. Build and run:
    cmake --build build --target unitTestRuntime -j$(nproc)
    export LD_LIBRARY_PATH=$TRT_PACKAGE_DIR/lib:$LD_LIBRARY_PATH
    ./build/unittests/unitTestRuntime --gtest_filter="YourSuite.*"
  5. Mutation-test each new assertion, then revert the mutation and re-run the whole target to confirm the tree is clean.
  6. Run the full group before reporting, not just your filter: a substitute or fixture shared with other suites can break them.

When a test fails

Only two responses are legitimate: fix the production code so it satisfies the Given/When/Then, or establish that the Given/When/Then itself is wrong — which needs a human. Re-rendering the test so it passes while the comment stays put is not a third option.

References

FileRead when
references/test-discipline.mdBefore writing or changing any test
references/runtime-test-infra.mdWriting a test that drives LLMInferenceRuntime

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.