Skip to content

Conversation

@Alan-Jowett
Copy link
Contributor

@Alan-Jowett Alan-Jowett commented Jan 24, 2026

Summary

This PR adds RFC9669 conformance tests and updates the bpf_conformance submodule to include fixes for several test files.

Changes

Testing

  • All 313 conformance tests pass
  • Coverage increased (+0.1% to 86.79%)

Summary by CodeRabbit

  • Tests

    • Added infrastructure to mark and track known failing conformance tests with expected failure reasons.
    • Expanded conformance test suite with byte-order and RFC 9669 protocol tests.
  • Chores

    • Updated external conformance test dependencies.

✏️ Tip: You can customize this high-level summary in your review settings.

- Update bpf_conformance submodule to include fixes for movsx, smod, ja32, and div/mod-by-zero tests
- Add RFC9669 LLM conformance tests
- Add missing bswap conformance tests
- Document TEST_CONFORMANCE_FAIL macro usage

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 24, 2026

Walkthrough

Update submodule reference for external/bpf_conformance and introduce TEST_CONFORMANCE_FAIL macro along with expanded conformance test suite covering additional byte-swap and RFC 9669 generated test cases.

Changes

Cohort / File(s) Summary
Submodule Update
external/bpf_conformance
Updated commit reference from 3203c1fa to e208f525
Test Infrastructure & Cases
src/test/test_conformance.cpp
Added TEST_CONFORMANCE_FAIL macro for known-failing tests; refined test_conformance logic to handle expected_reason matching (distinguishing ERROR vs. other results); expanded test suite with be16/be32/be64, bswap, and RFC 9669 generated test cases

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the two main changes: adding RFC9669 conformance tests and updating the bpf_conformance submodule, matching the PR objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/test/test_conformance.cpp`:
- Around line 31-35: The test currently hard-codes the plugin error code "1"
when checking the reason for TEST_RESULT_ERROR; update the assertion so it does
not depend on a magic "1". In the block that checks
bpf_conformance_test_result_t::TEST_RESULT_ERROR (using expected_result, reason,
expected_reason), either parameterize the expected exit code (e.g.,
expected_code) and build the expected message dynamically, or assert that reason
starts_with("Plugin returned error code ") and ends_with(expected_reason) /
contains the expected_reason suffix rather than matching the full string; adjust
the REQUIRE accordingly so the test accepts any numeric exit code while still
verifying the expected_reason.

Comment on lines +31 to +35
if (expected_result == bpf_conformance_test_result_t::TEST_RESULT_ERROR) {
REQUIRE(reason == "Plugin returned error code 1 and output " + expected_reason);
} else {
REQUIRE(reason == expected_reason);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Avoid hard‑coding error code in error‑reason comparison.
If the conformance checker ever returns a non‑1 exit code (platform change or future update), ERROR tests will fail even when the reason matches. Match prefix/suffix instead of the exact code or parameterize the expected code.

Proposed change
-            if (expected_result == bpf_conformance_test_result_t::TEST_RESULT_ERROR) {
-                REQUIRE(reason == "Plugin returned error code 1 and output " + expected_reason);
-            } else {
-                REQUIRE(reason == expected_reason);
-            }
+            if (expected_result == bpf_conformance_test_result_t::TEST_RESULT_ERROR) {
+                const std::string prefix = "Plugin returned error code ";
+                const std::string suffix = " and output " + expected_reason;
+                REQUIRE(reason.rfind(prefix, 0) == 0);
+                REQUIRE(reason.size() >= prefix.size() + suffix.size());
+                REQUIRE(reason.compare(reason.size() - suffix.size(), suffix.size(), suffix) == 0);
+            } else {
+                REQUIRE(reason == expected_reason);
+            }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (expected_result == bpf_conformance_test_result_t::TEST_RESULT_ERROR) {
REQUIRE(reason == "Plugin returned error code 1 and output " + expected_reason);
} else {
REQUIRE(reason == expected_reason);
}
if (expected_result == bpf_conformance_test_result_t::TEST_RESULT_ERROR) {
const std::string prefix = "Plugin returned error code ";
const std::string suffix = " and output " + expected_reason;
REQUIRE(reason.rfind(prefix, 0) == 0);
REQUIRE(reason.size() >= prefix.size() + suffix.size());
REQUIRE(reason.compare(reason.size() - suffix.size(), suffix.size(), suffix) == 0);
} else {
REQUIRE(reason == expected_reason);
}
🤖 Prompt for AI Agents
In `@src/test/test_conformance.cpp` around lines 31 - 35, The test currently
hard-codes the plugin error code "1" when checking the reason for
TEST_RESULT_ERROR; update the assertion so it does not depend on a magic "1". In
the block that checks bpf_conformance_test_result_t::TEST_RESULT_ERROR (using
expected_result, reason, expected_reason), either parameterize the expected exit
code (e.g., expected_code) and build the expected message dynamically, or assert
that reason starts_with("Plugin returned error code ") and
ends_with(expected_reason) / contains the expected_reason suffix rather than
matching the full string; adjust the REQUIRE accordingly so the test accepts any
numeric exit code while still verifying the expected_reason.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 21309583909

Details

  • 93 of 94 (98.94%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 86.792%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/test/test_conformance.cpp 93 94 98.94%
Totals Coverage Status
Change from base Build 21259620701: 0.1%
Covered Lines: 9127
Relevant Lines: 10516

💛 - Coveralls

@elazarg elazarg merged commit e790732 into vbpf:main Jan 24, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants