Conversation
Wire up sonic-net/sonic-pins' P4 fuzzer as a cc_test that spawns a FourwardServer, pushes a pipeline, and runs 10,000 iterations of random WriteRequests with three layers of validation: 1. Spec oracle: validates response status codes against the P4RT spec. 2. Read-back: every 500 iterations, reads all entries and verifies they match the SwitchState mirror (~1,792 entries across 3 tables). 3. Crash detection: any unhandled exception or server crash fails. Results: 10,000 iterations, 413,032 updates, 0 oracle failures, 21 read-back checks passed. The fixture program (fuzzer_table.p4) has three tables exercising different match kinds: exact, ternary, and LPM. All tables and action refs have @proto_id annotations required by PDPI. Also fixes 4ward's validation ordering to match the spec: - Unknown table IDs now return INVALID_ARGUMENT (was NOT_FOUND). - Match field validation runs before existence checking on DELETEs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
smolkaj
added a commit
that referenced
this pull request
May 28, 2026
## Summary - update TESTING_STRATEGY to describe the merged BMv2 P4Runtime diff suite - document PR #665 as a proven but intentionally unmerged fuzzer validation artifact - reframe the remaining P4Runtime validation risk as scoped breadth, not absence of independent oracles ## Testing - `git diff --check`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires up sonic-net/sonic-pins' P4 fuzzer as a
cc_testthat spawns a FourwardServer, pushes a pipeline, and runs 10,000 iterations of random WriteRequests validated by the P4Runtime spec oracle.Results: 10,000 iterations, 406,842 updates, 0 oracle failures.
Also fixes two validation ordering issues the fuzzer surfaced:
INVALID_ARGUMENT(wasNOT_FOUND). A table ID that doesn't exist in the P4Info is a malformed request, not a "not found" condition.INVALID_ARGUMENTrather than falling through toNOT_FOUND.What's here
e2e_tests/p4_fuzzer/fuzzer_table.p4@proto_idannotations (required by PDPI)e2e_tests/p4_fuzzer/p4_fuzzer_test.cce2e_tests/p4_fuzzer/BUILD.bazelsonic_pinsfuzzer library depsMODULE.bazelsonic_pins+gutilas dev dependenciesgrpc/WriteValidator.ktINVALID_ARGUMENTfor unknown table IDsgrpc/*.ktgolden/test updatesKnown limitations
basic_table-shaped programs; action selectors would need a second fixtureTest plan
bazel test //e2e_tests/p4_fuzzer:p4_fuzzer_test— 10k iterations, 0 failures, ~5.5 minbazel test //grpc:WriteValidatorTest //grpc:P4RuntimeConformanceTest //grpc:GoldenErrorTest //grpc:P4RuntimeWriteErrorTest— all pass🤖 Generated with Claude Code