forked from xdp2-dev/xdp2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
1882 lines (1695 loc) · 90.7 KB
/
Copy pathflake.nix
File metadata and controls
1882 lines (1695 loc) · 90.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# flake.nix for XDP2
#
# This flake provides:
# - Development environment: nix develop
# - Package build: nix build
#
# To enter the development environment:
# nix develop
#
# To build the package:
# nix build .#xdp2
#
# If flakes are not enabled, use the following command:
# nix --extra-experimental-features 'nix-command flakes' develop .
# nix --extra-experimental-features 'nix-command flakes' build .
#
# To enable flakes, you may need to enable them in your system configuration:
# test -d /etc/nix || sudo mkdir /etc/nix
# echo 'experimental-features = nix-command flakes' | sudo tee -a /etc/nix/nix.conf
#
# Debugging:
# XDP2_NIX_DEBUG=7 nix develop --verbose --print-build-logs
#
# Alternative commands:
# nix --extra-experimental-features 'nix-command flakes' --option eval-cache false develop
# nix --extra-experimental-features 'nix-command flakes' develop --no-write-lock-file
# nix --extra-experimental-features 'nix-command flakes' print-dev-env --json
#
# Recommended term:
# export TERM=xterm-256color
#
# To run the sample test:
# nix build .#tests.simple-parser
# ./result/bin/xdp2-test-simple-parser
#
{
description = "XDP2 packet processing framework";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
# MicroVM for eBPF testing (Phase 1)
# See: documentation/nix/microvm-implementation-phase1.md
microvm = {
url = "github:astro/microvm.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, microvm }:
flake-utils.lib.eachDefaultSystem (system:
let
# Overlay applies a User-Agent fix to Nixpkgs' rustPlatform
# .fetchCargoVendor so crates.io stops returning HTTP 403
# under its API data-access policy. See
# nix/overlays/fetch-cargo-vendor-ua-fix.nix for the diagnosis,
# the empirical UA → status code map, and the removal criterion.
pkgs = import nixpkgs {
inherit system;
overlays = [
(import ./nix/overlays/fetch-cargo-vendor-ua-fix.nix)
];
};
lib = nixpkgs.lib;
# Import LLVM configuration module
# Use default LLVM version from nixpkgs (no pinning required)
llvmConfig = import ./nix/llvm.nix { inherit pkgs lib; };
llvmPackages = llvmConfig.llvmPackages;
# Import packages module
packagesModule = import ./nix/packages.nix { inherit pkgs llvmPackages; };
# Compiler configuration
compilerConfig = {
cc = pkgs.gcc;
cxx = pkgs.gcc;
ccBin = "gcc";
cxxBin = "g++";
};
# Import environment variables module
envVars = import ./nix/env-vars.nix {
inherit pkgs llvmConfig compilerConfig;
packages = packagesModule;
configAgeWarningDays = 14;
};
# Import package derivation (production build, assertions disabled)
xdp2 = import ./nix/derivation.nix {
inherit pkgs lib llvmConfig;
inherit (packagesModule) nativeBuildInputs buildInputs;
enableAsserts = false;
};
# Debug build with assertions enabled
xdp2-debug = import ./nix/derivation.nix {
inherit pkgs lib llvmConfig;
inherit (packagesModule) nativeBuildInputs buildInputs;
enableAsserts = true;
};
# XDP sample programs (BPF bytecode)
# Uses xdp2-debug for xdp2-compiler and headers
xdp-samples = import ./nix/xdp-samples.nix {
inherit pkgs;
xdp2 = xdp2-debug;
};
# Proto-audit: multi-source protocol definition audit tool
protoAuditSources = import ./nix/proto-audit-sources.nix { inherit pkgs; };
proto-audit-bin = import ./nix/proto-audit.nix {
inherit pkgs protoAuditSources;
};
# Wrapped proto-audit with all external sources pre-configured
proto-audit = pkgs.writeShellApplication {
name = "proto-audit";
runtimeInputs = [
proto-audit-bin
protoAuditSources.scapyPython
protoAuditSources.tshark
];
text = ''
export PROTO_AUDIT_PROTO_DEFS_DIR="''${PROTO_AUDIT_PROTO_DEFS_DIR:-${./src/include/xdp2/proto_defs}}"
export PROTO_AUDIT_KERNEL_SRC="''${PROTO_AUDIT_KERNEL_SRC:-${protoAuditSources.kernelSrc}}"
export PROTO_AUDIT_DPDK_SRC="''${PROTO_AUDIT_DPDK_SRC:-${protoAuditSources.dpdkSrc}}"
export PROTO_AUDIT_NDPI_SRC="''${PROTO_AUDIT_NDPI_SRC:-${protoAuditSources.ndpiSrc}}"
export PROTO_AUDIT_PPPD_SRC="''${PROTO_AUDIT_PPPD_SRC:-${protoAuditSources.pppdSrc}}"
export PROTO_AUDIT_RDMA_SRC="''${PROTO_AUDIT_RDMA_SRC:-${protoAuditSources.rdmaSrc}/include}"
export PROTO_AUDIT_XDP2_HEADERS_DIR="''${PROTO_AUDIT_XDP2_HEADERS_DIR:-${./src/include}}"
export PROTO_AUDIT_SCAPY_HELPER="''${PROTO_AUDIT_SCAPY_HELPER:-${proto-audit-bin}/share/proto-audit/scapy_dump.py}"
export PROTO_AUDIT_PYTHON="''${PROTO_AUDIT_PYTHON:-${protoAuditSources.scapyPython}/bin/python3}"
export PROTO_AUDIT_TSHARK_BIN="''${PROTO_AUDIT_TSHARK_BIN:-${protoAuditSources.tshark}/bin/tshark}"
export PROTO_AUDIT_PCAP="''${PROTO_AUDIT_PCAP:-${test-pcap}/combo.pcap}"
export PROTO_AUDIT_ETHERPARSE_SRC="''${PROTO_AUDIT_ETHERPARSE_SRC:-${protoAuditSources.etherparseSrc}}"
export PROTO_AUDIT_LIBPCAP_SRC="''${PROTO_AUDIT_LIBPCAP_SRC:-${protoAuditSources.libpcapSrc}}"
export PROTO_AUDIT_TSHARK_REGISTRY="''${PROTO_AUDIT_TSHARK_REGISTRY:-${protoAuditSources.tsharkRegistry}/tshark_registry.json}"
export PROTO_AUDIT_SCAPY_REGISTRY="''${PROTO_AUDIT_SCAPY_REGISTRY:-${protoAuditSources.scapyRegistry}/scapy_registry.json}"
export PROTO_AUDIT_KERNEL_REGISTRY="''${PROTO_AUDIT_KERNEL_REGISTRY:-${protoAuditSources.kernelRegistry}/kernel_registry.json}"
export PROTO_AUDIT_PCAP_TEMPLATES="''${PROTO_AUDIT_PCAP_TEMPLATES:-${protoAuditSources.pcapTemplates}}"
export PROTO_AUDIT_PCAP_CORPUS="''${PROTO_AUDIT_PCAP_CORPUS:-${protoAuditSources.pcapCorpus}/pdml}"
export PROTO_AUDIT_IANA_DIR="''${PROTO_AUDIT_IANA_DIR:-${protoAuditSources.ianaRegistries}}"
export PROTO_AUDIT_KAITAI_DIR="''${PROTO_AUDIT_KAITAI_DIR:-${protoAuditSources.kaitaiFormats}}"
export PROTO_AUDIT_SURICATA_DIR="''${PROTO_AUDIT_SURICATA_DIR:-${protoAuditSources.suricataSrc}}"
export PROTO_AUDIT_OMI_CSTRUCTS_DIR="''${PROTO_AUDIT_OMI_CSTRUCTS_DIR:-${protoAuditSources.omiCStructs}}"
export PROTO_AUDIT_OMI_LUA_DIR="''${PROTO_AUDIT_OMI_LUA_DIR:-${protoAuditSources.omiWiresharkLua}}"
export PROTO_AUDIT_OMI_PCAPS_DIR="''${PROTO_AUDIT_OMI_PCAPS_DIR:-${protoAuditSources.omiDataPackets}}"
export PROTO_AUDIT_XTCP2_SRC="''${PROTO_AUDIT_XTCP2_SRC:-${protoAuditSources.xtcp2Src}}"
export PROTO_AUDIT_XTCP2_PCAPS="''${PROTO_AUDIT_XTCP2_PCAPS:-${protoAuditSources.xtcp2Src}/pkg/xtcpnl/testdata}"
exec proto-audit "$@"
'';
};
# XDP2 Rust reimplementation — build, test, and analysis targets
# See nix/xdp2-rs.nix for all available targets
xdp2Rs = import ./nix/xdp2-rs.nix {
inherit pkgs;
xdp2 = xdp2-debug;
};
# xdp2-flow-ebpf — production-distribution bundle:
# fast_flow.bpf.o + xdp2-flow-loader + man page + systemd unit.
# See nix/xdp2-flow-ebpf.nix.
xdp2FlowEbpf = import ./nix/xdp2-flow-ebpf.nix {
inherit pkgs llvmPackages;
xdp2 = xdp2-debug;
};
# xdp2-flow-ebpf OCI container image. D10 deliverable — packages
# xdp2FlowEbpf as a layered image for Kubernetes DaemonSet
# deployment. See nix/xdp2-flow-ebpf-image.nix.
xdp2FlowEbpfImage = import ./nix/xdp2-flow-ebpf-image.nix {
inherit pkgs;
xdp2-flow-ebpf = xdp2FlowEbpf;
};
# 6-way flow dissector performance matrix — shellcheck-validated
# wrapper packaged via writeShellApplication, hermetic artifact
# paths. See nix/flow-dissector-matrix.nix.
flowDissectorMatrix = import ./nix/flow-dissector-matrix.nix {
inherit pkgs llvmPackages;
xdp2 = xdp2-debug;
};
# Per-encapsulation xdp2-flow-ebpf menu benchmark + Gold-parity
# harness (10 loadable objects + in-tree oracle). See
# nix/flow-menu-bench.nix and
# kernel-patches/series6-common-case/ebpf-menu.md.
flowMenuBench = import ./nix/flow-menu-bench.nix {
inherit pkgs llvmPackages;
xdp2 = xdp2-debug;
};
# Unified xdp2-rs vs C-matrix harness — runs the 6-way C matrix
# AND xdp2-bench (graph/mono/compiled/template) against the same
# filtered pcap. See nix/xdp2-rs-matrix.nix and
# samples/flow_dissector/docs/benchmarks.md "Unified" section.
flowDissectorMatrixUnified = import ./nix/xdp2-rs-matrix.nix {
inherit pkgs xdp2Rs flowDissectorMatrix;
workloadPcapHttpsWeb = perfAnalysis.workload-pcap-https-web;
# Phase 17.E: when XDP2_MATRIX_PARITY=1, the runner invokes
# this binary on the same pcap and stamps parity_ok +
# parity_disagreements into every per-cell JSON.
parityCheck = flowDissectorParityCheck;
};
# Aggregator over Phase-5 per-cell JSONs. Walks a result tree
# and emits summary.md / summary.csv / regressions.md. Stdlib-
# only Python. See nix/scripts/aggregate-results.py.
flowDissectorMatrixAggregate =
import ./nix/aggregate-results.nix { inherit pkgs; };
# Phase L4: live-wire AF_XDP campaign aggregator. Walks
# <results>/<date>/<testbed>/afxdp/<mode>/<size>b/*.json and
# emits summary-afxdp.{md,csv}. Separate from the matrix
# aggregator because the two campaigns measure different
# things (per-pcap PCAP replay vs. per-cell live-wire).
flowDissectorAfxdpAggregate =
import ./nix/aggregate-afxdp.nix { inherit pkgs; };
# Phase A1 (assembly-level analysis): bundles dump-asm.sh with
# binutils + llvm so `objdump` and `llvm-objdump` are on PATH.
# Drives per-impl asm extraction across 14 implementations
# (8 Rust + 3 C + 3 BPF).
flowDissectorDumpAsm =
import ./nix/dump-asm.nix {
inherit pkgs xdp2Rs flowDissectorMatrix;
};
# Phase 7: composed runner (orchestrator + aggregator).
# nix run .#flow-dissector-matrix-run -- --testbed PATH
flowDissectorMatrixRun =
import ./nix/flow-dissector-matrix-run.nix {
inherit pkgs;
runOnHost = run-on-host;
aggregate = flowDissectorMatrixAggregate;
};
# 2026-05-19 post-R3.4: multi-workload sweep harness that
# pre-scps cached workload-pcap-* derivations to each host
# in the testbed and loops calling matrix-run for each.
# Used to reproduce perf-results/2026-05-19-* runs.
flowDissectorMatrixSweep =
import ./nix/flow-dissector-matrix-sweep.nix {
inherit pkgs lib;
matrixRun = flowDissectorMatrixRun;
matrixAggregate = flowDissectorMatrixAggregate;
workloadPcaps = {
"https-web" = perfAnalysis.workload-pcap-https-web;
"nfs-server" = perfAnalysis.workload-pcap-nfs-server;
"k8s-microservices" = perfAnalysis.workload-pcap-k8s-microservices;
"vlan-tcp-mix" = perfAnalysis.workload-pcap-vlan-tcp-mix;
"pppoe-isp" = perfAnalysis.workload-pcap-pppoe-isp;
"vxlan-k8s-pure" = perfAnalysis.workload-pcap-vxlan-k8s-pure;
};
};
# 2026-05-19 post-R3.4: icache / branch-miss / cycle counter
# sweep. Wraps `benchmark -p -<mode>` in `perf stat` for each
# (host, workload, parser-mode) cell. Output is a markdown
# table comparing parser modes on cache behavior — used to
# test code-size hypotheses (see
# perf-results/2026-05-19-O3-march-native-flto/comparison.md
# for the remaining c-xdp2-mono vs rust-mono gap analysis).
flowDissectorIcacheSweep =
import ./nix/flow-dissector-icache-sweep.nix {
inherit pkgs lib;
workloadPcaps = {
"https-web" = perfAnalysis.workload-pcap-https-web;
"nfs-server" = perfAnalysis.workload-pcap-nfs-server;
"k8s-microservices" = perfAnalysis.workload-pcap-k8s-microservices;
"vlan-tcp-mix" = perfAnalysis.workload-pcap-vlan-tcp-mix;
"pppoe-isp" = perfAnalysis.workload-pcap-pppoe-isp;
"vxlan-k8s-pure" = perfAnalysis.workload-pcap-vxlan-k8s-pure;
};
};
# Phase 7: smoke regression gate. Wraps -run --smoke with
# the aggregator's --baseline / --fail-on-regression mode.
flowDissectorMatrixCheck =
import ./nix/flow-dissector-matrix-check.nix {
inherit pkgs;
runOnHost = run-on-host;
aggregate = flowDissectorMatrixAggregate;
matrixRun = flowDissectorMatrixRun;
};
# Phase 8: AF_XDP live offered-load sweep. Composes
# flow-dissector-ntuple-template-bench across [1,2,5,10] Mpps
# and emits per-load JSON.
flowDissectorAfxdpLive =
import ./nix/flow-dissector-afxdp-live.nix {
inherit pkgs;
ntupleTemplateBench = flowDissectorNtupleTemplateBench;
};
# Phase 17: cross-parser parity comparator (Python). Wraps
# nix/scripts/parity-compare.py with a vendored default --scope
# path so the comparator is invocable hermetically.
parityCompare = import ./nix/parity-compare.nix { inherit pkgs; };
# Phase 17: parity gate driver. Runs each of 14 flow-dissector
# parsers on a pcap with the dump-meta protocol added in 17.B,
# captures per-packet ParityRecord JSONL, and feeds the tree
# into the comparator. Exits non-zero on any unexpected
# cross-parser disagreement.
flowDissectorParityCheck =
import ./nix/flow-dissector-parity-check.nix {
inherit pkgs xdp2Rs flowDissectorMatrix parityCompare;
};
# Phase 2 of the protocol-coverage-matrix plan: runs the
# parity-check driver against every per-protocol pcap
# template under samples/proto_audit/pcap_templates/ and
# aggregates the resulting JSONLs into a (protocol × parser)
# matrix. Report-only by default; --require-expectations
# turns it into a gate. See nix/protocol-coverage-matrix.nix.
protocolCoverageMatrix =
import ./nix/protocol-coverage-matrix.nix {
inherit pkgs lib;
parityCheck = flowDissectorParityCheck;
};
# Peer-side kernel pktgen driver, shellchecked + packaged as a
# standalone writeShellApplication. The orchestrator below scp's
# this to the peer at runtime.
flowDissectorPktgenNtupleTemplate =
import ./nix/pktgen-ntuple-template.nix { inherit pkgs; };
# Peer-side DPDK-pktgen driver, Deliverable-2 alternative for the
# hp2 kernel pktgen ~1.37 Mpps TX cap. Same start/stop/status
# CLI as the kernel variant so run_ntuple_template_bench.sh
# orchestrates either by swapping PKTGEN_SCRIPT. See
# docs/physical-testbed.md §13 Future work.
flowDissectorPktgenDpdkNtupleTemplate =
import ./nix/pktgen-dpdk-ntuple-template.nix { inherit pkgs; };
# Live X710 ntuple + AF_XDP + template bench orchestrator —
# drives a two-host run (target + peer) over SSH. Requires the
# target to have xdp2.testbed.flowDirectorRules and
# realServicesBench = true via the physical-testbed module.
# See docs/ntuple-template-bench.md.
flowDissectorNtupleTemplateBench = import ./nix/ntuple-template-bench.nix {
inherit pkgs;
# Bundled af_xdp_parser.xdp.o — wrapper exports XDP_OBJ so the
# orchestrator script can scp it onto the target before loading.
xdpSamples = xdp-samples;
# Peer-side pktgen driver — wrapper exports PKTGEN_SCRIPT so
# the orchestrator scp's a known-good store path, not a
# `dirname "$0"` guess.
pktgenDriver = flowDissectorPktgenNtupleTemplate;
};
# DPDK-driven variant of the above. The target side is
# identical (XDP attach + FD rules + AF_XDP); only PKTGEN_SCRIPT
# points at the DPDK pktgen driver. Requires the PEER host to
# have xdp2.testbed.dpdkBenchHost = true so vfio-pci is loaded
# and 1024×2MB hugepages are reserved at boot.
flowDissectorDpdkNtupleTemplateBench = import ./nix/dpdk-ntuple-template-bench.nix {
inherit pkgs;
xdpSamples = xdp-samples;
pktgenDpdkDriver = flowDissectorPktgenDpdkNtupleTemplate;
};
# Factory for one-shot testbed experiment wrappers. Each
# Deliverable-1/2/3 experiment (see docs/physical-testbed.md
# §9 Category H / §13 Future work) is a writeShellApplication
# built from this helper, so `nix flake show` surfaces every
# tunable knob by name, and each result lands in a stable
# perf-results/${target}/exp-${name}-${ts}/ directory with a
# summary.json for downstream tooling.
mkBenchExperiment = import ./nix/lib/mkBenchExperiment.nix {
inherit pkgs;
ntupleTemplateBench = flowDissectorNtupleTemplateBench;
};
# Compiler verification framework — compare C++ vs Rust xdp2-compiler
# See nix/compiler-verify.nix for all available targets
compilerVerify = import ./nix/compiler-verify.nix {
inherit pkgs xdp2Rs;
xdp2 = xdp2-debug;
};
# Parser performance benchmark — C vs Rust parse engine comparison
# Usage: nix build .#parser-benchmark && ./result/bin/xdp2-parser-benchmark [iterations] [npkts]
parserBenchmark = import ./nix/parser-benchmark.nix {
inherit pkgs xdp2Rs;
xdp2 = xdp2-debug;
};
# Rust parser performance benchmarks (reproducible, all modes)
# Usage: nix run .#perf-bench — standard benchmark
# nix run .#perf-sweep — full sweep (all threads, JSON)
perfBench = import ./nix/perf-bench.nix {
inherit pkgs xdp2Rs;
};
# Deep performance analysis (reproducible across machines)
# Usage: nix run .#perf-sweep-tcp — baseline sweep
# nix run .#perf-sweep-mixed — real protocol diversity
# nix run .#perf-sweep-combo — full-scale 500K packets
# nix run .#perf-flamegraph — flamegraphs for 3 modes
# nix run .#perf-annotate — assembly-level hot functions
# nix run .#perf-analysis-all — run everything
perfAnalysis = import ./nix/perf-analysis.nix {
inherit pkgs xdp2Rs test-pcap;
};
# Protocol coverage verification
# Usage: nix run .#coverage-check — acceptance rate on combo.pcap
# nix run .#coverage-check-all — acceptance rate on all PCAPs
coverageCheck = import ./nix/coverage-check.nix {
inherit pkgs xdp2Rs test-pcap;
};
# Physical-testbed automation wrapper
# Drives nix targets on hp2/hp5 (or any SSH-reachable host) via
# rsync + ssh + nix build/run. See docs/physical-testbed.md §9.
# Usage: nix run .#run-on-host -- HOST [HOST...] -- TARGET [TARGET...]
run-on-host = import ./nix/physical-testbed-runner.nix {
inherit pkgs;
};
# Series 3 flow_dissector fast-path A/B harnesses. See
# kernel-patches/series3-flowdis-fastpath/v1/STATUS.md for the
# patch shape and perf-results/2026-06-09-series3-arm-microbench
# for the canonical x86+ARM dataset shape these reproduce.
#
# nix run .#series3-traffic-ab -- GEN DUT DUT_V4 DUT_V6 [N]
# Cross-host iperf3 A/B (TCP+UDP, v4+v6, interleaved
# sysctl, sidecar telemetry).
#
# nix run .#series3-microbench -- HOST PATCHED BASELINE [N]
# Userspace libflowdis A/B. Requires two xdp2 closures
# pre-built and nix-copy-closure'd to HOST.
series3-traffic-ab = import ./nix/series3-traffic-ab.nix {
inherit pkgs;
};
series3-microbench = import ./nix/series3-microbench.nix {
inherit pkgs;
};
series3-pcap-microbench = import ./nix/series3-pcap-microbench.nix {
inherit pkgs;
};
# 10-cell × 1-hour real-traffic soak across the Pi pair fleet.
# Static matrix (pi5-1↔pi5-2, pi5-2↔pi4-1, pi5-2↔pi3-1) over
# iperf3 TCP + iperf2 TCP + tcpreplay vxlan, A/B on sysctl.
# ~10.3 h wall clock at default DUR=3600 / COOLDOWN=120.
series3-soak = import ./nix/series3-soak.nix {
inherit pkgs;
};
# 12-cell soak for the x86 back-to-back pair l (generator) <-> l2
# (DUT) over the Mellanox 25 GbE link. The high-performance
# analogue of series3-soak (Pi fleet): /sys+/proc sidecar,
# CPU-bound UDP + tunnelled tcpreplay cells, taskset-pinned
# generator. ~12 h at default DUR=3600.
series3-soak-l-l2 = import ./nix/series3-soak-x86.nix {
inherit pkgs;
};
# ===================================================================
# Network-config scenarios for the series3 extension patches.
# Each script reconfigures a host pair (over SSH) for a named
# encap shape (single VLAN, QinQ, VXLAN, PPPoE), runs an
# `up | down | verify` op, and emits scenario-specific env
# vars (L_SCENARIO_DEV, L_SCENARIO_V4, ...) on stdout for the
# orchestrator to ingest. The underlying NixOS-managed static
# config is never modified — these scripts add and remove
# sub-interfaces only.
#
# See nix/scenarios/lib.sh for shared helpers and
# kernel-patches/series3-flowdis-fastpath/docs/packet-flow-context.md
# section 9 for the design rationale.
netconf-eth_ip = import ./nix/scenarios/netconf-eth_ip.nix { inherit pkgs; };
netconf-vlan = import ./nix/scenarios/netconf-vlan.nix { inherit pkgs; };
netconf-qinq = import ./nix/scenarios/netconf-qinq.nix { inherit pkgs; };
netconf-vxlan = import ./nix/scenarios/netconf-vxlan.nix { inherit pkgs; };
netconf-pppoe = import ./nix/scenarios/netconf-pppoe.nix { inherit pkgs; };
netconf-mpls = import ./nix/scenarios/netconf-mpls.nix { inherit pkgs; };
netconf-ipip = import ./nix/scenarios/netconf-ipip.nix { inherit pkgs; };
netconf-gre = import ./nix/scenarios/netconf-gre.nix { inherit pkgs; };
netconf-geneve = import ./nix/scenarios/netconf-geneve.nix { inherit pkgs; };
netconf-gtpu = import ./nix/scenarios/netconf-gtpu.nix { inherit pkgs; };
# Phase 2 orchestrator: loops {pair × scenario × proto × sysctl},
# composing the netconf-<scenario> scripts with iperf3 A/B cells
# in the spirit of series3-soak-x86.nix. Emits matrix.csv.
series3-extensions-soak = import ./nix/series3-extensions-soak.nix {
inherit pkgs;
};
# 10-hour soak wrapper around series3-extensions-soak with
# DUR=600 across 60 cells (3 pairs × 5 scenarios × 4 cells).
# Goal: pin down recv_soft delta confidence intervals beyond
# the ±0.3pp noise floor of the DUR=60 runs.
series3-extensions-soak-10h = import ./nix/series3-extensions-soak-10h.nix {
inherit pkgs;
};
# Phase G: CPU-bound pktgen-driven matrix. Same shape as
# series3-extensions-soak but pktgen with random source ports
# replaces iperf3, and the per-cell artifacts include a
# ksoftirqd-targeted perf-stat trace so we get
# cycles_per_pkt + ins_per_pkt + branch_miss_per_pkt as
# architecture-independent numbers for the netdev cover
# letter alongside the recv_soft_pct mpstat deltas.
series3-cpu-bound-soak = import ./nix/series3-cpu-bound-soak.nix {
inherit pkgs;
};
# Phase H: cover-letter summary table generator. Reads one or
# more matrix.csv files from Phase F (iperf3) or Phase G
# (pktgen) and emits a kernel-team-ready markdown table with
# per-sysctl % improvement, sorted by |% improvement| desc so
# the strongest signal lands first. Pure awk.
series3-summary-report = import ./nix/series3-summary-report.nix {
inherit pkgs;
};
# Phase H comprehensive matrix wrappers. Defaults: 3 pairs *
# 8 scenarios (eth_ip..geneve) * REPLICATES=3 * DUR=60. Run
# iperf3 wrapper first (~5.6h), then pktgen wrapper (~2.8h),
# then series3-summary-report on both matrix.csv files.
series3-comprehensive-iperf3-soak =
import ./nix/series3-comprehensive-iperf3-soak.nix { inherit pkgs; };
series3-comprehensive-pktgen-soak =
import ./nix/series3-comprehensive-pktgen-soak.nix { inherit pkgs; };
# OFAT mlx5 offload investigation harness. Designed to isolate
# the cause of the IPIP +5.2% vs GRE -4% UDP throughput
# discrepancy on hp1<->hp3. Toggles one offload feature at a
# time (off, on) under both sysctl=0/1 and replicates each
# cell. Output CSV is suitable for sharing with the kernel
# team. See nix/mlx5-offload-investigate.nix for env knobs.
mlx5-offload-investigate = import ./nix/mlx5-offload-investigate.nix {
inherit pkgs;
};
# R1.1 — focused perf-record on the post-S _opt path of the
# flow-dissector benchmark. Outputs land in result/perf-hp5/
# so the run-on-host orchestrator's result rsync carries them
# home. Defined late because it depends on
# flowDissectorMatrix.artifacts (assigned further down).
perfRecordR1 = import ./nix/perf-record-c-xdp2-r1.nix {
inherit pkgs test-pcap;
flow-dissector-matrix-artifacts = flowDissectorMatrix.artifacts;
};
perfRecordR7MonoVsRust = import ./nix/perf-record-r7-mono-vs-rust.nix {
inherit pkgs;
flow-dissector-matrix-artifacts = flowDissectorMatrix.artifacts;
xdp2-rs = xdp2Rs.build;
workload-pcap-vxlan-k8s-pure = perfAnalysis.workload-pcap-vxlan-k8s-pure;
};
# Common source flags for proto-audit commands
protoAuditFlags = builtins.concatStringsSep " " [
"--proto-defs-dir ${./src/include/xdp2/proto_defs}"
"--kernel-src ${protoAuditSources.kernelSrc}"
"--scapy-helper ${proto-audit-bin}/share/proto-audit/scapy_dump.py"
"--python ${protoAuditSources.scapyPython}/bin/python3"
"--tshark-bin ${protoAuditSources.tshark}/bin/tshark"
"--pcap ${test-pcap}/combo.pcap"
"--etherparse-src ${protoAuditSources.etherparseSrc}"
"--libpcap-src ${protoAuditSources.libpcapSrc}"
"--omi-cstructs-dir ${protoAuditSources.omiCStructs}"
"--omi-lua-dir ${protoAuditSources.omiWiresharkLua}"
"--omi-pcaps-dir ${protoAuditSources.omiDataPackets}"
];
# Full audit report (cached Nix derivation)
proto-audit-report = pkgs.runCommand "proto-audit-report" {
nativeBuildInputs = [
proto-audit-bin
protoAuditSources.scapyPython
protoAuditSources.tshark
];
} ''
mkdir -p $out
# Full audit
proto-audit audit ${protoAuditFlags} \
> $out/audit.txt 2>&1 || true
proto-audit audit --json ${protoAuditFlags} \
> $out/audit.json 2>/dev/null || true
# Source × protocol matrix
proto-audit matrix ${protoAuditFlags} \
> $out/matrix.txt 2>/dev/null || true
proto-audit matrix --json ${protoAuditFlags} \
> $out/matrix.json 2>/dev/null || true
# Detailed cross-source findings
proto-audit findings ${protoAuditFlags} \
> $out/findings.txt 2>/dev/null || true
proto-audit findings --json ${protoAuditFlags} \
> $out/findings.json 2>/dev/null || true
# Protocol list
proto-audit list > $out/protocols.txt
proto-audit list --json > $out/protocols.json
# XDP2 scan
proto-audit scan --proto-defs-dir ${./src/include/xdp2/proto_defs} \
> $out/xdp2-scan.txt
proto-audit scan --proto-defs-dir ${./src/include/xdp2/proto_defs} --json \
> $out/xdp2-scan.json
echo "Proto-audit report generated at: $out"
ls -la $out/
'';
# Generate all C headers and compile-test with clang -target bpf
proto-audit-c-check = pkgs.runCommand "proto-audit-c-check" {
nativeBuildInputs = [
proto-audit-bin
protoAuditSources.scapyPython
protoAuditSources.tshark
pkgs.llvmPackages.clang
];
} ''
mkdir -p $out/headers $out/logs
# Generate all C headers (curated tier only for compile check)
proto-audit generate-all --target c --tier curated \
--output-dir $out/headers \
${protoAuditFlags} \
2>$out/logs/generate.log || true
echo "Generated $(ls $out/headers/*.h 2>/dev/null | wc -l) C headers"
# Compile-test each header
passed=0
failed=0
for h in $out/headers/*.h; do
[ -f "$h" ] || continue
base=$(basename "$h" .h)
# Create a test .c file that includes the header
cat > /tmp/test_$base.c <<TESTEOF
#include <linux/types.h>
#include "$h"
TESTEOF
if clang -fsyntax-only -target bpf \
-I${protoAuditSources.kernelSrc}/include \
-I${protoAuditSources.kernelSrc}/include/uapi \
-I${./src/include} \
-Wno-everything \
/tmp/test_$base.c 2>>$out/logs/compile.log; then
passed=$((passed + 1))
else
failed=$((failed + 1))
echo "FAIL: $base" >> $out/logs/failures.txt
fi
done
echo "Compile test: $passed passed, $failed failed" | tee $out/logs/summary.txt
echo "Compile test results in $out/logs/"
'';
# Run round-trip validation for all curated protocols (batch)
proto-audit-validate-all = pkgs.runCommand "proto-audit-validate-all" {
nativeBuildInputs = [
proto-audit-bin
protoAuditSources.scapyPython
protoAuditSources.tshark
];
} ''
mkdir -p $out
# Run validate-all: validates each protocol's IR→PCAP→tshark round-trip
proto-audit validate --proto all --tier curated --json \
${protoAuditFlags} \
> $out/validate_all.json 2>$out/validate.log || true
# Also produce audit baseline for regression tracking
proto-audit audit --json ${protoAuditFlags} \
> $out/audit_baseline.json 2>/dev/null || true
echo "Validation results in $out/"
echo "Use as baseline: nix build .#proto-audit-validate-all"
'';
# Import development shell module
devshell = import ./nix/devshell.nix {
inherit pkgs lib llvmConfig compilerConfig envVars;
packages = packagesModule;
};
# Import tests module (uses debug build for assertion support)
tests = import ./nix/tests {
inherit pkgs;
xdp2 = xdp2-debug; # Tests use debug build with assertions
};
# =====================================================================
# Static Analysis Infrastructure
# Ported from reference implementation, adapted for C/Make build system
# =====================================================================
analysis = import ./nix/analysis {
inherit pkgs lib llvmConfig packagesModule;
src = ./.;
};
# Kernel-source static-analysis tools (sparse-master, smatch).
# For vetting kernel-patches/ series before posting to netdev.
# See nix/kernel-static-analysis.nix for usage.
kernelStaticAnalysis = import ./nix/kernel-static-analysis.nix {
inherit pkgs lib;
};
# iperf3 + iperf2 long-running soak runners for the testbed
# pairs. See nix/testbed-soaks.nix for the parameter list and
# usage examples.
testbedSoaks = import ./nix/testbed-soaks.nix {
inherit pkgs lib;
};
# =====================================================================
# Phase 1: Packaging (x86_64 .deb only)
# See: documentation/nix/microvm-implementation-phase1.md
# =====================================================================
packaging = import ./nix/packaging {
inherit pkgs lib;
xdp2 = xdp2; # Use production build for distribution
};
# =====================================================================
# Phase 2: MicroVM infrastructure (x86_64, aarch64, riscv64)
# See: documentation/nix/microvm-phase2-arm-riscv-plan.md
#
# Cross-compilation: We pass buildSystem so that when building for
# non-native architectures (e.g., riscv64 on x86_64), we use true
# cross-compilation with native cross-compilers instead of slow
# binfmt emulation.
# =====================================================================
microvms = import ./nix/microvms {
inherit pkgs lib microvm nixpkgs;
buildSystem = system; # Pass host system for cross-compilation
};
# Generate combinatorial test PCAPs with all protocol permutations
# Usage: nix run .#gen-test-pcap -- -n 500000 -o /tmp/combo_500k.pcap
# nix run .#gen-test-pcap -- --list
gen-test-pcap = pkgs.writeShellApplication {
name = "gen-test-pcap";
runtimeInputs = [
(pkgs.python314.withPackages (ps: [ ps.scapy ]))
];
text = ''
exec python3 ${./samples/flow_dissector/gen_test_pcap.py} "$@"
'';
};
# Pre-built 500k packet PCAP for benchmarking (cached in Nix store)
# Usage: nix build .#test-pcap
# ls result/combo.pcap
test-pcap = pkgs.runCommand "xdp2-test-pcap" {
nativeBuildInputs = [
(pkgs.python314.withPackages (ps: [ ps.scapy ]))
];
} ''
mkdir -p $out
python3 ${./samples/flow_dissector/gen_test_pcap.py} \
-n 500000 -o $out/combo.pcap
'';
# Convenience target to run all sample tests
run-sample-tests = pkgs.writeShellApplication {
name = "run-sample-tests";
runtimeInputs = [];
text = ''
echo "========================================"
echo " XDP2 Sample Tests Runner"
echo "========================================"
echo ""
# Run all tests via the combined test runner
${tests.all}/bin/xdp2-test-all
'';
};
in
{
# Package outputs
packages = {
default = xdp2;
xdp2 = xdp2;
xdp2-debug = xdp2-debug; # Debug build with assertions
xdp-samples = xdp-samples; # XDP sample programs (BPF bytecode)
# Tests (build with: nix build .#tests.simple-parser)
tests = tests;
# Convenience aliases for individual tests
simple-parser-test = tests.simple-parser;
offset-parser-test = tests.offset-parser;
ports-parser-test = tests.ports-parser;
flow-tracker-combo-test = tests.flow-tracker-combo;
flow-dissector-benchmark-test = tests.flow-dissector-benchmark;
super-flow-dissector-test = tests.super-flow-dissector;
xdp-build-test = tests.xdp-build;
# Proto-audit: multi-source protocol definition audit tool
# Usage: nix run .#proto-audit -- list
# nix run .#proto-audit -- compare --proto IPv4
# nix build .#proto-audit-report
inherit proto-audit proto-audit-bin proto-audit-report proto-audit-c-check proto-audit-validate-all;
# ===================================================================
# XDP2 Rust Reimplementation
# Build: nix build .#xdp2-rs
# Test: nix build .#xdp2-rs-test
# Lint: nix build .#xdp2-rs-clippy
# Format: nix build .#xdp2-rs-fmt-check
# Docs: nix build .#xdp2-rs-doc
# Golden: nix build .#xdp2-rs-golden
# Adversarial: nix build .#xdp2-rs-adversarial
# Stress: nix run .#xdp2-rs-stress -- [hours] [threads]
# ===================================================================
# ===================================================================
# xdp2-flow-ebpf — production fast-path flow dissector bundle
# Build: nix build .#xdp2-flow-ebpf
# Run: sudo ./result/bin/xdp2-flow-loader \
# --bpf ./result/lib/xdp2-flow-ebpf/fast_flow.bpf.o
# Layout: bin/xdp2-flow-loader + lib/xdp2-flow-ebpf/fast_flow.bpf.o
# + share/man/man1/xdp2-flow-loader.1
# + share/xdp2-flow-ebpf/xdp2-flow-loader.service
# ===================================================================
xdp2-flow-ebpf = xdp2FlowEbpf;
# ===================================================================
# xdp2-flow-ebpf-image — OCI container for k8s DaemonSet deploy
# Build: nix build .#xdp2-flow-ebpf-image
# Load: docker load < result
# ===================================================================
xdp2-flow-ebpf-image = xdp2FlowEbpfImage;
# ===================================================================
# flow-dissector-matrix — 6-way performance comparison
# Build: nix build .#flow-dissector-matrix
# Run: sudo ./result/bin/xdp2-flow-dissector-matrix PCAP
# Inputs: also exposes .#flow-dissector-matrix-artifacts (bins + .o)
# ===================================================================
flow-dissector-matrix = flowDissectorMatrix.matrix;
flow-dissector-matrix-artifacts = flowDissectorMatrix.artifacts;
# flow-menu-bench — benchmark + Gold-parity for the 10-object
# per-encapsulation xdp2-flow-ebpf menu (needs root/CAP_BPF).
# Run: nix run .#run-on-host -- l2 -- flow-menu-bench
# or: sudo ./result/bin/xdp2-flow-menu-bench
flow-menu-bench = flowMenuBench;
# Clang-stdenv build for the R-followup compiler-comparison
# experiment. Same parser.mono.c source (xdp2-compiler is
# gcc-built either way), but clang-21 compiles the userspace
# benchmark + the mono parser instead of gcc-15.
flow-dissector-matrix-artifacts-clang =
flowDissectorMatrix.artifacts-clang;
# ===================================================================
# flow-dissector-matrix-unified — C matrix + xdp2-bench,
# same filtered pcap, one unified comparison table.
# Build: nix build .#flow-dissector-matrix-unified
# Run: sudo ./result/bin/xdp2-flow-dissector-matrix-unified [pcap]
# ===================================================================
flow-dissector-matrix-unified = flowDissectorMatrixUnified;
# ===================================================================
# flow-dissector-matrix-aggregate — Phase 6 aggregator over
# the per-cell JSONs emitted by flow-dissector-matrix-unified
# under -j <dir>. Emits summary.md / summary.csv and, when
# --baseline is given, regressions.md.
# Build: nix build .#flow-dissector-matrix-aggregate
# Run: nix run .#flow-dissector-matrix-aggregate -- --results <dir>
# ===================================================================
flow-dissector-matrix-aggregate = flowDissectorMatrixAggregate;
# ===================================================================
# flow-dissector-afxdp-aggregate — Phase L4. Walks afxdp/<mode>/<size>b/
# cell tree and emits summary-afxdp.{md,csv}. Separate from the matrix
# aggregator because the two campaigns measure different things.
# Build: nix build .#flow-dissector-afxdp-aggregate
# Run: nix run .#flow-dissector-afxdp-aggregate -- --results <dir>
# ===================================================================
flow-dissector-afxdp-aggregate = flowDissectorAfxdpAggregate;
# ===================================================================
# flow-dissector-dump-asm — Phase A1. Per-impl asm extraction
# across 8 Rust + 3 C + 3 BPF implementations. Output tree at
# perf-results/asm/<date>/<impl>/disasm.asm + INDEX.md.
# Build: nix build .#flow-dissector-dump-asm
# Run: nix run .#flow-dissector-dump-asm -- [--out DIR] [--with-bpf-jit]
# ===================================================================
flow-dissector-dump-asm = flowDissectorDumpAsm;
# ===================================================================
# flow-dissector-matrix-run — Phase 7 composed runner.
# Orchestrates flow-dissector-matrix-unified across the testbed
# (via run-on-host) and aggregates results.
# Run: nix run .#flow-dissector-matrix-run -- \
# --testbed testbeds/<name>.toml [--smoke] [--results <dir>]
# ===================================================================
flow-dissector-matrix-run = flowDissectorMatrixRun;
# ===================================================================
# flow-dissector-matrix-sweep — multi-workload reproducibility
# harness for the 2026-05-19 post-R3.4 sweep. Pre-scps each
# cached workload-pcap-* derivation to every host in the
# testbed TOML, loops calling matrix-run for each, and
# aggregates at the end. Default workload list is all 6:
# https-web, nfs-server, k8s-microservices,
# vlan-tcp-mix, pppoe-isp, vxlan-k8s-pure.
# Run: nix run .#flow-dissector-matrix-sweep -- \
# --testbed testbeds/<name>.toml [--smoke]
# See: docs/r3.4-hp5-perf-targets.md
# ===================================================================
flow-dissector-matrix-sweep = flowDissectorMatrixSweep;
# ===================================================================
# flow-dissector-icache-sweep — perf-counter sweep for code-
# size hypothesis investigation. Wraps `benchmark -p -<mode>`
# in `perf stat -e l1-icache-load-misses,instructions,cycles,
# branch-misses,iTLB-load-misses` for each (host, workload,
# parser-mode) cell. Emits a markdown table with IPC and
# miss/Mi columns. Requires perf_event_paranoid <= 1 or root.
# Run: nix run .#flow-dissector-icache-sweep -- \
# --testbed testbeds/<name>.toml [--workloads CSV] \
# [--modes M,O,S] [--iters N]
# See: perf-results/2026-05-19-O3-march-native-flto/comparison.md
# ===================================================================
flow-dissector-icache-sweep = flowDissectorIcacheSweep;
# ===================================================================
# flow-dissector-matrix-check — Phase 7 smoke regression gate.
# Wraps -run --smoke with the aggregator's --baseline /
# --fail-on-regression mode. Exits non-zero on any cell
# regression. Designed for CI.
# Run: nix run .#flow-dissector-matrix-check -- \
# --testbed testbeds/<name>.toml [--baseline ...] [--threshold N]
# ===================================================================
flow-dissector-matrix-check = flowDissectorMatrixCheck;
# ===================================================================
# flow-dissector-afxdp-live — Phase 8 offered-load sweep.
# Sweeps pktgen rates [1,2,5,10] Mpps against the testbed's
# DUT (running xdp2-bench --mode af-xdp-template) and emits
# per-load JSON under <results>/<date>/<testbed>/afxdp/.
# Run: nix run .#flow-dissector-afxdp-live -- \
# --testbed testbeds/<name>.toml [--duration N] [--loads CSV]
# ===================================================================
flow-dissector-afxdp-live = flowDissectorAfxdpLive;
# ===================================================================
# flow-dissector-parity-check — Phase 17 cross-parser parity gate.
# Runs each of 14 flow-dissector parsers on a pcap with their
# dump-meta path, captures per-packet ParityRecord JSONL, and
# feeds the tree into the symmetric all-vs-all comparator at
# nix/scripts/parity-compare.py. Catches the gaps the matrix
# campaign masks: c-bpf-fast slow-path fall-through reported
# as accepted, parser-specific extract bugs, scope drift.
# Run: nix run .#flow-dissector-parity-check -- --pcap PATH
# See: docs/flow-dissector-parity.md (Phase 17.D)
# ===================================================================
flow-dissector-parity-check = flowDissectorParityCheck;
parity-compare = parityCompare;
# ===================================================================
# protocol-coverage-matrix — Phase 2 of the protocol coverage plan.
# Runs flow-dissector-parity-check once per per-protocol pcap
# template under samples/proto_audit/pcap_templates/ (378 single-
# packet shapes) and aggregates the JSONL output into a
# (protocol × parser) markdown + CSV matrix.
# Run: nix run .#protocol-coverage-matrix -- [--out DIR]
# See: nix/protocol-coverage-matrix.nix,
# nix/scripts/protocol-coverage-matrix.py
# ===================================================================
protocol-coverage-matrix = protocolCoverageMatrix;
# Note: the existing `xdp2-rs-golden` flake output (defined at
# line 920) is the natural place to alias to
# flow-dissector-parity-check; that's a follow-up refactor
# (Phase 17.D housekeeping) since it requires also updating
# nix/xdp2-rs.nix's golden target definition.
# ===================================================================
# flow-dissector-ntuple-template-bench — live X710 Flow Director
# + AF_XDP + template extraction. Two-host orchestration; the
# target must have the xdp2.testbed physical-testbed module with
# flowDirectorRules + realServicesBench configured.
# Run: nix run .#flow-dissector-ntuple-template-bench -- hp5 hp2
# See: docs/ntuple-template-bench.md
# ===================================================================
flow-dissector-ntuple-template-bench = flowDissectorNtupleTemplateBench;
# Standalone peer-side kernel pktgen driver (shellchecked).
# Build: nix build .#flow-dissector-pktgen-ntuple-template
# Normally consumed by flow-dissector-ntuple-template-bench,