← Back to Pull requests

Fix sysprobe KMT leaf helper and testdata BUILD files #61982

Open
unknown opened this pull request with 464 lines diff across 5 files
View on GitHub
unknown unknown commented on Dec 03, 2026 11:46 UTC
Author

What does this PR do?

Updates five BUILD.bazel files so system-probe KMT leaf helper binaries and testdata targets build hermetically in Bazel:

  • Adds //pkg/gpu/probe/testdata (BUILD.bazel) with a statically linked Linux cudasample cc_binary and an explicit testdata_files filegroup containing the checked-in source and fixture files. The cudasample executable remains a separate public target for KMT packaging; it is not included in testdata_files, so local GPU tests can build their helper without colliding with a Bazel runfile. The cudasample target uses copts = ["-O0"] so optimized builds preserve its dummy CUDA calls for GPU probes to observe. Updates //pkg/gpu/probe:probe_test to depend on the filegroup instead of a recursive glob.

  • Builds //pkg/ebpf/uprobes/testutil/standalone_attacher statically (static = "on") with netgo and osusergo Go build tags so it runs in minimal containers without a dynamic loader.

  • Adds the missing testdata/decoded/sample/testHandleOrder.json fixture to //pkg/dyninst:dyninst_test embedsrcs.

  • Adds gotags = ["test"] to //test/new-e2e/system-probe/test-json-review so its //pkg/util/testutil/flake (//go:build test) dependency compiles.
  • No Python, Go, or C source files are changed.

    Motivation

    Makes all four system-probe KMT leaf helper and testdata targets buildable hermetically in Bazel so downstream //bazel/kmt packaging can depend on them cleanly (ABLD-584), while keeping the CUDA fixture available to KMT consumers without making it an input runfile that conflicts with local GPU test helper compilation.

    Describe how you validated your changes

  • Formatting (bazel run //bazel/buildifier:test): Passed locally.

  • Gazelle consistency (bazel run //:gazelle -- -mode=diff pkg/gpu/probe pkg/gpu/probe/testdata pkg/ebpf/uprobes/testutil/standalone_attacher pkg/dyninst test/new-e2e/system-probe/test-json-review): Passed locally with empty diff.

  • Linux x86_64 leaf builds: bzlog --format text build --config=rbe //pkg/gpu/probe/testdata:cudasample //pkg/gpu/probe/testdata:testdata_files //pkg/ebpf/uprobes/testutil/standalone_attacher //test/new-e2e/system-probe/test-json-review succeeded. The dependency query confirms testdata_files contains the four checked-in fixture/source files and omits :cudasample.

  • CUDA fixture optimization check: Confirmed all 15 dummy CUDA calls are preserved in both fastbuild and -c opt after adding copts = ["-O0"].

  • Linux x86_64 package builds (bzlog --format text build --config=rbe //pkg/gpu/probe:all //pkg/dyninst:all): Succeeded (covers //pkg/dyninst:dyninst_test_bpf and all //pkg/gpu/probe:probe_test* variants).

  • Linux x86_64 unit tests (bzlog --format text test --config=rbe //pkg/gpu/probe:probe_test //pkg/gpu/probe:probe_test_nvml //test/new-e2e/system-probe/test-json-review:test-json-review_test): Succeeded (3/3 tests passed).

  • Non-Linux validation (Darwin arm64): Explicit builds of //pkg/gpu/probe:probe_test, //pkg/gpu/probe:probe_test_nvml, //pkg/gpu/probe:probe_test_bpf, and //pkg/gpu/probe:probe_test_bpf_nvml succeeded. The cudasample binary remains a separate Linux-only target.

  • GPU probe tests after separating the runfile and local helper: bzlog --format text test --config=rbe //pkg/gpu/probe:probe_test //pkg/gpu/probe:probe_test_nvml succeeded (2/2 tests passed); the corresponding Darwin builds also succeeded.

  • Unverified coverage: BPF-tagged tests (//pkg/dyninst:dyninst_test_bpf, //pkg/gpu/probe:probe_test_bpf, //pkg/gpu/probe:probe_test_bpf_nvml) were build-verified only; executing them requires a privileged Linux kernel / KMT environment.
  • Diff: 464 lines (+348 / -116) across 5 files Reviewer: gjulianm Review duration: 2065m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.46) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 464 lines diff across 5 files
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.367
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #61982"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.6% (MEDIUM) · Higher = larger blast radius
    45.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.3% · Safe to merge
    24.3%